query-70ba928596650ae2e1e9a6f2f188f370
Indonesian national heroes whose spouse is also an Indonesian national hero SELECT * { ?person wdt:P166 wd:Q1369309 . # An Indonesian national hero .. ?person wdt:P26 ?spouse . # whose spouse .. ?spouse wdt:P166 wd:Q1369309 . # is also an Indonesian national hero. ?person wdt:P21 wd:Q6581097 . # hack for removing repetitions ?person rdfs:label ?labelPerson . ?spouse rdfs:label ?labelSpouse . FILTER(LANG(?labelPerson)="en" && LANG(?labelSpouse)="en") }
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
# Indonesian national heroes whose spouse is also an Indonesian national hero
SELECT *
{ ?person wdt:P166 wd:Q1369309 . # An Indonesian national hero ..
?person wdt:P26 ?spouse . # whose spouse ..
?spouse wdt:P166 wd:Q1369309 . # is also an Indonesian national hero.
?person wdt:P21 wd:Q6581097 . # hack for removing repetitions
?person rdfs:label ?labelPerson .
?spouse rdfs:label ?labelSpouse .
FILTER(LANG(?labelPerson)="en" && LANG(?labelSpouse)="en")
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?labelPerson"):::projected
v2("?labelSpouse"):::projected
v3("?person"):::projected
v4("?spouse"):::projected
c6(["wd:Q6581097"]):::iri
c3(["wd:Q1369309"]):::iri
f0[["?labelPerson = 'en'?labelSpouse = 'en'"]]
f0 --> v1
f0 --> v2
v3 --"wdt:P166"--> c3
v3 --"wdt:P26"--> v4
v4 --"wdt:P166"--> c3
v3 --"wdt:P21"--> c6
v3 --"rdfs:label"--> v1
v4 --"rdfs:label"--> v2