6. Querying: REST API
Properties of node with id 32:
GET http://localhost:7474/db/data/node/32/properties
{
"user": "@onof80",
"lastLogin": 1394304000,
"tags": ["Java","Scala","NoSql"]
}
7. Traversing the graph
for ( Path position : db.traversalDescription()
.depthFirst()
.relationships( Rels.KNOWS, Direction.INCOMING )
.evaluator( Evaluators.toDepth( 5 ) )
.traverse( node6 ) )
{
output += position + "n";
}
(6)
(6)<--[KNOWS,1]--(3)
(6)<--[KNOWS,1]--(3)<--[KNOWS,6]--(0)
(6)<--[KNOWS,1]--(3)<--[KNOWS,6]--(0)<--[KNOWS,4]--(5)
Powerful but
hardcoded
8. Querying with Cypher
START n=node(10)
MATCH path =(n)<-[:KNOWS*0..5]-()
RETURN path
http://console.neo4j.org/