query-46dafa85d8206c23a6c8db365acff350
TODO
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?genderLabel ?father ?fatherLabel ?mother ?motherLabel ?children WHERE {
{ SELECT ?item (GROUP_CONCAT(?childLabel; separator=", ") AS ?children) WHERE {
?item wdt:P31/wdt:P279* wd:Q22988604 .
OPTIONAL { ?item wdt:P40 ?child } .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
} GROUP BY ?item } .
OPTIONAL { ?item wdt:P21 ?gender } .
OPTIONAL { ?item wdt:P22 ?father } .
OPTIONAL { ?item wdt:P25 ?mother } .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?child")
v3("?childLabel")
v4("?children"):::projected
v6("?father"):::projected
v5("?gender")
v1("?item"):::projected
v7("?mother"):::projected
a1((" "))
c6(["bd:serviceParam"]):::iri
c8(["en"]):::literal
c3(["wd:Q22988604"]):::iri
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P40".-> v2
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
bind1[/"?childLabel"/]
v3 --o bind1
bind1 --as--o v4
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P21".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P22".-> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P25".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end