nichtich / wikidata-taxonomy

command-line tool to extract taxonomies from Wikidata
https://www.npmjs.org/package/wikidata-taxonomy
MIT License
124 stars 11 forks source link

sparqlRequest bug involving wdk.simplifySparqlResults? #5

Closed maxlath closed 8 years ago

maxlath commented 8 years ago

great module! If you have an example where wdk.simplifySparqlResults crashes as suggested by your comment, I would be happy to have a look at it :)

nichtich commented 8 years ago

Try this with wdsparql --simplify. The query is not optimized but valid:

SELECT ?item ?itemLabel ?broader ?parents
WHERE
{
    {
        SELECT ?item (count(distinct ?parent) as ?parents) {
            ?item wdt:P279* wd:Q1
            OPTIONAL { ?item wdt:P279 ?parent }
        } GROUP BY ?item
    }
    SERVICE wikibase:label {
        bd:serviceParam wikibase:language "en" .
    }
}
maxlath commented 8 years ago

ok, I created an issue in the wikidata-sdk repo, closing here