query-e11d30fc433d1247410bd80b6a33ca8a

rq turtle/ttl

TODO

Use at

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 (SAMPLE(?personLabel) AS ?personLabel) (SAMPLE(?genderLabel) AS ?genderLabel) (GROUP_CONCAT(?citizenshipLabel;SEPARATOR=', ') AS ?citizenship)
WHERE {
  ?person wdt:P3171 [] .
  OPTIONAL { ?person wdt:P27 ?value2 . }
  #OPTIONAL { ?person wdt:P21 ?gender . }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
    ?person rdfs:label ?personLabel.
    #?gender rdfs:label ?genderLabel.
    ?value2 rdfs:label ?citizenshipLabel.
  }
}
GROUP BY ?person

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?citizenship") v4("?citizenshipLabel"):::projected v6("?genderLabel"):::projected v1("?person"):::projected v6("?personLabel"):::projected v2("?value2") a1((" ")) c4(["bd:serviceParam"]):::iri c6(["en"]):::literal v1 --"wdt:P3171"--> a1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P27".-> v2 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 v1 --"rdfs:label"--> v6 v2 --"rdfs:label"--> v4 end bind3[/"sample(?personLabel)"/] v6 --o bind3 bind3 --as--o v6 bind4[/"sample(?genderLabel)"/] v6 --o bind4 bind4 --as--o v6 bind5[/"?citizenshipLabel"/] v4 --o bind5 bind5 --as--o v6