How to run PageRank in Blazegraph on a dataset?

357 views Asked by At

I want to run the PageRank algorithm in Blazegraph on dataset downloaded from SNAP, the Stanford Network Analysis Project. As far as I can see, there is a PageRank implementation in Blazegraph, but I cannot find a way to run it. Is it possible to run it? If yes, how?

1

There are 1 answers

1
Brad Bebee On

You can use the Blazegraph GAS API to execute graph analytics on data loaded in Blazegraph. The example below shows running a PageRank over all of the data loaded in a namespace. If you have a particular SNAP data set converted to RDF, you'd like to see feel free to post a link.

PREFIX gas: <http://www.bigdata.com/rdf/gas#>
SELECT ?node ?rank {
  SERVICE gas:service {
     gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.PR" .
     gas:program gas:out ?node . # exactly once - will be bound to the visited vertices.
     gas:program gas:out1 ?rank . # Computed PageRank value for the node
  }
  FILTER (?rank<100)
} ORDER BY DESC(?rank) 

PageRank example output over the connectivity of Autonomous System (AS) Links:

node    rank
<as:1120>   0.4546700227713777
<as:11492>  0.42358562655858023
<as:12644>  0.41794183515852634
<as:12143>  0.39695587975476715
<as:10217>  0.37759985273202806
<as:13092>  0.3668006144247455
<as:11139>  0.33221277719235737
<as:12722>  0.3256365110406788
<as:10913>  0.32270313230429504