query-fc65248608feb8830cd10050bd352f0b
Propertiesinstance of (P31)country of citizenship (P27)
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 skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?itemDescription WHERE {
?item wdt:P31 wd:Q5. # instance of human
?item wdt:P27 wd:Q31. # country of citizenship Belgium
SERVICE wikibase:label { bd:serviceParam wikibase:language "nl,en,fr,de,it,lu,es,no,pt". }
FILTER ( EXISTS {
?item rdfs:label ?lang_label.
?item skos:altLabel ?altLabel.
# FILTER (LANG(?lang_label) = "nl")
FILTER (?lang_label = ?altLabel )
})
}
ORDER BY ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?altLabel")
v4("?item"):::projected
v1("?itemLabel"):::projected
v2("?lang_label")
c8(["bd:serviceParam"]):::iri
c4(["wd:Q5"]):::iri
c6(["wd:Q31"]):::iri
c10(["nl,en,fr,de,it,lu,es,no,pt"]):::literal
f0[[" "]]
subgraph f0e0["Exists Clause"]
e0f0[["?lang_label = ?altLabel"]]
e0f0 --> e0v1
e0f0 --> e0v2
e0v3 --"rdfs:label"--> e0v1
e0v3 --"skos:altLabel"--> e0v2
e0v2("?altLabel"):::projected
e0v3("?item"):::projected
e0v1("?lang_label"):::projected
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> v3
f0 --> v4
f0 --> c1
f0 --> c2
f1[["?lang_label = ?altLabel"]]
f1 --> v2
f1 --> v3
v4 --"rdfs:label"--> v2
v4 --"skos:altLabel"--> v3
v4 --"wdt:P31"--> c4
v4 --"wdt:P27"--> c6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end