Query filter bug

0 views
Skip to first unread message

Robert Butler

unread,
Jun 25, 2012, 4:45:51 PM6/25/12
to Stardog
I believe I have found a bug with filters, specifically the OPTIONAL/!BOUND query pattern.

I have a query in which I have the following:

  FILTER(!BOUND(?var0))
  OPTIONAL {  ?item <http://pancaketech.com/ont/attune/1.0#belongsToFocus> ?var0 .  }

The filter does not seem to filter any results on ?var0 since I get results back with a focus. If I move the filter below the optional, it behaves as I would expect. After double checking the SPARQL spec, I believe order shouldn't matter here since both lines are in the same graph pattern.

I've attached a Java class, data file and 2 query files to exercise the bug.

Thanks,
Robert

Stardog-BugFiles.zip

Rob Vesse

unread,
Jun 25, 2012, 9:13:13 PM6/25/12
to sta...@clarkparsia.com
These are not in the same graph pattern as I understand the spec, an OPTIONAL is a new graph pattern. The FILTER is only applying over an implicit empty BGP in your example

Putting queries into the validator at sparql.org and selecting the SPARQL algebra option can be quite enlightening in cases like this. I think the difference between the output for the two variations of the query should confirm my above statement

Rob
Sent via BlackBerry by AT&T

-----Original Message-----
From: Robert Butler <rbu...@pancaketech.com>
Date: Mon, 25 Jun 2012 15:45:51
To: Stardog<sta...@clarkparsia.com>
Reply-To: sta...@clarkparsia.com
Subject: [stardog-users] Query filter bug

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



Robert Butler

unread,
Jun 25, 2012, 9:36:28 PM6/25/12
to sta...@clarkparsia.com, sta...@clarkparsia.com
Hey Rob,

You are absolutely correct. I looked at the spec again based on your comments and found the following:

Section 5.1: Any graph pattern terminates a basic graph pattern.

Thanks for the clarification.

- Robert

Sent from my iPad
Reply all
Reply to author
Forward
0 new messages