Re: [Neo4j] Neo4j server - Gremlin plugin - line break in script
Hi all, Hi event with \n, I am not able to send this script {script:g.v(1);g.v(2)} in 2 lines. BTW I am still using 1.4. Stack trace is here http://pastebin.com/WYVJPy3K http://pastebin.com/WYVJPy3K It says Unrecognized character escape (CTRL-CHAR, code 10) -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-server-Gremlin-plugin-line-break-in-script-tp3191845p3274688.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo4j server - Gremlin plugin - line break in script
Guillaume, I added a test to the Gremlin test, which works, see https://github.com/neo4j/gremlin-plugin/blob/master/src/test/java/org/neo4j/server/plugin/gremlin/GremlinPluginTest.java#L238 However, I suspect the REST system to treat linebreaks wrongly, so I need to track that down. https://github.com/neo4j/gremlin-plugin/blob/master/src/test/java/org/neo4j/server/plugin/gremlin/GremlinPluginFunctionalTest.java#L205 is failing, so I have a test for it :) /peter On Mon, Aug 22, 2011 at 11:35 AM, Guillaume ALLEE guillaume.al...@capgemini.com wrote: Hi all, Hi event with \n, I am not able to send this script {script:g.v(1);g.v(2)} in 2 lines. BTW I am still using 1.4. Stack trace is here http://pastebin.com/WYVJPy3K http://pastebin.com/WYVJPy3K It says Unrecognized character escape (CTRL-CHAR, code 10) -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-server-Gremlin-plugin-line-break-in-script-tp3191845p3274688.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo4j server - Gremlin plugin - line break in script
Guillaume, update - https://github.com/neo4j/gremlin-plugin/blob/master/src/test/java/org/neo4j/server/plugin/gremlin/GremlinPluginFunctionalTest.java#L205 shows you that you need to escape the newline if you are executing your test from Java, since one String parsing in your client code is done before hitting the wire. Is that the case? /peter On Mon, Aug 22, 2011 at 12:04 PM, Peter Neubauer pe...@neubauer.se wrote: Guillaume, I added a test to the Gremlin test, which works, see https://github.com/neo4j/gremlin-plugin/blob/master/src/test/java/org/neo4j/server/plugin/gremlin/GremlinPluginTest.java#L238 However, I suspect the REST system to treat linebreaks wrongly, so I need to track that down. https://github.com/neo4j/gremlin-plugin/blob/master/src/test/java/org/neo4j/server/plugin/gremlin/GremlinPluginFunctionalTest.java#L205 is failing, so I have a test for it :) /peter On Mon, Aug 22, 2011 at 11:35 AM, Guillaume ALLEE guillaume.al...@capgemini.com wrote: Hi all, Hi event with \n, I am not able to send this script {script:g.v(1);g.v(2)} in 2 lines. BTW I am still using 1.4. Stack trace is here http://pastebin.com/WYVJPy3K http://pastebin.com/WYVJPy3K It says Unrecognized character escape (CTRL-CHAR, code 10) -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-server-Gremlin-plugin-line-break-in-script-tp3191845p3274688.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://startupbootcamp.org/ - Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo4j server - Gremlin plugin - line break in script
Hi, I am using a simple rest client in chrome to try to send my gremlin script (working without a line break) https://chrome.google.com/webstore/detail/fhjcajmcbmldlhcimfajhfbgofnpcjmb -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-server-Gremlin-plugin-line-break-in-script-tp3191845p3275191.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo4j server - Gremlin plugin - line break in script
Guillaume, I checked this out with people in the know. Actually, unescaped newline in the middle of a token like your string is not allowed in JSON, much like in java. {script:2\n4, hi:hej} in the Chrome plugin is working, while {script:2 4, hi:hej} is illegal JSON and will throw the parsing error. This is unfortunate for the readability of a script, but apparently there is no good way around it. So, the client library needs to convert linebreaks into \n if that is interesting. Do others have input on this? Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://startupbootcamp.org/ - Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Mon, Aug 22, 2011 at 2:22 PM, Guillaume ALLEE guillaume.al...@capgemini.com wrote: Hi, I am using a simple rest client in chrome to try to send my gremlin script (working without a line break) https://chrome.google.com/webstore/detail/fhjcajmcbmldlhcimfajhfbgofnpcjmb -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-server-Gremlin-plugin-line-break-in-script-tp3191845p3275191.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo4j server - Gremlin plugin - line break in script
Peter, On Mon, Aug 22, 2011 at 5:04 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Do others have input on this? it's just like that :) javascript (and therefore also json) don't allow linebreaks in strings. alert( foo bar ); results in 'Unexpected identifier'. what would be possible, just to increase the readability is the following: alert( foo\n + bar ); Regards Stefan ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo4j server - Gremlin plugin - line break in script
Hi Stefan, On 22 August 2011 15:15, Stefan Matheis matheis.ste...@googlemail.comwrote: results in 'Unexpected identifier'. what would be possible, just to increase the readability is the following: alert( foo\n + bar ); This is certainly a solution if you are in an environment that evaluates JavaScript. However, in this situation the server is expecting JSON, which as a very small subset of JavaScript, doesn't support operators or any kind of evaluation to determine property values. It would be nice though :-) -Alistair ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo4j server - Gremlin plugin - line break in script
Oh yes .. of course, you're right .. i should just finish thinking before sending my mail :) i'm sorry! Regards Stefan On Mon, Aug 22, 2011 at 6:10 PM, Alistair Jones alistair.jo...@neotechnology.com wrote: Hi Stefan, On 22 August 2011 15:15, Stefan Matheis matheis.ste...@googlemail.comwrote: results in 'Unexpected identifier'. what would be possible, just to increase the readability is the following: alert( foo\n + bar ); This is certainly a solution if you are in an environment that evaluates JavaScript. However, in this situation the server is expecting JSON, which as a very small subset of JavaScript, doesn't support operators or any kind of evaluation to determine property values. It would be nice though :-) -Alistair ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Neo4j server - Gremlin plugin - line break in script
Hi, I am using neo4j server 1.4. I want to send a gremin script (which is ok with script with one line). I am wondering if I can send script with line break in it. I currently have /message: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value at [Source: java.io.StringReader@fde4e6; line: 1, column: 21], exception: org.neo4j.server.rest.repr.BadInputException: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value at [Source: java.io.StringReader@fde4e6; line: 1, column: 21], stacktrace: [(36)/ -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-server-Gremlin-plugin-line-break-in-script-tp3191845p3191845.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo4j server - Gremlin plugin - line break in script
Guillaume, Are you sending it via the rest plugin? In docs.neo4j.org the sample graph example is using multiple lines, separated by semicolon. /peter Sent from my phone. On Jul 22, 2011 6:17 PM, Guillaume ALLEE guillaume.al...@capgemini.com wrote: Hi, I am using neo4j server 1.4. I want to send a gremin script (which is ok with script with one line). I am wondering if I can send script with line break in it. I currently have /message: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value at [Source: java.io.StringReader@fde4e6; line: 1, column: 21], exception: org.neo4j.server.rest.repr.BadInputException: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value at [Source: java.io.StringReader@fde4e6; line: 1, column: 21], stacktrace: [(36)/ -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-server-Gremlin-plugin-line-break-in-script-tp3191845p3191845.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo4j server - Gremlin plugin - line break in script
Hi Peter, Thanks for your answer. I knew that it was possible to put semi colons for line break ;-) To be more precise, I have the following script that was given kindly given by Marko on another thread. m = [:] g.idx('id')[[object_type:'A']].transform{ if(it.out('USES'){it.object_type.equals('B')}.count() 1) count = 1 else count 1 }.groupCount(m) -1 m I know it is possible to do the same following in one line (see below) however I would like, for more readability to be able to submit it to the REST gremlin plugin with multiple lines. m = [:] ;g.idx('id')[[object_type:'A']].transform{if(it.out('USES'){it.object_type.equals('B')}.count() 1) count = 1 else count 1}.groupCount(m) -1 ; m Guillaume in holiday tonight ;-) -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-server-Gremlin-plugin-line-break-in-script-tp3191845p3192325.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo4j server - Gremlin plugin - line break in script
Mmh, ok, I get the thought. Will see how we could do that. How would you like to submit this? JSON with \n instead of ;? Wanna write a test for this. Now back to parental leave and the catastrophe in Norway. Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://startupbootcamp.org/ - Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Fri, Jul 22, 2011 at 10:25 PM, Guillaume ALLEE guillaume.al...@capgemini.com wrote: Hi Peter, Thanks for your answer. I knew that it was possible to put semi colons for line break ;-) To be more precise, I have the following script that was given kindly given by Marko on another thread. m = [:] g.idx('id')[[object_type:'A']].transform{ if(it.out('USES'){it.object_type.equals('B')}.count() 1) count = 1 else count 1 }.groupCount(m) -1 m I know it is possible to do the same following in one line (see below) however I would like, for more readability to be able to submit it to the REST gremlin plugin with multiple lines. m = [:] ;g.idx('id')[[object_type:'A']].transform{if(it.out('USES'){it.object_type.equals('B')}.count() 1) count = 1 else count 1}.groupCount(m) -1 ; m Guillaume in holiday tonight ;-) -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-server-Gremlin-plugin-line-break-in-script-tp3191845p3192325.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user