nichtich / wdq

Command line interface to Wikidata Query Service
https://metacpan.org/pod/distribution/App-wdq/script/wdq
Other
54 stars 4 forks source link

SPARQL examples won't work #25

Open Spiritdude opened 8 years ago

Spiritdude commented 8 years ago

Samples from https://www.mediawiki.org/wiki/Wikibase/Indexing/SPARQL_Query_Examples like

SELECT DISTINCT ?country ?countryLabel ?capital ?capitalLabel
WHERE
{
        ?country wdt:P31 wd:Q3624078 .
        FILTER NOT EXISTS {?country wdt:P31 wd:Q3024240}
        OPTIONAL { ?country wdt:P36 ?capital } .
        SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
ORDER BY ?countryLabel

won't work:

% wdq < sample.sparql
invalid SPARQL query

Using --force won't help it.

What am I missing?

PS: A manual curl access with encoded sparql query works.

nichtich commented 8 years ago

Thanks for the report. I just verified that the given SPARQL query does not work with the current wdq but should works with the underlying SPARQL parser, so I am going to fix it!