W3C home > Mailing lists > Public > public-rif-wg@w3.org > May 2007

Re: [TED] Worked Examples of Use Cases Updated According to RIF Core WD1

From: Adrian Giurca <giurca@tu-cottbus.de>
Date: Tue, 22 May 2007 10:21:57 +0200
Message-ID: <4652A825.4050709@tu-cottbus.de>
To: "Boley, Harold" <Harold.Boley@nrc-cnrc.gc.ca>
CC: RIF WG <public-rif-wg@w3.org>

I don't understand the reasons why the final translation is a RDF 
document. I guess some explanations are desirable. Indeed JenaRules use 
RDF(S) as a vocabulary language. Is this the intention of RIF?

1. First I guess that properties like "hasNIC" or "hasIP" must be  "NIC" 
or "IP". If they are named "hasNIC"  then this denotes a boolean 
property which is not the case here. 
I propose the following markup for rule 1 in  source rules 

<rif:Rule rif:id="r1-computeNodeToServer">
<!-- (?x rdf:type it:ComputeNode) -->
  <rif:Predicate rif:id="it:ComputeNode"/>
  <rif:Var rif:name="?x"/>
 <!-- (?x it:hasNIC ?i)  -->
  <rif:Predicate rif:id="it:NIC"/>
   <rif:Var rif:name="?x"/>
   <rif:Var rif:name="?i"/>
 <!-- (?i it:hasIP ?p) -->
  <rif:Predicate rif:id="it:IP"/>
   <rif:Var rif:name="?i"/>
   <rif:Var rif:name="?p"/>
    <!-- (?x rdf:type t:Server) -->
  <rif:Predicate rif:id="t:Server"/>
  <rif:Var rif:name="?x"/>
    <!--(?x t:address ?p) -->
  <rif:Predicate rif:id="t:address"/>
   <rif:Var rif:name="?x"/>
   <rif:Var rif:name="?p"/>

3. In rule R3 discussing blanc nodes I don't see why the rule is not 
written as:

     (?a rdf:type bp:Application) 
     (?a bp:discoveredAtIP ?p)
     (?n rdf:type t:Server)
     (?n t:address ?p)  (?n t:hosts ?a)]

Why we need the blank node here?

4. About built-ins:
In rule r4-discount I guess that, according with Jena Rules syntax , we 
have product(?c, '0.75', ?cd) or  product(?c, '0.75'^^xs:float, ?cd). In 
the second case the markup may be:

 <!-- if we allow RIF built-ins -->
  <rif:Predicate rif:id="rif:product"/>
   <rif:Var rif:name="?c"/>
   <rif:Const rif:type="xs:float">0.75</rif:Const>
   <rif:Var rif:name="?cd"/>

5. the triple (?a ?P ?subApp)  may be represented as:

   <rif:Var rif:name="?P"/>
   <rif:Var rif:name="?a"/>
   <rif:Var rif:name="?subApp"/>

while (?P rdfs:subPropertyOf bp:comprises) may be:

  <rif:Predicate rif:id="rdfs:subPropertyOf"/>
   <rif:Var rif:name="?P"/>
   <rif:Predicate rif:id="bp:comprises"/>

For example you can move the rule 1 from Jena to JBossRules (using RIF ) as:

package jenaRules
     // carefully to transforming URI in Java path expressions. Not all 
the time possible
   import com.hp.hp1.jena.rifUC08.ITDatabase.ComputeNode;
   import com.hp.hp1.jena.rifUC08.target.Server;

   rule "r1-computeNodeToServer"
     //(?x rdf:type it:ComputeNode)  (?x it:NIC ?i) (?i it:IP ?p) 
translates to the following column
     $x: ComputeNode( $i: nic -> ($p: $i.ip() ) ) 
     // (?x rdf:type t:Server)
     $x = (Server)$x;
     // (?x t:address ?p)
   // update the working memory
     modify( $x);

We have a running use case (UServ Product Derby 2005 Use Case 
<http://www.businessrulesforum.com/2005_Product_Derby.pdf>) with 
JenaRules and JBoss Rules (using R2ML) at:

The Jena Rules  application is: 

At the end of insurance calculation you can see rules that were applies, 
RDF data and so on.


Boley, Harold wrote:
> I've updated the Worked Examples of the Use Cases available at
> <http://www.w3.org/2005/rules/wg/wiki/D._Evaluation%3A_Use_Cases>
> according to RIF Core WD1 (UC6 Worked Example not yet available).
> -- Harold

Dr. Adrian Giurca
Received on Tuesday, 22 May 2007 08:22:12 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:47:44 UTC