Support for BIND(IF(x,y,z) AS ?foo) in SPARQL rules

1 view
Skip to first unread message

Albert Meroño Peñuela

unread,
Dec 8, 2014, 8:59:51 AM12/8/14
to sta...@clarkparsia.com
Hi,

I'm trying to encode some business rules as Stardog SPARQL rules, using the format

eg:myrule a rule:SPARQLRule ;
   rule:content """
       PREFIX eg: <http://example.org/ns#>
       PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
     IF {
       ?foo a eg:bar .
       ?foo eg:myprop ?baz .
       BIND ( IF(?baz = "foobaz", "true"^^xsd:boolean, "false"^^xsd:boolean) AS ?c )
     }
     THEN {
       ?foo eg:myrule ?c
     }
   """.
However, this rule never gets triggered (i.e. the triple ?foo eg:myrule ?c is never generated), unless I replace the IF(x,y,z) statement to something like

BIND ( IF(?baz = "foobaz", ?baz != ?foo, ?foo = ?foo)

Is this well supported in Stardog or am I missing something?

Thanks,
Albert

Héctor Pérez-Urbina

unread,
Dec 12, 2014, 8:25:07 AM12/12/14
to stardog
Albert,

We recently received a very similar report involving the use of BIND in a rule. We are in the process of deciding whether we will support this or not, as the original intention was for this syntax to be sugar over SWRL (not SPARQL). I will keep you posted.

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en



--
Best,
Héctor
Reply all
Reply to author
Forward
0 new messages