query-fd49d5682c2fe3847c3f3ef8456f49c0
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
?person ?personLabel (GROUP_CONCAT(?citizenshipLabel;SEPARATOR=', ') AS ?citizenship)
WHERE
{
?person wdt:P3171 ?value .
OPTIONAL { ?person wdt:P27 ?value2 .
?value2 rdfs:label ?citizenshipLabel . FILTER (LANG(?citizenshipLabel)='en') }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
GROUP BY ?person ?personLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?citizenship")
v1("?citizenshipLabel"):::projected
v2("?person"):::projected
v3("?value")
v4("?value2")
c6(["bd:serviceParam"]):::iri
c1(["en"]):::literal
v2 --"wdt:P3171"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P27".-> v4
v4 --"rdfs:label"--> v1
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c1
end
bind1[/"?citizenshipLabel"/]
v1 --o bind1
bind1 --as--o v5