odd FILTER(contains(...)) issue

16 views
Skip to first unread message

David Kamholz

unread,
Oct 8, 2014, 7:56:13 PM10/8/14
to 4store-...@googlegroups.com
I am running a query like the following on 4store 1.1.4:  

SELECT (COUNT(DISTINCT ?ex) AS ?count) WHERE {
  ?tr a dbnary:Translation ; dbnary:writtenForm ?ex .
  FILTER( contains(?ex, "a") )
}

4store returns a count of 84356, which is far too low. I get the correct count of 1716263 if I run the following query instead:

SELECT (COUNT(DISTINCT ?ex) AS ?count) WHERE {
  ?tr a dbnary:Translation ; dbnary:writtenForm ?ex .
  FILTER( regex(?ex, "a") )
}

Is this a bug in 4store's implementation of contains(), or am I missing something basic here? Any help would be much appreciated!

Dave

David Kamholz

unread,
Oct 9, 2014, 12:39:46 AM10/9/14
to 4store-...@googlegroups.com
Is this a bug in 4store's implementation of contains(), or am I missing something basic here? Any help would be much appreciated!

I've now found a workaround for this issue -- if I do contains(str(?ex), "a") I get the correct result. So apparently 4store is only comparing strings that have no language tag, since "a" also has no language tag. This workaround works, but it looks like 4store is not compatible with the SPARQL spec on this: as I read http://www.w3.org/TR/sparql11-query/#func-contains, two arguments are still "argument compatible" when one has a language tag and the other does not.

Dave

swh

unread,
Oct 9, 2014, 5:59:40 AM10/9/14
to 4store-...@googlegroups.com
You're right, it's a bug - I'll file a ticket for it.
Reply all
Reply to author
Forward
0 new messages