query-7e1bfb5fc0ea135b9224394e67d4e3f6

rq turtle/ttl

Exploring hierachy in KB manuscripts

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?manuscript ?manuscriptLabel ?text ?textLabel
WHERE 
{
  ?manuscript wdt:P31 wd:Q87167; wdt:P195 wd:Q1526131 #manuscripts from KB collection 
  OPTIONAL{?manuscript wdt:P527 ?text.} #texts

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } 
}
ORDER BY ASC (?manuscriptLabel)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?manuscript"):::projected v1("?manuscriptLabel"):::projected v3("?text"):::projected c2(["wd:Q87167"]):::iri c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal c4(["wd:Q1526131"]):::iri v2 --"wdt:P31"--> c2 v2 --"wdt:P195"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P527".-> v3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end