March 2015
Intermediate to advanced
192 pages
4h 32m
English
Let's take a look at a simple Hello World application code for Neo4j and understand what goes on under the hood when you try to perform some simple operations on Neo4j through the Java API. Here is the code for a sample app:
import org.neo4j.graphdb.*; import org.neo4j.kernel.EmbeddedGraphDatabase; /** * Example class that constructs a simple graph with * message attributes and then prints them. */ public class NeoOneMinute { public enum MyRelationshipTypes implements RelationshipType { KNOWS } public static void main(String[] args) { GraphDatabaseService graphDb = new EmbeddedGraphDatabase("var/base"); Transaction tx = graphDb.beginTx(); try { Node node1 = graphDb.createNode(); Node node2 = graphDb.createNode(); Relationship ...Read now
Unlock full access