In short, Neo4J is a network/graph database that promises to deliver Web 3.0, Semantic Web and RDF greatness. Its advantages are fast specific types of search, graph traversal and shortest route. It can also store partially structured information, eg. V1.0 and v1.1 of Person in the DB at the same time. It also integrates well with Qi4J, you don't need ORMaping, and the graph can be read from and persisted to RDF.
//Setting up the database in a folder called myNeoDB
NeoService neoDb = new EmbeddedNeo("myNeoDB");
//Create test dataset
Node neo = neoDb.createNode();
neo.setProperty("name", "Thomas Andersson");
Node trinity = neoDb.createNode();
neo.createRelationshipTo(trinity, MyRelationShipTypes.KNOWS);
Queries can be done with SPARQL, or a traverser:
Traverser friendFinder(Node person) {
return person.traverse(
Traverser.Order.BREADTH_FIRST,
StopEvaluator.END_OF_NETWORK,
ReturnableEvaluator.ALL_BUT_START_NODE,
MyRelationShipTypes.KNOWS,
Direction.OUTGOING);
}
The Matrix demo is as simple as Unzip og "mvn test"!
No comments:
Post a Comment
Spam will be pruned