query-d93c9ee72d41fa4df3a08c1ee2bee494
20:44, 4 August 2023 (UTC)) talk (skHow can I fill the time column. And also the type? -- : My try:Stefan Kühn@
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Table
SELECT ?item ?itemLabel ?significant_eventLabel ?typeLabel ?time
WHERE {
?item (wdt:P131/wdt:P279*) wd:Q1731. # items in Dresden
?item wdt:P793 [ pq:* ?significant_event ]. # significant event
OPTIONAL {?significant_event wdt:P31 ?type}
?item p:P793 ?eventstatment .
?eventstatment pq:P585 ?time.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
}
order by ?time ?significant_eventLabel ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?eventstatment")
v4("?item"):::projected
v3("?itemLabel"):::projected
v5("?significant_event")
v2("?significant_eventLabel"):::projected
v1("?time"):::projected
v6("?type")
a1((" "))
a2((" "))
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;"]):::literal
c3(["wd:Q1731"]):::iri
v4 --"p:direct/P131"--> a1
a1 --"p:direct/P279"--> c3
a2 --"p:qualifier/"--> v5
v4 --"p:direct/P793"--> a2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:direct/P31".-> v6
end
v4 --"p:P793"--> v7
v7 --"p:qualifier/P585"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end