Use of SWRL for Ontology Translation

sounderslipInternet και Εφαρμογές Web

22 Οκτ 2013 (πριν από 3 χρόνια και 9 μήνες)

104 εμφανίσεις

Copyright
©2008

BBN Technologies

Use of SWRL for

Ontology Translation

Mike Dean

Principal Engineer

BBN Technologies

mdean@bbn.com

Copyright
©2008

BBN Technologies

Assumptions


Technology


Intermediate


Familiarity with RDF and OWL


Desire to integrate multiple independent
data sources using Semantic Web
technologies

2

Copyright
©2008

BBN Technologies

3

Outline


Background


Ontology Translation


SWRL


Demo of open source Snoggle tool


Other Approaches


Copyright
©2008

BBN Technologies

Presenter Background


Principal Engineer at BBN Technologies (1984
-
present)


Principal Investigator for DARPA Agent Markup Language (DAML)
Integration and Transition (2000
-
2005)


Chaired the Joint US/EU Committee that developed DAML+OIL and
SWRL


Developer and/or Principal Investigator for many Semantic Web
tools, datasets, and applications (2000
-
present)


Member of the W3C RDF Core, Web Ontology, and Rule
Interchange Format Working Groups


Co
-
editor of the W3C OWL Reference


Other SemTech presentations


Semantic Query: Solving the Needs of a Net
-
Centric Data Sharing
Environment (2007, w/ Matt Fisher)


Semantic Queries and Mediation in a RESTful Architecture (2008, w/
John Gilman and Matt Fisher)

4

Copyright
©2008

BBN Technologies

Ontology Translation


Data source
-
> domain ontologies


Data source ontology is an OWL representation of its
native data model


Domain ontology is an OWL ontology used by a
community of interest


Mappings typically unidirectional and incomplete


Common variations


Use a key data source as the domain ontology


Generalize to n
-
levels, by employing a domain
ontology as someone else’s data source

5

Copyright
©2008

BBN Technologies

Types of Ontology Translation


Renaming


(data:Car ?x) => (domain:Vehicle ?x)


Structural


(family:Family ?f)

(family:husband ?f ?h)

(family:wife ?f ?w)

=> (exfoaf:hasHusband ?w ?h)

(exfoaf:hasWife ?h ?w)


Value Conversion


(data:length ?feet)

(swrlb:multiply ?inches ?feet 12)

=> (domain:length ?inches)

6

Copyright
©2008

BBN Technologies

SWRL


Semantic Web Rule Language


Combines OWL, RuleML, and builtins


From the developers of OWL and RuleML


W3C Member Submission in 2004


Input to the W3C standardization process, not an
output (Recommendation)


Current de facto standard for Semantic Web
Rules


Numerous implementations


7

Copyright
©2008

BBN Technologies

SWRL Constructs


ClassAtom (?i ?c)


DataRangeAtom (?d ?r)


IndividualPropertyAtom (?i1 ?p ?i2)


DatavaluedPropertyAtom (?i ?p ?d)


SameIndividualsAtom (?i1 ?i2)


DifferentIndividualsAtom (?i1 ?i2)


BuiltinAtom (?op ?arg1 … ?argn)

8

Copyright
©2008

BBN Technologies

9

SWRL Builtins

See
http://www.w3.org/Submission/SWRL/#8

for details

Copyright
©2008

BBN Technologies

Snoggle


Open source GUI SWRL editor focused
on ontology translation


Can export SWRL/XML or SWRL/RDF


Extensible to other formats such as RIF


Available at
http://snoggle.projects.semwebcentral.org

10

Copyright
©2008

BBN Technologies

Snoggle Demo

11

Copyright
©2008

BBN Technologies

Snoggle
-
Generated

Rules In Protégé 4

12

Copyright
©2008

BBN Technologies

SWRL Implementations


SweetRules


Translates to Jena Rules and implements builtins


Protégé 3 and 4


TopBraid Composer


Pellet


KAON2


RacerPro


INRIA Alignment API (export)


RuleVISor and BaseVISor




13

Copyright
©2008

BBN Technologies

SWRL Notes 1


Can also generally be used with RDF vocabularies as well as OWL
ontologies


