agroportal / project-management

Repository used to consolidate documentation about the AgroPortal project and track content related issues.
http://agroportal.lirmm.fr
7 stars 0 forks source link

Short term hierarchy enhancement for SKOS vocabularies including multiple Concept Schemes #258

Closed jonquet closed 1 year ago

jonquet commented 2 years ago

Problem

When a SKOS vocabulary contains several skos:ConceptScheme AgroPortal build the hierarchy tree displaying at the root all the concepts with a skos:topConceptOf declaration.

For instance INRAETHES in stageportal (see discussion #233)

image

Requirement

We already require (for metadata extraction, but also as a good practice) that ONE skos:ConceptScheme (that would be the main one, including the other ones) be also declared owl:Ontology. This allow to consider the concept scheme as the main object and grab the metadata annotation properties.

Proposed solution

Display in the hierarchy tree only the top concepts of the main concept scheme (i.e. the one which is alos declared owl:ontology).

syphax-bouazzouni commented 2 years ago

Some context and references

Solution

Change the SPARQL query that is fetching the top Concept from

SELECT DISTINCT ?root WHERE {
GRAPH #{self.id.to_ntriples} {
  ?x #{RDF::SKOS[:hasTopConcept].to_ntriples} ?root .
}}

To

SELECT DISTINCT ?root WHERE {
GRAPH #{self.id.to_ntriples} {
  #{self.ontology_uri.to_ntriples} #{RDF::SKOS[:hasTopConcept].to_ntriples} ?root .
}}

With this new query the fetched top concepts will be only from the owl:Ontology

syphax-bouazzouni commented 2 years ago

Done in testportal

image
saubin78 commented 2 years ago

brilliant! Thanks a lot Syphax!

syphax-bouazzouni commented 1 year ago

Fixed with https://github.com/ontoportal-lirmm/ontologies_linked_data/issues/22