query-8069599536e61e355e2133d58b48df05

rq turtle/ttl

title:Works of which the Khalili Collections have an exemplar SELECT ?item ?itemLabel ?workLabel ?authorLabel ?inventory ?pages ?url WHERE { ?item p:P195 ?s. ?s ps:P195/wdt:P361 wd:Q63160499. # In Khalili Collections ?s pq:P217 ?inventory. # inventory number attached to the collection property ?item wdt:P1574 ?work. # exemplar of a work OPTIONAL {?item wdt:P973 ?url} OPTIONAL {?work wdt:P50 ?author} OPTIONAL {?item wdt:P1104 ?pages} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY ?workLabel

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:Works of which the Khalili Collections have an exemplar
SELECT ?item ?itemLabel ?workLabel ?authorLabel ?inventory ?pages ?url WHERE { 
  ?item p:P195 ?s. ?s ps:P195/wdt:P361 wd:Q63160499. # In Khalili Collections
    ?s pq:P217 ?inventory. # inventory number attached to the collection property
  ?item wdt:P1574 ?work. # exemplar of a work
  OPTIONAL {?item wdt:P973 ?url}
  OPTIONAL {?work wdt:P50 ?author}
  OPTIONAL {?item wdt:P1104 ?pages}
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?workLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?author") v4("?inventory"):::projected v2("?item"):::projected v8("?pages"):::projected v3("?s") v6("?url"):::projected v5("?work") v1("?workLabel"):::projected a1((" ")) c11(["bd:serviceParam"]):::iri c4(["wd:Q63160499"]):::iri c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"p:P195"--> v3 v3 --"p:statement/P195"--> a1 a1 --"p:direct/P361"--> c4 v3 --"p:qualifier/P217"--> v4 v2 --"p:direct/P1574"--> v5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P973".-> v6 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P50".-> v7 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P1104".-> v8 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end