Download - SparQL and the FMA
![Page 1: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/1.jpg)
SparQL and the FMA
Non-Materialized Ontology Views
Todd DetwilerSIG University of Washington
![Page 2: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/2.jpg)
FMA SparQL Service
Uses the FMA in OWL N. F. Noy, D. L. Rubin. Translating the
Foundational Model of Anatomy into OWL. 2007. Uses Jena API Uses persistent storage backend Does not use any OWL inference
![Page 3: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/3.jpg)
SELECT Query
![Page 4: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/4.jpg)
SELECT Query
![Page 5: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/5.jpg)
SELECT Results
![Page 6: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/6.jpg)
CONSTRUCT Query
![Page 7: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/7.jpg)
CONSTRUCT Query
![Page 8: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/8.jpg)
CONSTRUCT Results
![Page 9: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/9.jpg)
CONSTRUCT Results
<dl:part rdf:resource=".../fmaOwlDlComponent_1_4_0#Right_ventricle"/> <dl:part rdf:resource=".../fmaOwlDlComponent_1_4_0#Atrioventricular_septum"/> <dl:FMAID rdf:datatype=“…/XMLSchema#string">7088</dl:FMAID>
![Page 10: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/10.jpg)
DESCRIBE Query
![Page 11: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/11.jpg)
DESCRIBE Query
![Page 12: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/12.jpg)
DESCRIBE Results
![Page 13: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/13.jpg)
DESCRIBE Results
<rdf:Description rdf:about=“…#Anterior_surface_of_lobe_of_right_lung"><rdfs:subClassOf rdf:resource=“…#Anterior_surface_of_lobe_of_lung"/><rdfs:label xml:lang="en">Anterior surface of lobe of right lung</rdfs:label><rdf:type rdf:resource=“…#Class"/> <dl:Preferred_name rdf:resource=“…#KB_INSTANCE_33014"/> <dl:FMAID rdf:datatype=“…#string">26298</dl:FMAID><rdf:type rdf:resource=“…#Anterior_surface_of_lobe_of_lung"/>
</rdf:Description>
![Page 14: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/14.jpg)
ASK Query
![Page 15: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/15.jpg)
ASK Query
![Page 16: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/16.jpg)
ASK Results
![Page 17: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/17.jpg)
DXBrain
![Page 18: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/18.jpg)
DXBrain and FMA Service
let $fma_query := concat( "PREFIX dl: <http://bioontology.org/projects/ontologies/fma/fmaOwlDlComponent_1_4_0#> CONSTRUCT { ?ae dl:FMAID ?fmaid . } WHERE { ?cn dl:name ?name . FILTER (?name = '", $site_name,"') . ?ae dl:Preferred_name ?cn . ?ae dl:FMAID ?fmaid . }") let $fma_identifier := dxq:xqueryWS($wsdlURL, $serviceName, $methodName, $fma_query)
![Page 19: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/19.jpg)
DXBrain and FMA Results
<site> <site_label>10</site_label> <name>Middle part of postcentral gyrus</name> <rdf:Description rdf:about=“…#Middle_part_of_postcentral_gyrus"> <dl:FMAID rdf:datatype=“…#string">70693</dl:FMAID> </rdf:Description></site> <site> <site_label>20</site_label> <name>Posterior part of middle temporal gyrus</name> <rdf:Description rdf:about=“…#Posterior_part_of_middle_temporal_gyrus"> <dl:FMAID rdf:datatype=“…#string">70707</dl:FMAID> </rdf:Description> </site>
![Page 20: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/20.jpg)
Query CompositionQ1:CONSTRUCT { $subject $relation $object }WHERE{ $subject rdfs:subClassOf :Organ . $subject $relation $object .}
V1:PREFIX obo: < http://purl.org/obo/owl/>CONSTRUCT{ $sub obo:has_part $part . $sub rdfs:subClassOf $superClass .}WHERE{ :Heart %p $sub . FILTER (regex(%p,":regionalPart*","ds")) . $sub :regionalPart $part . $sub rdfs:subClassOf $superClass .}
Q2 (Q1 + V1) :CONSTRUCT { $sub obo:has_part $part . $sub rdfs:subClassOf $superClass .}WHERE{ :Heart %p $sub . FILTER (regex(%p,":regional_part*","ds")) . $sub :regionalPart $part . $sub rdfs:subClassOf $superClass . $sub rdfs:subClassOf :Organ . $sub $relation $obj .}
![Page 21: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/21.jpg)
Sample Dataset
![Page 22: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/22.jpg)
View QueryPREFIX books: <http://example.org/book/>PREFIX dc: <http://purl.org/dc/elements/1.1/>CONSTRUCT { ?sub dc:creator ?obj . ?sub2 dc:title ?obj2 .}WHERE { ?sub dc:creator ?obj . ?sub2 dc:title ?obj2 . FILTER regex(?obj2, "Prince")}
![Page 23: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/23.jpg)
View Query Results
![Page 24: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/24.jpg)
Query on ViewPREFIX books: <http://example.org/book/>PREFIX dc: <http://purl.org/dc/elements/1.1/>CONSTRUCT { ?sub ?rel ?obj .}WHERE { ?sub dc:creator ?bound_obj . FILTER regex(?bound_obj, "J.K. Rowling") ?sub ?rel ?obj}
![Page 25: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/25.jpg)
Query CompositionCONSTRUCT { ?sub ?rel ?obj .}WHERE { ?sub dc:creator ?obj . ?sub2 dc:title ?obj2 . FILTER regex(?obj2, "Prince")
?sub dc:creator ?bound_obj . FILTER regex(?bound_obj, "J.K. Rowling") .
(how do we get everything there is in view about ?sub?)}
![Page 26: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/26.jpg)
Rewritten View QueryPREFIX books: <http://example.org/book/>PREFIX dc: <http://purl.org/dc/elements/1.1/>CONSTRUCT {?sub ?rel ?obj}WHERE { { ?sub ?rel ?obj FILTER (?rel = dc:creator) } UNION { ?sub ?rel ?obj FILTER (?rel = dc:title && regex(?obj, "Prince")) }}
![Page 27: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/27.jpg)
Rewritten Query CompositionPREFIX dc: <http://purl.org/dc/elements/1.1/>CONSTRUCT {?sub ?rel ?obj}WHERE { { ?sub ?rel ?obj . FILTER (?rel = dc:creator) } UNION { ?sub ?rel ?obj . FILTER (?rel = dc:title && regex(?obj, "Prince")) }
?sub dc:creator ?bound_obj . FILTER (?bound_obj = ?obj && regex(?bound_obj, "J.K. Rowling"))}
![Page 28: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/28.jpg)
Rewritten Query CompositionPREFIX dc: <http://purl.org/dc/elements/1.1/>CONSTRUCT {?sub ?rel ?obj}WHERE { { ?sub ?rel ?obj . FILTER (?rel = dc:creator) } UNION { ?sub ?rel ?obj . FILTER (?rel = dc:title && regex(?obj, "Prince")) }
?sub dc:creator ?bound_obj . FILTER (?bound_obj = ?obj && regex(?bound_obj, "J.K. Rowling"))}
Problem:
?bound_obj = ?obj
![Page 29: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/29.jpg)
Rewritten Query Results
![Page 30: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/30.jpg)
Questions?
![Page 31: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/31.jpg)
Additional Slides
![Page 32: SparQL and the FMA](https://reader034.vdocuments.net/reader034/viewer/2022051418/5681584c550346895dc5a4b0/html5/thumbnails/32.jpg)
Query RewritePREFIX books: <http://example.org/book/>PREFIX dc: <http://purl.org/dc/elements/1.1/>CONSTRUCT { ?sub dc:creator ?creator . ?sub dc:title ?title . }WHERE { books:book7 ?relation ?object . ?sub ?relation ?object . ?sub dc:creator ?creator . ?sub dc:title ?title .}
PREFIX books: <http://example.org/book/>PREFIX dc: <http://purl.org/dc/elements/1.1/>CONSTRUCT { ?sub ?rel ?obj . }WHERE { { books:book7 ?relation ?object . ?sub ?relation ?object . ?sub ?rel ?obj FILTER (?rel = dc:creator) } UNION { books:book7 ?relation ?object . ?sub ?relation ?object . ?sub ?rel ?obj FILTER (?rel = dc:title ) . }}