query-ca19845d4ac9c376754f4a566744fe43

rq turtle/ttl

Subclass tree to depth maxIterations

SELECT ?item ?itemLabel ?depth ?parent ?parentLabel WHERE { { SERVICE gas:service { gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" . gas:program gas:linkType wdt:P279 . gas:program gas:traversalDirection "Reverse" .
gas:program gas:in wd:Q35120 . gas:program gas:out ?item . gas:program gas:out1 ?depth . gas:program gas:out2 ?parent . gas:program gas:maxIterations 2 . } } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY ?depth ?parentLabel

Use at

PREFIX gas: <http://www.bigdata.com/rdf/gas#>
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#>
# Subclass tree to depth maxIterations

SELECT ?item ?itemLabel ?depth ?parent ?parentLabel WHERE {
  {
     SERVICE gas:service {
       gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" .
       gas:program gas:linkType wdt:P279 .
       gas:program gas:traversalDirection "Reverse" .   
       gas:program gas:in wd:Q35120 .
       gas:program gas:out ?item .
       gas:program gas:out1 ?depth .
       gas:program gas:out2 ?parent .
       gas:program gas:maxIterations 2 .
     }
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?depth ?parentLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?depth"):::projected v3("?item"):::projected v4("?parent"):::projected v2("?parentLabel"):::projected c2(["gas:program"]):::iri c8(["Reverse"]):::literal c6(["wdt:P279"]):::iri c15(["2^^xsd:integer"]):::literal c4(["com.bigdata.rdf.graph.analytics.BFS"]):::literal c17(["bd:serviceParam"]):::iri c10(["wd:Q35120"]):::iri c19(["#91;AUTO_LANGUAGE#93;,en"]):::literal subgraph s1["http://www.bigdata.com/rdf/gas#service"] style s1 stroke-width:4px; c2 --"gas:gasClass"--> c4 c2 --"gas:linkType"--> c6 c2 --"gas:traversalDirection"--> c8 c2 --"gas:in"--> c10 c2 --"gas:out"--> v3 c2 --"gas:out1"--> v1 c2 --"gas:out2"--> v4 c2 --"gas:maxIterations"--> c15 end subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c17 --"wikibase:language"--> c19 end