query-19b75e4e42126c53c78fecdfbb5b1daa
Advanced triple patterns )? Try writing that query, based on the one above. Q57487, Maria Barbara Bach (only want to see the children of Johann Sebastian Bach with his first wifeSo now we’ve seen all children of Johann Sebastian Bach – more specifically: all items with the father Johann Sebastian Bach. But Bach had two wives, and so those items have two different mothers: what if we Done that? Okay, then onto the solution! The simplest way to do this is to add a second triple with that restriction:
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 ?child ?childLabel
WHERE
{
?dziecko wdt:P22 wd:Q1339.
?dziecko wdt:P25 wd:Q57487.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?dziecko")
c2(["wd:Q1339"]):::iri
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;"]):::literal
c4(["wd:Q57487"]):::iri
v1 --"wdt:P22"--> c2
v1 --"wdt:P25"--> c4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end