W3C home > Mailing lists > Public > public-sws-ig@w3.org > December 2004

Re: Problems and some possible typos with the Congo example.

From: Evren Sirin <evren@cs.umd.edu>
Date: Wed, 29 Dec 2004 01:46:41 -0500
Message-ID: <41D252D1.70406@cs.umd.edu>
To: collin@w3china.org
CC: public-sws-ig@w3.org

Collin Hsu wrote:

> I noticed there are two flavors of Condition description to state a 
> book is out of book.
>
> While
>
> {{
>
> <expr:SWRL-Condition rdf:ID="ExpressCongoBuyBookOutOfStock">
> <expr:expressionBody rdf:parseType="Literal">
> <swrlx:AtomList>
> <rdf:first>
> <swrlx:ClassAtom>
> <swrlx:classPredicate>
> <owl:Restriction>
> <owl:onProperty rdf:resource="#hasBook"/>
> <owl:allValueFrom rdf:resource="OutOfStockBook"/>
> </owl:Restriction>
> </swrlx:classPredicate>
> <swrlx:argument1 rdf:resource="#ExpressCongoBuyBookISBN"/>
> </swrlx:ClassAtom>
> </rdf:first>
> <rdf:rest rdf:resource="&rdf;#nil"/>
> </swrlx:AtomList>
> </expr:expressionBody>
> </expr:SWRL-Condition>
> }}
>
> indicates that the instance of OutOfStockBook class is actually a copy 
> of a book,
>

I guess it would be more clear to write this condition as:

hasISBN(?aBook, ExpressCongoBuyBookISBN) & OutOfStockBook(?aBook)

Note that this expression is equivalent to the above expression since 
hasBook is the inverse of hasISBN (and assuming that there is only one 
book associated with an ISBN number). So this condition says that there 
is a book identified by the ExpressCongoBuyBookISBN and that book is out 
of stock.

> the following two condition description give the opposite indication.
>
> {{
>
> <expr:SWRL-Condition rdf:ID="FullCongoBuyBookOutOfStock">
> <expr:expressionBody rdf:parseType="Literal">
> <swrlx:AtomList>
> <rdf:first>
> <swrlx:DatavaluedPropertyAtom>
> <swrlx:propertyPredicate rdf:resource="&profileHierarchy;#title"/>
> <swrlx:argument1>
> <swrlx:Variable rdf:ID="#aBook"/>
> </swrlx:argument1>
> <swrlx:argument2 rdf:resource="#FullCongoBuyBookName"/>
> </swrlx:DatavaluedPropertyAtom>
> </rdf:first>
> <rdf:rest>
> <swrlx:AtomList>
> <rdf:first>
> <swrlx:ClassAtom>
> <swrlx:classPredicate rdf:resource="#OutOfStockBook"/>
> <swrlx:argument1 rdf:resource="#aBook"/>
> </swrlx:ClassAtom>
> </rdf:first>
> <rdf:rest rdf:resource="&rdf;#nil"/>
> </swrlx:AtomList>
> </rdf:rest>
> </swrlx:AtomList>
> </expr:expressionBody>
> </expr:SWRL-Condition>
> }}
>
> {{
>
> <expr:SWRL-Condition rdf:ID="BookOutOfStock">
> <expr:expressionBody rdf:parseType="Literal">
> <swrlx:AtomList>
> <rdf:first>
> <swrlx:DatavaluedPropertyAtom>
> <swrlx:propertyPredicate rdf:resource="&profileHierarchy;#title"/>
> <swrlx:argument1>
> <swrlx:Variable rdf:ID="#aBook"/>
> </swrlx:argument1>
> <swrlx:argument2 rdf:resource="#LocateBookBookName"/>
> </swrlx:DatavaluedPropertyAtom>
> </rdf:first>
> <rdf:rest>
> <swrlx:AtomList>
> <rdf:first>
> <swrlx:ClassAtom>
> <swrlx:classPredicate rdf:resource="#OutOfStockBook"/>
> <swrlx:argument1 rdf:resource="#aBook"/>
> </swrlx:ClassAtom>
> </rdf:first>
> <rdf:rest rdf:resource="&rdf;#nil"/>
> </swrlx:AtomList>
> </rdf:rest>
> </swrlx:AtomList>
> </expr:expressionBody>
> </expr:SWRL-Condition>
> }}
>
>
This condition in short form is:

hasTitle(?aBook, LocateBookBookName) & OutOfStockBook(?aBook)

This is exactly same as the first condition but uses the title of the 
book to identify the book. This is because the input to ExpressCongoBuy 
is an ISBN number but the input to LocateBook is the title of the book.


> Could somebody tell me why or something I missed? Thanks.
>
>
>
> Finally I 'd like to list some typos I found in the Congo examples.
>
Thanks for pointing these out. The expressions in the examples have not 
been fully tested mainly because there wasn't any tool that would parse 
the SWRL conditions from literals and validate them with respect to the 
OWL-S definitions. I'm now working on a tool that would validate the 
conditions and expressions so hopefully all the typos in the expressions 
will be found and fixed.

Regards,
Evren

>
> 1) <swrlx:argument2 rdf:resource="#ExpressCongoBuyISBN"/>
>
> The URIref should be "#ExpressCongoBuyBookISBN".
>
> 2) <owl:allValueFrom rdf:resource="OutOfStockBook"/>
> The URIref should be "#OutOfStockBook".
>
> 3) <swrlx:argument1 rdf:resource="#ExpressCongoBuyShipment"/>
>
> "ExpressCongoBuyShipment" is undefined in the document.
>
> 4) <swrlx:argument1 rdf:resource="#FukkCongoBuyShipment"/>
> The URIref should be "#FullCongoBuyshipment".
>
> 5) <swrlx:argument2 rdf:resource="#ExpressCongoAcctID"/>
> The URIref should be "#ExpressCongoBuyAcctID".
>
> 6) <swrlx:Variable rdf:ID="#aBook"/>
>
> The XML Name should be "aBook"
>
> Cheers,
> Collin
>
>
> ===================================================
> Please feel free to email me once more with a changed title (starting 
> with the prefix "[ByeSpam]" is recommended) if you have not received 
> my reply.
> The spam guard sometimes puts email in the wrong box.
>
Received on Wednesday, 29 December 2004 06:47:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 16 March 2008 00:10:59 GMT