query-8afb0c507d94e67ccb4ba996f880a7cf
display instance of ambassadors to/of a country SELECT DISTINCT ?item2 ?item2Label WHERE { {?item wdt:P279 wd:Q29645880.} union {?item wdt:P279 wd:Q29645886} ?item2 wdt:P31 ?item. SERVICE wikibase:label { bd:serviceParam wikibase:language "fr, 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#>
#display instance of ambassadors to/of a country
SELECT DISTINCT ?item2 ?item2Label
WHERE
{
{?item wdt:P279 wd:Q29645880.} union {?item wdt:P279 wd:Q29645886}
?item2 wdt:P31 ?item.
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr, en" }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item")
v2("?item2"):::projected
c8(["fr, en"]):::literal
c6(["bd:serviceParam"]):::iri
c3(["wd:Q29645886"]):::iri
c2(["wd:Q29645880"]):::iri
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P279"--> c3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P279"--> c2
end
union0r <== or ==> union0l
end
v2 --"wdt:P31"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end