Re: [Neo4j] Propertiy keys with slashes and spaces in REST server
On Wed, Jul 20, 2011 at 22:06, Michael Hunger michael.hun...@neotechnology.com wrote: what is the concrete error that happens if you send over that space + slash encoded property? Returned by HTTP console on Neo4j server (but the behaviour is the same in my Python client): - Regular property key: http PUT http://localhost:7373/db/sylva/node/3537/properties/pröp€rtŷ un\u00ed\u00a9od e/v\u00e4l\u00fa\u00ea == 204 No Content - Property key with spaces invalidate the URL: http PUT http://localhost:7373/db/sylva/node/3537/properties/pr öp€rtŷ un\u00ed\u00a9od e/v\u00e4l\u00fa\u00ea == Invalid JSON data. I can fix this URL encoding the key and decoding in the client. - Property key with slahs crash the URL: http PUT http://localhost:7373/db/sylva/node/3537/properties/pr/öp€rtŷ un\u00ed\u00a9od e/v\u00e4l\u00fa\u00ea == 404 Not Found I can fix this with safe URL encoding. - Propery key with slash and spaces: http PUT http://localhost:7373/db/sylva/node/3537/properties/pr ö/p€rtŷ un\u00ed\u00a9od e/v\u00e4l\u00fa\u00ea == Invalid JSON data. I'm not able to fix this becaus If a use safe URL encoding, the spaces are converted into + characters in the server, and that's not the key i want to store. Sorry for the difficulty to reproduce the bug. Regards. -- Javier de la Rosa http://versae.es ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Propertiy keys with slashes and spaces in REST server
Javier, I quickly tried it with curl, escaping the space to %20 and the forward slash to %2F worked just fine. Please note, that in your examples the forward slash was never escaped: my example is a/b c for both key and value. ADD: curl -i -H Content-Type:application/json -X POST -d 'http://localhost:7474/db/data/node/0;'son 'http://localhost:7474/db/data/index/node/my_nodes/a%2Fb%20c/a%2Fb%20c' GET: curl -i -H Accept:application/json 'http://localhost:7474/db/data/index/node/my_nodes/a%2Fb%20c/a%2Fb%20c' DELETE: curl -i -X DELETE 'http://localhost:7474/db/data/index/node/my_nodes/a%2Fb%20c/a%2Fb%20c/0' Cheers Michael Am 21.07.2011 um 16:32 schrieb Javier de la Rosa: On Wed, Jul 20, 2011 at 22:06, Michael Hunger michael.hun...@neotechnology.com wrote: what is the concrete error that happens if you send over that space + slash encoded property? Returned by HTTP console on Neo4j server (but the behaviour is the same in my Python client): - Regular property key: http PUT http://localhost:7373/db/sylva/node/3537/properties/pröp€rtŷ un\u00ed\u00a9od e/v\u00e4l\u00fa\u00ea == 204 No Content - Property key with spaces invalidate the URL: http PUT http://localhost:7373/db/sylva/node/3537/properties/pr öp€rtŷ un\u00ed\u00a9od e/v\u00e4l\u00fa\u00ea == Invalid JSON data. I can fix this URL encoding the key and decoding in the client. - Property key with slahs crash the URL: http PUT http://localhost:7373/db/sylva/node/3537/properties/pr/öp€rtŷ un\u00ed\u00a9od e/v\u00e4l\u00fa\u00ea == 404 Not Found I can fix this with safe URL encoding. - Propery key with slash and spaces: http PUT http://localhost:7373/db/sylva/node/3537/properties/pr ö/p€rtŷ un\u00ed\u00a9od e/v\u00e4l\u00fa\u00ea == Invalid JSON data. I'm not able to fix this becaus If a use safe URL encoding, the spaces are converted into + characters in the server, and that's not the key i want to store. Sorry for the difficulty to reproduce the bug. Regards. -- Javier de la Rosa http://versae.es ___ 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] Propertiy keys with slashes and spaces in REST server
I'm so sorry. The problem was a default value in a Python library for URL encoding. Thank you. On Thu, Jul 21, 2011 at 17:41, Michael Hunger michael.hun...@neotechnology.com wrote: Javier, I quickly tried it with curl, escaping the space to %20 and the forward slash to %2F worked just fine. Please note, that in your examples the forward slash was never escaped: my example is a/b c for both key and value. ADD: curl -i -H Content-Type:application/json -X POST -d 'http://localhost:7474/db/data/node/0;'son 'http://localhost:7474/db/data/index/node/my_nodes/a%2Fb%20c/a%2Fb%20c' GET: curl -i -H Accept:application/json 'http://localhost:7474/db/data/index/node/my_nodes/a%2Fb%20c/a%2Fb%20c' DELETE: curl -i -X DELETE 'http://localhost:7474/db/data/index/node/my_nodes/a%2Fb%20c/a%2Fb%20c/0' Cheers Michael Am 21.07.2011 um 16:32 schrieb Javier de la Rosa: On Wed, Jul 20, 2011 at 22:06, Michael Hunger michael.hun...@neotechnology.com wrote: what is the concrete error that happens if you send over that space + slash encoded property? Returned by HTTP console on Neo4j server (but the behaviour is the same in my Python client): - Regular property key: http PUT http://localhost:7373/db/sylva/node/3537/properties/pröp€rtŷ un\u00ed\u00a9od e/v\u00e4l\u00fa\u00ea == 204 No Content - Property key with spaces invalidate the URL: http PUT http://localhost:7373/db/sylva/node/3537/properties/pr öp€rtŷ un\u00ed\u00a9od e/v\u00e4l\u00fa\u00ea == Invalid JSON data. I can fix this URL encoding the key and decoding in the client. - Property key with slahs crash the URL: http PUT http://localhost:7373/db/sylva/node/3537/properties/pr/öp€rtŷ un\u00ed\u00a9od e/v\u00e4l\u00fa\u00ea == 404 Not Found I can fix this with safe URL encoding. - Propery key with slash and spaces: http PUT http://localhost:7373/db/sylva/node/3537/properties/pr ö/p€rtŷ un\u00ed\u00a9od e/v\u00e4l\u00fa\u00ea == Invalid JSON data. I'm not able to fix this becaus If a use safe URL encoding, the spaces are converted into + characters in the server, and that's not the key i want to store. Sorry for the difficulty to reproduce the bug. Regards. -- Javier de la Rosa http://versae.es ___ 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 -- Javier de la Rosa http://versae.es ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Propertiy keys with slashes and spaces in REST server
Hi all, I'm trying to implement full support for unicode in my neo4j Python REST client, but I'm finding some dificulties: - I send a property key such as p r öp€rtŷ, and I'm able to get everything working using a URL encoding, that converts that string into 'p%20r%20%C3%83%C2%B6p%C3%A2%C2%82%C2%ACrt%C3%85%C2%B7' and all I have to do is decode at reception. - I send a property key such as pr/öp€rtŷ, I can use safe URL encoding to avoid crash with the slash: pr/%C3%83%C2%B6p%C3%A2%C2%82%C2%ACrt%C3%85%C2%B7, after that I can decode it in the client. - But if I have a property key with both slash and spaces, such as p r/ öp€rtŷ, there's no way to get this working properly. Any ideas? Thanks. -- Javier de la Rosa http://versae.es ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Propertiy keys with slashes and spaces in REST server
Javier, do you have the curl command for this? We can just add a test case and fix it. Thanks! 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 Wed, Jul 20, 2011 at 10:28 PM, Javier de la Rosa ver...@gmail.com wrote: Hi all, I'm trying to implement full support for unicode in my neo4j Python REST client, but I'm finding some dificulties: - I send a property key such as p r öp€rtŷ, and I'm able to get everything working using a URL encoding, that converts that string into 'p%20r%20%C3%83%C2%B6p%C3%A2%C2%82%C2%ACrt%C3%85%C2%B7' and all I have to do is decode at reception. - I send a property key such as pr/öp€rtŷ, I can use safe URL encoding to avoid crash with the slash: pr/%C3%83%C2%B6p%C3%A2%C2%82%C2%ACrt%C3%85%C2%B7, after that I can decode it in the client. - But if I have a property key with both slash and spaces, such as p r/ öp€rtŷ, there's no way to get this working properly. Any ideas? Thanks. -- Javier de la Rosa http://versae.es ___ 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] Propertiy keys with slashes and spaces in REST server
Hi, Peter On Wed, Jul 20, 2011 at 18:32, Peter Neubauer peter.neuba...@neotechnology.com wrote: Javier, do you have the curl command for this? We can just add a test case and fix it. Thanks! The server works great, but the problem is, in practice, it's not possible to set property keys with spaces and slashes. What kind of encoding should I use to avoid problems with the slash and, in the same time, perseve the spaces? Thanks! 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 Wed, Jul 20, 2011 at 10:28 PM, Javier de la Rosa ver...@gmail.com wrote: Hi all, I'm trying to implement full support for unicode in my neo4j Python REST client, but I'm finding some dificulties: - I send a property key such as p r öp€rtŷ, and I'm able to get everything working using a URL encoding, that converts that string into 'p%20r%20%C3%83%C2%B6p%C3%A2%C2%82%C2%ACrt%C3%85%C2%B7' and all I have to do is decode at reception. - I send a property key such as pr/öp€rtŷ, I can use safe URL encoding to avoid crash with the slash: pr/%C3%83%C2%B6p%C3%A2%C2%82%C2%ACrt%C3%85%C2%B7, after that I can decode it in the client. - But if I have a property key with both slash and spaces, such as p r/ öp€rtŷ, there's no way to get this working properly. Any ideas? Thanks. -- Javier de la Rosa http://versae.es ___ 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 -- Javier de la Rosa http://versae.es ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Propertiy keys with slashes and spaces in REST server
Javier, what is the concrete error that happens if you send over that space + slash encoded property? Cheers Michael Am 21.07.2011 um 01:15 schrieb Javier de la Rosa: Hi, Peter On Wed, Jul 20, 2011 at 18:32, Peter Neubauer peter.neuba...@neotechnology.com wrote: Javier, do you have the curl command for this? We can just add a test case and fix it. Thanks! The server works great, but the problem is, in practice, it's not possible to set property keys with spaces and slashes. What kind of encoding should I use to avoid problems with the slash and, in the same time, perseve the spaces? Thanks! 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 Wed, Jul 20, 2011 at 10:28 PM, Javier de la Rosa ver...@gmail.com wrote: Hi all, I'm trying to implement full support for unicode in my neo4j Python REST client, but I'm finding some dificulties: - I send a property key such as p r öp€rtŷ, and I'm able to get everything working using a URL encoding, that converts that string into 'p%20r%20%C3%83%C2%B6p%C3%A2%C2%82%C2%ACrt%C3%85%C2%B7' and all I have to do is decode at reception. - I send a property key such as pr/öp€rtŷ, I can use safe URL encoding to avoid crash with the slash: pr/%C3%83%C2%B6p%C3%A2%C2%82%C2%ACrt%C3%85%C2%B7, after that I can decode it in the client. - But if I have a property key with both slash and spaces, such as p r/ öp€rtŷ, there's no way to get this working properly. Any ideas? Thanks. -- Javier de la Rosa http://versae.es ___ 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 -- Javier de la Rosa http://versae.es ___ 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