query-524e359b88cb290b349aa67f0b01c0c9
Addresses SELECT ?company ?companyLabel ?hqLocation ?hqLocationLabel ?territorialEntity WHERE { ?company wdt:P159 ?hqLocation . # company headquarted location ?hqLocation wdt:P131 ?territorialEntity . # located in territorial entity ?territorialEntity wdt:P31 wd:Q35657 . # territorial entity is instance of 'state'
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_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#>
#Addresses
SELECT ?company ?companyLabel ?hqLocation ?hqLocationLabel ?territorialEntity
WHERE
{
?company wdt:P159 ?hqLocation . # company headquarted location
?hqLocation wdt:P131 ?territorialEntity . # located in territorial entity
?territorialEntity wdt:P31 wd:Q35657 . # territorial entity is instance of 'state'
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?company"):::projected
v2("?hqLocation"):::projected
v3("?territorialEntity"):::projected
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c4(["wd:Q35657"]):::iri
v1 --"wdt:P159"--> v2
v2 --"wdt:P131"--> v3
v3 --"wdt:P31"--> c4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end