Re: [Neo4j] Datetimes in Neo4j REST Server

2010-11-23 Thread Max De Marzi Jr.
Hum...maybe we should have the type of object in the json string?

data: {name : {string : Max}, age: {int :31} }

also how about arrays?   string[] : [Max, Javier,Peter]


On Tue, Nov 23, 2010 at 1:02 PM, Javier de la Rosa ver...@gmail.com wrote:
 I was writting some extra tests for the python rest client and
 checking what are the types allowed.
 The boolean, strings, integers and floats seem to be OK when the
 client receives the JSOn from the server. But if I serialize a date or
 datetime, I have no way to know whether I must do a casting the data
 to a datetime object or whether it's simply a string containing a
 date. What should I do? Are the dates handled in a different way?

 --
 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] Datetimes in Neo4j REST Server

2010-11-23 Thread Peter Neubauer
Javier, Max, good point!

Jim, what do you say about that? How type safe can we make the REST
API? At least I think this warrants an issue over at
https://trac.neo4j.org/ticket/286 for 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://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



On Tue, Nov 23, 2010 at 9:58 PM, Max De Marzi Jr. maxdema...@gmail.com wrote:
 Hum...maybe we should have the type of object in the json string?

 data: {name : {string : Max}, age: {int :31} }

 also how about arrays?   string[] : [Max, Javier,Peter]


 On Tue, Nov 23, 2010 at 1:02 PM, Javier de la Rosa ver...@gmail.com wrote:
 I was writting some extra tests for the python rest client and
 checking what are the types allowed.
 The boolean, strings, integers and floats seem to be OK when the
 client receives the JSOn from the server. But if I serialize a date or
 datetime, I have no way to know whether I must do a casting the data
 to a datetime object or whether it's simply a string containing a
 date. What should I do? Are the dates handled in a different way?

 --
 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

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


Re: [Neo4j] Datetimes in Neo4j REST Server

2010-11-23 Thread Javier de la Rosa
On Tue, Nov 23, 2010 at 16:05, Peter Neubauer
peter.neuba...@neotechnology.com wrote:
 Jim, what do you say about that? How type safe can we make the REST
 API? At least I think this warrants an issue over at
 https://trac.neo4j.org/ticket/286 for this.

Thank you Peter and Max for the quick response. It would be great to
have well defined data types in the REST server.
I hope the solution also works in order to talk to the server what
types are sent to it, because now we have no way to create Date or
List objects like properties in nodes or relationships trhough the
REST API.

It's not easy manage with Dates and objects in JSON. The proposal in
https://trac.neo4j.org/ticket/286 adds some overhead although I think
is a very good solution. However, there wouldn't be backwards
compatibility.

Best regards.



-- 
Javier de la Rosa
http://versae.es
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Datetimes in Neo4j REST Server

2010-11-23 Thread Jim Webber
Hi folks,

My concern about this is that we're already taking liberties with the media 
type application/json. 

Adding this kind of annotation definitely takes us into very neo4j-specific 
territory (which might be a good thing). I responded to the ticket, saying that 
perhaps we should consider a neo4j media type. In that media type we could 
properly define a set of programmatic types that we support, as well as the 
hypermedia controls (links, forms) that we'd like to see.

However what if we didn't use JSON? The Clojure community are thinking about 
introducing the notion of URI into the core language. Once that's implemented 
Ian Robinson, Savas Parastatidis and me along with Stu Halloway are going to 
design the (hyper)media type application/clojure (which will start life as 
application/x.clojure)

Why is this important? Because Clojure already has a sophisticated type system 
and sending round Clojure data structures is just as easy as sending around 
JSON (though admittedly the acronym AJAC does not sound so sexy).

Jim


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