W3C home > Mailing lists > Public > www-rdf-rules@w3.org > July 2005

Re: Web Rule Language - WRL vs SWRL

From: ÷ <mayyam@is.pku.edu.cn>
Date: Sun, 03 Jul 2005 15:28:18 +0800
To: www-rdf-rules@w3.org
Message-ID: <IsMailClient-F200507031528.AA28180041@is.pku.edu.cn>

 Hi all,

Sorry for bothering you, but I am interested in your discussion on SWRL,
and I have read all your emails carefully. Being a student, I know that my
knowledge is limited, and my points below might be somehow
boring/wrong/ridiculous. But, anyway, thank you for reading my email :)

(1) the example of

I suppose that: as to ask for all Persons that know exactly one Person,

"pat" is in one SPARQL query as follows (due to the CLOSED database):

PREFIX foo:    <http://foo/>
WHERE { ?x rdf:type foo:Person .
	?x foo:knows ?y .
	?y rdf:type foo:Person .
	?x foo:knows ?z .
	?z rdf:type foo:Person .
	FILTER ?y = ?z .}

BUT, "pat" is not in the other SPARQL query as follows (due to the OPEN
semantics for OWL constructors):

PREFIX foo:    <http://foo/>
WHERE { ?x rdf:type foo:Person .
	?x rdf:type _:b .
	_:b rdf:type owl:Restriction .
	_:b owl:onProperty foo:knows . 
	_:b owl:cardinality "1"^^xsd:integer .}

That is, the result depends on the query, and as far as I know, the above
query (asking for all Persons that know exactly one Person) is not easy to
express in any rule-based languages: either it turns out to be a counting
function (which is undoubtly based on the closed existing
database/rulebase) as shown in the first case, or it employs the blank
nodes for OWL restrictions (whose semantics should be implemented by an
external engine) as shown in the second case.

(2) the complex SWRL rules beyond Datalog are making sense, for OWL
constructors used as the predicate symbols appearing in atoms. Perhaps,
the following one might be considered (which is borrowed from [1] with
some modification):

an OWL subClassOf axiom: Person \sqsubseteq \exists hasParent.Person     
a SWRL implication axiom: Grandchild(x) <- \exists hasParent.(\exists
hasParent.Person) (x)         (**)

surely, Grandchild has a simpler expression as: Grandchild(x) <-
hasParent(x,y) & hasParent(y,z)   (***)

Noting, given the unique fact of Person(Peter), Grandchild(Peter) can be
drawn out from SWRL reasoning, i.e., (*)+(**), but not the case of (***),
since there is no matching of "hasParent".

To be admitted, (**) is my revision of the DL version in [1], which
originally states: \exists hasParent.(\exists hasParent.Person)
\sqsubseteq Grandchild

btw: (*) cannot be expressed in DLP, lacking of assertions for the
existence in rules.

(3) finally, in my opinion, SWRL is also a framework for higher-order
logics, as interpreting SWRL rules in RDF-compatible semantics.

For example, Narcissism(x) <-- likeType(x, t) & t(x), we call it
Narcissism if it likes others whose type is the same as itself (and its
RDF syntax is provided below). Here, we have a variable of "t" being an
OWL class due to "t(x)", and being an OWL individual due to "likeType(x, t)".

Similar as OWL Full [2], SWRL Full also states:
CEXTI(SI(owl:Thing)) = CEXTI(SI(rdfs:Resource)),
CEXTI(SI(owl:ObjectProperty)) = CEXTI(SI(rdf:Property)),
CEXTI(SI(owl:Class)) = CEXTI(SI(rdfs:Class)).
And swrl:Variable is typed of owl:Class, whose instances are "t" and "x"
in the above example. Being RDF resources, "t" will be related to a
concrete unary predicate symbol whose ID shows up an OWL class, while "x"
will be related to a concrete constant symbol whose ID shows up an OWL
individual. Therefore, in a RDF-compatible view, SWRL works in the
higher-order logical framework.

  <swrl:Variable rdf:ID="t"/>
  <swrl:Variable rdf:ID="x"/>
  <swrl:Imp rdf:ID="example4swrlFull">
            <swrl:argument1 rdf:resource="#x"/>
            <swrl:classPredicate rdf:ID="Narcissism"/>
            <swrl:propertyPredicate rdf:ID="likeType"/>
            <swrl:argument1 rdf:resource="#x"/>
            <swrl:argument2 rdf:resource="#t"/>
                <swrl:classPredicate rdf:resource="#t"/>
                <swrl:argument1 rdf:resource="#x"/>

[1] Boris Motik, Ulrike Sattler, and Rudi Studer. Query answering for
OWL-DL with rules. In Proc. of the 2004 International Semantic Web
Conference (ISWC 2004), pages 549C563, 2004.

[2] http://www.w3.org/TR/owl-semantics/rdfs.html#5.3

Jing Mei
Received on Sunday, 3 July 2005 07:27:40 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:49:40 UTC