Possible Sparql BIND bug - 4.1

2 views
Skip to first unread message

Mark James

unread,
Jun 14, 2016, 7:36:46 AM6/14/16
to Stardog
Hi Guys,
Since upgrading to stardog 4.1 i've encountered a range of temperamental sparql results for certain kinds of queries. A big one that seems consistently problematic is using bound in a bind variable.  In the following query see the bolded line -

prefix mw: <http://www.xyz.com/moveware/>

prefix sn: <http://api.xyz.com/ontology/acme/>

prefix sm: <http://xyz.com/ontology/event/>

select ?ID ?EDATE ?ETIME ?ETYPE ?ESTATUS ?EASSIGNED ?EID

where {

graph ?g

{?s <http://www.xyz.com/event/ID> ?ID

optional {?event a sm:TASKS_COMPLETED .

         ?event sm:SituationStatus ?eStatus .

         ?event sm:EventEntityID ?eID .

    filter (?eStatus in ('Ongoing'))}

?mwJob a mw:Job ;

     mw:MANAGEREMAIL ?EASSIGNED .

}

filter (?g =  <http://www.xyz.com/COST_UPDATE-7691457526850792123> )

BIND (now() + "PT10H0M0S"^^xsd:dayTimeDuration as ?SYSDATE)

BIND (substr(xsd:string(?SYSDATE),1,10) as ?EDATE)

BIND (substr(xsd:string(?SYSDATE),12,8) as ?ETIME)

BIND ("TASKS_COMPLETED" as ?ETYPE)

BIND (IF(bound(?eStatus), 'Ongoing', 'Started') as ?ESTATUS)

BIND (IF(bound(?event), ?event, 0) as ?EID)

}


The ESTATUS bind will reliably return 'Started' which indicates that the ?eStatus is unbound despite it being bound. To 'fix' the above query I inlined the filter (?g =  <http://www.xyz.com/COST_UPDATE-7691457526850792123> ) line so that the sparql reads - graph  <http://www.xyz.com/COST_UPDATE-7691457526850792123> which seemed to do the trick.


However in other variations of this problem the only way I could fix it was to push parts of the query into a subquery with the bind being in the outer query.


I've since reverted back to Stardog 4.0.5 and the problems have disappeared. So it seems to be quite specific to 4.1.


cheers

Mark



Pavel Klinov

unread,
Jun 14, 2016, 7:51:14 AM6/14/16
to sta...@clarkparsia.com
Mark,

Thanks for reporting this, we'll fix it for 4.1.1.

Best,
Pavel

--
-- --
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

Reply all
Reply to author
Forward
0 new messages