Date post: | 27-Mar-2015 |
Category: |
Documents |
Upload: | kylie-mckenna |
View: | 220 times |
Download: | 3 times |
Knowledge Integration with SWRL
Martin O’ConnorStanford Center for Biomedical Informatics Research,
Stanford University
2
Talk Outline
• Rules and the Semantic Web: OWL + SWRL
• Knowledge Integration–Querying–XML–Relational (and CSV/Excel)–Ontology integration
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).
4
Example SWRL Rule
Person(?p) ^ hasAge(?p,?age) ^ swrlb:greaterThan(?age,17)
→ Adult(?p)
5
SWRL Semantics
• Based on OWL-DL
• Has a formal semantics
• Complements OWL and fully semantically compatible
• More expressive yet at expense of decidability
6
SWRLTab: http://protege.cim3.net/cgi-bin/wiki.pl?SWRLTab
7
Uses of SWRL for Knowledge Integration
• Ontology querying• Data integration
– XML– Relational data (and CSV/Excel)
• Ontology mapping
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
9
Example SQWRL Query
Person(?p) ^ hasAge(?p,?age) ^ swrlb:greaterThan(?age,17)
→ sqwrl:select(?p, ?age)
Return all adults in an ontology :
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:
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
12
XML Mapping
Ontology
XML Document
Application
SWRLMappingRules
Visit_3
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:
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
15
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
17
DynamicDataMaster
OWLKB Bridge
Data
Knowledge
Rule Engine
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
19
Example Application
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