Using Schema to create indices with the Neo4J Java REST binding

2013-05-21T07:04:52

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

About “Using Schema to create indices with the Neo4J Java REST binding” questions

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 tro...
I am trying to get more familiar with the java-rest-binding (https://github.com/neo4j/java-rest-binding). My main question is what operations of the GraphDatabaseService supports. For example I...
I want to use neo4j in rest way with Java. In this case, should I use java-rest-binding(https://github.com/neo4j/java-rest-binding)? I cannot find javadoc comments in the source code, so where can...
I am trying to get the project from github to work. It can be found here: https://github.com/neo4j/java-rest-binding Has anyone put this into a JAR already? I am to connect to a local neo4j store...
Can anyone help me to understand the different projects that are available related to neo4j.I can see there are a lot of projects for ex. Java REST binding, Spring data neo4j, etc. What is the exact
I use Java REST binding of Neo4j on my project, but I face a problem on handling transactions. When the name is Error, it can success insert node into DB..., event if I take off Transaction contro...
I have a simple relationship test that I am trying to run to create a unique node using Rest API (java-rest-binding) https://github.com/neo4j/java-rest-binding but unfortunately I am stuck on somet...
Since version 2.0, Neo4j has a preferred way for index creation : http://docs.neo4j.org/chunked/milestone/rest-api-schema-indexes.html Following the documentation, I was able to easily create an i...
I have no problem with this cypher request : MATCH user-[r:OWE_TO*]->final WHERE user.name="toto" AND user.name <> final.name AND r[0].value=r[length(r)-1].value RETURN final.n...
Is there an existing library that I can use that has the functionality: http://docs.neo4j.org/chunked/milestone/rest-api-transactional.html I've looked into https://github.com/neo4j/java-rest-bin...

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.