Frage

I have loaded an embedded instance of Neo4j with some data, and would like to know how I can now view this graph. I saw an intro video here: http://video.neo4j.org/m9FD/how-to-get-started-with-neo4j-119/. Here the guy opened an instance in his web browser via Heroku and was able not only see the data in the graph, but also enter new data and search for both nodes and relationships. How do I see the data I have entered into the graph-database?

graphDb = new GraphDatabaseFactory().newEmbeddedDatabase( "var/graphDb" );
        registerShutdownHook(graphDb);

        WrappingNeoServerBootstrapper srv = new WrappingNeoServerBootstrapper( graphDb );
        srv.start();

        for (Statement s : statements){

            Transaction tx = graphDb.beginTx();
            try{
                firstNode = graphDb.createNode();
                firstNode.setProperty("message", s.getFirstTerm());
                secondNode = graphDb.createNode();
                secondNode.setProperty( "message", s.getSecondTerm());

                relation = firstNode.createRelationshipTo(secondNode, s.getRelationshipType());
                //relation.setProperty("message", "crazy cruel");
                tx.success();
            }
            finally{
                tx.finish();
            }
        }
        srv.stop();

    }
War es hilfreich?

Lösung

you could either

Would that work?

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top