query-cc2f1601dbc335132a4a36a857aa7855
modifier that lets you reverse the direction along the tree. inverse-ofThis is an easier case, as gorilla and human are closer, taxonomically if not culinarily, than human and chicken. I also limit the depth of the search to a maximum of three for the way "down" from any checked root. There is "+" meaning "one or more", "*" meaning "zero or more", but unfortunately no "{1,5}" for "from one to five", so I used the ugly construction with consecutive "?"s. "^" is the 07:33, 19 August 2020 (UTC)) talk (Matthias WinkelmannYou may be able to find relations between more distant taxons by trying around with the depth, adding a limitation for the upward search and, in turn, allowing more on the way down. -- for instance: (Q6027402)human leg to (Q1072190)chicken nugget , but I think it is useful here as it works at least for a couple of arbitrary steps to find a link from RDF_GAS_API I don't have much experience with the Расстояние между элементами
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX gas: <http://www.bigdata.com/rdf/gas#>
SELECT ?depth ?subject ?subjectLabel ?predicate ?object ?objectLabel {
SERVICE gas:service {
gas:program gas:gasClass 'com.bigdata.rdf.graph.analytics.BFS';
gas:in wd:Q1072190;
gas:target wd:Q6027402;
gas:out ?object;
gas:out1 ?depth;
gas:out2 ?subject;
gas:maxIterations 12;
gas:maxVisited 10000 .
}
?subject ?predicate ?object . # figure out what link type(s) connect a vertex with a predecessor
FILTER(?depth > 0) . # remove dead ends from results
SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
} ORDER BY ASC(?depth)
Query found at
- https://www.wikidata.org/wiki/User:Infovarius/Queries
- https://www.wikidata.org/wiki/Wikidata:Project_chat/Archive/2020/08