Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement mechanism to support integration with Dataverse #16

Open
3 tasks
jonquet opened this issue Jan 11, 2023 · 2 comments
Open
3 tasks

Implement mechanism to support integration with Dataverse #16

jonquet opened this issue Jan 11, 2023 · 2 comments
Assignees

Comments

@jonquet
Copy link
Contributor

jonquet commented Jan 11, 2023

Is your feature request related to a problem? Please describe.

We need a way to ease the selection of vocabulary/ontology term in Dataverse using OntoPortal instances.
For the moment the current intefcae requires 4 fields

image

In Data INRAE we can replace the fields above with only one, the concept search below:

image

Describe the solution you'd like

The plan is to :

  • Refactor our widgets to support easy integration with outside application like this. See also Fix Agroportal widgets agroportal/project-management#349
  • Implement a mechanism to change the 4 fields above by only one field with autocompletion with selected vocabularies hosted in a OntoPortal instance
  • Implement a mechanism to call the correspondant OntoPortal Annotator on the title/abstract fields of the data set to pre-propose some ontology/vocabulary terms in the UI that the user can only keep or discard.

Describe alternatives you've considered

Something similar has been done for SKOSMOS already. Lesson to be learned: https://osf.io/5af9q
Also in video : https://www.youtube.com/watch?v=mWMPxCwB2ys&t=1825s

Additional context

This is being done in the context of FAIR-IMPACT T4.5
CC @DS-INRA @xeniacs @IlariaRosati @saubin78

@syphax-bouazzouni
Copy link
Contributor

syphax-bouazzouni commented Nov 8, 2023

Context

This is a Technical update, addinng details after discussing with the team at INRAE Dataverse.

Goal

Extend the dataverse-external-vocab-support interface to work with Ontoportal repositories, which mean in summary two thing:
1- Add a configuration file for ontoportal (as already done for authors, affiliations, or, skosmos,...)
2- Add a JS/Jquery script to render the results got from Ontoportal from JSON to HTML

Roadmap

1- Get a API key

