Skip to content

Instantly share code, notes, and snippets.

@phaer
Last active March 6, 2018 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phaer/46c0fa44b0550ef5e2256eedd5495d8e to your computer and use it in GitHub Desktop.
Save phaer/46c0fa44b0550ef5e2256eedd5495d8e to your computer and use it in GitHub Desktop.
query software versions on wikidata.org
# See https://wikidata.org/wiki/P348 https://wikidata.org/wiki/Q83, https://wikidata.org/wiki/Q13166 for a
# definition of the arguments. Or paste the query to https://query.wikidata.org for a nice online editor.
curl -sSH 'Accept: application/sparql-results+json' --data-urlencode query@- https://query.wikidata.org/sparql <<EOF \
| jq '.results.bindings | map({"key": .softwareLabel.value, "value": .version.value}) | from_entries'
SELECT ?softwareLabel ?version WHERE {
?software wdt:P348 ?version;
FILTER ( ?software IN (wd:Q13166, wd:Q83))
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment