Re: [Neo4j] Forward slashes in index values

2011-09-29 Thread Peter Neubauer
Had a few minutes and implemented this, see
https://github.com/neo4j/community/issues/35

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, Sep 28, 2011 at 11:06 PM, Peter Neubauer
 wrote:
> Good call Josh,
> Valid and much appreciated!
>
> /peter
>
> Sent from my phone.
>
> On Sep 28, 2011 10:33 PM, "jadell"  wrote:
>> Thanks for the heads up, Jim. On a tangentially related note, I filed this
>> request: https://github.com/neo4j/community/issues/35
>>
>> Basically, in the future, it would be useful to have a way to determine
>> the
>> server version via REST so the various clients can account for differences
>> in the protocol like this.
>>
>> Thanks!
>>
>> -- Josh Adell
>>
>> --
>> View this message in context:
>> http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Forward-slashes-in-index-values-tp3347515p3377304.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] Forward slashes in index values

2011-09-28 Thread Peter Neubauer
Good call Josh,
Valid and much appreciated!

/peter

Sent from my phone.
On Sep 28, 2011 10:33 PM, "jadell"  wrote:
> Thanks for the heads up, Jim. On a tangentially related note, I filed this
> request: https://github.com/neo4j/community/issues/35
>
> Basically, in the future, it would be useful to have a way to determine
the
> server version via REST so the various clients can account for differences
> in the protocol like this.
>
> Thanks!
>
> -- Josh Adell
>
> --
> View this message in context:
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Forward-slashes-in-index-values-tp3347515p3377304.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] Forward slashes in index values

2011-09-28 Thread jadell
Thanks for the heads up, Jim.  On a tangentially related note, I filed this
request: https://github.com/neo4j/community/issues/35

Basically, in the future, it would be useful to have a way to determine the
server version via REST so the various clients can account for differences
in the protocol like this.

Thanks!

-- Josh Adell

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Forward-slashes-in-index-values-tp3347515p3377304.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] Forward slashes in index values

2011-09-28 Thread Jim Webber
Hi Tatham,

I've closed off this issue in Github now: 
https://github.com/neo4j/community/issues/25

For all you Neo4j REST API client maintainers, this means there *WILL BE 
BREAKING CHANGES* to the Neo4j REST API in the 1.5 release.

I'll try to ensure they're all very well documented in the manual, but 
following the URI above will show you how things look on the wire now.

Tatham/Romiko/Josh/Nigel/Jake/and others, you have tweaks to make...

Jim

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Forward slashes in index values

2011-09-19 Thread Tatham Oddie
Ok, it seems that you're right about %2f and / being different.

The slash is one of a few reserved characters defined in section 2.2 of RFC2396.

Other characters can safely be unencoded in the URL. For example, 
http://test.com/%7efoo/ is 100% equivalent to http://test.com/~foo/.

Canonicalization algorithms are described in section 2.4.2. It seems that 
adherence to these rules are rare through.

For the sake of simplicity across platforms and frameworks, irrespective of how 
well they follow 2.4.2, I think a JSON payload is the safest approach.


-- Tatham


-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Tatham Oddie
Sent: Tuesday, 20 September 2011 11:04 AM
To: Neo4j user discussions
Subject: Re: [Neo4j] Forward slashes in index values

Great! :)

Re: the URLs being the same, check out http://www.google.com.au/intl/en/about/ 
vs http://www.google.com.au/intl/en%2fabout/
Both load just fine.

I'll go trudging through the URI spec to work out if this is correct behaviour 
or not later.


-- Tatham


-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Jim Webber
Sent: Monday, 19 September 2011 9:32 PM
To: Neo4j user discussions
Subject: Re: [Neo4j] Forward slashes in index values

Hi Tatham,

I don't necessarily agree with %2f and / being the same, but I do agree that 
POSTing everything in the URI is a bit quirky.

Peter's opened up a new issue on this: 

https://github.com/neo4j/community/issues/25

And I get to hack on it. So it looks like the REST index API will be changing 
in our 1.5 release to have a JSON payload in the entity body. That should 
prevent any URI ambiguity and be more sensible too.

Jim
___
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 mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Forward slashes in index values

2011-09-19 Thread Tatham Oddie
Great! :)

Re: the URLs being the same, check out http://www.google.com.au/intl/en/about/ 
vs http://www.google.com.au/intl/en%2fabout/
Both load just fine.

I'll go trudging through the URI spec to work out if this is correct behaviour 
or not later.


-- Tatham


-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Jim Webber
Sent: Monday, 19 September 2011 9:32 PM
To: Neo4j user discussions
Subject: Re: [Neo4j] Forward slashes in index values

Hi Tatham,

I don't necessarily agree with %2f and / being the same, but I do agree that 
POSTing everything in the URI is a bit quirky.

Peter's opened up a new issue on this: 

https://github.com/neo4j/community/issues/25

And I get to hack on it. So it looks like the REST index API will be changing 
in our 1.5 release to have a JSON payload in the entity body. That should 
prevent any URI ambiguity and be more sensible too.

Jim
___
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] Forward slashes in index values

2011-09-19 Thread Jim Webber
Hi Tatham,

I don't necessarily agree with %2f and / being the same, but I do agree that 
POSTing everything in the URI is a bit quirky.

Peter's opened up a new issue on this: 

https://github.com/neo4j/community/issues/25

And I get to hack on it. So it looks like the REST index API will be changing 
in our 1.5 release to have a JSON payload in the entity body. That should 
prevent any URI ambiguity and be more sensible too.

Jim
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Forward slashes in index values

2011-09-18 Thread Tatham Oddie
Hi guys,

If you go to any URL with your browser, both %2f and / are treated the same.

These two URLs are exactly the same, irrespective of encoding:

http://localhost:7474/db/data/index/node/mynodes/mykey/my%2fvalue

http://localhost:7474/db/data/index/node/mynodes/mykey/my/value

neo4j seems to use a very basic parsing routine - just splitting on the slashes 
- instead of a full URI parser.

Using the encoded format, we *can* successfully create an index entry with a 
slash in the value:



curl -i -H Content-Type:application/json -X POST -d 
'"http://localhost:7474/db/data/node/0";'
 'http://localhost:7474/db/data/index/node/mynodes/mykey/my%2fvalue'


Without the encoding, it results in a 405 response:



curl -i -H Content-Type:application/json -X POST -d 
'"http://localhost:7474/db/data/node/0";'
 'http://localhost:7474/db/data/index/node/mynodes/mykey/my/value'

The issue we are facing is that the web client we are using in .NET unwraps the 
URL into a canonical format before sending the request. When it does this, it 
decodes the %2f back to a slash.

It would take a reasonable amount of work for us to bypass this. I'm not very 
comfortable going to that effort considering it's all dependent on neo4j's 
specific URL parser implementation. If this is upgraded to a compliant parser 
in the future, our workaround will break.

Is there a way for us to pass index values in a query string or POST body?

For example:


curl -i -H Content-Type:application/json -X POST -d 
'"http://localhost:7474/db/data/node/0";'
 
'http://localhost:7474/db/data/index/node?indexname=mynodes&indexkey=mykey&indexvalue=my%2fvalue'


--
Tatham Oddie
au mob: +61 414 275 989, us cell: +1 415 598 8201, skype: tathamoddie
If you're printing this email, you're doing it wrong. This is a computer, not a 
typewriter.

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user