W3C home > Mailing lists > Public > www-rdf-rules@w3.org > December 2003

a simple question

From: titi roman <dumitru.roman@deri.ie>
Date: Tue, 2 Dec 2003 10:27:19 +0100
Message-ID: <009d01c3b8b6$7ef240b0$330110ac@nwg.local>
To: <public-sws-ig@w3.org>, <www-rdf-rules@w3.org>
Hi,

 
Suppose we have a simple service having as input the current location of a user and as output the nearest airport.
I suppose that the web service should describe what "nearest" means. A way to describe this, I think, is by using rules. 
Probably the definition of "nearest" could be:
 
nearest(current_location, X):- airport(X),
                               airport(Y),
                               X =\= Y,
                               (location(X) - current_location) < (location(Y) - current_location). 
 
Could anybody explain me how I can use OWL Rule Language [1] in specifying such a rule, taking 
into account that in OWL Rule Language only variables that occur in the antecedent of a rule may occur in the consequent.
And one more thing: in OWL-S, a rule language should be deployed only for the reason that it may help in describing 
preconditions and effects in a more comfortable way(i.e. not having to use for example in OWL-S Profile the definitions of 
"preconditions" and "effect", but rather considering the rule:

_if a buyer has a valid Account and a valid Credit Card, then he can buy the book_

<!-- inputs to the service -->
<profile:Input rdf:ID="AcctID"/>
<profile:Input rdf:ID="Password"/>
<profile:Input rdf:ID="CreditCardNumber"/>
<profile:Input rdf:ID="ISBNNumber"/>

<!-- we need to define "Variables"  to be used in rules-->
<owlr:Variable rdf:ID="_AcctID"/>
<owlr:Variable rdf:ID="_Password"/>
<owlr:Variable rdf:ID="_CreditCardNumber"/>
<owlr:Variable rdf:ID="_ISBNNumber"/>

<!-- specification that the inputs are the actual variables of the rule-->
<owlr:sameIndividualAtom>
    <owlr:Variable rdf:ID="_AcctID"/>
    <owlr:Variable rdf:ID="_Password"/>
    <owlr:Variable rdf:ID="_CreditCardNumber"/>
    <owlr:Variable rdf:ID="_ISBNNumber"/>
    <profile:Input rdf:ID="AcctID"/>
    <profile:Input rdf:ID="Password"/>
    <profile:Input rdf:ID="CreditCardNumber"/>
    <profile:Input rdf:ID="ISBNNumber"/>
</owlr:sameIndividualAtom> 

<!-- the rule is defined-->
<owlr:Rule>
    <!-the antecedent of the rule  is defined-->
    <owlr:antecedent rdf:parseType="Collection">
 <owlr:individualPropertyAtom>
     <owlr:propertyPredicate rdf:resource=accountExists/>
  <owlr:argument1 rdf:about="_AcctID" />
  <owlr:argument2 rdf:about="_Password" />
 </owlr:individualPropertyAtom>
 <owlr:individualPropertyAtom>
     <owlr:propertyPredicate rdf:resource=creditExists/>
  <owlr:argument1 rdf:about="_AcctID" />
  <owlr:argument2 rdf:about="_CreditCardNumber" />
 </owlr:individualPropertyAtom>   
    </owlr:antecedent>
    <!-the consequent  of the rule  is defined-->
    <owlr:consequent rdf:parseType="Collection">
       <owlr:individualPropertyAtom>
    <owlr:propertyPredicate rdf:resource=allowedToBuy/>
  <owlr:argument1 rdf:about="_AcctID" />
  <owlr:argument2 rdf:about="_ISBNNumber" />
 </owlr:individualPropertyAtom>
    </owlr:consequent>
<owlr:Rule>

) or for the reason that it gives more expressivity (if yes, please explain what this expressivity 
means and how it is achieved or can be achieved). 
 
Thank you,
Titi Roman 
 
[1] http://www.daml.org/rules/proposal/rules-all.html
Received on Tuesday, 2 December 2003 04:31:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:53:11 GMT