Stardog Rules HELP!!!

0 views
Skip to first unread message

Tiago Sosa

unread,
Sep 11, 2014, 11:12:11 AM9/11/14
to sta...@clarkparsia.com
Hi Guys How are you?? 

I have a little problem ( could be a syntax problem) when I try to execute a Query based in a SparQl rule...

More exactly, I defined my ontology like this:

Class:
  • Point
DataTypeProperties: ( Domain -> Range)
  • X ( Point -> Double)
  • Y ( Point -> Double)
Object Properties: ( Domain -> Range)
  • equalTo (Point -> Point)

ok... and says that I have 2 individuals ( P1 and P2) with same X and Y

if I try a query like below, to find which Points have same coordinates:

PREFIX : //load the prefix
SELECT ?p1 ?p2
WHERE{

   ?p1 a :Point.
   ?p2 a :Point.
   ?p1 :X ?x1.
   ?p2 :X ?x2.
   ?p1 :Y ?y1.
   ?p2 :Y ?y2.
   FILTER ( (?x1 = ?x2) && (?y1 = ?y2) && ( ?p1 != ?p2) )
}

it Works FINE!!! and lists P1 and P2.... But if I put the where statement in a rule to define the "equalTo" objectProperty like this:

 
@prefix rule: <tag:stardog:api:rule:> .

[] a rule:SPARQLRule ;
rule:content """
PREFIX : //Ontology Prefix goes here
IF {
   ?p1 a :Point.
   ?p2 a :Point.
   ?p1 :X ?x1.
   ?p2 :X ?x2.
   ?p1 :Y ?y1.
   ?p2 :Y ?y2.
   FILTER ( (?x1 = ?x2) && (?y1 = ?y2) && ( ?p1 != ?p2) )
}
THEN 
{
  ?p1 :equalTo ?p2.
} """.


Now If I try the same query with the "equalTo" ObjectProperty should return the same result... 

PREFIX : //load the prefix
SELECT ?p1 ?p2
WHERE{

   ?p1 :equalTo ?p2.

}

but always retun 0 rows...

I don't understand what I'm doing wrong in this... or there's some limitations in stardog with the rule definitions? 


Thanks

Tiago
Reply all
Reply to author
Forward
0 new messages