Created
May 21, 2018 20:33
-
-
Save egonw/7c932f6af6223129b5a6c5d524c51b8a to your computer and use it in GitHub Desktop.
Wikidata SPARQL to count the number of identifiers for substances.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ?IDpred ?IDpredLabel ?count WITH { | |
SELECT ?IDpred (COUNT(?id) AS ?count) WHERE { | |
?chemical ?IDdir ?id . | |
?IDpred wikibase:directClaim ?IDdir ; | |
wdt:P31 wd:Q19833835 . | |
FILTER (?IDpred != wd:P639) | |
FILTER (?IDpred != wd:P2926) | |
} GROUP BY ?IDpred | |
} AS %RESULTS { | |
INCLUDE %RESULTS | |
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | |
} ORDER BY DESC(?count) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment