Skip to content

Instantly share code, notes, and snippets.

@Abbe98
Created June 2, 2018 15:01
Show Gist options
  • Save Abbe98/713f80e951c17a8dcb98503c275b40a0 to your computer and use it in GitHub Desktop.
Save Abbe98/713f80e951c17a8dcb98503c275b40a0 to your computer and use it in GitHub Desktop.
Wikidata SparQL Queries
# Sign languages by count
SELECT (COUNT(?lang) as ?language) ?langLabel ?lang
WHERE {
?item wdt:P2919 ?file .
?item p:P2919 ?statement .
?statement pq:P407 ?lang .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
}
GROUP BY ?langLabel ?lang
ORDER BY DESC(?language)
# Items with label in specified sign language
SELECT ?item ?itemLabel ?file ?itemDescription
WHERE {
?item wdt:P2919 ?file .
?item p:P2919 ?statement .
?statement pq:P407 wd:Q36558 .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment