问题
I recently asked a question about the feasibility of loading about 10 million statements into a triplestore with OWL reasoning enabled.
That has lead to some StackOverflow comments as well as discussion within my research group about whether or not we really need OWL reasoning.
I'll start with a real-world query that doesn't seem to require OWL reasoning.
"41167-4120-0" is the NDC Code that identifies the commercial drug product "Fexofenadine hydrochloride 180 MG Oral Tablet [Allegra]" in the US.
A slightly modified version of the NDC appears as a label in the drug ontology (specifically file dron-ndc.owl):
http://purl.obolibrary.org/obo/DRON_00604430 rdfs:label "41167412000"
DrON makes the following OWL assertions:
http://purl.obolibrary.org/obo/DRON_00604430 is a packaged drug product
and is rdfs:subClass of
( has_proper_part some http://purl.obolibrary.org/obo/DRON_00083688 )
http://purl.obolibrary.org/obo/DRON_00083688
rdfs:subClassOf http://purl.obolibrary.org/obo/DRON_00062350
http://purl.obolibrary.org/obo/DRON_00062350 has_proper_part some
(scattered molecular aggregate
and (is bearer of some active ingredient)
and (is bearer of some (mass and
(has measurement unit label value milligram)
and (has specified value <value> )))
and (has granular part some fexofenadine))
And ChEBI says:
http://purl.obolibrary.org/obo/CHEBI_5050 rdfs:label "fexofenadine"
subClassOf (has role some anti-allergic agent)
and
http://purl.obolibrary.org/obo/CHEBI_50857 rdfs:label "anti-allergic agent"
So in order to link a NDC code and a therapeutic role, I can write a query like the following
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
select distinct
?ndcval ?packdrugprod ?drugbrand ?brandlab ?drugform ?api ?apilab ?drugrole
where {
values ?ndcval {
"41167412000"
}
?packdrugprod rdfs:subClassOf ?hasproppart ;
rdfs:label ?ndcval .
?hasproppart a owl:Restriction ;
owl:onProperty <http://www.obofoundry.org/ro/ro.owl#has_proper_part> ;
owl:someValuesFrom ?drugbrand .
?drugbrand rdfs:subClassOf ?drugform ;
rdfs:label ?brandlab .
?drugform rdfs:subClassOf ?proppart .
?proppart a owl:Restriction ;
owl:onProperty <http://www.obofoundry.org/ro/ro.owl#has_proper_part> ;
owl:someValuesFrom ?valSource1 .
?valSource1 owl:intersectionOf ?intsect1 .
# scat mol agg
?intsect1 rdf:first obo:OBI_0000576 .
?intsect1 rdf:rest ?scatmolag .
?scatmolag rdf:first ?bearacting .
?scatmolag rdf:rest ?intsect3 .
# bearer of active ingredient
?bearacting a owl:Restriction ;
owl:onProperty obo:BFO_0000053 ;
owl:someValuesFrom obo:DRON_00000028 .
?intsect3 rdf:first ?granpart .
?intsect3 rdf:rest ?r .
# has granular part fexofenadine
?granpart a owl:Restriction ;
owl:onProperty obo:BFO_0000071 ;
owl:someValuesFrom ?api .
?api rdfs:subClassOf ?rolerestr ;
rdfs:label ?apilab .
# has anti allergic role
?rolerestr a owl:Restriction ;
owl:onProperty obo:RO_0000087 ;
owl:someValuesFrom ?drugrole .
?drugrole rdfs:label ?drlab .
values ?drugrole {
obo:CHEBI_50857
}
}
Concerns:
What about accessing nested subClass relationships without reasoning?
The example above was easy because fexofenadine is directly asserted to have the "anti-allergic" role
What if I am interested in people taking nitrate esters? Nitroglycerin is a nitroglycerol, which is in turn a nitrate ester. If I used a repository with no reasoning enabled, I would have to explicitly use a property path to find patients who are taking any nitrate esters, with a snippet like this (right?)
?s rdfs:subClassOf* <http://purl.obolibrary.org/obo/CHEBI_51080> .
What about inferring the classes to which individuals belong to?
What if my ontology says something like
:ViagraPill owl:equivalentClass ( :pill
and (:hasColor some :blue )
and (:hasShape some :diamond))
:steelBlue rdfs:subClassOf :blue
And I have data triples that say something like
:patient1 :consumed :pill1 .
:pill1 :hasColor :steelBlue1 ;
:hasShape :diamond1 .
:steelBlue1 a :steelBlue .
:diamond1 a :diamond.
And I want to write a query for patients who have consumed Viagra pills:
?patient a :patient ;
:consumed ?pill .
?pill a :ViagraPill .
I would need some form of OWL reasoning for that, right?
来源:https://stackoverflow.com/questions/46916049/do-i-really-need-owl-reasoning