Perhaps I'm missing something here, but since Neo4j does not support dates,
then surely neither should the main REST API? If a users application decided
to store dates in strings, then their client code would also already need to
deal with the dates as strings, regardless of whether the client talked to
the database direct, or through REST. Likewise if they used long timestamps.
IMHO it is an application level issue.

My vote is to keep the REST API as close as possible to the core Neo4j. If
dates are added to the core, then add them to the REST API. Until then,
surely this is an application level issue...

On Thu, Nov 25, 2010 at 8:23 AM, Max De Marzi Jr. <maxdema...@gmail.com>wrote:

> I was thinking about this...Neo4j doesn't really do Dates.  It's Java
> Primitives or Strings.
>
> So how about we just establish a convention?
>
> Something like:
>
> Any field ending in "date", "time", "_at", or "_on" is assumed to be a
> date (in Unix Epoch milliseconds) and will be converted (from string,
> int, long, float, double) into whatever the idiomatic way for handling
> dates is (in the language of the library being used).
>
>
>
>
> On Wed, Nov 24, 2010 at 2:15 AM, Mattias Persson
> <matt...@neotechnology.com> wrote:
> > Neo4j REST/Server handles array values:
> >
> > { "array-property": [10, 321, 45] }
> >
> > 2010/11/24 Max De Marzi Jr. <maxdema...@gmail.com>
> >
> >> BSON seems to have an Array type as well.
> >>
> >> http://bsonspec.org/#/specification
> >>
> >>
> >>
> >> On Tue, Nov 23, 2010 at 7:40 PM, Javier de la Rosa <ver...@gmail.com>
> >> wrote:
> >> > IMHO, the data types that are not supported by the Neo4j REST API are
> >> > Date and Binary data. So it could be a solution add a Neo4j special
> >> > dictionary for these cases:
> >> > {
> >> > "address":
> >> >     {
> >> >         "streetAddress": "21 2nd Street",
> >> >         "city": "New York",
> >> >         "state": "NY",
> >> >         "postalCode": "10021",
> >> >         "birthdate": {
> >> >                 "__ntype__": "/Date(36779659600.0)/", # Timestamp in
> >> > Javascript supports BC dates
> >> >                 "__nval__": "1971-02-03T00:00:00"  # ISO Format also
> >> > supports BC dates
> >> >         }
> >> >     },
> >> > }
> >> > On the other hand, I don't know how Neo4j handles Arrays and Objects
> >> > in order to put them like values in properties when they came from a
> >> > REST client. It Neo4j doesn't handle this, then it's not a problem to
> >> > have some special dics for dates.
> >> >
> >> > All of this come from the limitations on JSON by itself. It's more
> >> > usual of what we think to use a domain specific implementation for the
> >> > JSON interchange. For example, Cassandra uses JSON2SStable to
> >> > import/export data, and mongoDB created BSON [1] to support Date and
> >> > binary data.
> >> >
> >> > Best regards.
> >> >
> >> >
> >> > [1] http://bsonspec.org/
> >> >
> >> > On Tue, Nov 23, 2010 at 19:02, Max De Marzi Jr. <maxdema...@gmail.com
> >
> >> wrote:
> >> >> What about:
> >> >>
> >> >> "data": {"name" : "NeoS::Max"}, "age": {"NeoI::31" }
> >> >> "data": {"name" : "NeoS[]::Max,Javier,Peter"}, "age":
> >> {"NeoI[]::31,29,33" }
> >> >>
> >> >>
> >> >>
> >> >> On Tue, Nov 23, 2010 at 4:59 PM, Rick Bullotta
> >> >> <rick.bullo...@burningskysoftware.com> wrote:
> >> >>> FWIW, we store all dates as milliseconds relative to UTC, and pass
> them
> >> >>> around in that format.  We identify the data types of
> fields/properties
> >> in
> >> >>> separate metadata structures embedded in the response, making the
> >> returned
> >> >>> content easily parsable and interpretable by relatively dumb
> clients.
> >> >>>
> >> >>> -----Original Message-----
> >> >>> From: user-boun...@lists.neo4j.org [mailto:
> >> user-boun...@lists.neo4j.org] On
> >> >>> Behalf Of Javier de la Rosa
> >> >>> Sent: Tuesday, November 23, 2010 4:26 PM
> >> >>> To: Neo4j user discussions
> >> >>> Subject: [SPAM] Re: [Neo4j] Datetimes in Neo4j REST Server
> >> >>>
> >> >>> 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
> >> >>>
> >> >>> _______________________________________________
> >> >>> 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
> >>
> >
> >
> >
> > --
> > Mattias Persson, [matt...@neotechnology.com]
> > Hacker, Neo Technology
> > www.neotechnology.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
>
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to