query-a8bbb7595078633f777001fc83efa2db

rq turtle/ttl

h. avg. depth of class tree

simple case for SELECT ?item WHERE { ?item wdt:P279* wd:Q181388 }

SELECT (AVG(?depth) as ?avg_depth_of_class_tree) (MIN(?depth) as ?min) (MAX(?depth) as ?max) WHERE { SERVICE gas:service { gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.SSSP" ; gas:in wd:Q181388 ; gas:traversalDirection "Reverse" ; gas:out ?item ; gas:out1 ?depth ; gas:maxIterations 100 ; gas:linkType wdt:P279 . } ?item wdt:P279* wd:Q181388
}

Use at

PREFIX gas: <http://www.bigdata.com/rdf/gas#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
#  h. avg. depth of class tree
# simple case for SELECT ?item WHERE { ?item wdt:P279* wd:Q181388 }  
SELECT (AVG(?depth) as ?avg_depth_of_class_tree) (MIN(?depth) as ?min)  (MAX(?depth) as ?max)
WHERE
{
  SERVICE gas:service {
    gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.SSSP" ;
                gas:in wd:Q181388 ;
                gas:traversalDirection "Reverse" ;
                gas:out ?item ;
                gas:out1 ?depth ;
                gas:maxIterations 100 ;
                gas:linkType wdt:P279 .
  }
  ?item wdt:P279* wd:Q181388  
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?avg_depth_of_class_tree") v2("?depth"):::projected v1("?item") v5("?max") v4("?min") c2(["gas:program"]):::iri c4(["com.bigdata.rdf.graph.analytics.SSSP"]):::literal c8(["Reverse"]):::literal c14(["wdt:P279"]):::iri c6(["wd:Q181388"]):::iri c12(["100^^xsd:integer"]):::literal subgraph s1["http://www.bigdata.com/rdf/gas#service"] style s1 stroke-width:4px; c2 --"gas:gasClass"--> c4 c2 --"gas:in"--> c6 c2 --"gas:traversalDirection"--> c8 c2 --"gas:out"--> v1 c2 --"gas:out1"--> v2 c2 --"gas:maxIterations"--> c12 c2 --"gas:linkType"--> c14 end v1 -->c14--> c6 bind3[/"average(?depth)"/] v2 --o bind3 bind3 --as--o v3 bind4[/"min(?depth)"/] v2 --o bind4 bind4 --as--o v4 bind5[/"max(?depth)"/] v2 --o bind5 bind5 --as--o v5