query-b771c74bf66b322194b8be7b6a6fae7c

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
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#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
  ?person (SAMPLE(?personLabel) AS ?personLabel) (GROUP_CONCAT(?citizenshipLabel;SEPARATOR=', ') AS ?citizenship)
WHERE {
  ?person wdt:P3171 [];
    wdt:P21 wd:Q6581072. # Only females
  OPTIONAL { ?person wdt:P27 ?value2 . }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
    ?person rdfs:label ?personLabel.
    ?value2 rdfs:label ?citizenshipLabel.
  }
}
GROUP BY ?person

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?citizenship") v4("?citizenshipLabel"):::projected v1("?person"):::projected v5("?personLabel"):::projected v2("?value2") a1((" ")) c6(["bd:serviceParam"]):::iri c8(["en"]):::literal c3(["wd:Q6581072"]):::iri v1 --"wdt:P3171"--> a1 v1 --"wdt:P21"--> c3 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; c6 --"wikibase:language"--> c8 v1 --"rdfs:label"--> v5 v2 --"rdfs:label"--> v4 end bind2[/"sample(?personLabel)"/] v5 --o bind2 bind2 --as--o v5 bind3[/"?citizenshipLabel"/] v4 --o bind3 bind3 --as--o v5