query-ef395bfbf3bf68de8b900feb67ca921e
title: Wars SELECT DISTINCT ?item ?itemLabel ?date ?starttime ?endtime ?geo ?location WHERE { ?item wdt:P31/wdt:P279* wd:Q198. OPTIONAL { ?item wdt:P585 ?date } . OPTIONAL { ?item wdt:P580 ?starttime } . OPTIONAL { ?item wdt:P582 ?endtime } . OPTIONAL { ?item wdt:P625 ?geo } . OPTIONAL { ?item wdt:P276/wdt:P625 ?location } . SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } }
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 bd: <http://www.bigdata.com/rdf#>
#title: Wars
SELECT DISTINCT ?item ?itemLabel ?date ?starttime ?endtime ?geo ?location WHERE
{
?item wdt:P31/wdt:P279* wd:Q198.
OPTIONAL { ?item wdt:P585 ?date } .
OPTIONAL { ?item wdt:P580 ?starttime } .
OPTIONAL { ?item wdt:P582 ?endtime } .
OPTIONAL { ?item wdt:P625 ?geo } .
OPTIONAL { ?item wdt:P276/wdt:P625 ?location } .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?date"):::projected
v4("?endtime"):::projected
v5("?geo"):::projected
v1("?item"):::projected
v6("?location"):::projected
v3("?starttime"):::projected
a1((" "))
a2((" "))
c10(["bd:serviceParam"]):::iri
c12(["en"]):::literal
c3(["wd:Q198"]):::iri
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P585".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P580".-> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P582".-> v4
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P625".-> v5
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P276".-> a2
a2 --"wdt:P625"--> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end