Question

I have just started playing around with Neo4j graph database for a new social network site I am building. Everything worked very well and as expected until I wanted to use the spatial plugin in order to be able to ask questions like "get all users within the distance of 2 km from point X" in an efficient way.

I am using neo4j-community-2.0.0 binaries for windows and the neo4j-spatial-0.12 server plugin.

Asking :GET /db/data through the REST-API gives me:

"extensions": {
    "SpatialPlugin": {
      "addNodeToLayer": "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addNodeToLayer",
      "findGeometriesWithinDistance": "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/findGeometriesWithinDistance",
      "findGeometriesInBBox": "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/findGeometriesInBBox",
      "addSimplePointLayer": "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer",
      "getLayer": "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/getLayer",
      "addGeometryWKTToLayer": "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addGeometryWKTToLayer",
      "addCQLDynamicLayer": "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addCQLDynamicLayer",
      "addEditableLayer": "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addEditableLayer",
      "updateGeometryFromWKT": "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/updateGeometryFromWKT"
    }
  },

...but then when I try to add a simple point layer:

:POST http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer
{
  "layer" : "geom",
  "lat" : "lat",
  "lon" : "lon"
}

the server responds with 500 :( Anyone having a clue of what is wrong/where I can get more information about the problem?

Was it helpful?

Solution

The plugin still references a version of the GraphDatabaseService interface that introduced a breaking change in a recent Neo4J version.

The 500 you're seeing is because of a NoSuchMethodError, where GraphDatabaseService.getReferenceNode() is being called. That method no longer exists in the Neo4J v2.0.0 API.

I've added a defect on GitHub for this to be fixed, documented here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top