Hello,

> I wonder if it even makes sense to type numbers according to their
> memory model. As objects, Byte, Short, and Integer occupy the same
> space. Long isn't much more.  So in Java we're not saving much space.
> Jackson will attempt to parse in order: int, long, BigInt, BigDecimal.
> The JSON JSR uses only BigDecimal. Some non-jvm languages don't even
> have this concept.  Does anything in gremlin actually require this?
> I'm thinking that this is only going to be relevant at the domain
> model level. This way json native numbers can be used and not need
> typing.

I think we should type numbers. Already, with Gremlin-Python, I’m having 
trouble between Python’s “big integer”, Java’s long, Java’s float, Python’s 
double…. knowing the size and schema of a number is important. However, I 
believe that if something is NOT typed, then we assume it is a JSON-type. E.g. 
String, boolean.

> Additionally, I think that all things that will be typed should always
> be typed. For the use cases of injesting a saved graph from a file, it
> can probably be assumed that the top-level objects are vertices since
> the graph is vertex-centric and everything else follows naturally.
> I'm not entirely sure what is required for submitting traversals to
> gremlin server from GLV.  However, if this is used for the results
> from gremlin server then the results could start with any one of path,
> vertex, edge, property, vertex property, etc. So you'll need that type
> data there.

Gremlin-XXX will be sending Bytecode to Gremlin-YYY. Byte code looks like this:

V 1
out knows
has name marko
has age gt(10)
values name

Here is a thrown together JSON representation of 

g.V().as("a").repeat(out("created", 
"knows")).times(2).as("b").dedup().select("a", "b”)

[["V"],
["as","a"],
["repeat",[["out","created","knows"]]],
["times",2],
["as","b"],
["dedup"],
["select","a","b”]]

We will need a GraphSON representation of this that is Java free. This will be 
the foundational representation of serialized Gremlin traversals that can be 
passed around between Gremlin VMs and used by any programming language to both 
host Gremlin and compile traversals to this JSON-based Bytecode representation.

Marko.

Reply via email to