query-4227d67a3cd8d16f79f41104de4a342c

rq turtle/ttl

i. avg. branching factor of class tree (width)

SELECT (AVG(?width) as ?avg_width_of_class_tree) (MIN(?width) as ?min) (MAX(?width) as ?max) { SELECT ?depth (COUNT(?item) as ?width) 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
} GROUP BY ?depth }

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/>
# i. avg. branching factor of class tree (width)

SELECT (AVG(?width) as ?avg_width_of_class_tree)  (MIN(?width) as ?min)  (MAX(?width) as ?max)
{
  SELECT ?depth (COUNT(?item) as ?width)
  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  
  }
  GROUP BY ?depth
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?avg_width_of_class_tree") v2("?depth") v1("?item") v6("?max") v5("?min") v3("?width"):::projected 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 bind1[/"count(?item)"/] v1 --o bind1 bind1 --as--o v3 bind5[/"average(?width)"/] v3 --o bind5 bind5 --as--o v4 bind6[/"min(?width)"/] v3 --o bind6 bind6 --as--o v5 bind7[/"max(?width)"/] v3 --o bind7 bind7 --as--o v6