query-713af3db306a21a4e99051a434b2b6f0

rq turtle/ttl

Propertiesparent taxon (P171)taxon name (P225)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX gas: <http://www.bigdata.com/rdf/gas#>

SELECT DISTINCT ?qid ?Len
WHERE
{
  SERVICE gas:service {
    gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.SSSP" ;
                gas:in wd:Q4589415; # Diaphoretickes
                gas:traversalDirection "Reverse" ;
                gas:out ?item ;
                gas:out1 ?depth ;
                gas:maxIterations 10 ;
                gas:linkType wdt:P171 .
  }
  OPTIONAL { ?item wdt:P171 ?linkTo }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
  FILTER(
    NOT EXISTS {
      ?item rdfs:label ?itemLabelEn.
      FILTER(LANG(?itemLabelEn) = "en")
    }
  )
  ?item wdt:P225 ?Len.
  BIND (ENCODE_FOR_URI(REPLACE(STR(?item), ".*Q", "Q")) AS ?qid)
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?Len"):::projected v3("?depth") v2("?item") v1("?itemLabelEn") v4("?linkTo") v6("?qid"):::projected c4(["gas:program"]):::iri c6(["com.bigdata.rdf.graph.analytics.SSSP"]):::literal c10(["Reverse"]):::literal c1(["en"]):::literal c8(["wd:Q4589415"]):::iri c18(["bd:serviceParam"]):::iri c16(["wdt:P171"]):::iri c14(["10^^xsd:integer"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0f0[["?itemLabelEn = 'en'"]] e0f0 --> e0v1 e0v2 --"rdfs:label"--> e0v1 e0v2("?item"):::projected e0v1("?itemLabelEn"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> v2 f0 --> c2 f1[["?itemLabelEn = 'en'"]] f1 --> v1 v2 --"rdfs:label"--> v1 subgraph s1["http://www.bigdata.com/rdf/gas#service"] style s1 stroke-width:4px; c4 --"gas:gasClass"--> c6 c4 --"gas:in"--> c8 c4 --"gas:traversalDirection"--> c10 c4 --"gas:out"--> v2 c4 --"gas:out1"--> v3 c4 --"gas:maxIterations"--> c14 c4 --"gas:linkType"--> c16 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -->c16--> v4 end subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c18 -."wikibase:language".-> c1 end v2 --"wdt:P225"--> v5 bind2[/"encode-for-uri(replace(str(?item),'.*Q','Q'))"/] v2 --o bind2 bind2 --as--o v6