query-a5ace981d8a33bad01d2cd2f2c188deb
title:Number of labels for an item, split by language SELECT ?q ?langcode ?langLabel (COUNT(?label) AS ?count) WHERE { VALUES ?q {wd:Q43459} ?q (rdfs:label|skos:altLabel) ?label BIND(LANG(?label) AS ?langcode) ?lang wdt:P218 ?langcode SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } GROUP BY ?q ?langcode ?langLabel ORDER BY DESC(?count)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:Number of labels for an item, split by language
SELECT ?q ?langcode ?langLabel (COUNT(?label) AS ?count) WHERE {
VALUES ?q {wd:Q43459}
?q (rdfs:label|skos:altLabel) ?label
BIND(LANG(?label) AS ?langcode)
?lang wdt:P218 ?langcode
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
} GROUP BY ?q ?langcode ?langLabel
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?count")
v3("?label"):::projected
v5("?lang")
v4("?langcode"):::projected
v2("?q"):::projected
c5(["bd:serviceParam"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal
bind0[/VALUES ?q/]
bind0-->v2
bind00(["wd:Q43459"])
bind00 --> bind0
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v2 --"skos:altLabel"--> v3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"rdfs:label"--> v3
end
union0r <== or ==> union0l
end
bind1[/"?label"/]
v3 --o bind1
bind1 --as--o v4
v5 --"wdt:P218"--> v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end
bind3[/"count(?label)"/]
v3 --o bind3
bind3 --as--o v6