Hello everyone,
I'm writing on behalf of a Wikidata Research Project https://meta.wikimedia.org/wiki/Research:Understanding_Wikidata_Queries into SPARQL-Queries.
I was wondering if anybody could help me understand why (and how) this query:
SELECT DISTINCT ?item WHERE { ?tree0 wdt:P31 ?item . BIND (wd:Q146 AS ?tree0) }
is being accepted by query.wikidata.org.
The reason I'm asking is that we are trying to parse the queries from the wikidata logs and analyze them for different features. At the moment we are parsing them using OpenRDF, which fails (as far as I can see understandably) at parsing this query.
Greetings,
Adrian
good evening;
go here :
http://www.sparql.org/query-validator.html
and try the query (with appropriate prefix declarations). you will see that it is not valid.
On 2017-01-14, at 18:23, Adrian Bielefeldt Adrian.Bielefeldt@mailbox.tu-dresden.de wrote:
Hello everyone,
I'm writing on behalf of a Wikidata Research Project into SPARQL-Queries.
I was wondering if anybody could help me understand why (and how) this query:
SELECT DISTINCT ?item WHERE { ?tree0 wdt:P31 ?item . BIND (wd:Q146 AS ?tree0) }
is being accepted by query.wikidata.org.
The reason I'm asking is that we are trying to parse the queries from the wikidata logs and analyze them for different features. At the moment we are parsing them using OpenRDF, which fails (as far as I can see understandably) at parsing this query.
handling erroneous queries in such circumstances is one of the general framing issues.
best regards, from berlin,
--- james anderson | james@dydra.com | http://dydra.com
Hi!
On 1/14/17 9:23 AM, Adrian Bielefeldt wrote:
I was wondering if anybody could help me understand why (and how) this query:
SELECT DISTINCT ?item WHERE { ?tree0 wdt:P31 ?item . BIND (wd:Q146 AS ?tree0) }
is being accepted by query.wikidata.org.
Probably Blazegraph engine considers it analogous with the query having the bind in front, or maybe optimization reorders it.
At the moment we are parsing them using OpenRDF, which fails (as far
as I can see understandably) at parsing this query.
Well, the standard does say you can not use a variable in BIND that was previously used, and I guess OpenRDF parser chooses to be more strict than Blazegraph.
wikidata-tech@lists.wikimedia.org