query-b982a7187d076e3994b4ff995f63a7c0
display instance of ambassadors with countries SELECT DISTINCT ?item2 ?item2Label ?p1Label ?p2Label WHERE { ?item wdt:P279 wd:Q29645880. ?item_b wdt:P279 wd:Q29645886. ?item2 wdt:P31 ?item. ?item2 wdt:P31 ?item_b. ?item wdt:P17 ?p1. ?item_b wdt:P17 ?p2. filter (?p1 != ?p2)
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 with countries
SELECT DISTINCT ?item2 ?item2Label ?p1Label ?p2Label
WHERE
{
?item wdt:P279 wd:Q29645880.
?item_b wdt:P279 wd:Q29645886.
?item2 wdt:P31 ?item.
?item2 wdt:P31 ?item_b.
?item wdt:P17 ?p1.
?item_b wdt:P17 ?p2.
filter (?p1 != ?p2)
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;
v3("?item")
v5("?item2"):::projected
v4("?item_b")
v1("?p1")
v2("?p2")
c9(["fr, en"]):::literal
c7(["bd:serviceParam"]):::iri
c3(["wd:Q29645886"]):::iri
c2(["wd:Q29645880"]):::iri
f0[["?p1 != ?p2"]]
f0 --> v1
f0 --> v2
v3 --"wdt:P279"--> c2
v4 --"wdt:P279"--> c3
v5 --"wdt:P31"--> v3
v5 --"wdt:P31"--> v4
v3 --"wdt:P17"--> v1
v4 --"wdt:P17"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end