0
votes

I need to use Rest API to issue a merge query to execute for neo4j database. I am trying to refer the Neo4J manual, but it only defines for the case of creating nodes, relationships not executing queries of the like.

What needs to be done to execute a merge query? Is there any examples in the web? Thanks!!!

EDIT: I tried to use the following

 String response = resource.accept( MediaType.APPLICATION_JSON_TYPE )
                        .entity( query, MediaType.APPLICATION_JSON_TYPE )
                        .post( String.class );

With query = "{\"query\":\"MERGE (n:Person) RETURN n\"}", It creates the node

But when I try to add a property to the node like the following

  query = "{\"query\":\"MERGE (n:Person{name:"JRapid"}) RETURN n\"}"

I encountered the following error -

  Caused by: com.sun.jersey.api.client.UniformInterfaceException: POST http://localhost:7474/db/data/cypher returned a response status of 500 Internal Server Error

Is there any other way to specify the properties while issuing merge command in REST API?

1

1 Answers

1
votes

You should find a detailed error message in the response or logs

Double escape your quotes around the name or use single quotes

Better use parameters

And try to use the transactional endpoint

From Mobile, so w/o code or links