0

I want to create a subgraph consisting of only "Disorder sub-hierarchy" of SNOMED. I am trying to create this subgraph from the complete SNOMED-OWL graph using a SPARQL CONSTRUCT query. However the property consisting of owl:equivalentCLass/ owl:intersectionOf / owl:Restriction shows an empty [] in the created subgraph. The same query displays correct result in the ontology editor window. I am new to SPARQL and OWL. Can someone please help me with traversing the complex owl axioms in attribute relationships so that the subgraph is created correctly. I have used the SPARQL query tab provided in the free edition of TopBraid ontology editor Version 6.0.1 (tbcfe-6.0.1). This is the query the I tried. I had provided screenshots in my question earlier but they are not clearly visible I guess.


    #select disorder concepts containing "and" and lenght <=4 words
    CONSTRUCT {?s ?p ?o}
    WHERE
    {
      ?s rdfs:label ?fsn
      bind(replace(?fsn, "\\S", "") as ?space)
      bind(strlen(?space) as ?spacecount)
     FILTER(REGEX(?fsn," and ") && REGEX(?fsn,"(disorder)")) 
    FILTER(?spacecount<=3).
    ?s ?p ?o
    }
    ORDER BY ?spacecount

This query displays the correct output in TopBraid editor retrieved results but when I export them to a .ttl file, I get a blank [] wherever there are complex owl axioms like owl:intersectionOf, owl:EquivalentClass, owl:restriction, etc.

**Concept in original file**
<http://snomed.info/id/188487008> rdf:type owl:Class ;
                                  rdfs:subClassOf [ owl:intersectionOf ( <http://snomed.info/id/64572001>
                                                                         [ rdf:type owl:Restriction ;
                                                                           owl:onProperty <http://snomed.info/id/609096000> ;
                                                                           owl:someValuesFrom [ rdf:type owl:Restriction ;
                                                                                                owl:onProperty <http://snomed.info/id/116676008> ;
                                                                                                owl:someValuesFrom <http://snomed.info/id/128929007>
                                                                                              ]
                                                                         ]
                                                                       ) ;
                                                    rdf:type owl:Class
                                                  ] ;
                                  rdfs:label "Lymphosarcoma and reticulosarcoma (disorder)"@en ;
                                  skos:prefLabel "Lymphosarcoma and reticulosarcoma"@en .

**Concept created/exported in Subgraph**
:188487008  a            owl:Class ;
        rdfs:label       "Lymphosarcoma and reticulosarcoma (disorder)"@en ;
        rdfs:subClassOf  owl:Thing ;
        rdfs:subClassOf  []  ;
        skos:prefLabel   "Lymphosarcoma and reticulosarcoma"@en .

I have referred this solution but it doesn't seem to work for me and gives an empty resultset- (SPARQL: how to transfer owl:equivalentClass to rdfs:subClassOf (owl:Restriction) properties?) Screenshots Ontology editor displays the ?o correctly Generated subgraph file has a blank [] for ?o

3
  • you should add more details. Which dataset exactly with which SPARQL engine and which SPARQL query exactly did you try? Commented Apr 16, 2021 at 17:37
  • Have you tried Refactor > Copy/move/delete axioms in Protege? Commented Apr 18, 2021 at 15:04
  • @StanislavKralin Thanks a lot. It worked. The only thing is that the ontology that I want to create consists of around 80,000 classes, many of which are nested and there's no option in the "Refactor > Copy/move/delete axioms" window to expand all classes at a click / select a collapsed class and automatically include all its subclasses in the new file. Expanding each class and selecting 80 K subclasses classes is a bit tedious manually. Any suggestions on that? Commented Apr 19, 2021 at 8:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.