query-7b3c092ff9dfc3a0c9c52159deba4213

rq turtle/ttl


Objekte in Dresden mit Schlüsselereignissen

-------------------------------------------------------------------------------

SELECT ?item ?itemLabel #?countryLabel
?significant_eventLabel (year(?start) AS ?y1) (year(?end) AS ?y2) ?altesdresden ?propLabel ?valLabel

(year(?destroyed) AS ?yr_d)

WHERE { ?item wdt:P131 wd:Q1731 . ?item p:P793 ?stmt .

#?stmt ps:P793 wd:Q1441983 . # Filter für bestimmte Ereignisse OPTIONAL {?stmt ps:P793 ?significant_event.} . OPTIONAL {?stmt pq:P580|pq:P585 ?start} . OPTIONAL {?stmt pq:P582 ?end} . OPTIONAL { ?stmt ?pq ?val . ?pq ^wikibase:qualifier ?prop . FILTER(?prop NOT IN (wd:P580, wd:P582, wd:P585, wd:P793, wd:P18)) . } #OPTIONAL {?item wdt:P17 ?country } . #OPTIONAL {?item wdt:P576 ?destroyed } . #OPTIONAL {?item wdt:P11855 ?altesdresden } . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } order by ?y1

ORDER BY xsd:integer(STRAFTER(str(?item), 'Q')) ?start ?propLabel

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#>
#-------------------------------------------------------------------------------
# Objekte in Dresden mit Schlüsselereignissen
#-------------------------------------------------------------------------------
SELECT ?item ?itemLabel #?countryLabel  
?significant_eventLabel (year(?start) AS ?y1) (year(?end) AS ?y2) ?altesdresden
?propLabel ?valLabel 
#(year(?destroyed) AS ?yr_d) 

WHERE { 
  ?item wdt:P131 wd:Q1731 .
  ?item p:P793 ?stmt .

  #?stmt ps:P793 wd:Q1441983 .   # Filter für bestimmte Ereignisse
  OPTIONAL {?stmt ps:P793 ?significant_event.} .
  OPTIONAL {?stmt pq:P580|pq:P585 ?start} .
  OPTIONAL {?stmt pq:P582 ?end} .
  OPTIONAL {
    ?stmt ?pq ?val .
    ?pq ^wikibase:qualifier ?prop .
    FILTER(?prop NOT IN (wd:P580, wd:P582, wd:P585, wd:P793, wd:P18)) .
  }
  #OPTIONAL {?item wdt:P17 ?country } .
  #OPTIONAL {?item wdt:P576 ?destroyed } . 
  #OPTIONAL {?item wdt:P11855 ?altesdresden } . 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
order by ?y1
#ORDER BY xsd:integer(STRAFTER(str(?item), 'Q')) ?start ?propLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?end"):::projected v3("?item"):::projected v8("?pq") v2("?prop") v5("?significant_event") v6("?start"):::projected v4("?stmt") v9("?val") v10("?y1") v10("?y2") c15(["bd:serviceParam"]):::iri c17(["#91;AUTO_LANGUAGE#93;,en"]):::literal c7(["wd:Q1731"]):::iri v3 --"p:direct/P131"--> c7 v3 --"p:P793"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:statement/P793".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v4 -."p:qualifier/P585".-> v6 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v4 --"p:qualifier/P580"--> v6 end union0r <== or ==> union0l end end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:qualifier/P582".-> v7 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v4 -->v8--> v9 v2 -."wikibase:qualifier".-> v8 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c15 --"wikibase:language"--> c17 end bind0[/"year-from-dateTime(?start)"/] v6 --o bind0 bind0 --as--o v10 bind1[/"year-from-dateTime(?end)"/] v7 --o bind1 bind1 --as--o v10