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

Expand parsed SPARQL query with labels #9

Closed nichtich closed 8 years ago

nichtich commented 9 years ago

The SPARQL query can be extended by adding the label service and language from LC_LANG or command line option --language / -g.

$ wdq -g fr -nq '{ ?x wdt:P361 wd:Q544 }
SELECT ?x ?xLabel WHERE {
     ?x wdt:P361 wd:Q544 .
    SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" }
}

See also #8 for another use.

The query can also be extended by descriptions (-d), aliases (-a) or all of them (-L).

nichtich commented 9 years ago

The SERVICE could always be added if this does not affect performance (?) It should only take effect if corresponding variables are included (qLabel, qDescription...).