query-4c32eda6fcfa1f69b3d2961f92701a23

rq turtle/ttl

Exhibitions

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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#>
PREFIX target: <http://www.wikidata.org/entity/Q35>

SELECT 
  (xsd:date(?start_datetime) AS ?start_date)

  ?exhibition ?exhibitionLabel
  (CONCAT("#exhibition/", SUBSTR(STR(?exhibition), 32)) AS ?exhibitionUrl)
  ?exhibitionDescription
WHERE {
  ?exhibition wdt:P31 / wdt:P279* wd:Q464980 ;
              p:P17 ?country_statement .
  ?country_statement ps:P17 target: .

  OPTIONAL { ?exhibition wdt:P580 ?start_datetime_directly }
  OPTIONAL { ?exhibition wdt:P585 ?datetime_directly }
  OPTIONAL { ?country_statement pq:P580 ?start_datetime_qualifier }
  BIND(COALESCE(?start_datetime_directly, ?start_datetime_qualifier, ?datetime_directly) AS ?start_datetime)

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en,cz,da,de,es,fi,fr,nb,nl,nn,sv,zh". }
}
ORDER BY DESC(?start_datetime)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?country_statement") v5("?datetime_directly") v2("?exhibition"):::projected v8("?exhibitionUrl") v7("?start_date") v7("?start_datetime"):::projected v4("?start_datetime_directly") v6("?start_datetime_qualifier") a1((" ")) c13(["#91;AUTO_LANGUAGE#93;,mul,en,cz,da,de,es,fi,fr,nb,nl,nn,sv,zh"]):::literal c6(["wd:Q35"]):::iri c11(["bd:serviceParam"]):::iri c3(["wd:Q464980"]):::iri v2 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c3 v2 --"p:P17"--> v3 v3 --"p:statement/P17"--> c6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P580".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P585".-> v5 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:qualifier/P580".-> v6 end bind0[/"?start_datetime_directly?start_datetime_qualifier?datetime_directly"/] v4 --o bind0 v6 --o bind0 v5 --o bind0 bind0 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end bind1[/"http://www.w3.org/2001/XMLSchema#date(?start_datetime)"/] v7 --o bind1 bind1 --as--o v7 bind2[/"concat('#exhibition/',substring(str(?exhibition),'32^^xsd:integer'))"/] v2 --o bind2 bind2 --as--o v8