query-3d3c097a2d112f827de1ba4567646cd9

rq turtle/ttl

title:Wikisource transcriptions of specific Memory of the World inscriptions SELECT ?langname ?itemLabel ?site WHERE { ?item p:P1435 ?s. ?s ps:P1435 wd:Q473858. # Heritage designation: MotW ?site schema:about/wdt:P629? ?item ; schema:inLanguage ?langcode. FILTER(CONTAINS(str(?site), ".wikisource.org/") ) OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langlabel FILTER(lang(?langlabel) = "en") } # Convert short code to full language name SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } BIND(COALESCE(?langlabel, ?langcode) AS ?langname) } ORDER BY ?langname

Use at

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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:Wikisource transcriptions of specific Memory of the World inscriptions
SELECT ?langname ?itemLabel ?site  WHERE {
  ?item p:P1435 ?s. ?s ps:P1435 wd:Q473858. # Heritage designation: MotW
 ?site schema:about/wdt:P629? ?item ; schema:inLanguage ?langcode. FILTER(CONTAINS(str(?site), ".wikisource.org/") )
OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langlabel FILTER(lang(?langlabel) = "en") } # Convert short code to full language name
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
BIND(COALESCE(?langlabel, ?langcode) AS ?langname)
} 
ORDER BY ?langname

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?item") v6("?langcode") v3("?langlabel") v8("?langname"):::projected v7("?language") v5("?s") v2("?site"):::projected a1((" ")) c12(["bd:serviceParam"]):::iri c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal c5(["wd:Q473858"]):::iri f0[["contains(str(?site),'.wikisource.org/')"]] f0 --> v2 v4 --"p:P1435"--> v5 v5 --"p:statement/P1435"--> c5 v2 --"schema:about"--> a1 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; a1 --"p:direct/P629"--> v4 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; end union0r <== or ==> union0l end v2 --"schema:inLanguage"--> v6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v7 -."p:direct/P218".-> v6 v7 --"rdfs:label"--> v3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end bind1[/"?langlabel?langcode"/] v3 --o bind1 v6 --o bind1 bind1 --as--o v8