In both cases you will need to have an apikey, (having anonymous can be discussed in the future ncbo/bioportal_web_ui#112)
Here is a doc, to how to get an API key

2- Use our search API, to have an autocomplete

GET "https://data.agroportal.lirmm.fr/search?q=<pattern_to_search>&include_properties=true&include_views=true&apikey=<your_apikey>&display_context=false"

example of a result

	{
	"prefLabel": "plant",
	"definition": [
	"Any living organism that typically synthesizes its food from inorganic substances, possesses cellulose cell walls, responds slowly and often permanently to a stimulus, lacks specialized sense organs and nervous system, and has no powers of locomotion. (Source: CED)",
	"http://opendata.inra.fr/anaeeThes/i_def_24509784-142a-4d0d-9deb-2c7c5869ebde"
	],
	"obsolete": false,
	"matchType": "prefLabel",
	"ontologyType": "ONTOLOGY",
	"provisional": false,
	"@id": "http://opendata.inra.fr/anaeeThes/c2_225",
	"@type": "http://www.w3.org/2002/07/owl#Class",
	"links": {
				"self": "https://data.agroportal.lirmm.fr/ontologies/ANAEETHES/classes/http%3A%2F%2Fopendata.inra.fr%2FanaeeThes%2Fc2_225",
				"ontology": "https://data.agroportal.lirmm.fr/ontologies/ANAEETHES",
				"children": "https://data.agroportal.lirmm.fr/ontologies/ANAEETHES/classes/http%3A%2F%2Fopendata.inra.fr%2FanaeeThes%2Fc2_225/children",
				"parents": "https://data.agroportal.lirmm.fr/ontologies/ANAEETHES/classes/http%3A%2F%2Fopendata.inra.fr%2FanaeeThes%2Fc2_225/parents",
				"descendants": "https://data.agroportal.lirmm.fr/ontologies/ANAEETHES/classes/http%3A%2F%2Fopendata.inra.fr%2FanaeeThes%2Fc2_225/descendants",
				"ancestors": "https://data.agroportal.lirmm.fr/ontologies/ANAEETHES/classes/http%3A%2F%2Fopendata.inra.fr%2FanaeeThes%2Fc2_225/ancestors",
				"instances": "https://data.agroportal.lirmm.fr/ontologies/ANAEETHES/classes/http%3A%2F%2Fopendata.inra.fr%2FanaeeThes%2Fc2_225/instances",
				"tree": "https://data.agroportal.lirmm.fr/ontologies/ANAEETHES/classes/http%3A%2F%2Fopendata.inra.fr%2FanaeeThes%2Fc2_225/tree",
				"notes": "https://data.agroportal.lirmm.fr/ontologies/ANAEETHES/classes/http%3A%2F%2Fopendata.inra.fr%2FanaeeThes%2Fc2_225/notes",
				"mappings": "https://data.agroportal.lirmm.fr/ontologies/ANAEETHES/classes/http%3A%2F%2Fopendata.inra.fr%2FanaeeThes%2Fc2_225/mappings",
				"ui": "http://agroportal.lirmm.fr/ontologies/ANAEETHES?p=classes&conceptid=http%3A%2F%2Fopendata.inra.fr%2FanaeeThes%2Fc2_225"
		}
}

From it you can extract two main information:

  • Concept ID: "@id": "http://opendata.inra.fr/anaeeThes/c2_225"
  • Ontology ACRONYM: from "ontology":"https://data.agroportal.lirmm.fr/ontologies/ANAEETHES" in the links block, you can extract ontology_acronym = ANAEETHES

3- Use the dataverse-external-vocab-support plugin to retrieve concept details

The dataverse external vocab support plugin, need one main field in its configuration file, the retrieval-uri, in the case of skosmos they use https://skosmos.dev.finto.fi/rest/v1/data?uri={0}, with {0} equal to the URI of a concept in skosmos.

In our case, as we don't identify elements not only by URI but also with its Òntoloy. The retrieval-uri will be tricky:

 "retrieval-uri": "https://data.agroportal.lirmm.fr/ontologies/{0}"

with {0}equal to ${ontology_acronym}/classes/${concept_id}?display=all&display_context=false&display_links=false&apikey=${your_apikey}

here is an a example of a result

{
	"id": "http://opendata.inra.fr/anaeeThes/c2_225",
	"synonym": [ ],
	"prefLabel": "plant",
	"definition": [
			"Any living organism that typically synthesizes its food from inorganic substances, possesses cellulose cell walls, responds slowly and often permanently to a stimulus, lacks specialized sense organs and nervous system, and has no powers of locomotion. (Source: CED)",
	],
	"obsolete": false,
	"inScheme": [
			"http://opendata.inra.fr/anaeeThes/"
	],
	"memberOf": [ ],
	"isInActiveScheme": [
			"http://opendata.inra.fr/anaeeThes/"
	],
	"isInActiveCollection": [ ],
	"created": null,
	"parents": [
			{
				"id": "http://opendata.inra.fr/anaeeThes/c2_2758",
				"synonym": [
					"eukaryotes",
					"eukaryota"
				],
				"prefLabel": "eukaryote",
				"definition": [ ],
				"obsolete": false,
				"inScheme": [
					"http://opendata.inra.fr/anaeeThes/"
				],
				"created": null,
				"modified": "2020-04-17T09:38:53+02:00",
				"notation": null,
				"label": [ ],
				"prefLabelXl": [ ],
				"altLabelXl": [ ],
				"hiddenLabelXl": [ ],
				"prefixIRI": null,
				"subClassOf": [ ],
				"semanticType": [ ],
				"cui": [ ],
				"xref": null,
				"@id": "http://opendata.inra.fr/anaeeThes/c2_2758",
				"@type": "http://www.w3.org/2004/02/skos/core#Concept"
			}
	],
	"modified": "2018-06-26T14:47:36+00:00",
	"notation": null,
	"label": [ ],
	"prefLabelXl": [ ],
	"altLabelXl": [ ],
	"hiddenLabelXl": [ ],
	"prefixIRI": null,
	"subClassOf": [ ],
	"semanticType": [ ],
	"cui": [ ],
	"xref": null,
	"properties": {
			"http://www.w3.org/2004/02/skos/core#narrower": [
					"http://opendata.inra.fr/anaeeThes/c2_226",
					"http://opendata.inra.fr/anaeeThes/c2_243",
					"http://opendata.inra.fr/anaeeThes/c_4d1cf953",
					"http://opendata.inra.fr/anaeeThes/c2_2440"
			],
			"http://www.w3.org/2004/02/skos/core#definition": [
					"Any living organism that typically synthesizes its food from inorganic substances, possesses cellulose cell walls, responds slowly and often permanently to a stimulus, lacks specialized sense organs and nervous system, and has no powers of locomotion. (Source: CED)",
					"http://opendata.inra.fr/anaeeThes/i_def_24509784-142a-4d0d-9deb-2c7c5869ebde"
			],
			"http://www.w3.org/2004/02/skos/core#prefLabel": [
					"plante",
					"plant"
			],
			"http://www.w3.org/2004/02/skos/core#inScheme": [
					"http://opendata.inra.fr/anaeeThes/"
			],
			"http://www.w3.org/2004/02/skos/core#broader": [
					"http://opendata.inra.fr/anaeeThes/c2_2758"
			],
			"http://art.uniroma2.it/ontologies/vocbench#hasStatus": [
					"Published"
			],
			"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [
					"http://www.w3.org/2004/02/skos/core#Concept",
					"http://www.w3.org/2002/07/owl#NamedIndividual"
			],
			"http://purl.org/dc/terms/modified": [
					"2018-06-26T14:47:36Z"
			],
			"http://www.w3.org/2004/02/skos/core#exactMatch": [
					"http://aims.fao.org/aos/agrovoc/c_5993"
			]
	},
	"@id": "http://opendata.inra.fr/anaeeThes/c2_225",
	"@type": "http://www.w3.org/2004/02/skos/core#Concept"
}

@jonquet
Copy link
Contributor Author

jonquet commented Nov 8, 2023

Note that the config file must allow to specify a list of ontologies to deal with. If empty then all ontologies shall be used.
Then such a list can be used into the /search call at step 2 to avoid getting back results that we know will be filter out after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants