query-7875d13a0dcd1d7399d2fceea64ca255

rq turtle/ttl

If we used an asterisk instead of a plus here, the query results would include Bach himself. of this element”. zero or one) is similar to an asterisk or a plus, but means “?A question mark () instead of a forward slash; this means “either-or”: the path might use either of those properties. (But not both – an either-or path segment always matches a path of length one.) |You can separate path elements with a vertical bar (). This means that another way to find all descendants of Bach is: /|*+?), and freely combine all these syntax elements (()You can also group path elements with parentheses (

Use at

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 ?descendant ?descendantLabel
WHERE
{
  ?descendant (wdt:P22|wdt:P25)+ wd:Q1339.
  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("?descendant"):::projected c2(["wd:Q1339"]):::iri c5(["bd:serviceParam"]):::iri c7(["en"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P25"--> c2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P22"--> c2 end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end