query-f20586aa3ef8bce5973c877765999109

rq turtle/ttl

title:Non-English labels for Khalili Collections items SELECT ?lang ?count WITH { SELECT ?work ?label WHERE { ?work wdt:P195?/wdt:P361? wd:Q63160499. # Khalili Collections, or individual collections, or objects within collections ?work (rdfs:label|skos:altLabel) ?label FILTER(lang(?label) != "en") } } AS %core WHERE { { SELECT ?lang (COUNT(?label) AS ?count) WHERE { INCLUDE %core. BIND(lang(?label) AS ?langcode). OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langname FILTER(lang(?langname) = "en")} BIND(IF (BOUND(?langname), ?langname, ?langcode) AS ?lang) } GROUP BY ?lang } UNION { SELECT ("TOTAL" AS ?lang) (COUNT(?label) AS ?count) WHERE { INCLUDE %core. } } } order BY DESC(?count) ?lang title:Non-English labels for Khalili Collections items SELECT ?lang ?count WITH { SELECT ?work ?label WHERE { ?work wdt:P195?/wdt:P361? wd:Q63160499. # Khalili Collections, or individual collections, or objects within collections ?work (rdfs:label|skos:altLabel) ?label FILTER(lang(?label) != "en") } } AS %core WHERE { { SELECT ?lang (COUNT(?label) AS ?count) WHERE { INCLUDE %core. BIND(lang(?label) AS ?langcode). OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langname FILTER(lang(?langname) = "en")} BIND(IF (BOUND(?langname), ?langname, ?langcode) AS ?lang) } GROUP BY ?lang } UNION { SELECT ("TOTAL" AS ?lang) (COUNT(?label) AS ?count) WHERE { INCLUDE %core. } } } order BY DESC(?count) ?lang title:Non-English labels for Khalili Collections items SELECT ?lang ?count WITH { SELECT ?work ?label WHERE { ?work wdt:P195?/wdt:P361? wd:Q63160499. # Khalili Collections, or individual collections, or objects within collections ?work (rdfs:label|skos:altLabel) ?label FILTER(lang(?label) != "en") } } AS %core WHERE { { SELECT ?lang (COUNT(?label) AS ?count) WHERE { INCLUDE %core. BIND(lang(?label) AS ?langcode). OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langname FILTER(lang(?langname) = "en")} BIND(IF (BOUND(?langname), ?langname, ?langcode) AS ?lang) } GROUP BY ?lang } UNION { SELECT ("TOTAL" AS ?lang) (COUNT(?label) AS ?count) WHERE { INCLUDE %core. } } } order BY DESC(?count) ?lang title:Non-English labels for Khalili Collections items SELECT ?lang ?count WITH { SELECT ?work ?label WHERE { ?work wdt:P195?/wdt:P361? wd:Q63160499. # Khalili Collections, or individual collections, or objects within collections ?work (rdfs:label|skos:altLabel) ?label FILTER(lang(?label) != "en") } } AS %core WHERE { { SELECT ?lang (COUNT(?label) AS ?count) WHERE { INCLUDE %core. BIND(lang(?label) AS ?langcode). OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langname FILTER(lang(?langname) = "en")} BIND(IF (BOUND(?langname), ?langname, ?langcode) AS ?lang) } GROUP BY ?lang } UNION { SELECT ("TOTAL" AS ?lang) (COUNT(?label) AS ?count) WHERE { INCLUDE %core. } } } order BY DESC(?count) ?lang title:Non-English labels for Khalili Collections items SELECT ?lang ?count WITH { SELECT ?work ?label WHERE { ?work wdt:P195?/wdt:P361? wd:Q63160499. # Khalili Collections, or individual collections, or objects within collections ?work (rdfs:label|skos:altLabel) ?label FILTER(lang(?label) != "en") } } AS %core WHERE { { SELECT ?lang (COUNT(?label) AS ?count) WHERE { INCLUDE %core. BIND(lang(?label) AS ?langcode). OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langname FILTER(lang(?langname) = "en")} BIND(IF (BOUND(?langname), ?langname, ?langcode) AS ?lang) } GROUP BY ?lang } UNION { SELECT ("TOTAL" AS ?lang) (COUNT(?label) AS ?count) WHERE { INCLUDE %core. } } } order BY DESC(?count) ?lang title:Non-English labels for Khalili Collections items SELECT ?lang ?count WITH { SELECT ?work ?label WHERE { ?work wdt:P195?/wdt:P361? wd:Q63160499. # Khalili Collections, or individual collections, or objects within collections ?work (rdfs:label|skos:altLabel) ?label FILTER(lang(?label) != "en") } } AS %core WHERE { { SELECT ?lang (COUNT(?label) AS ?count) WHERE { INCLUDE %core. BIND(lang(?label) AS ?langcode). OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langname FILTER(lang(?langname) = "en")} BIND(IF (BOUND(?langname), ?langname, ?langcode) AS ?lang) } GROUP BY ?lang } UNION { SELECT ("TOTAL" AS ?lang) (COUNT(?label) AS ?count) WHERE { INCLUDE %core. } } } order BY DESC(?count) ?lang title:Non-English labels for Khalili Collections items SELECT ?lang ?count WITH { SELECT ?work ?label WHERE { ?work wdt:P195?/wdt:P361? wd:Q63160499. # Khalili Collections, or individual collections, or objects within collections ?work (rdfs:label|skos:altLabel) ?label FILTER(lang(?label) != "en") } } AS %core WHERE { { SELECT ?lang (COUNT(?label) AS ?count) WHERE { INCLUDE %core. BIND(lang(?label) AS ?langcode). OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langname FILTER(lang(?langname) = "en")} BIND(IF (BOUND(?langname), ?langname, ?langcode) AS ?lang) } GROUP BY ?lang } UNION { SELECT ("TOTAL" AS ?lang) (COUNT(?label) AS ?count) WHERE { INCLUDE %core. } } } order BY DESC(?count) ?lang title:Non-English labels for Khalili Collections items SELECT ?lang ?count WITH { SELECT ?work ?label WHERE { ?work wdt:P195?/wdt:P361? wd:Q63160499. # Khalili Collections, or individual collections, or objects within collections ?work (rdfs:label|skos:altLabel) ?label FILTER(lang(?label) != "en") } } AS %core WHERE { { SELECT ?lang (COUNT(?label) AS ?count) WHERE { INCLUDE %core. BIND(lang(?label) AS ?langcode). OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langname FILTER(lang(?langname) = "en")} BIND(IF (BOUND(?langname), ?langname, ?langcode) AS ?lang) } GROUP BY ?lang } UNION { SELECT ("TOTAL" AS ?lang) (COUNT(?label) AS ?count) WHERE { INCLUDE %core. } } } order BY DESC(?count) ?lang title:Non-English labels for Khalili Collections items SELECT ?lang ?count WITH { SELECT ?work ?label WHERE { ?work wdt:P195?/wdt:P361? wd:Q63160499. # Khalili Collections, or individual collections, or objects within collections ?work (rdfs:label|skos:altLabel) ?label FILTER(lang(?label) != "en") } } AS %core WHERE { { SELECT ?lang (COUNT(?label) AS ?count) WHERE { INCLUDE %core. BIND(lang(?label) AS ?langcode). OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langname FILTER(lang(?langname) = "en")} BIND(IF (BOUND(?langname), ?langname, ?langcode) AS ?lang) } GROUP BY ?lang } UNION { SELECT ("TOTAL" AS ?lang) (COUNT(?label) AS ?count) WHERE { INCLUDE %core. } } } order BY DESC(?count) ?lang

Use at

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#>
#title:Non-English labels for Khalili Collections items
SELECT ?lang ?count WHERE { {
  SELECT ?lang (COUNT(?label) AS ?count) WHERE {
     {
  SELECT ?work ?label WHERE {
    ?work wdt:P195?/wdt:P361? wd:Q63160499. # Khalili Collections, or individual collections, or objects within collections
    ?work (rdfs:label|skos:altLabel) ?label
    FILTER(lang(?label) != "en") } }
    BIND(lang(?label) AS ?langcode).
    OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langname FILTER(lang(?langname) = "en")}
    BIND(IF (BOUND(?langname), ?langname, ?langcode) AS ?lang) 
    } GROUP BY ?lang
 } UNION {
    SELECT ("TOTAL" AS ?lang) (COUNT(?label) AS ?count) WHERE {
     {
  SELECT ?work ?label WHERE {
    ?work wdt:P195?/wdt:P361? wd:Q63160499. # Khalili Collections, or individual collections, or objects within collections
    ?work (rdfs:label|skos:altLabel) ?label
    FILTER(lang(?label) != "en") } }
    } }
} order BY DESC(?count) ?lang

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?count"):::projected v4("?label") v8("?lang"):::projected v6("?langcode") v3("?langname") v7("?language") v5("?work") a1((" ")) a2((" ")) c3(["wd:Q63160499"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; f0[["?label != 'en'"]] f0 --> v4 subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P195"--> a2 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; end union1r <== or ==> union1l end subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; a2 --"wdt:P361"--> c3 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; end union2r <== or ==> union2l end subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; v5 --"skos:altLabel"--> v4 end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; v5 --"rdfs:label"--> v4 end union3r <== or ==> union3l end bind2[/"'TOTAL'"/] bind2 --as--o v8 bind3[/"count(?label)"/] v4 --o bind3 bind3 --as--o v8 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; f4[["?label != 'en'"]] f4 --> v4 subgraph union4[" Union "] subgraph union4l[" "] style union4l fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P195"--> a1 end subgraph union4r[" "] style union4r fill:#abf,stroke-dasharray: 3 3; end union4r <== or ==> union4l end subgraph union5[" Union "] subgraph union5l[" "] style union5l fill:#abf,stroke-dasharray: 3 3; a1 --"wdt:P361"--> c3 end subgraph union5r[" "] style union5r fill:#abf,stroke-dasharray: 3 3; end union5r <== or ==> union5l end subgraph union6[" Union "] subgraph union6l[" "] style union6l fill:#abf,stroke-dasharray: 3 3; v5 --"skos:altLabel"--> v4 end subgraph union6r[" "] style union6r fill:#abf,stroke-dasharray: 3 3; v5 --"rdfs:label"--> v4 end union6r <== or ==> union6l end bind5[/"?label"/] v4 --o bind5 bind5 --as--o v6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v7 -."wdt:P218".-> v6 v7 --"rdfs:label"--> v3 end bind6[/"if(bound(?langname),?langname,?langcode)"/] v3 --o bind6 v6 --o bind6 bind6 --as--o v8 bind8[/"count(?label)"/] v4 --o bind8 bind8 --as--o v8 end union0r <== or ==> union0l end