query-6f142929658e2b499cb2c8dd245e68c0
Wikinaut{ pattern1 } UNION { pattern2 }
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#>
#defaultView:Map
# Map for coal OR wat<er power plants which are in service or which were in service
SELECT ?plantLabel ?typeLabel ?plantGeo ?plantserviceentry ?plantserviceretirement
WHERE
{
{
?plant wdt:P31/wdt:P279* wd:Q6558431.
?plant wdt:P625 ?plantGeo.
BIND (wd:Q6558431 AS ?type)
}
UNION
{
?plant wdt:P31/wdt:P279* wd:Q15911738.
?plant wdt:P625 ?plantGeo.
BIND (wd:Q15911738 AS ?type)
}
OPTIONAL { ?plant wdt:P729 ?plantserviceentry. }
OPTIONAL { ?plant wdt:P730 ?plantserviceretirement. }
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;
v1("?plant")
v2("?plantGeo"):::projected
v4("?plantserviceentry"):::projected
v5("?plantserviceretirement"):::projected
v4("?type")
a1((" "))
a2((" "))
c9(["bd:serviceParam"]):::iri
c3(["wd:Q6558431"]):::iri
c11(["en"]):::literal
c5(["wd:Q15911738"]):::iri
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c5
v1 --"wdt:P625"--> v2
bind0[/"'wd:Q15911738'"/]
bind0 --as--o v4
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v1 --"wdt:P625"--> v2
bind1[/"'wd:Q6558431'"/]
bind1 --as--o v4
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P729".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P730".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end