query-0357b0e3964e5b9ec978a5b88fbb8b32

rq turtle/ttl

07:42, 8 September 2016 (UTC)) talk (Syced results. Any idea? zero, but it returns (Q554046)Embassy of France in Berlin ... should return 07:49, 8 September 2016 (UTC)) talk (MisterSynergyFixed it (now one result), and added a useful template... --09:53, 8 September 2016 (UTC) MolarusAdding some labels, ... -- 09:57, 8 September 2016 (UTC)) talk (GerardMHow would you deal with something that is in a country that no longer exists? Eg the Ottoman empire? Thanks,

Use at

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 DISTINCT ?item ?itemLabel ?hostcountryLabel ?countryLabel WHERE {
  ?item wdt:P131*/wdt:P17 ?hostcountry.  # country: ...
  ?item wdt:P31 wd:Q3917681.       # instance of: embassy
  ?item wdt:P137 ?country.          # operated by: ...
  SERVICE wikibase:label {bd:serviceParam wikibase:language "en"}
  } ORDER BY ASC(?hostcountryLabel)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?country") v3("?hostcountry") v1("?hostcountryLabel"):::projected v2("?item"):::projected a1((" ")) c7(["bd:serviceParam"]):::iri c9(["en"]):::literal c4(["wd:Q3917681"]):::iri v2 --"wdt:P131"--> a1 a1 --"wdt:P17"--> v3 v2 --"wdt:P31"--> c4 v2 --"wdt:P137"--> v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end