I am currently using the neo4j java-rest-binding project to try and make the client code the same for embedded and remote databases, which is highly desirable for me.
But I am currently having trouble with the following bit of code when executed on the remote server:
protected void createDefaultIndices(GraphDatabaseService graphDb) {
Schema schema = graphDb.schema();
Transaction tx = graphDb.beginTx();
try {
/* Folder index on path property. */
schema.indexCreator(DynamicLabel.label(FolderNode.FOLDER_LABEL))
.on(FolderNode.PATH_PROPERTY)
.create();
tx.success();
} catch (Exception x) {
x.printStackTrace();
} finally {
tx.finish();
}
}
When I attempt to execute this, the following exception occurs:
Exception in thread "main" java.lang.AbstractMethodError:
org.neo4j.rest.graphdb.RestGraphDatabase.schema()Lorg/neo4j/graphdb/schema/Schema;
Is the schema API implemented for the REST implementation of the GraphDatabaseService? Or do I need to go about this some other way?
Thanks.
Copyright License:
Author:「Jeremy McCormick」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/16659697/using-schema-to-create-indices-with-the-neo4j-java-rest-binding