query-3b9b2cbd3447982bc4d7830f1e4414cb
title:Count each external identifier only once
SELECT (COUNT(DISTINCT ?wdt) as ?count) ?n
WHERE
{
?p wikibase:propertyType wikibase:ExternalId .
?p wikibase:directClaim ?wdt .
wd:Q11922067 ?wdt [] .
wd:Q11922067 wikibase:identifiers ?n .
}
GROUP BY ?n
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
#title:Count each external identifier only once
SELECT (COUNT(DISTINCT ?wdt) as ?count) ?n
WHERE
{
?p wikibase:propertyType wikibase:ExternalId .
?p wikibase:directClaim ?wdt .
wd:Q11922067 ?wdt [] .
wd:Q11922067 wikibase:identifiers ?n .
}
GROUP BY ?n
Query found at
- https://www.wikidata.org/wiki/User:Ep%C3%ACdosis/Queries
- https://www.wikidata.org/wiki/User:Ep%C3%ACdosis/sandbox
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?count")
v3("?n"):::projected
v1("?p")
v2("?wdt"):::projected
a1((" "))
c4(["wd:Q11922067"]):::iri
c2(["wikibase:ExternalId"]):::iri
v1 --"wikibase:propertyType"--> c2
v1 --"wikibase:directClaim"--> v2
c4 -->v2--> a1
c4 --"wikibase:identifiers"--> v3
bind1[/"count(?wdt)"/]
v2 --o bind1
bind1 --as--o v4