query-514b99b8ad7008346e536e8e3e651fd9

rq turtle/ttl

title: Qurans and Quran-fragments in the Khalili Collections SELECT DISTINCT ?item ?itemLabel ?placeLabel ?pubdate ?pubdatePrecision ?url ?img WHERE { ?item wdt:P195 wd:Q66455355 # collection: Khalili Collection of Islamic Art {?item wdt:P1574 wd:Q428 } UNION {?item wdt:P1574/wdt:P31 wd:Q234262 }. # Quran or a sura ?item p:P571/psv:P571 ?pubdateStatementNode. ?pubdateStatementNode wikibase:timeValue ?pubdate ; wikibase:timePrecision ?pubdatePrecision # get precision of the creation date

OPTIONAL {?item wdt:P217 ?inventory}

OPTIONAL {?item wdt:P1071 ?place} OPTIONAL {?item wdt:P973 ?url} OPTIONAL {?item wdt:P18 ?img} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title: Qurans and Quran-fragments in the Khalili Collections
SELECT DISTINCT ?item ?itemLabel ?placeLabel ?pubdate ?pubdatePrecision ?url ?img WHERE {
  ?item wdt:P195 wd:Q66455355 # collection: Khalili Collection of Islamic Art
   {?item wdt:P1574 wd:Q428 } UNION {?item wdt:P1574/wdt:P31 wd:Q234262 }. # Quran or a sura
    ?item p:P571/psv:P571 ?pubdateStatementNode.
?pubdateStatementNode wikibase:timeValue ?pubdate ;
   wikibase:timePrecision ?pubdatePrecision # get precision of the creation date
#  OPTIONAL {?item wdt:P217 ?inventory}
  OPTIONAL {?item wdt:P1071 ?place}
  OPTIONAL {?item wdt:P973 ?url}
  OPTIONAL {?item wdt:P18 ?img}
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?img"):::projected v1("?item"):::projected v5("?place") v3("?pubdate"):::projected v4("?pubdatePrecision"):::projected v2("?pubdateStatementNode") v6("?url"):::projected a1((" ")) a2((" ")) c2(["wd:Q66455355"]):::iri c6(["wd:Q234262"]):::iri c15(["bd:serviceParam"]):::iri c4(["wd:Q428"]):::iri c17(["#91;AUTO_LANGUAGE#93;,en"]):::literal v1 --"p:direct/P195"--> c2 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P1574"--> a1 a1 --"p:direct/P31"--> c6 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P1574"--> c4 end union0r <== or ==> union0l end v1 --"p:P571"--> a2 a2 --"p:statement/value/P571"--> v2 v2 --"wikibase:timeValue"--> v3 v2 --"wikibase:timePrecision"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P1071".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P973".-> v6 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P18".-> v7 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c15 --"wikibase:language"--> c17 end