query-065f0c6f69a9dbfbe7a70506eb4e644a
Battles with identical names
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?time1 ?itemLabel WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul". }
{
SELECT DISTINCT ?item (SAMPLE(?time) as ?time1) WHERE {
?item p:P31 ?statement0.
?statement0 (ps:P31/(wdt:P279*)) wd:Q645883.
OPTIONAL {?item wdt:P580 ?start.}
OPTIONAL {?item wdt:P585 ?point}
BIND(COALESCE(?point,?start) as ?time)
MINUS {?item wdt:P1889 ?different}
}
GROUP BY ?item
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?different")
v1("?item"):::projected
v4("?point")
v3("?start")
v2("?statement0")
v5("?time")
v7("?time1"):::projected
a1((" "))
c4(["en-gb,en,mul"]):::literal
c2(["bd:serviceParam"]):::iri
c8(["wd:Q645883"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v1 --"p:P31"--> v2
v2 --"p:statement/P31"--> a1
a1 --"p:direct/P279"--> c8
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P580".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P585".-> v4
end
bind0[/"?point?start"/]
v4 --o bind0
v3 --o bind0
bind0 --as--o v5
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v1 --"p:direct/P1889"--> v6
end
bind3[/"sample(?time)"/]
v5 --o bind3
bind3 --as--o v7