query-62e3f42099b4c2f23e68e788d240b5fd
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel (SAMPLE(?fatherLabel_) as ?fatherLabel) (SAMPLE(?motherLabel_) as ?motherLabel) WHERE {
?item wdt:P31 wd:Q5;
wdt:P27 wd:Q30;
wdt:P106 wd:Q82955.
{?item wdt:P22 ?father.
?father wdt:P106 wd:Q82955.}
UNION
{?item wdt:P25 ?mother.
?mother wdt:P106 wd:Q82955.}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?item rdfs:label ?itemLabel .
?father rdfs:label ?fatherLabel_ .
?mother rdfs:label ?motherLabel_ . }
} group by ?item ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?father")
v7("?fatherLabel")
v5("?fatherLabel_"):::projected
v1("?item"):::projected
v4("?itemLabel"):::projected
v3("?mother")
v8("?motherLabel")
v6("?motherLabel_"):::projected
c4(["wd:Q30"]):::iri
c6(["wd:Q82955"]):::iri
c10(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v1 --"wdt:P31"--> c2
v1 --"wdt:P27"--> c4
v1 --"wdt:P106"--> c6
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P25"--> v3
v3 --"wdt:P106"--> c6
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P22"--> v2
v2 --"wdt:P106"--> c6
end
union0r <== or ==> union0l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
v1 --"rdfs:label"--> v4
v2 --"rdfs:label"--> v5
v3 --"rdfs:label"--> v6
end
bind2[/"sample(?fatherLabel_)"/]
v5 --o bind2
bind2 --as--o v7
bind3[/"sample(?motherLabel_)"/]
v6 --o bind3
bind3 --as--o v8