query-db3fa57e2818444af091488a37e2ee71
National heroes of Indonesia without genders SELECT ?itemID ?labelEN ?labelID ?genderEN WHERE { ?itemID wdt:P166 wd:Q1369309 . # items with award received National Hero of Indonesia FILTER NOT EXISTS { ?itemID wdt:P21 ?gender } # without genders OPTIONAL { ?itemID rdfs:label ?labelEN . # English label FILTER(LANG(?labelEN)="en") } OPTIONAL { ?itemID rdfs:label ?labelID . # Indonesian label FILTER(LANG(?labelID)="id") } }
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#>
# National heroes of Indonesia without genders
SELECT ?itemID ?labelEN ?labelID ?genderEN
WHERE {
?itemID wdt:P166 wd:Q1369309 . # items with award received National Hero of Indonesia
FILTER NOT EXISTS { ?itemID wdt:P21 ?gender } # without genders
OPTIONAL { ?itemID rdfs:label ?labelEN . # English label
FILTER(LANG(?labelEN)="en") }
OPTIONAL { ?itemID rdfs:label ?labelID . # Indonesian label
FILTER(LANG(?labelID)="id") }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?gender")
v2("?itemID"):::projected
v4("?labelEN"):::projected
v1("?labelID"):::projected
c5(["wd:Q1369309"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P21"--> e0v2
e0v2("?gender"):::projected
e0v1("?itemID"):::projected
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> c2
f0 --> v3
v2 --"wdt:P21"--> v3
v2 --"wdt:P166"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."rdfs:label".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."rdfs:label".-> v1
end