knowledge integration with swrl martin oconnor stanford center for biomedical informatics research,...
TRANSCRIPT
![Page 1: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/1.jpg)
Knowledge Integration with SWRL
Martin O’ConnorStanford Center for Biomedical Informatics Research,
Stanford University
![Page 2: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/2.jpg)
2
Talk Outline
• Rules and the Semantic Web: OWL + SWRL
• Knowledge Integration–Querying–XML–Relational (and CSV/Excel)–Ontology integration
![Page 3: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/3.jpg)
3
What is SWRL?
• SWRL is an acronym for Semantic Web Rule Language.
• SWRL is intended to be the rule language of the Semantic Web.
• SWRL includes a high-level abstract syntax for Horn-like rules.
• All rules are expressed in terms of OWL concepts (classes, properties, individuals).
![Page 4: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/4.jpg)
4
Example SWRL Rule
Person(?p) ^ hasAge(?p,?age) ^ swrlb:greaterThan(?age,17)
→ Adult(?p)
![Page 5: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/5.jpg)
5
SWRL Semantics
• Based on OWL-DL
• Has a formal semantics
• Complements OWL and fully semantically compatible
• More expressive yet at expense of decidability
![Page 6: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/6.jpg)
6
SWRLTab: http://protege.cim3.net/cgi-bin/wiki.pl?SWRLTab
![Page 7: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/7.jpg)
7
Uses of SWRL for Knowledge Integration
• Ontology querying• Data integration
– XML– Relational data (and CSV/Excel)
• Ontology mapping
![Page 8: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/8.jpg)
8
SWRL and Querying: SQWRL
• SWRL is a rule language, not a query language
• However, a rule antecedent can be viewed as a pattern matching specification, i.e., a query
• With built-ins, language compliant query extensions are possible.
• We have developed a SWRL-based query language called SQWRL
![Page 9: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/9.jpg)
9
Example SQWRL Query
Person(?p) ^ hasAge(?p,?age) ^ swrlb:greaterThan(?age,17)
→ sqwrl:select(?p, ?age)
Return all adults in an ontology :
![Page 10: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/10.jpg)
10
Another SQWRL Query
Person(?p) ^ hasAge(?p, ?age) ^ swrlb:greaterThan(?age, 17) -> sqwrl:select(?p)
^ sqwrl:orderBy(?age)
Return all adults in an ontology ordered by age:
![Page 11: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/11.jpg)
11
Use of SWRL as basis for Query Language is Attractive
• Cleaner semantics than SPARQL
• OWL-based, not RDF-based
• Very extensible via built-ins, e.g., temporal queries using temporal built-ins
![Page 12: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/12.jpg)
12
XML Mapping
Ontology
XML Document
Application
SWRLMappingRules
Visit_3
![Page 13: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/13.jpg)
13
<Patients> <Patient> <PID>3454-34</PID> <Age>43</Age> … <ZIP>94402</ZIP> </Patient>…<Patents>
XML Querying
swrlxml:XMLElement(?ep) ^ swrlxml:hasName(?ep,“Patent”) ^ swrlxml:hasSubElement(?ep,?eAge) ^ swrlxml:hasName(?eAge,“Age”) ^ swrlxml:hasContent(?eAge,?cAge) ^ swrlxml:convert(?age, ?cAge, xs:Integer) ^swrlxml:hasSubElement(?ep,?eZIP) ^ swrlxml:hasName(?eZIP,“ZIP”) ^ swrlxml:hasContent(?eZIP, ?ZIP) -> sqwrl:select(?ZIP) ^ sqwrl:avg(?age)
Return the average age of patients per ZIP code:
![Page 14: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/14.jpg)
14
Relational Mapping
• DataMaster:– Imports schema or content of relational
databases into Protégé-OWL– Uses JDBC/ODBC so supports: MySQL, SQL
Server, Oracle etc.– Also supports Excel files.
• Dynamic DataMaster: supports dynamic SWRL/SQWRL-driven relational importation
![Page 15: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/15.jpg)
15
![Page 16: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/16.jpg)
16
Dynamic DataMaster
• Can query data imported by DataMaster
• Dynamic querying also supported via DDM
• One-the-fly querying of relational data
• Mapping ontology specifies link
![Page 17: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/17.jpg)
17
DynamicDataMaster
OWLKB Bridge
Data
Knowledge
Rule Engine
![Page 18: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/18.jpg)
18
Ontology Mapping for Integration
• SWRL rules are very good at traversing trees
• Complex mappings between multiple ontologies convenient in SWRL
• Knowledge-level mappings to merge or integrate ontologies
![Page 19: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/19.jpg)
19
Example Application
![Page 20: Knowledge Integration with SWRL Martin OConnor Stanford Center for Biomedical Informatics Research, Stanford University](https://reader033.vdocument.in/reader033/viewer/2022051400/55149a3755034640138b45e4/html5/thumbnails/20.jpg)
20
Software Availability
• Free, open source; download at: protégé.stanford.edu
• SWRLTab, Datamaster: v3.3.1
• SQWRL, XML querying: v3.4 beta
• Dynamic relational querying: 2-3 months
• Extensive documentation: http://protege.cim3.net/cgi-bin/wiki.pl?SWRLTab