query-84d863ee30a8ea69b33fba725377d9bf
Advanced triple patterns)? Try writing that query, based on the one above. Q57487So 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 only want to see the children of Johann Sebastian Bach with his first wife, Maria Barbara Bach (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
{
?child wdt:P22 wd:Q1339.
?child wdt:P25 wd:Q57487.
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;
v1("?child"):::projected
c2(["wd:Q1339"]):::iri
c6(["bd:serviceParam"]):::iri
c4(["wd:Q57487"]):::iri
c8(["en"]):::literal
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