Nullable database columns each require their own SWRL
translation rule


Most/all implementations support named classes only, referring to
externally defined classes and properties rather than internal OWL
definitions


Most implementations use SWRL/RDF rather than SWRL/XML


a
surprise to the authors


Process and store rules with ontologies


Most implementations assume that only the first argument of a
builtin is unbound


SWRL builtins formally represent logical relationships, not function calls


(swrlb:subtract ?a ?b ?c) generally computes ?a = ?b
-

?c not all
combinations of ?b and ?c that produce ?a

14

Copyright
©2008

BBN Technologies

SWRL Notes 2


Most applications employ some sort of user
-
defined builtin(s) to generate a URI or bNode


Examples


Generate a new Family instance from information about
Individuals


Generate a view (e.g. map point) for instance data


Construct a resolvable URI from database primary or foreign
key(s)


Translate a database column spouseName into a
foaf:Person with foaf:name and domain:spouse


Jena Rules makeTemp and makeInstance builtins


Logicians worry about “head existential variables”


This should be standardized

15

Copyright
©2008

BBN Technologies

16


Asio
TM

Semantic Web Toolkit

SOAP

WS

RDBMS

Query

Decomposition

Query: SPARQL

1

2

4

Data Access

3

Generation of

Sub Queries

6

Query Result Set

5

Semantic Bridge

Database

Semantic Bridge

Web Service

Backwards

Rule Chaining

Snoggle

KB


Semantic Query Decomposition (SQD)

Semantic Bridge

SPARQL Endpoint

Automapper

Copyright
©2008

BBN Technologies

Alternative Translation Approaches


OWL


XSLT


SPARQL


OWL 2


RIF


OWLED DL Safe Rules


FOL


Custom code

17

Copyright
©2008

BBN Technologies

History (My Perspective)


The current W3C separation between ontologies
and rules is largely artificial


Precursor representations such as KIF and CycL
include both sets of constructs


Adding rules would have significantly delayed OWL


W3C agonized over the relationship between
queries and rules before forming the DAWG
(SPARQL) and RIF Working Groups


~50% same/~50% different


W3C made the right decision, but should keep the
efforts aligned

18

Copyright
©2008

BBN Technologies

OWL


W3C OWL Web Ontology Language


Recommendation since 2004


+ Includes basic mapping constructs


subClassOf, equivalentClass


subPropertyOf, equivalentProperty


sameAs


+ Often sufficient for renaming


-

Usually insufficient by itself for ontology translation


Many constructs can be expressed using either ontologies or rules


Description Logic Programs (DLP) and subsequent extensions


Users often are more comfortable with one formalism than the other


Probably preferable to use one formalism for translation (rules)

19

Copyright
©2008

BBN Technologies

OWL Examples


data:Individual owl:equivalentClass
domain:Person


data:SUV rdfs:subClassOf domain:Vehicle


data:lastName owl:eqivalentProperty
foaf:surname

20

Copyright
©2008

BBN Technologies

XSLT


W3C Recommendation since 1999


XSLT 2.0 Recommendation since 2007


Widely used XML tool


+ Great for generating RDF from other
XML formats


-

Generally impractical for reading RDF


No canonical RDF/XML serialization


Too many ways to say the same thing

21

Copyright
©2008

BBN Technologies

SPARQL


SPARQL Query Language for RDF


W3C Recommendation since January 2008


+ CONSTRUCT queries can easily map from one
ontology to another


++ Concise representation when dealing with optional
values


Supports a range of builtins similar to SWRL


--

Multiple queries can’t naturally be composed (unlike
rules)


-

No intrinsic support for OWL


SPARQL
-
DL proposal and Pellet prototype

22

Copyright
©2008

BBN Technologies

SPARQL Example

23

PREFIX family: <http://asio.bbn.com/2008/05/semtech/family#>

PREFIX exfoaf:
http://asio.bbn.com/2008/05/semtech/exfoaf#


