I am trying out neo4j traversal api. All examples online work with GraphDatabaseService instance to use its traversalDescription() afterwards to define traversal pattern.
However online examples (like this one) uses GraphDatabaseFactory to obtain GraphDatabaseService instance from embedded database / database file:
GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase("/tmp/neo4j/");
I want to use it with neo4j server instance running locally. Usually I use to do this by calling methods on session opbtained instance as follows:
Driver driver = GraphDatabase.driver( "bolt://localhost", AuthTokens.basic( "neo4j", "password" ) );
session session = driver.session();
How do we get GraphDatabaseService instance from driver or session instance or by other means so that we can work with the locally running neo4j server instance? Or is it like we can use traversal api only with embedded neo4j database?