query-9d4c57b36d5c306e72276e93f1022ffd

rq turtle/ttl

title:Labels for Memory of the World inscriptions SELECT ?langname (COUNT(?item) AS ?count) WHERE { ?item p:P1435 ?s. ?s ps:P1435 wd:Q473858. # Heritage designation: MotW ?item rdfs:label ?label BIND(lang(?label) AS ?langcode) 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) } GROUP BY ?langname ORDER BY DESC(?count)

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
#title:Labels for Memory of the World inscriptions
SELECT ?langname (COUNT(?item) AS ?count)  WHERE {
  ?item p:P1435 ?s. ?s ps:P1435 wd:Q473858. # Heritage designation: MotW
 ?item rdfs:label ?label BIND(lang(?label) AS ?langcode)
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)
} GROUP BY ?langname
ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?count") v3("?item"):::projected v5("?label") v6("?langcode") v2("?langlabel") v8("?langname"):::projected v7("?language") v4("?s") c4(["wd:Q473858"]):::iri v3 --"p:P1435"--> v4 v4 --"p:statement/P1435"--> c4 v3 --"rdfs:label"--> v5 bind0[/"?label"/] v5 --o bind0 bind0 --as--o v6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v7 -."p:direct/P218".-> v6 v7 --"rdfs:label"--> v2 end bind1[/"?langlabel?langcode"/] v2 --o bind1 v6 --o bind1 bind1 --as--o v8 bind3[/"count(?item)"/] v3 --o bind3 bind3 --as--o v9