Thanks for the help, nawroth suggested that this is because there are new lines inside the Cypher statement which is in quotes. My subsequent testing demonstrates that is true. The REST JSON parser probably terminates when it hits a newline. The other examples I tried before that worked were single line. The one REST example that's more complex had a bunch of cypher phrases without newline separators in a single set of quotes. This behavior could be made more clear in the documentation. ᐧ
On Fri, Sep 19, 2014 at 10:40 AM, Michael Hunger < michael.hun...@neotechnology.com> wrote: > Hi Daniel, seems to depend on the escaping of the quotes but definitely > weird. > It's afaik not related to Cypher but the streaming JSON parser before it. > I think it somehow concludes that it parsed the input correctly but without > any output > > e.g. here I get the same as you > > curl -XPOST -i -H accept:application/json -H content-type:application/json > -d '{"statements":[{"statement":"LOAD CSV WITH HEADERS F\"xx > file://C:/countries.csvxxx\\" as csvLine MERGE (c:Country { Code: > csvLine.Code })"}]}' http://localhost:7474/db/data/transaction/commit > > HTTP/1.1 200 OK > > Content-Type: application/json > > Access-Control-Allow-Origin: * > > Transfer-Encoding: chunked > > Server: Jetty(9.0.5.v20130815) > > > {"results":[],"errors":[]} > and here it fails correctly > > curl -XPOST -i -H accept:application/json -H content-type:application/json > -d '{"statements":[{"statement":"LOAD CSV WITH HEADERS FROM \"xx > file://C:/countries.csvxxx\" as csvLine MERGE (c:Country { Code: > csvLine.Code })"}]}' http://localhost:7474/db/data/transaction/commit > > HTTP/1.1 200 OK > > Content-Type: application/json > > Access-Control-Allow-Origin: * > > Transfer-Encoding: chunked > > Server: Jetty(9.0.5.v20130815) > > > {"results":[],"errors":[{"code":"Neo.TransientError.Statement.ExternalResourceFailure","message":"Invalid > URL specified (no protocol: xx > file://C:/countries.csvxxx)","stackTrace":"org.neo4j.cypher.LoadExternalResourceException: > Invalid URL specified (no protocol: xx file://C:/countries.csvxxx)\n\tat > org.neo4j.cypher.internal.compiler.v2_1.pipes.LoadCSVPipe.checkURL(LoadCSVPipe.scala:50)\n\tat > org.neo4j.cypher.internal.compiler.v2_1.pipes.LoadCSVPipe$$anonfun$internalCreateResults$1.apply(LoadCSVPipe.scala:66)\n\tat > org.neo4j.cypher.internal.compiler.v2_1.pipes.LoadCSVPipe$$anonfun$internalCreateResults$1.apply(LoadCSVPipe.scala:64)\n\tat > scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)\n\tat > scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)\n\tat > org.neo4j.cypher.internal.compiler.v2_1.pipes.EmptyResultPipe.internalCreateResults(EmptyResultPipe.scala:29)\n\tat > org.neo4j.cypher.internal.compiler.v2_1.pipes.PipeWithSource.createResults(Pipe.scala:105)\n\tat > org.neo4j.cypher.internal.compiler.v2_1.executionplan.ExecutionPlanBuilder$$anonfun$getExecutionPlanFunction$1$$anonfun$apply$2.apply(ExecutionPlanBuilder.scala:120)\n\tat > org.neo4j.cypher.internal.compiler.v2_1.executionplan.ExecutionPlanBuilder$$anonfun$getExecutionPlanFunction$1$$anonfun$apply$2.apply(ExecutionPlanBuilder.scala:119)\n\tat > org.neo4j.cypher.internal.compiler.v2_1.executionplan.ExecutionWorkflowBuilder.runWithQueryState(ExecutionPlanBuilder.scala:168)\n\tat > org.neo4j.cypher.internal.compiler.v2_1.executionplan.ExecutionPlanBuilder$$anonfun$getExecutionPlanFunction$1.apply(ExecutionPlanBuilder.scala:118)\n\tat > org.neo4j.cypher.internal.compiler.v2_1.executionplan.ExecutionPlanBuilder$$anonfun$getExecutionPlanFunction$1.apply(ExecutionPlanBuilder.scala:103)\n\tat > org.neo4j.cypher.internal.compiler.v2_1.executionplan.ExecutionPlanBuilder$$anon$1.execute(ExecutionPlanBuilder.scala:68)\n\tat > org.neo4j.cypher.internal.compiler.v2_1.executionplan.ExecutionPlanBuilder$$anon$1.execute(ExecutionPlanBuilder.scala:67)\n\tat > org.neo4j.cypher.internal.ExecutionPlanWrapperForV2_1.execute(CypherCompiler.scala:159)\n\tat > org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:76)\n\tat > org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:71)\n\tat > org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:84)\n\tat > org.neo4j.server.rest.transactional.TransactionHandle.executeStatements(TransactionHandle.java:277)\n\tat > org.neo4j.server.rest.transactional.TransactionHandle.commit(TransactionHandle.java:139)\n\tat > org.neo4j.server.rest.web.TransactionalService$2.write(TransactionalService.java:194)\n\tat > com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)\n\tat > com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)\n\tat > com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306)\n\tat > com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1437)\n\tat > com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)\n\tat > com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)\n\tat > com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)\n\tat > com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)\n\tat > com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)\n\tat > javax.servlet.http.HttpServlet.service(HttpServlet.java:848)\n\tat > org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:698)\n\tat > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:505)\n\tat > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:211)\n\tat > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1096)\n\tat > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:432)\n\tat > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175)\n\tat > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1030)\n\tat > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)\n\tat > org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)\n\tat > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\n\tat > org.eclipse.jetty.server.Server.handle(Server.java:445)\n\tat > org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:268)\n\tat > org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:229)\n\tat > org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358)\n\tat > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601)\n\tat > org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532)\n\tat > java.lang.Thread.run(Thread.java:744)\n"}]} > > > > > > On Fri, Sep 19, 2014 at 4:14 PM, Daniel Corbett <daniel...@gmail.com> > wrote: > >> Continuing to try things... I am now using "Advanced REST Client" - a >> chrome application. I am using the example from the LOAD CSV >> Documentation, along with the REST transaction commit example. >> >> Here is a screen shot, showing my settings for the REST call, along with >> the payload and the result: >> >> >> https://drive.google.com/file/d/0ByBuUHqfY0BSTnFkZmdSYlp4NFU/edit?usp=sharing >> >> Here is a screen shot of me using the same tool & settings with a simple >> Cypher script that works: >> >> >> https://drive.google.com/file/d/0ByBuUHqfY0BSRDNJRWpvUW56UnM/edit?usp=sharing >> >> I've tried so many things... this seems to be a bug. >> >> Help please! >> >> Thanks, >> >> - Daniel >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Neo4j" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to neo4j+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Neo4j" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/neo4j/802M8hYF1as/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > neo4j+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.