CONSTRUCT { ?husband exfoaf:hasWife ?wife .


?wife exfoaf:hasHusband ?husband .


?husband exfoaf:hasDaughter ?daughter .


?wife exfoaf:hasDaughter ?daughter .


?husband exfoaf:hasSon ?son .


?wife exfoaf:hasSon ?son .


?son exfoaf:hasFather ?husband .


?son exfoaf:hasMother ?wife .


?daughter exfoaf:hasFather ?husband .


?daughter exfoaf:hasMother ?wife .


?son exfoaf:hasSister ?daughter .


?daughter exfoaf:hasBrother ?son .


?son exfoaf:hasBrother ?son2 .


?daughter exfoaf:hasSister ?daughter2 . }

WHERE { ?family a family:Family .


OPTIONAL { ?family family:husband ?husband } .


OPTIONAL { ?family family:wife ?wife } .


OPTIONAL { ?family family:son ?son } .


OPTIONAL { ?family family:daughter ?daughter } .


OPTIONAL { ?family family:son ?son2 } .


OPTIONAL { ?family family:daughter ?daughter2 } .


FILTER ( ( ! BOUND(?son) || ! BOUND(?son2) || ( ?son != ?son2 ))


&& ( ! BOUND(?daughter) || ! BOUND(?daughter2) || ( ?daughter != ?daughter2 ) ) ) . }


Copyright
©2008

BBN Technologies

OWL 2


W3C OWL Working Group formed in October 2007 to update
OWL based on user feedback


2 OWL Experiences and Directions Workshops led to W3C
OWL 1.1 Member Submission in December 2006


6 Working Drafts published in April 2008


Name changed to OWL 2


New features particularly relevant to translation


Property chains


Data ranges


OWL
-
R


N
-
ary data predicates (may support comparisons and other
builtins)


Largely already implemented in Pellet and other reasoners

24

Copyright
©2008

BBN Technologies

OWL 2 Examples

(Functional
-
Style Syntax)


SubObjectPropertyOf(


SubObjectPropertyChain(owns hasPart)


owns)


SubObjectPropertyOf(


SubObjectPropertyChain(parent brother)


uncle)

25

Copyright
©2008

BBN Technologies

RIF


W3C Rule Interchange Format Working Group
formed in December 2005


Brings together multiple communities: Semantic
Web, production rule system vendors (iLog, Fair
Isaac, …), OMG, business rules (SBVR, …)


Working Drafts published April 2008


+ Addresses RDF and OWL compatibility


May eventually subsume SWRL


-

Very few current implementations

26

Copyright
©2008

BBN Technologies

RIF Example

(BLD presentation syntax)


Forall ?family ?husband ?wife

?husband # “foaf:Person^^rif:iri


[“exfoaf:wife”^^rif:iri
-
> ?wife]

:
-

?family # “family:Family”^^rif:iri


[“family:husband”^^rif:iri
-
> ?husband,


“family:wife”^^rif:iri
-
> ?wife]



Forall ?family ?husband ?wife

?wife # “foaf:Person^^rif:iri


[“exfoaf:husband”^^rif:iri
-
> ?husband]

:
-

?family # “family:Family”^^rif:iri


[“family:husband”^^rif:iri
-
> ?husband,


“family:wife”^^rif:iri
-
> ?wife]


27

Copyright
©2008

BBN Technologies

OWLED DL Safe (SWRL) Rules


OWLED Task Force


Out of charter for WG OWL WG


DL Safety means only working with
named individuals


Incomplete compared to full SWRL


Better computational properties


28

Copyright
©2008

BBN Technologies

FOL


First Order Logic


Common Logic (ISO 24707:2007)


CycL





+ Expressive power


Superset of OWL and SWRL


-

Generally not focused on ontology translation


-

Builtin support, scalability, and/or portability may
be limited

29

Copyright
©2008

BBN Technologies

Custom Code


Gold standard


+ Total flexibility


-

Expensive


-

Can’t reason over translation rules


Coverage


Data discovery


Maintenance

30

Copyright
©2008

BBN Technologies

Conclusions


SWRL is the current de facto standard for
Semantic Web rules


SWRL works well for ontology translation


SWRL rules can easily be translated to
other representations when necessary

31

Copyright
©2008

BBN Technologies

Additional Pointers


SWRL Member Submission


http://www.w3.org/Submission/SWRL/


Snoggle


http://snoggle.projects.semwebcentral.org


BBN Asio Toolkit


http://asio.bbn.com

32