query-f4f27c39d088126223490a494cdb88b5
Propertiessubclass of (P279)located in the administrative territorial entity (P131)country (P17)inception (P571)dissolved, abolished or demolished date (P576)instance of (P31)field of work (P101)
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 ?itemLabel ?country ?countryLabel ?start ?stop ?city ?cityLabel WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en". }
{
SELECT DISTINCT ?item WHERE {
{
?item p:P31 ?statement0.
?statement0 (ps:P31/(wdt:P279*)) wd:Q1820625.
}
UNION
{
?item p:P101 ?statement1.
?statement1 (ps:P101/(wdt:P279*)) wd:Q1820625.
}
}
}
OPTIONAL { ?item wdt:P131 ?city. }
OPTIONAL { ?item wdt:P17 ?country. }
OPTIONAL { ?item wdt:P571 ?start. }
OPTIONAL { ?item wdt:P576 ?stop. }
} ORDER by ?start
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?city"):::projected
v6("?country"):::projected
v2("?item"):::projected
v1("?start"):::projected
v3("?statement0")
v4("?statement1")
v7("?stop"):::projected
a1((" "))
a2((" "))
c8(["wd:Q1820625"]):::iri
c4(["#91;AUTO_LANGUAGE#93;, en"]):::literal
c2(["bd:serviceParam"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v2 --"p:P101"--> v4
v4 --"p:statement/P101"--> a2
a2 --"p:direct/P279"--> c8
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"p:P31"--> v3
v3 --"p:statement/P31"--> a1
a1 --"p:direct/P279"--> c8
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P131".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P17".-> v6
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P571".-> v1
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P576".-> v7
end