query-3d0663283af9b37f5ca8e078ef2a5f61
22:43, 7 February 2024 (UTC)) talk (Vicarage: This?Vicarage@
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#>
SELECT ?item ?itemLabel ?country ?poi ?min_inception ?max_dissolved WHERE
{
{
SELECT ?item ?country (MIN(?inception) as ?min_inception) (MAX(?dissolved) as ?max_dissolved) WHERE
{
?item wdt:P31/wdt:P279* wd:Q178561. # battle
?item wdt:P17 ?country.
?country wdt:P571 ?inception.
?country wdt:P576 ?dissolved.
} GROUP BY ?item ?country } ?item wdt:P585 ?poi.
FILTER (?poi > ?max_dissolved || ?poi < ?min_inception)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?country"):::projected
v7("?dissolved")
v6("?inception")
v4("?item"):::projected
v8("?max_dissolved"):::projected
v8("?min_inception"):::projected
v1("?poi"):::projected
a1((" "))
c9(["bd:serviceParam"]):::iri
c11(["#91;AUTO_LANGUAGE#93;"]):::literal
c3(["wd:Q178561"]):::iri
f0[["(?poi > ?max_dissolved || ?poi < ?min_inception)"]]
f0 --> v1
f0 --> v8
f0 --> v8
v4 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v4 --"wdt:P17"--> v5
v5 --"wdt:P571"--> v6
v5 --"wdt:P576"--> v7
bind3[/"min(?inception)"/]
v6 --o bind3
bind3 --as--o v8
bind4[/"max(?dissolved)"/]
v7 --o bind4
bind4 --as--o v8
v4 --"wdt:P585"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end