Generating a resource roots
Getting Root concept
Root concepts retrieved by the def roots method in ontologies_linked_data/models/ontology_submission.rb
If this is not a SKOS ontology: it retrieves owl:Thing
owlThing = Goo.vocabulary(:owl)["Thing"]If this is a SKOS ontology: it retrieves the skos:hasTopConcept of the scheme
More details on SKOS
Paragraph "4.6.3. Top Concepts and Semantic Relations": The property skos:hasTopConcept is, by convention, used to link a concept scheme to the SKOS concept(s) which are topmost in the hierarchical relations for that scheme. However, there are no integrity conditions enforcing this convention. Therefore, the graph below, whilst not strictly adhering to the usage convention for skos:hasTopConcept, is nevertheless consistent with the SKOS data model.
<MyScheme> skos:hasTopConcept <MyConcept> .
<MyConcept> skos:broader <AnotherConcept> .
<AnotherConcept> skos:inScheme <MyScheme> .
#Testing on BioPortal SPARQL
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT DISTINCT ?root WHERE {
GRAPH <http://data.bioontology.org/ontologies/CO_325/submissions/1> {
?x skos:hasTopConcept ?root .
}}Code source
Process modelization
Source: https://app.diagrams.net/#G1DNkAkL2Vw7ed4_jciPHCsrrY790qdH3y