This is an unmanaged extension running a Custom Pagerank algorithm on Companies with a SIMILAR relationship score >= 0.80.
-
Build it:
mvn clean package
-
Copy target/pagerank-1.0.jar to the plugins/ directory of your Neo4j 2.3.0-M03 server.
mv target/pagerank-1.0.jar neo4j/plugins/.
-
Configure Neo4j by adding a line to conf/neo4j-server.properties:
org.neo4j.server.thirdparty_jaxrs_classes=com.maxdemarzi.pagerank=/v1
If you need to configure 2 extensions at the same time, use a comma between them:
org.neo4j.server.thirdparty_jaxrs_classes=com.maxdemarzi.recruit=/v1,com.maxdemarzi.pagerank=/analytics
-
Start Neo4j server.
-
Create sample dataset:
CREATE (a:Company {name:'a'}) CREATE (b:Company {name:'b'}) CREATE (c:Company {name:'c'}) CREATE (d:Company {name:'d'}) CREATE (e:Company {name:'e'}) CREATE (f:Company {name:'f'}) CREATE (g:Company {name:'g'}) CREATE (h:Company {name:'h'}) CREATE (i:Company {name:'i'}) CREATE (j:Company {name:'j'}) CREATE (k:Company {name:'k'}) CREATE (b)-[:SIMILAR]->(c), (c)-[:SIMILAR]->(b), (d)-[:SIMILAR]->(a), (e)-[:SIMILAR]->(b), (e)-[:SIMILAR]->(d), (e)-[:SIMILAR]->(f), (f)-[:SIMILAR]->(b), (f)-[:SIMILAR]->(e), (g)-[:SIMILAR]->(b), (g)-[:SIMILAR]->(e), (h)-[:SIMILAR]->(b), (h)-[:SIMILAR]->(e), (i)-[:SIMILAR]->(b), (i)-[:SIMILAR]->(e), (j)-[:SIMILAR]->(e), (k)-[:SIMILAR]->(e);
-
Call the pagerank endpoint:
:GET /v1/service/pagerank
You should see "PageRank for Company using SIMILAR relationship type Completed!"
-
Check the pageranks of some nodes:
MATCH (n:Company) RETURN n.name, n.pagerank LIMIT 25;