query-e0b013e0480f2f0a429140e05449e006
title:Languages of Wikipedia articles about Memory of the World Register inscriptions SELECT ?langcode ?langname (COUNT(?link) AS ?count) WHERE { ?item wdt:P1435 wd:Q473858. # heritage designation: Memory of the World ?link schema:about ?item ; schema:inLanguage ?langcode FILTER(CONTAINS(str(?link), ".wikipedia.org/")) # only Wikipedia articles OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langlabel FILTER(lang(?langlabel) = "en") } # Convert short code to full language name BIND(COALESCE(?langlabel, ?langcode) AS ?langname) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?langcode ?langname 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 schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:Languages of Wikipedia articles about Memory of the World Register inscriptions
SELECT ?langcode ?langname (COUNT(?link) AS ?count) WHERE {
?item wdt:P1435 wd:Q473858. # heritage designation: Memory of the World
?link schema:about ?item ; schema:inLanguage ?langcode
FILTER(CONTAINS(str(?link), ".wikipedia.org/")) # only Wikipedia articles
OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langlabel FILTER(lang(?langlabel) = "en") } # Convert short code to full language name
BIND(COALESCE(?langlabel, ?langcode) AS ?langname)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?langcode ?langname
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?count")
v4("?item")
v5("?langcode"):::projected
v3("?langlabel")
v7("?langname"):::projected
v6("?language")
v2("?link"):::projected
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c4(["wd:Q473858"]):::iri
f0[["contains(str(?link),'.wikipedia.org/')"]]
f0 --> v2
v4 --"wdt:P1435"--> c4
v2 --"schema:about"--> v4
v2 --"schema:inLanguage"--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v6 -."wdt:P218".-> v5
v6 --"rdfs:label"--> v3
end
bind1[/"?langlabel?langcode"/]
v3 --o bind1
v5 --o bind1
bind1 --as--o v7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
bind3[/"count(?link)"/]
v2 --o bind3
bind3 --as--o v8