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.

Greetings,

Adrian