I have a dataset that looks a bit like:
<item1> <isLocated> <someAddress> <item2> <isLocated> <someAddress> <item3> <isLocated> <someOtherAddress>
I want to be able to use SPARQL to answer the question:
"What items will I find in someAddress or someOtherAddress?"
I could use UNION as follows:
SELECT ?item { { ?item <isLocated> <someAddress> } UNION { ?item <isLocated> <someOtherAddress } }
But I think it will get pretty dirty when I start talking about 100 or 1000 addresses.
I think VALUES embedded data might be more appropriate than a bunch of UNION queries. I tried writing the following query, but my RDF repository / engine (bigdata) seems to strangle it:
SELECT ?item { ?item <isLocated> ?loc . } VALUES (?loc) { (<someAddress>) (<someOtherAddress>) }
(based on http://www.w3.org/TR/sparql11-query/#inline-data )
The error I get from bigdata: Lexical error in row 5, column 7. Found: "(32), after:" VALUES "
Am I generating this request correctly? Is using UNION or VALUES more appropriate?
It seems that no matter how I format this request (based on the w3 examples in the link above), I get similar lexical errors.
Any ideas?
Greetings.
source share