Dylan Millikin wrote:
> I hear you, trust me. I'm just pointing out some potential conflicts. I'm
> not sure if this could be another but what of the Property typing for some
> DBs (like Titan). If you have a schema expecting Long are we going to have
> conflicts?
But this is exactly the problem!
GraphSON requires a type. What type does the client send? E.g. g.V(3).
Does it send an int32 or int64?
The deeper issue: Which domain is responsible for numeric types (and other
types not directly supported by a client natively)?
I see some potential philosophies:
1) Gremlin is an extension of java and the graph provider, exposes the
memory size of numbers as GraphSON domain objects. This is the current
choice. But it's only partially implemented because clients can't actually
choose the number type.
a) Leave it as-is. A limitation of GLV clients is that they can't
interoperate with mixed GLV/java/JVM clients. Users are SOL.
b) Use a default type. Maybe it's configurable on the client so it can
match the server. But this is still vulnerable to mixed numeric types, and
doesn't support non-numeric types.
c) Expose the domain objects as first-class types all the way to the
user. This also lends itself to supporting non-numeric types.
g.V(int32(3)), g.V(int64(3)), g.V(uuid("124..."))
Finally someone else is beginning to recognize this problem.
https://lists.apache.org/thread.html/263739a38133be620dd32640fe997388e76b20379a3dae44b10d4442@%3Cdev.tinkerpop.apache.org%3E
However, including memory size of numeric types is still inconsistent with
how strings are treated. The memory size constraint of a string for a
particular property is never included. Why force this level of detail on
numbers??
2) Gremlin has its own well-defined domain, is consistent with user
expectations, and transparently does the right thing. In GraphSON, I could
still see there being two types: integer, float. Maybe integer means using
long or BigInteger. Maybe float means using double or BigDecimal. Depends
on what limitations are acceptable. In any case, the problem of conversion
to anything lesser is pushed down to graph providers. Gremlin clients and
servers can treat numbers as numbers. Sanity is restored where 2 == 2.
And there's probably a lot area in-between these.
--
Robert Dale