From d5dfb0c96a79da432030fcbbad5d8321fe48d27c Mon Sep 17 00:00:00 2001 From: kenhuuu <106191785+kenhuuu@users.noreply.github.com> Date: Thu, 12 Sep 2024 12:47:52 -0700 Subject: [PATCH] Update IO documentation for V4 serializers. (#2769) --- docs/src/dev/io/graphbinary.asciidoc | 481 +- docs/src/dev/io/graphson.asciidoc | 7807 ++++++++--------------- docs/src/upgrade/release-4.x.x.asciidoc | 67 + 3 files changed, 2772 insertions(+), 5583 deletions(-) diff --git a/docs/src/dev/io/graphbinary.asciidoc b/docs/src/dev/io/graphbinary.asciidoc index 56fde6a0e6e..8c6a1901443 100644 --- a/docs/src/dev/io/graphbinary.asciidoc +++ b/docs/src/dev/io/graphbinary.asciidoc @@ -35,7 +35,8 @@ Where: * `{type_code}` is a single unsigned byte representing the type number. * `{type_info}` is an optional sequence of bytes providing additional information of the type represented. This is specially useful for representing complex and custom types. -* `{value_flag}` is a single byte providing information about the value. Flags have the following meaning: +* `{value_flag}` is a single byte providing information about the value. Each type may have its own specific flags so +see each type for more details. Generally, flags have the following meaning: ** `0x01` The value is `null`. When this flag is set, no bytes for `{value}` will be provided. * `{value}` is a sequence of bytes which content is determined by the type. @@ -50,7 +51,7 @@ type_code `0x01`, and empty flag value `0x00` and four bytes to describe the val - `02 00 00 00 00 00 00 00 00 01`: a 64-bit integer number 1. It’s composed by the type_code `0x02`, empty flags and eight bytes to describe the value. -== Version 1.0 +== Version 4.0 === Forward Compatibility @@ -65,9 +66,7 @@ Changes to existing types require new revision. - `0x01`: Int - `0x02`: Long - `0x03`: String -- `0x04`: Date -- `0x05`: Timestamp -- `0x06`: Class +- `0x04`: DateTime - `0x07`: Double - `0x08`: Float - `0x09`: List @@ -80,55 +79,24 @@ Changes to existing types require new revision. - `0x10`: TinkerGraph - `0x11`: Vertex - `0x12`: VertexProperty -- `0x13`: Barrier -- `0x14`: Binding -- `0x15`: Bytecode -- `0x16`: Cardinality -- `0x17`: Column - `0x18`: Direction -- `0x19`: Operator -- `0x1a`: Order -- `0x1b`: Pick -- `0x1c`: Pop -- `0x1d`: Lambda -- `0x1e`: P -- `0x1f`: Scope - `0x20`: T -- `0x21`: Traverser - `0x22`: BigDecimal - `0x23`: BigInteger - `0x24`: Byte -- `0x25`: ByteBuffer +- `0x25`: Binary - `0x26`: Short - `0x27`: Boolean -- `0x28`: TextP -- `0x29`: TraversalStrategy -- `0x2a`: BulkSet - `0x2b`: Tree -- `0x2c`: Metrics -- `0x2d`: TraversalMetrics -- `0x2e`: Merge -- `0x2f`: DT +- `0xf0`: CompositePDT +- `0xf1`: PrimitivePDT +- `0xfd`: Marker - `0xfe`: Unspecified null object -- `0x00`: Custom ==== Extended Types - `0x80`: Char - `0x81`: Duration -- `0x82`: InetAddress -- `0x83`: Instant -- `0x84`: LocalDate -- `0x85`: LocalDateTime -- `0x86`: LocalTime -- `0x87`: MonthDay -- `0x88`: OffsetDateTime -- `0x89`: OffsetTime -- `0x8a`: Period -- `0x8b`: Year -- `0x8c`: YearMonth -- `0x8d`: ZonedDateTime -- `0x8e`: ZoneOffset === Null handling @@ -181,22 +149,19 @@ Example values - `00 00 00 04 61 62 63 64`: the string 'abcd'. - `00 00 00 00`: the empty string ''. -==== Date +==== DateTime -Format: An 8-byte two's complement signed integer representing a millisecond-precision offset from the unix epoch. - -Example values - -- `00 00 00 00 00 00 00 00`: The moment in time 1970-01-01T00:00:00.000Z. -- `ff ff ff ff ff ff ff ff`: The moment in time 1969-12-31T23:59:59.999Z. - -==== Timestamp +A date-time with an offset from UTC/Greenwich in the ISO-8601 calendar system, such as 2007-12-03T10:15:30+01:00. -Format: The same as `Date`. +Format: `{year}{month}{day}{time}{offset}` -==== Class +Where: -Format: A `String` containing the fqcn. +- `{year}` is an `Int` from -999,999,999 to 999,999,999. +- `{month}` is a `Byte` to represent the month, from 1 (January) to 12 (December) +- `{day}` is a `Byte` from 1 to 31. +- `{time}` is a `Long` to represent nanoseconds since midnight, from 0 to 86399999999999 +- `{offset}` is an `Int` to represent total zone offset in seconds, from -64800 (-18:00) to 64800 (+18:00). ==== Double @@ -219,15 +184,24 @@ Example values ==== List -An ordered collection of items. +An ordered collection of items. The format depends on the {value_flag}. -Format: `{length}{item_0}...{item_n}` +Format (value_flag=0x00): `{length}{item_0}...{item_n}` + +Where: + +- `{length}` is an `Int` describing the length of the collection. +- `{item_0}...{item_n}` are the items of the list. `{item_i}` is a fully qualified typed value composed of +`{type_code}{type_info}{value_flag}{value}`. + +Format (value_flag=0x02): `{length}{item_0}{bulk_0}...{item_n}{bulk_n}` Where: - `{length}` is an `Int` describing the length of the collection. - `{item_0}...{item_n}` are the items of the list. `{item_i}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}`. +- `{bulk_0}...{bulk_n}` are `Int` that represent how many times that item should be repeated in the expanded list. ==== Set @@ -237,7 +211,7 @@ Format: Same as `List`. ==== Map -A dictionary of keys to values. +A dictionary of keys to values. A {value_flag} equal to 0x02 means that the map is ordered. Format: `{length}{item_0}...{item_n}` @@ -265,15 +239,29 @@ Format: `{id}{label}{inVId}{inVLabel}{outVId}{outVLabel}{parent}{properties}` Where: - `{id}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}`. -- `{label}` is a `String` value. +- `{label}` is a `List` {value}. - `{inVId}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}`. -- `{inVLabel}` is a `String` value. +- `{inVLabel}` is a `List` {value}. - `{outVId}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}`. -- `{outVLabel}` is a `String` value. +- `{outVLabel}` is a `List` {value}. - `{parent}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}` which contains the parent `Vertex`. Note that as TinkerPop currently send "references" only, this value will always be `null`. -- `{properties}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}` which contains -the properties for the edge. Note that as TinkerPop currently send "references" only this value will always be `null`. +- `{properties}` is a `List` of `Property` objects. + +Example values: + +[source,text] +---- +01 00 00 00 00 0d id is 13 +00 00 00 01 03 00 00 00 00 08 64 65 76 65 6c 6f 70 73 label is a size 1 list with string 'develops' +01 00 00 00 00 0a inVId is 10 +00 00 00 01 03 00 00 00 00 08 73 6f 66 74 77 61 72 65 inVLabel is a size 1 list with string 'software' +01 00 00 00 00 01 outVId is 1 +00 00 00 01 03 00 00 00 00 06 70 65 72 73 6f 6e outVLabel is a size 1 list with string 'person' +fe 01 parent is always null +09 00 00 00 00 01 properties is a size 1 list +0f 00 00 00 00 05 73 69 6e 63 65 01 00 00 00 07 d9 fe 01 property with key 'since' and value 2009 and null parent +---- ==== Path @@ -338,9 +326,23 @@ Format: `{id}{label}{properties}` Where: - `{id}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}`. -- `{label}` is a `String` value. -- `{properties}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}` which contains -properties. Note that as TinkerPop currently send "references" only, this value will always be `null`. +- `{label}` is a `List` {value}. +- `{properties}` is a `List` of `VertexProperty` values. + +Example values: + +[source,text] +---- +01 00 00 00 00 01 id is int 1 +00 00 00 01 03 00 00 00 00 06 70 65 72 73 6f 6e label is size 1 list with string 'person' +09 00 00 00 00 01 12 00 02 00 00 00 00 00 00 00 00 09 properties is a size 1 list with VertexProperty id 9 +00 00 00 01 03 00 00 00 00 08 6c 6f 63 61 74 69 6f 6e VertexProperty label is string 'location' +03 00 00 00 00 08 73 61 6e 74 61 20 66 65 VertexProperty value is string 'santa fe' +fe 01 VertexProperty parent is always null +09 00 00 00 00 01 VertexProperty has a size 1 list +0f 00 00 00 00 09 73 74 61 72 74 54 69 6d 65 metaproperty with string key 'startTime' +01 00 00 00 07 d5 fe 01 VertexProperty metaproperty value is 2005 with null parent +---- ==== VertexProperty @@ -349,106 +351,40 @@ Format: `{id}{label}{value}{parent}{properties}` Where: - `{id}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}`. -- `{label}` is a `String` value. +- `{label}` is a `List` {value}. - `{value}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}`. - `{parent}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}` which contains the parent `Vertex`. Note that as TinkerPop currently send "references" only, this value will always be `null`. -- `{properties}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}` which contains -properties. Note that as TinkerPop currently send "references" only, this value will always be `null`. - -==== Barrier - -Format: a fully qualified single `String` representing the enum value. - -==== Binding - -Format: `{key}{value}` - -Where: - -- `{key}` is a `String` value. -- `{value}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}`. - -==== Bytecode - -Format: `{steps_length}{step_0}...{step_n}{sources_length}{source_0}...{source_n}` - -Where: - -* `{steps_length}` is an `Int` value describing the amount of steps. -* `{step_i}` is composed of `{name}{values_length}{value_0}...{value_n}`, where: -** `{name}` is a String. -** `{values_length}` is an `Int` describing the amount values. -** `{value_i}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}` describing the step argument. -* `{sources_length}` is an `Int` value describing the amount of source instructions. -* `{source_i}` is composed of `{name}{values_length}{value_0}...{value_n}`, where: -** `{name}` is a `String`. -** `{values_length}` is an `Int` describing the amount values. -** `{value_i}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}`. - -==== Cardinality - -Format: a fully qualified single `String` representing the enum value. +- `{properties}` is a `List` of `Property` objects. -==== Column +Example values: -Format: a fully qualified single `String` representing the enum value. +[source,text] +---- +02 00 00 00 00 00 00 00 00 00 id is Long 0 +00 00 00 01 03 00 00 00 00 04 6e 61 6d 65 label is size 1 list with string 'name' +03 00 00 00 00 05 6d 61 72 6b 6f value is string 'marko' +fe 01 parent is always null +09 00 00 00 00 00 metaproperties is empty list +---- ==== Direction Format: a fully qualified single `String` representing the enum value. -==== Operator - -Format: a fully qualified single `String` representing the enum value. - -==== Order - -Format: a fully qualified single `String` representing the enum value. - -==== Pick - -Format: a fully qualified single `String` representing the enum value. - -==== Pop - -Format: a fully qualified single `String` representing the enum value. - -==== Lambda - -Format: `{language}{script}{arguments_length}` -Where: - -- `{language}` is a `String`. -- `{script}` is a `String`. -- `{arguments_length}` is an `Int`. - -==== P - -Format: `{name}{values_length}{value_0}...{value_n}` - -Where: - -- `{name}` is a String. -- `{values_length}` is an `Int` describing the amount values. -- `{value_i}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}`. - -==== Scope +Example values: -Format: a fully qualified single `String` representing the enum value. +- `00 00 00 03 4F 55 54`: OUT +- `00 00 00 02 49 4E`: IN ==== T Format: a fully qualified single `String` representing the enum value. -==== Traverser - -Format: `{bulk}{value}` - -Where: +Example values: -- `{bulk}` is a `Long`. -- `{value}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}`. +- `00 00 00 05 6C 61 62 65 6C`: label +- `00 00 00 02 69 64`: id ==== BigDecimal @@ -485,9 +421,14 @@ Example values of the two's complement `{value}`: ==== Byte -An unsigned 8-bit integer. +Format: 1-byte two's complement integer. -==== ByteBuffer +Example values: + +- `01`: 8-bit integer number 1. +- `ff`: 8-bit integer number -1. + +==== Binary Format: `{length}{value}` @@ -500,42 +441,14 @@ Where: Format: 2-byte two's complement integer. -==== Boolean - -Format: A single byte containing the value `0x01` when it's `true` and `0` otherwise. - -==== TextP - -Format: `{predicate}{values_length}{value_0}...{value_n}` - -Where: - -- `{name}` is a String. -- `{values_length}` is an `Int` describing the amount values. -- `{value_i}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}`. - -==== TraversalStrategy - -Format: `{strategy_class}{configuration}` - -Where: - -- `{strategy_class}` is a `Class` that is of type `TraversalStrategy`. -- `{configuration}` is a `Map` of data used to configure the strategy that will be given to a `TraversalStrategy` `create(Configuration)` method. - -==== BulkSet - -Format: `{length}{item_0}...{item_n}` +Example values: -Where: +- `00 01`: 16-bit integer number 1. +- `01 02`: 16-bit integer number 258. -- `{length}` is an `Int` describing the length of the `BulkSet`. -- `{item_0}...{item_n}` are the items of the `BulkSet`. `{item_i}` is a sequence of a fully qualified typed value composed of -`{type_code}{type_info}{value_flag}{value}` followed by the "bulk" which is a `Long` value. +==== Boolean -If the implementing language does not have a `BulkSet` object to deserialize into, this format can be coerced to a -`List` and still be considered compliant with Gremlin. Simply "expand the bulk" by adding the item to the `List` the -number of times specified by the bulk. +Format: A single byte containing the value `0x01` when it's `true` and `0` otherwise. ==== Tree @@ -547,59 +460,58 @@ Where: - `{item_0}...{item_n}` are the items of the `Tree`. `{item_i}` is composed of a `{key}` which is a fully-qualified typed value followed by a `{Tree}`. -==== Metrics +==== Marker -Format: `{id}{name}{duration}{counts}{annotations}{nested_metrics}` +A 1-byte marker used to separate the end of the data and the beginning of the status of a `ResponseMessage`. This is +mainly used by language variants during deserialization. -Where: +Format: 1-byte integer with a value of `00`. -- `{id}` is a `String` representing the identifier. -- `{name}` is a `String` representing the name. -- `{duration}` is a `Long` describing the duration in nanoseconds. -- `{counts}` is a `Map` composed by `String` keys and `Long` values. -- `{annotations}` is a `Map` composed by `String` keys and a value of any type. -- `{nested_metrics}` is a `List` composed by `Metrics` items. +==== CompositePDT -==== TraversalMetrics +A composite custom type, represented as a type and a map of values. -Format: `{duration}{metrics}` +Format: `{type}{fields}` Where: -- `{duration}` is a `Long` describing the duration in nanoseconds. -- `{metrics}` is a `List` composed by `Metrics` items. +- `{type}` is a `String` containing the implementation specific text identifier of the custom type. +- `{fields}` is a `Map` representing the fields of the composite type. -==== Merge - -Format: a single `String` representing the enum value. - -==== DT +Example values: -Format: a single `String` representing the enum value. +[source,text] +---- +03 00 00 00 00 05 50 6F 69 6E 74: the string "Point" +0A 00 00 00 00 02 31 30: length 2 map header +03 00 00 00 00 01 78 01 00 00 00 00 01: {x:1} +03 00 00 00 00 01 79 01 00 00 00 00 02: {y:2} +---- -==== Custom +==== PrimitivePDT -A custom type, represented as a blob value. +A primitive custom type, represented as a type and the stringified value. -Type Info: `{name}{custom_type_info}` +Format: `{type}{value}` Where: -- `{name}` is a `String` containing the implementation specific text identifier of the custom type. -- `{custom_type_info}` is a `ByteBuffer` representing the additional type information, specially useful -for complex custom types. - -Value format: `{blob}` +- `{type}` is a `String` containing the implementation specific text identifier of the custom type. +- `{value}` is a `String` representing the string version of the value. -Where: +Example values: -- `{blob}` is a `ByteBuffer`. +[source,text] +---- +03 00 00 00 00 05 55 69 6E 74 38: the string "Uint8" +03 00 00 00 00 02 31 30: the string "10" +---- ==== Unspecified Null Object A `null` value for an unspecified Object value. -It's represented using the null `{value_flag}` set and no sequence of bytes. +It's represented using the null `{value_flag}` set and no sequence of bytes (which is `FE 01`). ==== Char @@ -630,126 +542,6 @@ Where: - `{seconds}` is a `Long`. - `{nanos}` is an `Int`. -==== InetAddress - -Format: Same as `ByteBuffer`, having only 4 byte or 16 byte sequences allowed. - -==== Instant - -An instantaneous point on the time-line. - -Format: `{seconds}{nanos}` - -Where: - -- `{seconds}` is a `Long`. -- `{nanos}` is an `Int`. - -==== LocalDate - -A date without a time-zone in the ISO-8601 calendar system. - -Format: `{year}{month}{day}` - -Where: - -- `{year}` is an `Int` from -999,999,999 to 999,999,999. -- `{month}` is a `Byte` to represent the month, from 1 (January) to 12 (December) -- `{day}` is a `Byte` from 1 to 31. - -==== LocalDateTime - -Format: `{date}{time}` - -Where: - -- `{date}` is `LocalDate`. -- `{time}` is a `LocalTime`. - -==== LocalTime -A time without a time-zone in the ISO-8601 calendar system. - -Format: An 8 byte two's complement long representing nanoseconds since midnight. - -Valid values are in the range 0 to 86399999999999 - -==== MonthDay - -A month-day in the ISO-8601 calendar system. - -Format: `{month}{day}` - -Where: - -- `{month}` is `Byte` value from 1 to 12. -- `{day}` is `Byte` value from 1 to 31. - -==== OffsetDateTime - -A date-time with an offset from UTC/Greenwich in the ISO-8601 calendar system, such as 2007-12-03T10:15:30+01:00. - -Format: `{local_date_time}{offset}` - -Where: - -- `{local_date_time}` is `LocalDateTime`. -- `{offset}` is `ZoneOffset`. - -==== OffsetTime - -A time with an offset from UTC/Greenwich in the ISO-8601 calendar system, such as 10:15:30+01:00. - -Format: `{local_time}{offset}` - -Where: - -- `{local_time}` is `LocalTime`. -- `{offset}` is `ZoneOffset`. - -==== Period - -A date-based amount of time in the ISO-8601 calendar system, such as '2 years, 3 months and 4 days'. - -Format: `{years}{month}{days}` - -Where: - -`{years}`, `{month}` and `{days}` are `Int` values. - -==== Year - -A year in the ISO-8601 calendar system, such as 2018. - -Format: An `Int` representing the years. - -==== YearMonth - -A year-month in the ISO-8601 calendar system, such as 2007-12. - -Format: `{year}{month}` - -Where: - -- `{year}` is an `Int`. -- `{month}` is a `Byte` from 1 to 12. - -==== ZonedDateTime - -A date-time with a time-zone in the ISO-8601 calendar system. - -Format: `{local_date_time}{zone_offset}` - -Where: - -- `{local_date_time}` is `LocalDateTime`. -- `{zone_offset}` is a `ZoneOffset`. - -==== ZoneOffset - -A time-zone offset from Greenwich/UTC, such as +02:00. - -Format: An `Int` representing total zone offset in seconds. - === Request and Response Messages Request and response messages are special container types used to represent messages from client to the server and the @@ -759,33 +551,32 @@ other way around. These messages are independent from the transport layer. Represents a message from the client to the server. -Format: `{version}{request_id}{op}{processor}{args}` +Format: `{version}{fields}{gremlin}` Where: - `{version}` is a `Byte` representing the specification version, with the most significant bit set to one. For this -version of the format, the value expected is `0x81` (`10000001`). -- `{request_id}` is a `UUID`. -- `{op}` is a `String`. -- `{processor}` is a `String`. -- `{args}` is a `Map`. +version of the format, the value expected is `0x84` (`10000004`). +- `{fields}` is a `Map`. +- `{gremlin}` is a `String`. -The total length is not part of the message as the transport layer will provide it. For example: WebSockets, -as a framing protocol, defines payload length. +The total length is not part of the message as the transport layer will provide it. For example: in HTTP, there is the +`Content-Length` header which defines the payload size. ==== Response Message -Format: `{version}{request_id}{status_code}{status_message}{status_attributes}{result_meta}{result_data}` +Format: `{version}{bulked}{result_data}{marker}{status_code}{status_message}{exception}` Where: - `{version}` is a `Byte` representing the protocol version, with the most significant bit set to one. For this version -of the protocol, the value expected is `0x81` (`10000001`). -- `{request_id}` is a nullable `UUID`. +of the protocol, the value expected is `0x84` (`10000004`). +- `{bulked}` is a `Byte` representing whether `{result_data}` is bulked. `00` is false and `01` is true. +- `{result_data}` is a sequence of fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}`. +If `{bulked}` is `01` then each value is followed by an 8-byte integer denoting the bulk of the preceding value. +- `{marker}` is a `Marker`. - `{status_code}` is an `Int`. - `{status_message}` is a nullable `String`. -- `{status_attributes}` is a `Map`. -- `{result_meta}` is a `Map`. -- `{result_data}` is a fully qualified typed value composed of `{type_code}{type_info}{value_flag}{value}`. +- `{exception}` is a nullable `String`. The total length is not part of the message as the transport layer will provide it. diff --git a/docs/src/dev/io/graphson.asciidoc b/docs/src/dev/io/graphson.asciidoc index 4b2f89a20ea..e12f830c07e 100644 --- a/docs/src/dev/io/graphson.asciidoc +++ b/docs/src/dev/io/graphson.asciidoc @@ -97,800 +97,316 @@ reflect a particular one. Servers will return the GraphSON version and variation and it could be different (or change) from server to server. When building applications, it is recommended that the mime type is made explicit on requests to avoid breaking changes or unexpected results. -[[graphson-1d0]] -== Version 1.0 +[[graphson-4]] +== Version 4.0 -Version 1.0 of GraphSON was released with TinkerPop 3.0.0. It is referred to by the following mime types: +Version 4.0 of GraphSON was first introduced on TinkerPop 4.0.0 and is represented by the +`application/vnd.gremlin-v4.0+json` mime type. There also exists an untyped version: +`application/vnd.gremlin-v3.0+json;types=false`. It is very similar to GraphSON 3.0, with just several key differences: +many underused or duplicated types have been removed, labels are now list of strings and request/response formats have +changed quite a bit, and custom types have been replaced with Provider Defined Type (PDT). -* `application/vnd.gremlin-v1.0+json` - types embedded -* `application/vnd.gremlin-v1.0+json;types=false` - no types embedded - -When types are embedded, GraphSON uses the standard -link:https://github.com/FasterXML/jackson-databind[Jackson] type embedding approach that writes the full Java class -name into a "@class" field in the JSON. While this approach isn't especially language agnostic it does at least give -some hint as to what the expected type is. +=== Core -This section focuses on non-embedded types and their formats as there was little usage of embedded types in generalized -object serialization use cases. The format was simply too cumbersome to parse of non-Jackson enabled libraries and the -use cases for it were limited. <> attempts to improve upon this limitation. +==== Boolean -=== Graph Structure +Matches the JSON Boolean and doesn't have type information. -==== Edge +[source,text] +---- +true +---- -[source,json] +[source,text] ---- -{ - "id" : 13, - "label" : "develops", - "type" : "edge", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : 10, - "outV" : 1, - "properties" : { - "since" : 2009 - } -} +true ---- -==== Path +==== Composite PDT + +JSON Object with two required keys: "type" and "fields" + +"type" is a JSON String + +"fields" is a `g:Map` [source,json] ---- { - "labels" : [ [ ], [ ], [ ] ], - "objects" : [ { - "id" : 1, - "label" : "person", - "type" : "vertex", - "properties" : { - "name" : [ { - "id" : 0, - "value" : "marko" - } ], - "location" : [ { - "id" : 6, - "value" : "san diego", - "properties" : { - "startTime" : 1997, - "endTime" : 2001 - } - }, { - "id" : 7, - "value" : "santa cruz", - "properties" : { - "startTime" : 2001, - "endTime" : 2004 - } - }, { - "id" : 8, - "value" : "brussels", - "properties" : { - "startTime" : 2004, - "endTime" : 2005 - } - }, { - "id" : 9, - "value" : "santa fe", - "properties" : { - "startTime" : 2005 - } - } ] - } - }, { - "id" : 10, - "label" : "software", - "type" : "vertex", - "properties" : { - "name" : [ { - "id" : 4, - "value" : "gremlin" - } ] - } - }, { - "id" : 11, - "label" : "software", - "type" : "vertex", - "properties" : { - "name" : [ { - "id" : 5, - "value" : "tinkergraph" - } ] + "@type": "g:CompositePdt", + "@value": { + "type": "tinkerId", + "fields": { + "@type": "g:Map", + "@value": [ + "intId", + { + "@type": "g:Int32", + "@value": -1360894799 + }, + "strId", + "0" + ] } - } ] + } } ---- -==== Property - [source,json] ---- { - "key" : "since", - "value" : 2009 + "type": "tinkerId", + "fields": { + "intId": -1360894799, + "strId": "0" + } } ---- -==== TinkerGraph +==== DateTime -`TinkerGraph` has a custom serializer that is registered as part of the `TinkerIoRegistry`. +JSON String representing ISO-8601 format for datetime with offset. [source,json] ---- { - "vertices" : [ { - "id" : 1, - "label" : "person", - "type" : "vertex", - "properties" : { - "name" : [ { - "id" : 0, - "value" : "marko" - } ], - "location" : [ { - "id" : 6, - "value" : "san diego", - "properties" : { - "startTime" : 1997, - "endTime" : 2001 - } - }, { - "id" : 7, - "value" : "santa cruz", - "properties" : { - "startTime" : 2001, - "endTime" : 2004 - } - }, { - "id" : 8, - "value" : "brussels", - "properties" : { - "startTime" : 2004, - "endTime" : 2005 - } - }, { - "id" : 9, - "value" : "santa fe", - "properties" : { - "startTime" : 2005 - } - } ] - } - }, { - "id" : 7, - "label" : "person", - "type" : "vertex", - "properties" : { - "name" : [ { - "id" : 1, - "value" : "stephen" - } ], - "location" : [ { - "id" : 10, - "value" : "centreville", - "properties" : { - "startTime" : 1990, - "endTime" : 2000 - } - }, { - "id" : 11, - "value" : "dulles", - "properties" : { - "startTime" : 2000, - "endTime" : 2006 - } - }, { - "id" : 12, - "value" : "purcellville", - "properties" : { - "startTime" : 2006 - } - } ] - } - }, { - "id" : 8, - "label" : "person", - "type" : "vertex", - "properties" : { - "name" : [ { - "id" : 2, - "value" : "matthias" - } ], - "location" : [ { - "id" : 13, - "value" : "bremen", - "properties" : { - "startTime" : 2004, - "endTime" : 2007 - } - }, { - "id" : 14, - "value" : "baltimore", - "properties" : { - "startTime" : 2007, - "endTime" : 2011 - } - }, { - "id" : 15, - "value" : "oakland", - "properties" : { - "startTime" : 2011, - "endTime" : 2014 - } - }, { - "id" : 16, - "value" : "seattle", - "properties" : { - "startTime" : 2014 - } - } ] - } - }, { - "id" : 9, - "label" : "person", - "type" : "vertex", - "properties" : { - "name" : [ { - "id" : 3, - "value" : "daniel" - } ], - "location" : [ { - "id" : 17, - "value" : "spremberg", - "properties" : { - "startTime" : 1982, - "endTime" : 2005 - } - }, { - "id" : 18, - "value" : "kaiserslautern", - "properties" : { - "startTime" : 2005, - "endTime" : 2009 - } - }, { - "id" : 19, - "value" : "aachen", - "properties" : { - "startTime" : 2009 - } - } ] - } - }, { - "id" : 10, - "label" : "software", - "type" : "vertex", - "properties" : { - "name" : [ { - "id" : 4, - "value" : "gremlin" - } ] - } - }, { - "id" : 11, - "label" : "software", - "type" : "vertex", - "properties" : { - "name" : [ { - "id" : 5, - "value" : "tinkergraph" - } ] - } - } ], - "edges" : [ { - "id" : 13, - "label" : "develops", - "type" : "edge", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : 10, - "outV" : 1, - "properties" : { - "since" : 2009 - } - }, { - "id" : 14, - "label" : "develops", - "type" : "edge", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : 11, - "outV" : 1, - "properties" : { - "since" : 2010 - } - }, { - "id" : 15, - "label" : "uses", - "type" : "edge", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : 10, - "outV" : 1, - "properties" : { - "skill" : 4 - } - }, { - "id" : 16, - "label" : "uses", - "type" : "edge", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : 11, - "outV" : 1, - "properties" : { - "skill" : 5 - } - }, { - "id" : 17, - "label" : "develops", - "type" : "edge", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : 10, - "outV" : 7, - "properties" : { - "since" : 2010 - } - }, { - "id" : 18, - "label" : "develops", - "type" : "edge", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : 11, - "outV" : 7, - "properties" : { - "since" : 2011 - } - }, { - "id" : 19, - "label" : "uses", - "type" : "edge", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : 10, - "outV" : 7, - "properties" : { - "skill" : 5 - } - }, { - "id" : 20, - "label" : "uses", - "type" : "edge", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : 11, - "outV" : 7, - "properties" : { - "skill" : 4 - } - }, { - "id" : 21, - "label" : "develops", - "type" : "edge", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : 10, - "outV" : 8, - "properties" : { - "since" : 2012 - } - }, { - "id" : 22, - "label" : "uses", - "type" : "edge", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : 10, - "outV" : 8, - "properties" : { - "skill" : 3 - } - }, { - "id" : 23, - "label" : "uses", - "type" : "edge", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : 11, - "outV" : 8, - "properties" : { - "skill" : 3 - } - }, { - "id" : 24, - "label" : "uses", - "type" : "edge", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : 10, - "outV" : 9, - "properties" : { - "skill" : 5 - } - }, { - "id" : 25, - "label" : "uses", - "type" : "edge", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : 11, - "outV" : 9, - "properties" : { - "skill" : 3 - } - }, { - "id" : 26, - "label" : "traverses", - "type" : "edge", - "inVLabel" : "software", - "outVLabel" : "software", - "inV" : 11, - "outV" : 10 - } ] + "@type" : "gx:DateTime", + "@value" : "2007-12-03T10:15:30+01:00" } ---- -==== Vertex - -[source,json] +[source,text] ---- -{ - "id" : 1, - "label" : "person", - "type" : "vertex", - "properties" : { - "name" : [ { - "id" : 0, - "value" : "marko" - } ], - "location" : [ { - "id" : 6, - "value" : "san diego", - "properties" : { - "startTime" : 1997, - "endTime" : 2001 - } - }, { - "id" : 7, - "value" : "santa cruz", - "properties" : { - "startTime" : 2001, - "endTime" : 2004 - } - }, { - "id" : 8, - "value" : "brussels", - "properties" : { - "startTime" : 2004, - "endTime" : 2005 - } - }, { - "id" : 9, - "value" : "santa fe", - "properties" : { - "startTime" : 2005 - } - } ] - } -} +"2007-12-03T10:15:30+01:00" ---- -==== VertexProperty +==== Double + +A JSON Number with the same range as a IEEE754 double precision floating point or a JSON String with one of the +following values: "-Infinity", "Infinity", "NaN" [source,json] ---- { - "id" : 0, - "value" : "marko", - "label" : "name" + "@type" : "g:Double", + "@value" : 100.0 } ---- +[source,text] +---- +100.0 +---- -=== RequestMessage - -==== Authentication Response +==== Float -The following `RequestMessage` is an example of the response that should be made to a SASL-based authentication challenge. +A JSON Number with the same range as a IEEE754 single precision floating point or a JSON String with one of the +following values: "-Infinity", "Infinity", "NaN" [source,json] ---- { - "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", - "op" : "authentication", - "processor" : "", - "args" : { - "saslMechanism" : "PLAIN", - "sasl" : "AHN0ZXBocGhlbgBwYXNzd29yZA==" - } + "@type" : "g:Float", + "@value" : 100.0 } ---- -==== Session Eval - -The following `RequestMessage` is an example of a simple session request for a script evaluation with parameters. - -[source,json] +[source,text] ---- -{ - "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", - "op" : "eval", - "processor" : "session", - "args" : { - "gremlin" : "g.V(x)", - "language" : "gremlin-groovy", - "session" : "unique-session-identifier", - "bindings" : { - "x" : 1 - } - } -} +100.0 ---- -==== Session Eval Aliased +==== Integer -The following `RequestMessage` is an example of a session request for a script evaluation with an alias that binds the `TraversalSource` of "g" to "social". +A JSON Number with the same range as a 4-byte signed integer. [source,json] ---- { - "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", - "op" : "eval", - "processor" : "session", - "args" : { - "gremlin" : "social.V(x)", - "language" : "gremlin-groovy", - "aliases" : { - "g" : "social" - }, - "session" : "unique-session-identifier", - "bindings" : { - "x" : 1 - } - } + "@type" : "g:Int32", + "@value" : 100 } ---- -==== Session Close - -The following `RequestMessage` is an example of a request to close a session. - -[source,json] +[source,text] ---- -{ - "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", - "op" : "close", - "processor" : "session", - "args" : { - "session" : "unique-session-identifier" - } -} +100 ---- -==== Sessionless Eval +==== List -The following `RequestMessage` is an example of a simple sessionless request for a script evaluation with parameters. +List is a JSON Array. The type is used to distinguish between different collection types that are also mapped to JSON +Array. The untyped version converts complex types to JSON String. [source,json] ---- { - "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", - "op" : "eval", - "processor" : "", - "args" : { - "gremlin" : "g.V(x)", - "language" : "gremlin-groovy", - "bindings" : { - "x" : 1 - } - } + "@type": "g:List", + "@value": [ + { + "@type": "g:Int32", + "@value": 1 + }, + "person", + true, + null + ] } ---- -==== Sessionless Eval Aliased +[source,text] +---- +[ 1, "person", true, null ] +---- + +==== Long -The following `RequestMessage` is an example of a sessionless request for a script evaluation with an alias that binds the `TraversalSource` of "g" to "social". +A JSON Number with the same range as a 8-byte signed integer. [source,json] ---- { - "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", - "op" : "eval", - "processor" : "", - "args" : { - "gremlin" : "social.V(x)", - "language" : "gremlin-groovy", - "aliases" : { - "g" : "social" - }, - "bindings" : { - "x" : 1 - } - } + "@type" : "g:Int64", + "@value" : 100 } ---- +[source,text] +---- +100 +---- -=== ResponseMessage - -==== Authentication Challenge +==== Map -When authentication is enabled, an initial request to the server will result in an authentication challenge. The typical response message will appear as follows, but handling it could be different dependending on the SASL implementation (e.g. multiple challenges may be requested in some cases, but not in the default provided by Gremlin Server). +Map is a JSON Array to provide the ability to allow for non-String keys, which is not possible in JSON. The untyped +version converts complex types to JSON String. [source,json] ---- { - "requestId" : "41d2e28a-20a4-4ab0-b379-d810dede3786", - "status" : { - "message" : "", - "code" : 407, - "attributes" : { } - }, - "result" : { - "data" : null, - "meta" : { } - } + "@type": "g:Map", + "@value": [ + { + "@type": "g:List", + "@value": [ + { + "@type": "g:Int32", + "@value": 1 + }, + { + "@type": "g:Int32", + "@value": 2 + }, + { + "@type": "g:Int32", + "@value": 3 + } + ] + }, + null, + "test", + { + "@type": "g:Int32", + "@value": 123 + }, + { + "@type": "gx:OffsetDateTime", + "@value": "2024-09-02T10:30Z" + }, + "red" + ] } ---- -==== Standard Result - -The following `ResponseMessage` is a typical example of the typical successful response Gremlin Server will return when returning results from a script. - [source,json] ---- { - "requestId" : "41d2e28a-20a4-4ab0-b379-d810dede3786", - "status" : { - "message" : "", - "code" : 200, - "attributes" : { } - }, - "result" : { - "data" : [ { - "id" : 1, - "label" : "person", - "type" : "vertex", - "properties" : { - "name" : [ { - "id" : 0, - "value" : "marko" - } ], - "location" : [ { - "id" : 6, - "value" : "san diego", - "properties" : { - "startTime" : 1997, - "endTime" : 2001 - } - }, { - "id" : 7, - "value" : "santa cruz", - "properties" : { - "startTime" : 2001, - "endTime" : 2004 - } - }, { - "id" : 8, - "value" : "brussels", - "properties" : { - "startTime" : 2004, - "endTime" : 2005 - } - }, { - "id" : 9, - "value" : "santa fe", - "properties" : { - "startTime" : 2005 - } - } ] - } - } ], - "meta" : { } - } + "[1, 2, 3]": null, + "test": 123, + "2024-09-02T10:30Z": "red" } ---- -[[graphson-2d0]] -== Version 2.0 - -Version 2.0 of GraphSON was first introduced on TinkerPop 3.2.2. It was designed to be less tied to -link:https://github.com/FasterXML/jackson-databind[Jackson] (a JVM library) and to be less lossy as it pertained to -types. While the <> section focused on GraphSON without embedded types, GraphSON 2.0 will -do the opposite as embedded types is the expected manner in which non-JVM languages will interact with TinkerPop. +==== Null -GraphSON 2.0 is referred to by the following mime types: +Matches the JSON Null and doesn't have type information. -* `application/vnd.gremlin-v2.0+json` - Values are typed by way of a "complex object" that defines a `@typeId` and -`@value`. The `@typeId` is composed of two parts: a namespace and a type name, in the format "namespace:typename". A -namespace allows TinkerPop providers and users to categorize custom types that they may implement and avoid collision -with existing TinkerPop types. By default, TinkerPop types will have the namespace "g" (or "gx" for "extended" types). -* `application/vnd.gremlin-v2.0+json;types=false` - Values do not have their types embedded in the JSON. This format -does not follow the 1.0 untyped format in that it does not include a "type" field for `Vertex` and `Edge` objects and -it serializes property values in those graph objects with a `label` field which is redundant as the "key" field for -that property will already represent that value. - -=== Core - -==== Class +[source,text] +---- +null +---- -[source,json] +[source,text] ---- -{ - "@type" : "g:Class", - "@value" : "java.io.File" -} +null ---- -==== Date +==== Primitive PDT -Representing a millisecond-precision offset from the unix epoch. In Java, it is simply `Date.getTime()`. +JSON Object with two required keys: "type" and "value" + +"type" is a JSON String + +"value" is a JSON String [source,json] ---- { - "@type" : "g:Date", - "@value" : 1481750076295 + "@type": "g:PrimitivePdt", + "@value": { + "type": "tinkerId", + "value": "-1360894799" + } } ---- -==== Double - -While the `@value` is expected to be a JSON number, it might also be a `String` of `NaN`, `Infinity` or `-Infinity`. - [source,json] ---- { - "@type" : "g:Double", - "@value" : 100.0 + "type": "tinkerId", + "value": "-1360894799" } ---- -==== Float +==== Set + +A JSON Array. The untyped version converts complex types to JSON String. [source,json] ---- { - "@type" : "g:Float", - "@value" : 100.0 + "@type": "g:Set", + "@value": [ + null, + { + "@type": "g:Int32", + "@value": 2 + }, + "person", + true + ] } ---- -==== Integer - -[source,json] +[source,text] ---- -{ - "@type" : "g:Int32", - "@value" : 100 -} +[ null, 2, "person", true ] ---- -==== Long +==== String -[source,json] +Matches the JSON String and doesn't have type information. + +[source,text] ---- -{ - "@type" : "g:Int64", - "@value" : 100 -} +"abc" ---- -==== Timestamp - -[source,json] +[source,text] ---- -{ - "@type" : "g:Timestamp", - "@value" : 1481750076295 -} +"abc" ---- ==== UUID +JSON String form of UUID. + [source,json] ---- { @@ -899,4634 +415,2412 @@ While the `@value` is expected to be a JSON number, it might also be a `String` } ---- +[source,text] +---- +"41d2e28a-20a4-4ab0-b379-d810dede3786" +---- === Graph Structure ==== Edge +JSON Object (required keys are: id, label, inVLabel, outVLabel, inV, outV, properties) + +"id", "inV", "outV" is any GraphSON 4.0 type + +"label", "inVLabel", "outVLabel" value is a `g:List` of `String` + +"properties" is an Object containing "name" to `g:Property` mappings + +The untyped version has one additional required key "type" which is always "vertex". + [source,json] ---- { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 13 + "@type": "g:Edge", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 13 + }, + "label": { + "@type": "g:List", + "@value": [ + "develops" + ] }, - "label" : "develops", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 + "inVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] }, - "outV" : { - "@type" : "g:Int32", - "@value" : 1 + "outVLabel": { + "@type": "g:List", + "@value": [ + "person" + ] }, - "properties" : { - "since" : { - "@type" : "g:Int32", - "@value" : 2009 + "inV": { + "@type": "g:Int32", + "@value": 10 + }, + "outV": { + "@type": "g:Int32", + "@value": 1 + }, + "properties": { + "since": { + "@type": "g:Property", + "@value": { + "key": "since", + "value": { + "@type": "g:Int32", + "@value": 2009 + } + } } } } } ---- -==== Path - [source,json] ---- { - "@type" : "g:Path", - "@value" : { - "labels" : [ [ ], [ ], [ ] ], - "objects" : [ { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "person" - } - }, { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "label" : "software", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 4 - }, - "value" : "gremlin", - "vertex" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "label" : "name" - } - } ] - } - } - }, { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "label" : "software", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 5 - }, - "value" : "tinkergraph", - "vertex" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "label" : "name" - } - } ] - } - } - } ] + "id": 13, + "label": [ + "develops" + ], + "type": "edge", + "inVLabel": [ + "software" + ], + "outVLabel": [ + "person" + ], + "inV": 10, + "outV": 1, + "properties": { + "since": 2009 } } ---- -==== Property - -[source,json] ----- -{ - "@type" : "g:Property", - "@value" : { - "key" : "since", - "value" : { - "@type" : "g:Int32", - "@value" : 2009 - }, - "element" : { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 13 - }, - "label" : "develops", - "outV" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - } - } - } - } -} ----- +==== Graph -==== StarGraph +`TinkerGraph` has a custom serializer that is registered as part of the `TinkerIoRegistry`. Graph is a JSON Object with +two required keys: "vertices" and "edges" + +"vertices" is an Array of `g:Vertex` + +"edges" is an Array of `g:Edge` [source,json] ---- { - "starVertex" : { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 0 - }, - "value" : "marko", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "name" - } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 6 - }, - "value" : "san diego", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 1997 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2001 + "@type": "tinker:graph", + "@value": { + "vertices": [ + { + "@type": "g:Vertex", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 1 + }, + "label": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "properties": { + "name": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 0 + }, + "value": "marko", + "label": { + "@type": "g:List", + "@value": [ + "name" + ] + } + } } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 7 - }, - "value" : "santa cruz", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2001 + ], + "location": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 6 + }, + "value": "san diego", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 1997 + }, + "endTime": { + "@type": "g:Int32", + "@value": 2001 + } + } + } }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2004 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 8 - }, - "value" : "brussels", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2004 + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 7 + }, + "value": "santa cruz", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2001 + }, + "endTime": { + "@type": "g:Int32", + "@value": 2004 + } + } + } }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2005 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 9 - }, - "value" : "santa fe", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2005 - } - } - } - } ] - } - } - } -} ----- - -==== TinkerGraph - -`TinkerGraph` has a custom serializer that is registered as part of the `TinkerIoRegistry`. - -[source,json] ----- -{ - "@type" : "tinker:graph", - "@value" : { - "vertices" : [ { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 0 - }, - "value" : "marko", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "name" - } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 6 - }, - "value" : "san diego", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 1997 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2001 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 7 - }, - "value" : "santa cruz", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2001 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2004 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 8 - }, - "value" : "brussels", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2004 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2005 + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 8 + }, + "value": "brussels", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2004 + }, + "endTime": { + "@type": "g:Int32", + "@value": 2005 + } + } } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 9 - }, - "value" : "santa fe", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2005 + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 9 + }, + "value": "santa fe", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2005 + } + } } } - } - } ] + ] + } } - } - }, { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 7 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 1 - }, - "value" : "stephen", - "vertex" : { - "@type" : "g:Int32", - "@value" : 7 - }, - "label" : "name" - } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 10 - }, - "value" : "centreville", - "vertex" : { - "@type" : "g:Int32", - "@value" : 7 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 1990 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2000 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 11 - }, - "value" : "dulles", - "vertex" : { - "@type" : "g:Int32", - "@value" : 7 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2000 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2006 + }, + { + "@type": "g:Vertex", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 7 + }, + "label": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "properties": { + "name": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 1 + }, + "value": "stephen", + "label": { + "@type": "g:List", + "@value": [ + "name" + ] + } } } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 12 - }, - "value" : "purcellville", - "vertex" : { - "@type" : "g:Int32", - "@value" : 7 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2006 + ], + "location": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 10 + }, + "value": "centreville", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 1990 + }, + "endTime": { + "@type": "g:Int32", + "@value": 2000 + } + } } - } - } - } ] - } - } - }, { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 8 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 2 - }, - "value" : "matthias", - "vertex" : { - "@type" : "g:Int32", - "@value" : 8 }, - "label" : "name" - } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 13 - }, - "value" : "bremen", - "vertex" : { - "@type" : "g:Int32", - "@value" : 8 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2004 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2007 + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 11 + }, + "value": "dulles", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2000 + }, + "endTime": { + "@type": "g:Int32", + "@value": 2006 + } + } } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 14 }, - "value" : "baltimore", - "vertex" : { - "@type" : "g:Int32", - "@value" : 8 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2007 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2011 + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 12 + }, + "value": "purcellville", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2006 + } + } } } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 15 - }, - "value" : "oakland", - "vertex" : { - "@type" : "g:Int32", - "@value" : 8 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2011 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2014 + ] + } + } + }, + { + "@type": "g:Vertex", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 8 + }, + "label": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "properties": { + "name": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 2 + }, + "value": "matthias", + "label": { + "@type": "g:List", + "@value": [ + "name" + ] + } } } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 16 - }, - "value" : "seattle", - "vertex" : { - "@type" : "g:Int32", - "@value" : 8 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2014 + ], + "location": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 13 + }, + "value": "bremen", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2004 + }, + "endTime": { + "@type": "g:Int32", + "@value": 2007 + } + } } - } - } - } ] - } - } - }, { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 9 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 3 - }, - "value" : "daniel", - "vertex" : { - "@type" : "g:Int32", - "@value" : 9 }, - "label" : "name" - } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 17 - }, - "value" : "spremberg", - "vertex" : { - "@type" : "g:Int32", - "@value" : 9 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 1982 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2005 + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 14 + }, + "value": "baltimore", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2007 + }, + "endTime": { + "@type": "g:Int32", + "@value": 2011 + } + } } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 18 }, - "value" : "kaiserslautern", - "vertex" : { - "@type" : "g:Int32", - "@value" : 9 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2005 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2009 + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 15 + }, + "value": "oakland", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2011 + }, + "endTime": { + "@type": "g:Int32", + "@value": 2014 + } + } } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 19 }, - "value" : "aachen", - "vertex" : { - "@type" : "g:Int32", - "@value" : 9 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2009 + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 16 + }, + "value": "seattle", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2014 + } + } } } - } - } ] - } - } - }, { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "label" : "software", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 4 - }, - "value" : "gremlin", - "vertex" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "label" : "name" - } - } ] - } - } - }, { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "label" : "software", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 5 - }, - "value" : "tinkergraph", - "vertex" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "label" : "name" - } - } ] - } - } - } ], - "edges" : [ { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 13 - }, - "label" : "develops", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "properties" : { - "since" : { - "@type" : "g:Int32", - "@value" : 2009 - } - } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 14 - }, - "label" : "develops", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "properties" : { - "since" : { - "@type" : "g:Int32", - "@value" : 2010 - } - } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 15 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "properties" : { - "skill" : { - "@type" : "g:Int32", - "@value" : 4 - } - } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 16 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "properties" : { - "skill" : { - "@type" : "g:Int32", - "@value" : 5 - } - } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 17 - }, - "label" : "develops", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 7 - }, - "properties" : { - "since" : { - "@type" : "g:Int32", - "@value" : 2010 - } - } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 18 - }, - "label" : "develops", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 7 - }, - "properties" : { - "since" : { - "@type" : "g:Int32", - "@value" : 2011 - } - } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 19 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 7 - }, - "properties" : { - "skill" : { - "@type" : "g:Int32", - "@value" : 5 - } - } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 20 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 7 - }, - "properties" : { - "skill" : { - "@type" : "g:Int32", - "@value" : 4 - } - } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 21 - }, - "label" : "develops", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 8 - }, - "properties" : { - "since" : { - "@type" : "g:Int32", - "@value" : 2012 - } - } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 22 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 8 - }, - "properties" : { - "skill" : { - "@type" : "g:Int32", - "@value" : 3 - } - } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 23 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 8 - }, - "properties" : { - "skill" : { - "@type" : "g:Int32", - "@value" : 3 - } - } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 24 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 9 - }, - "properties" : { - "skill" : { - "@type" : "g:Int32", - "@value" : 5 - } - } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 25 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 9 - }, - "properties" : { - "skill" : { - "@type" : "g:Int32", - "@value" : 3 + ] } } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 26 - }, - "label" : "traverses", - "inVLabel" : "software", - "outVLabel" : "software", - "inV" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 10 - } - } - } ] - } -} ----- - -==== Tree - -[source,json] ----- -{ - "@type" : "g:Tree", - "@value" : [ { - "key" : { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 0 - }, - "value" : "marko", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "name" - } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 6 - }, - "value" : "san diego", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 1997 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2001 + }, + { + "@type": "g:Vertex", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 9 + }, + "label": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "properties": { + "name": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 3 + }, + "value": "daniel", + "label": { + "@type": "g:List", + "@value": [ + "name" + ] + } } } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 7 - }, - "value" : "santa cruz", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2001 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2004 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 8 - }, - "value" : "brussels", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2004 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2005 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 9 - }, - "value" : "santa fe", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2005 - } - } - } - } ] - } - } - }, - "value" : { - "@type" : "g:Tree", - "@value" : [ { - "key" : { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "label" : "software", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 4 + ], + "location": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 17 }, - "value" : "gremlin", - "vertex" : { - "@type" : "g:Int32", - "@value" : 10 + "value": "spremberg", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] }, - "label" : "name" - } - } ] - } - } - }, - "value" : { - "@type" : "g:Tree", - "@value" : [ { - "key" : { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "label" : "software", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 5 - }, - "value" : "tinkergraph", - "vertex" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "label" : "name" + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 1982 + }, + "endTime": { + "@type": "g:Int32", + "@value": 2005 } - } ] - } - } - }, - "value" : { - "@type" : "g:Tree", - "@value" : [ ] - } - } ] - } - } ] - } - } ] -} ----- - -==== Vertex - -[source,json] ----- -{ - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 0 - }, - "value" : "marko", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "name" - } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 6 - }, - "value" : "san diego", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 1997 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2001 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 7 - }, - "value" : "santa cruz", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2001 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2004 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 8 - }, - "value" : "brussels", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2004 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2005 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 9 - }, - "value" : "santa fe", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2005 - } - } - } - } ] - } - } -} ----- - -==== VertexProperty - -[source,json] ----- -{ - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 0 - }, - "value" : "marko", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "name" - } -} ----- - - -=== Graph Process - -==== Barrier - -[source,json] ----- -{ - "@type" : "g:Barrier", - "@value" : "normSack" -} ----- - -==== Binding - -A "Binding" refers to a `Bytecode.Binding`. - -[source,json] ----- -{ - "@type" : "g:Binding", - "@value" : { - "key" : "x", - "value" : { - "@type" : "g:Int32", - "@value" : 1 - } - } -} ----- - -==== Bytecode - -The following `Bytecode` example represents the traversal of `g.V().hasLabel('person').out().in().tree()`. Obviously the serialized `Bytecode` woudl be quite different for the endless variations of commands that could be used together in the Gremlin language. - -[source,json] ----- -{ - "@type" : "g:Bytecode", - "@value" : { - "step" : [ [ "V" ], [ "hasLabel", "person" ], [ "out" ], [ "in" ], [ "tree" ] ] - } -} ----- - -==== Cardinality - -[source,json] ----- -{ - "@type" : "g:Cardinality", - "@value" : "list" -} ----- - -==== Column - -[source,json] ----- -{ - "@type" : "g:Column", - "@value" : "keys" -} ----- - -==== Direction - -[source,json] ----- -{ - "@type" : "g:Direction", - "@value" : "OUT" -} ----- - -==== DT - -[source,json] ----- -{ - "@type" : "g:DT", - "@value" : "minute" -} ----- - -==== Lambda - -[source,json] ----- -{ - "@type" : "g:Lambda", - "@value" : { - "script" : "{ it.get() }", - "language" : "gremlin-groovy", - "arguments" : 1 - } -} ----- - -==== Merge - -[source,json] ----- -{ - "@type" : "g:Merge", - "@value" : "onMatch" -} ----- - -==== Metrics - -[source,json] ----- -{ - "@type" : "g:Metrics", - "@value" : { - "dur" : { - "@type" : "g:Double", - "@value" : 100.0 - }, - "counts" : { - "traverserCount" : { - "@type" : "g:Int64", - "@value" : 4 - }, - "elementCount" : { - "@type" : "g:Int64", - "@value" : 4 - } - }, - "name" : "TinkerGraphStep(vertex,[~label.eq(person)])", - "annotations" : { - "percentDur" : { - "@type" : "g:Double", - "@value" : 25.0 - } - }, - "id" : "7.0.0()", - "metrics" : [ { - "@type" : "g:Metrics", - "@value" : { - "dur" : { - "@type" : "g:Double", - "@value" : 100.0 - }, - "counts" : { - "traverserCount" : { - "@type" : "g:Int64", - "@value" : 7 - }, - "elementCount" : { - "@type" : "g:Int64", - "@value" : 7 - } - }, - "name" : "VertexStep(OUT,vertex)", - "annotations" : { - "percentDur" : { - "@type" : "g:Double", - "@value" : 25.0 - } - }, - "id" : "3.0.0()" - } - } ] - } -} ----- - -==== Operator - -[source,json] ----- -{ - "@type" : "g:Operator", - "@value" : "sum" -} ----- - -==== Order - -[source,json] ----- -{ - "@type" : "g:Order", - "@value" : "shuffle" -} ----- - -==== P - -[source,json] ----- -{ - "@type" : "g:P", - "@value" : { - "predicate" : "gt", - "value" : { - "@type" : "g:Int32", - "@value" : 0 - } - } -} ----- - -==== P within - -[source,json] ----- -{ - "@type" : "g:P", - "@value" : { - "predicate" : "within", - "value" : [ { - "@type" : "g:Int32", - "@value" : 1 - } ] - } -} ----- - -==== P without - -[source,json] ----- -{ - "@type" : "g:P", - "@value" : { - "predicate" : "without", - "value" : [ { - "@type" : "g:Int32", - "@value" : 1 - }, { - "@type" : "g:Int32", - "@value" : 2 - } ] - } -} ----- - -==== P and - -[source,json] ----- -{ - "@type" : "g:P", - "@value" : { - "predicate" : "and", - "value" : [ { - "@type" : "g:P", - "@value" : { - "predicate" : "gt", - "value" : { - "@type" : "g:Int32", - "@value" : 0 - } - } - }, { - "@type" : "g:P", - "@value" : { - "predicate" : "lt", - "value" : { - "@type" : "g:Int32", - "@value" : 10 - } - } - } ] - } -} ----- - -==== P or - -[source,json] ----- -{ - "@type" : "g:P", - "@value" : { - "predicate" : "or", - "value" : [ { - "@type" : "g:P", - "@value" : { - "predicate" : "gt", - "value" : { - "@type" : "g:Int32", - "@value" : 0 - } - } - }, { - "@type" : "g:P", - "@value" : { - "predicate" : "within", - "value" : [ { - "@type" : "g:Int32", - "@value" : -1 - }, { - "@type" : "g:Int32", - "@value" : -10 - }, { - "@type" : "g:Int32", - "@value" : -100 - } ] - } - } ] - } -} ----- - -==== Pick - -[source,json] ----- -{ - "@type" : "g:Pick", - "@value" : "any" -} ----- - -==== Pop - -[source,json] ----- -{ - "@type" : "g:Pop", - "@value" : "all" -} ----- - -==== Scope - -[source,json] ----- -{ - "@type" : "g:Scope", - "@value" : "local" -} ----- - -==== T - -[source,json] ----- -{ - "@type" : "g:T", - "@value" : "label" -} ----- - -==== TextP - -[source,json] ----- -{ - "@type" : "g:TextP", - "@value" : { - "predicate" : "containing", - "value" : "ark" - } -} ----- - -==== TraversalMetrics - -[source,json] ----- -{ - "@type" : "g:TraversalMetrics", - "@value" : { - "dur" : { - "@type" : "g:Double", - "@value" : 0.004 - }, - "metrics" : [ { - "@type" : "g:Metrics", - "@value" : { - "dur" : { - "@type" : "g:Double", - "@value" : 100.0 - }, - "counts" : { - "traverserCount" : { - "@type" : "g:Int64", - "@value" : 4 - }, - "elementCount" : { - "@type" : "g:Int64", - "@value" : 4 - } - }, - "name" : "TinkerGraphStep(vertex,[~label.eq(person)])", - "annotations" : { - "percentDur" : { - "@type" : "g:Double", - "@value" : 25.0 - } - }, - "id" : "7.0.0()" - } - }, { - "@type" : "g:Metrics", - "@value" : { - "dur" : { - "@type" : "g:Double", - "@value" : 100.0 - }, - "counts" : { - "traverserCount" : { - "@type" : "g:Int64", - "@value" : 13 - }, - "elementCount" : { - "@type" : "g:Int64", - "@value" : 13 - } - }, - "name" : "VertexStep(OUT,vertex)", - "annotations" : { - "percentDur" : { - "@type" : "g:Double", - "@value" : 25.0 - } - }, - "id" : "2.0.0()" - } - }, { - "@type" : "g:Metrics", - "@value" : { - "dur" : { - "@type" : "g:Double", - "@value" : 100.0 - }, - "counts" : { - "traverserCount" : { - "@type" : "g:Int64", - "@value" : 7 - }, - "elementCount" : { - "@type" : "g:Int64", - "@value" : 7 - } - }, - "name" : "VertexStep(OUT,vertex)", - "annotations" : { - "percentDur" : { - "@type" : "g:Double", - "@value" : 25.0 - } - }, - "id" : "3.0.0()" - } - }, { - "@type" : "g:Metrics", - "@value" : { - "dur" : { - "@type" : "g:Double", - "@value" : 100.0 - }, - "counts" : { - "traverserCount" : { - "@type" : "g:Int64", - "@value" : 1 - }, - "elementCount" : { - "@type" : "g:Int64", - "@value" : 1 - } - }, - "name" : "TreeStep", - "annotations" : { - "percentDur" : { - "@type" : "g:Double", - "@value" : 25.0 - } - }, - "id" : "4.0.0()" - } - } ] - } -} ----- - -==== Traverser - -[source,json] ----- -{ - "@type" : "g:Traverser", - "@value" : { - "bulk" : { - "@type" : "g:Int64", - "@value" : 1 - }, - "value" : { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 0 - }, - "value" : "marko", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "name" - } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 6 - }, - "value" : "san diego", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 1997 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2001 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 7 - }, - "value" : "santa cruz", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2001 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2004 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 8 - }, - "value" : "brussels", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2004 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2005 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 9 - }, - "value" : "santa fe", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2005 - } - } - } - } ] - } - } - } - } -} ----- - - -=== RequestMessage - -==== Authentication Response - -The following `RequestMessage` is an example of the response that should be made to a SASL-based authentication challenge. - -[source,json] ----- -{ - "requestId" : { - "@type" : "g:UUID", - "@value" : "cb682578-9d92-4499-9ebc-5c6aa73c5397" - }, - "op" : "authentication", - "processor" : "", - "args" : { - "saslMechanism" : "PLAIN", - "sasl" : "AHN0ZXBocGhlbgBwYXNzd29yZA==" - } -} ----- - -==== Session Eval - -The following `RequestMessage` is an example of a simple session request for a script evaluation with parameters. - -[source,json] ----- -{ - "requestId" : { - "@type" : "g:UUID", - "@value" : "cb682578-9d92-4499-9ebc-5c6aa73c5397" - }, - "op" : "eval", - "processor" : "session", - "args" : { - "gremlin" : "g.V(x)", - "language" : "gremlin-groovy", - "session" : "unique-session-identifier", - "bindings" : { - "x" : { - "@type" : "g:Int32", - "@value" : 1 - } - } - } -} ----- - -==== Session Eval Aliased - -The following `RequestMessage` is an example of a session request for a script evaluation with an alias that binds the `TraversalSource` of "g" to "social". - -[source,json] ----- -{ - "requestId" : { - "@type" : "g:UUID", - "@value" : "cb682578-9d92-4499-9ebc-5c6aa73c5397" - }, - "op" : "eval", - "processor" : "session", - "args" : { - "gremlin" : "social.V(x)", - "language" : "gremlin-groovy", - "aliases" : { - "g" : "social" - }, - "session" : "unique-session-identifier", - "bindings" : { - "x" : { - "@type" : "g:Int32", - "@value" : 1 - } - } - } -} ----- - -==== Session Close - -The following `RequestMessage` is an example of a request to close a session. - -[source,json] ----- -{ - "requestId" : { - "@type" : "g:UUID", - "@value" : "cb682578-9d92-4499-9ebc-5c6aa73c5397" - }, - "op" : "close", - "processor" : "session", - "args" : { - "session" : "unique-session-identifier" - } -} ----- - -==== Sessionless Eval - -The following `RequestMessage` is an example of a simple sessionless request for a script evaluation with parameters. - -[source,json] ----- -{ - "requestId" : { - "@type" : "g:UUID", - "@value" : "cb682578-9d92-4499-9ebc-5c6aa73c5397" - }, - "op" : "eval", - "processor" : "", - "args" : { - "gremlin" : "g.V(x)", - "language" : "gremlin-groovy", - "bindings" : { - "x" : { - "@type" : "g:Int32", - "@value" : 1 - } - } - } -} ----- - -==== Sessionless Eval Aliased - -The following `RequestMessage` is an example of a sessionless request for a script evaluation with an alias that binds the `TraversalSource` of "g" to "social". - -[source,json] ----- -{ - "requestId" : { - "@type" : "g:UUID", - "@value" : "cb682578-9d92-4499-9ebc-5c6aa73c5397" - }, - "op" : "eval", - "processor" : "", - "args" : { - "gremlin" : "social.V(x)", - "language" : "gremlin-groovy", - "aliases" : { - "g" : "social" - }, - "bindings" : { - "x" : { - "@type" : "g:Int32", - "@value" : 1 - } - } - } -} ----- - -=== ResponseMessage - -==== Authentication Challenge - -When authentication is enabled, an initial request to the server will result in an authentication challenge. The typical response message will appear as follows, but handling it could be different dependending on the SASL implementation (e.g. multiple challenges maybe requested in some cases, but not in the default provided by Gremlin Server). - -[source,json] ----- -{ - "requestId" : "41d2e28a-20a4-4ab0-b379-d810dede3786", - "status" : { - "message" : "", - "code" : 407, - "attributes" : { } - }, - "result" : { - "data" : null, - "meta" : { } - } -} ----- - -==== Standard Result - -The following `ResponseMessage` is a typical example of the typical successful response Gremlin Server will return when returning results from a script. - -[source,json] ----- -{ - "requestId" : "41d2e28a-20a4-4ab0-b379-d810dede3786", - "status" : { - "message" : "", - "code" : 200, - "attributes" : { } - }, - "result" : { - "data" : [ { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 0 - }, - "value" : "marko", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "name" - } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 6 - }, - "value" : "san diego", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 1997 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2001 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 7 - }, - "value" : "santa cruz", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2001 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2004 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 8 - }, - "value" : "brussels", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2004 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2005 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 9 - }, - "value" : "santa fe", - "vertex" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2005 - } - } - } - } ] - } - } - } ], - "meta" : { } - } -} ----- - - -=== Extended - -Note that the "extended" types require the addition of the separate `GraphSONXModuleV2` module as follows: - -[source,java] ----- -mapper = GraphSONMapper.build(). - typeInfo(TypeInfo.PARTIAL_TYPES). - addCustomModule(GraphSONXModuleV2.build()). - version(GraphSONVersion.V2_0).create().createMapper() ----- - -==== BigDecimal - -[source,json] ----- -{ - "@type" : "gx:BigDecimal", - "@value" : 123456789987654321123456789987654321 -} ----- - -==== BigInteger - -[source,json] ----- -{ - "@type" : "gx:BigInteger", - "@value" : 123456789987654321123456789987654321 -} ----- - -==== Byte - -[source,json] ----- -{ - "@type" : "gx:Byte", - "@value" : 1 -} ----- - -==== ByteBuffer - -[source,json] ----- -{ - "@type" : "gx:ByteBuffer", - "@value" : "c29tZSBieXRlcyBmb3IgeW91" -} ----- - -==== Char - -[source,json] ----- -{ - "@type" : "gx:Char", - "@value" : "x" -} ----- - -==== Duration - -The following example is a `Duration` of five days. - -[source,json] ----- -{ - "@type" : "gx:Duration", - "@value" : "PT120H" -} ----- - -==== InetAddress - -[source,json] ----- -{ - "@type" : "gx:InetAddress", - "@value" : "localhost" -} ----- - -==== Instant - -[source,json] ----- -{ - "@type" : "gx:Instant", - "@value" : "2016-12-14T16:39:19.349Z" -} ----- - -==== LocalDate - -[source,json] ----- -{ - "@type" : "gx:LocalDate", - "@value" : "2016-01-01" -} ----- - -==== LocalDateTime - -[source,json] ----- -{ - "@type" : "gx:LocalDateTime", - "@value" : "2016-01-01T12:30" -} ----- - -==== LocalTime - -[source,json] ----- -{ - "@type" : "gx:LocalTime", - "@value" : "12:30:45" -} ----- - -==== MonthDay - -[source,json] ----- -{ - "@type" : "gx:MonthDay", - "@value" : "--01-01" -} ----- - -==== OffsetDateTime - -[source,json] ----- -{ - "@type" : "gx:OffsetDateTime", - "@value" : "2007-12-03T10:15:30+01:00" -} ----- - -==== OffsetTime - -[source,json] ----- -{ - "@type" : "gx:OffsetTime", - "@value" : "10:15:30+01:00" -} ----- - -==== Period - -The following example is a `Period` of one year, six months and fifteen days. - -[source,json] ----- -{ - "@type" : "gx:Period", - "@value" : "P1Y6M15D" -} ----- - -==== Short - -[source,json] ----- -{ - "@type" : "gx:Int16", - "@value" : 100 -} ----- - -==== Year - -The following example is of the `Year` "2016". - -[source,json] ----- -{ - "@type" : "gx:Year", - "@value" : "2016" -} ----- - -==== YearMonth - -The following example is a `YearMonth` of "June 2016" - -[source,json] ----- -{ - "@type" : "gx:YearMonth", - "@value" : "2016-06" -} ----- - -==== ZonedDateTime - -[source,json] ----- -{ - "@type" : "gx:ZonedDateTime", - "@value" : "2016-12-23T12:12:24.000000036+02:00[GMT+02:00]" -} ----- - -==== ZoneOffset - -The following example is a `ZoneOffset` of three hours, six minutes, and nine seconds. - -[source,json] ----- -{ - "@type" : "gx:ZoneOffset", - "@value" : "+03:06:09" -} ----- - -[[graphson-3d0]] -== Version 3.0 - -Version 3.0 of GraphSON was first introduced on TinkerPop 3.3.0 and is represented by the `application/vnd.gremlin-v3.0+json` -mime type. It was introduced as only having embedded types. It is quite similar to GraphSON 2.0 with embedded types -and in most cases will appear compatible to the eye, however there are some critical differences. GraphSON 2.0 relied -on JSON data types for collections like `Map` and `List`. In GraphSON 3.0, there is explicit typed support for `Map`, -`List` and `Set` as Gremlin relies on those types in quite specific ways that are not directly compatible with the -JSON definitions of those collections. In the case of `List` and `Set`, it was important to distinguish between the -two and for `Map` it was necessary to have the ability to return `Map` instances that did not have `String` keys -(e.g. `g.V().out().groupCount()`). - -As of TinkerPop 3.7.0, GraphSON 3.0 also has a typeless representation referenced by the -`application/vnd.gremlin-v3.0+json;types=false`. This format matches the format developed for 1.0. - -=== Core - -==== Class - -[source,json] ----- -{ - "@type" : "g:Class", - "@value" : "java.io.File" -} ----- - -==== Date - -Representing a millisecond-precision offset from the unix epoch. In Java, it is simply `Date.getTime()`. - -[source,json] ----- -{ - "@type" : "g:Date", - "@value" : 1481750076295 -} ----- - -==== Double - -[source,json] ----- -{ - "@type" : "g:Double", - "@value" : 100.0 -} ----- - -==== Float - -[source,json] ----- -{ - "@type" : "g:Float", - "@value" : 100.0 -} ----- - -==== Integer - -[source,json] ----- -{ - "@type" : "g:Int32", - "@value" : 100 -} ----- - -==== List - -List is used to distinguish between different collection types as JSON is not explicit enough for all of Gremlin's requirements. - -[source,json] ----- -{ - "@type" : "g:List", - "@value" : [ { - "@type" : "g:Int32", - "@value" : 1 - }, "person", true ] -} ----- - -==== Long - -[source,json] ----- -{ - "@type" : "g:Int64", - "@value" : 100 -} ----- - -==== Map - -Map is redefined so that to provide the ability to allow for non-String keys, which is not possible in JSON. - -[source,json] ----- -{ - "@type" : "g:Map", - "@value" : [ { - "@type" : "g:Date", - "@value" : 1481750076295 - }, "red", { - "@type" : "g:List", - "@value" : [ { - "@type" : "g:Int32", - "@value" : 1 - }, { - "@type" : "g:Int32", - "@value" : 2 - }, { - "@type" : "g:Int32", - "@value" : 3 - } ] - }, { - "@type" : "g:Date", - "@value" : 1481750076295 - }, "test", { - "@type" : "g:Int32", - "@value" : 123 - } ] -} ----- - -==== Set - -Allows a JSON collection to behave as a Set. - -[source,json] ----- -{ - "@type" : "g:Set", - "@value" : [ { - "@type" : "g:Int32", - "@value" : 1 - }, "person", true ] -} ----- - -==== Timestamp - -[source,json] ----- -{ - "@type" : "g:Timestamp", - "@value" : 1481750076295 -} ----- - -==== UUID - -[source,json] ----- -{ - "@type" : "g:UUID", - "@value" : "41d2e28a-20a4-4ab0-b379-d810dede3786" -} ----- - - -=== Graph Structure - -==== Edge - -[source,json] ----- -{ - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 13 - }, - "label" : "develops", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "properties" : { - "since" : { - "@type" : "g:Property", - "@value" : { - "key" : "since", - "value" : { - "@type" : "g:Int32", - "@value" : 2009 - } - } - } - } - } -} ----- - -==== Path - -[source,json] ----- -{ - "@type" : "g:Path", - "@value" : { - "labels" : { - "@type" : "g:List", - "@value" : [ { - "@type" : "g:Set", - "@value" : [ ] - }, { - "@type" : "g:Set", - "@value" : [ ] - }, { - "@type" : "g:Set", - "@value" : [ ] - } ] - }, - "objects" : { - "@type" : "g:List", - "@value" : [ { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "person" - } - }, { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "label" : "software" - } - }, { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "label" : "software" - } - } ] - } - } -} ----- - -==== Property - -[source,json] ----- -{ - "@type" : "g:Property", - "@value" : { - "key" : "since", - "value" : { - "@type" : "g:Int32", - "@value" : 2009 - } - } -} ----- - -==== TinkerGraph - -`TinkerGraph` has a custom serializer that is registered as part of the `TinkerIoRegistry`. - -[source,json] ----- -{ - "@type" : "tinker:graph", - "@value" : { - "vertices" : [ { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 0 - }, - "value" : "marko", - "label" : "name" - } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 6 - }, - "value" : "san diego", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 1997 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2001 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 7 - }, - "value" : "santa cruz", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2001 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2004 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 8 - }, - "value" : "brussels", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2004 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2005 - } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 9 - }, - "value" : "santa fe", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2005 - } - } - } - } ] - } - } - }, { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 7 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 1 + } + } }, - "value" : "stephen", - "label" : "name" - } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 10 + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 18 + }, + "value": "kaiserslautern", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2005 + }, + "endTime": { + "@type": "g:Int32", + "@value": 2009 + } + } + } }, - "value" : "centreville", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 1990 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2000 + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 19 + }, + "value": "aachen", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2009 + } + } } } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 11 - }, - "value" : "dulles", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2000 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2006 + ] + } + } + }, + { + "@type": "g:Vertex", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 10 + }, + "label": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "properties": { + "name": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 4 + }, + "value": "gremlin", + "label": { + "@type": "g:List", + "@value": [ + "name" + ] + } } } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 12 - }, - "value" : "purcellville", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2006 + ] + } + } + }, + { + "@type": "g:Vertex", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 11 + }, + "label": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "properties": { + "name": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 5 + }, + "value": "tinkergraph", + "label": { + "@type": "g:List", + "@value": [ + "name" + ] + } } } - } - } ] + ] + } } } - }, { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 8 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 2 - }, - "value" : "matthias", - "label" : "name" - } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 13 - }, - "value" : "bremen", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2004 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2007 + ], + "edges": [ + { + "@type": "g:Edge", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 13 + }, + "label": { + "@type": "g:List", + "@value": [ + "develops" + ] + }, + "inVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "outVLabel": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "inV": { + "@type": "g:Int32", + "@value": 10 + }, + "outV": { + "@type": "g:Int32", + "@value": 1 + }, + "properties": { + "since": { + "@type": "g:Property", + "@value": { + "key": "since", + "value": { + "@type": "g:Int32", + "@value": 2009 } } } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 14 - }, - "value" : "baltimore", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2007 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2011 + } + } + }, + { + "@type": "g:Edge", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 14 + }, + "label": { + "@type": "g:List", + "@value": [ + "develops" + ] + }, + "inVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "outVLabel": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "inV": { + "@type": "g:Int32", + "@value": 11 + }, + "outV": { + "@type": "g:Int32", + "@value": 1 + }, + "properties": { + "since": { + "@type": "g:Property", + "@value": { + "key": "since", + "value": { + "@type": "g:Int32", + "@value": 2010 } } } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 15 - }, - "value" : "oakland", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2011 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2014 + } + } + }, + { + "@type": "g:Edge", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 15 + }, + "label": { + "@type": "g:List", + "@value": [ + "uses" + ] + }, + "inVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "outVLabel": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "inV": { + "@type": "g:Int32", + "@value": 10 + }, + "outV": { + "@type": "g:Int32", + "@value": 1 + }, + "properties": { + "skill": { + "@type": "g:Property", + "@value": { + "key": "skill", + "value": { + "@type": "g:Int32", + "@value": 4 } } } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 16 - }, - "value" : "seattle", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2014 + } + } + }, + { + "@type": "g:Edge", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 16 + }, + "label": { + "@type": "g:List", + "@value": [ + "uses" + ] + }, + "inVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "outVLabel": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "inV": { + "@type": "g:Int32", + "@value": 11 + }, + "outV": { + "@type": "g:Int32", + "@value": 1 + }, + "properties": { + "skill": { + "@type": "g:Property", + "@value": { + "key": "skill", + "value": { + "@type": "g:Int32", + "@value": 5 } } } - } ] + } } - } - }, { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 9 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 3 - }, - "value" : "daniel", - "label" : "name" - } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 17 - }, - "value" : "spremberg", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 1982 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2005 + }, + { + "@type": "g:Edge", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 17 + }, + "label": { + "@type": "g:List", + "@value": [ + "develops" + ] + }, + "inVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "outVLabel": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "inV": { + "@type": "g:Int32", + "@value": 10 + }, + "outV": { + "@type": "g:Int32", + "@value": 7 + }, + "properties": { + "since": { + "@type": "g:Property", + "@value": { + "key": "since", + "value": { + "@type": "g:Int32", + "@value": 2010 } } } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 18 - }, - "value" : "kaiserslautern", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2005 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2009 + } + } + }, + { + "@type": "g:Edge", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 18 + }, + "label": { + "@type": "g:List", + "@value": [ + "develops" + ] + }, + "inVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "outVLabel": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "inV": { + "@type": "g:Int32", + "@value": 11 + }, + "outV": { + "@type": "g:Int32", + "@value": 7 + }, + "properties": { + "since": { + "@type": "g:Property", + "@value": { + "key": "since", + "value": { + "@type": "g:Int32", + "@value": 2011 } } } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 19 - }, - "value" : "aachen", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2009 + } + } + }, + { + "@type": "g:Edge", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 19 + }, + "label": { + "@type": "g:List", + "@value": [ + "uses" + ] + }, + "inVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "outVLabel": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "inV": { + "@type": "g:Int32", + "@value": 10 + }, + "outV": { + "@type": "g:Int32", + "@value": 7 + }, + "properties": { + "skill": { + "@type": "g:Property", + "@value": { + "key": "skill", + "value": { + "@type": "g:Int32", + "@value": 5 } } } - } ] - } - } - }, { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "label" : "software", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 4 - }, - "value" : "gremlin", - "label" : "name" - } - } ] - } - } - }, { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "label" : "software", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 5 - }, - "value" : "tinkergraph", - "label" : "name" - } - } ] + } } - } - } ], - "edges" : [ { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 13 - }, - "label" : "develops", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "properties" : { - "since" : { - "@type" : "g:Property", - "@value" : { - "key" : "since", - "value" : { - "@type" : "g:Int32", - "@value" : 2009 + }, + { + "@type": "g:Edge", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 20 + }, + "label": { + "@type": "g:List", + "@value": [ + "uses" + ] + }, + "inVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "outVLabel": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "inV": { + "@type": "g:Int32", + "@value": 11 + }, + "outV": { + "@type": "g:Int32", + "@value": 7 + }, + "properties": { + "skill": { + "@type": "g:Property", + "@value": { + "key": "skill", + "value": { + "@type": "g:Int32", + "@value": 4 + } } } } } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 14 - }, - "label" : "develops", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "properties" : { - "since" : { - "@type" : "g:Property", - "@value" : { - "key" : "since", - "value" : { - "@type" : "g:Int32", - "@value" : 2010 + }, + { + "@type": "g:Edge", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 21 + }, + "label": { + "@type": "g:List", + "@value": [ + "develops" + ] + }, + "inVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "outVLabel": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "inV": { + "@type": "g:Int32", + "@value": 10 + }, + "outV": { + "@type": "g:Int32", + "@value": 8 + }, + "properties": { + "since": { + "@type": "g:Property", + "@value": { + "key": "since", + "value": { + "@type": "g:Int32", + "@value": 2012 + } } } } } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 15 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "properties" : { - "skill" : { - "@type" : "g:Property", - "@value" : { - "key" : "skill", - "value" : { - "@type" : "g:Int32", - "@value" : 4 + }, + { + "@type": "g:Edge", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 22 + }, + "label": { + "@type": "g:List", + "@value": [ + "uses" + ] + }, + "inVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "outVLabel": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "inV": { + "@type": "g:Int32", + "@value": 10 + }, + "outV": { + "@type": "g:Int32", + "@value": 8 + }, + "properties": { + "skill": { + "@type": "g:Property", + "@value": { + "key": "skill", + "value": { + "@type": "g:Int32", + "@value": 3 + } } } } } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 16 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "properties" : { - "skill" : { - "@type" : "g:Property", - "@value" : { - "key" : "skill", - "value" : { - "@type" : "g:Int32", - "@value" : 5 + }, + { + "@type": "g:Edge", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 23 + }, + "label": { + "@type": "g:List", + "@value": [ + "uses" + ] + }, + "inVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "outVLabel": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "inV": { + "@type": "g:Int32", + "@value": 11 + }, + "outV": { + "@type": "g:Int32", + "@value": 8 + }, + "properties": { + "skill": { + "@type": "g:Property", + "@value": { + "key": "skill", + "value": { + "@type": "g:Int32", + "@value": 3 + } } } } } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 17 - }, - "label" : "develops", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 7 - }, - "properties" : { - "since" : { - "@type" : "g:Property", - "@value" : { - "key" : "since", - "value" : { - "@type" : "g:Int32", - "@value" : 2010 + }, + { + "@type": "g:Edge", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 24 + }, + "label": { + "@type": "g:List", + "@value": [ + "uses" + ] + }, + "inVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "outVLabel": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "inV": { + "@type": "g:Int32", + "@value": 10 + }, + "outV": { + "@type": "g:Int32", + "@value": 9 + }, + "properties": { + "skill": { + "@type": "g:Property", + "@value": { + "key": "skill", + "value": { + "@type": "g:Int32", + "@value": 5 + } } } } } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 18 - }, - "label" : "develops", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 7 - }, - "properties" : { - "since" : { - "@type" : "g:Property", - "@value" : { - "key" : "since", - "value" : { - "@type" : "g:Int32", - "@value" : 2011 + }, + { + "@type": "g:Edge", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 25 + }, + "label": { + "@type": "g:List", + "@value": [ + "uses" + ] + }, + "inVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "outVLabel": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "inV": { + "@type": "g:Int32", + "@value": 11 + }, + "outV": { + "@type": "g:Int32", + "@value": 9 + }, + "properties": { + "skill": { + "@type": "g:Property", + "@value": { + "key": "skill", + "value": { + "@type": "g:Int32", + "@value": 3 + } } } } } - } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 19 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 7 - }, - "properties" : { - "skill" : { - "@type" : "g:Property", - "@value" : { - "key" : "skill", - "value" : { - "@type" : "g:Int32", - "@value" : 5 - } - } + }, + { + "@type": "g:Edge", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 26 + }, + "label": { + "@type": "g:List", + "@value": [ + "traverses" + ] + }, + "inVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "outVLabel": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "inV": { + "@type": "g:Int32", + "@value": 11 + }, + "outV": { + "@type": "g:Int32", + "@value": 10 } } } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 20 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 7 - }, - "properties" : { - "skill" : { - "@type" : "g:Property", - "@value" : { - "key" : "skill", - "value" : { - "@type" : "g:Int32", - "@value" : 4 - } + ] + } +} +---- + +[source,json] +---- +{ + "vertices": [ + { + "id": 1, + "label": [ + "person" + ], + "type": "vertex", + "properties": { + "name": [ + { + "id": 0, + "value": "marko" + } + ], + "location": [ + { + "id": 6, + "value": "san diego", + "properties": { + "startTime": 1997, + "endTime": 2001 + } + }, + { + "id": 7, + "value": "santa cruz", + "properties": { + "startTime": 2001, + "endTime": 2004 + } + }, + { + "id": 8, + "value": "brussels", + "properties": { + "startTime": 2004, + "endTime": 2005 + } + }, + { + "id": 9, + "value": "santa fe", + "properties": { + "startTime": 2005 } } - } + ] } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 21 - }, - "label" : "develops", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 8 - }, - "properties" : { - "since" : { - "@type" : "g:Property", - "@value" : { - "key" : "since", - "value" : { - "@type" : "g:Int32", - "@value" : 2012 - } + }, + { + "id": 7, + "label": [ + "person" + ], + "type": "vertex", + "properties": { + "name": [ + { + "id": 1, + "value": "stephen" + } + ], + "location": [ + { + "id": 10, + "value": "centreville", + "properties": { + "startTime": 1990, + "endTime": 2000 + } + }, + { + "id": 11, + "value": "dulles", + "properties": { + "startTime": 2000, + "endTime": 2006 + } + }, + { + "id": 12, + "value": "purcellville", + "properties": { + "startTime": 2006 } } - } + ] } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 22 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 8 - }, - "properties" : { - "skill" : { - "@type" : "g:Property", - "@value" : { - "key" : "skill", - "value" : { - "@type" : "g:Int32", - "@value" : 3 - } + }, + { + "id": 8, + "label": [ + "person" + ], + "type": "vertex", + "properties": { + "name": [ + { + "id": 2, + "value": "matthias" + } + ], + "location": [ + { + "id": 13, + "value": "bremen", + "properties": { + "startTime": 2004, + "endTime": 2007 + } + }, + { + "id": 14, + "value": "baltimore", + "properties": { + "startTime": 2007, + "endTime": 2011 + } + }, + { + "id": 15, + "value": "oakland", + "properties": { + "startTime": 2011, + "endTime": 2014 + } + }, + { + "id": 16, + "value": "seattle", + "properties": { + "startTime": 2014 } } - } + ] } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 23 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 8 - }, - "properties" : { - "skill" : { - "@type" : "g:Property", - "@value" : { - "key" : "skill", - "value" : { - "@type" : "g:Int32", - "@value" : 3 - } + }, + { + "id": 9, + "label": [ + "person" + ], + "type": "vertex", + "properties": { + "name": [ + { + "id": 3, + "value": "daniel" + } + ], + "location": [ + { + "id": 17, + "value": "spremberg", + "properties": { + "startTime": 1982, + "endTime": 2005 + } + }, + { + "id": 18, + "value": "kaiserslautern", + "properties": { + "startTime": 2005, + "endTime": 2009 + } + }, + { + "id": 19, + "value": "aachen", + "properties": { + "startTime": 2009 } } - } + ] } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 24 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 10 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 9 - }, - "properties" : { - "skill" : { - "@type" : "g:Property", - "@value" : { - "key" : "skill", - "value" : { - "@type" : "g:Int32", - "@value" : 5 - } - } + }, + { + "id": 10, + "label": [ + "software" + ], + "type": "vertex", + "properties": { + "name": [ + { + "id": 4, + "value": "gremlin" } - } + ] } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 25 - }, - "label" : "uses", - "inVLabel" : "software", - "outVLabel" : "person", - "inV" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 9 - }, - "properties" : { - "skill" : { - "@type" : "g:Property", - "@value" : { - "key" : "skill", - "value" : { - "@type" : "g:Int32", - "@value" : 3 - } - } + }, + { + "id": 11, + "label": [ + "software" + ], + "type": "vertex", + "properties": { + "name": [ + { + "id": 5, + "value": "tinkergraph" } - } + ] } - }, { - "@type" : "g:Edge", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 26 - }, - "label" : "traverses", - "inVLabel" : "software", - "outVLabel" : "software", - "inV" : { - "@type" : "g:Int32", - "@value" : 11 - }, - "outV" : { - "@type" : "g:Int32", - "@value" : 10 - } + } + ], + "edges": [ + { + "id": 13, + "label": [ + "develops" + ], + "type": "edge", + "inVLabel": [ + "software" + ], + "outVLabel": [ + "person" + ], + "inV": 10, + "outV": 1, + "properties": { + "since": 2009 } - } ] - } + }, + { + "id": 14, + "label": [ + "develops" + ], + "type": "edge", + "inVLabel": [ + "software" + ], + "outVLabel": [ + "person" + ], + "inV": 11, + "outV": 1, + "properties": { + "since": 2010 + } + }, + { + "id": 15, + "label": [ + "uses" + ], + "type": "edge", + "inVLabel": [ + "software" + ], + "outVLabel": [ + "person" + ], + "inV": 10, + "outV": 1, + "properties": { + "skill": 4 + } + }, + { + "id": 16, + "label": [ + "uses" + ], + "type": "edge", + "inVLabel": [ + "software" + ], + "outVLabel": [ + "person" + ], + "inV": 11, + "outV": 1, + "properties": { + "skill": 5 + } + }, + { + "id": 17, + "label": [ + "develops" + ], + "type": "edge", + "inVLabel": [ + "software" + ], + "outVLabel": [ + "person" + ], + "inV": 10, + "outV": 7, + "properties": { + "since": 2010 + } + }, + { + "id": 18, + "label": [ + "develops" + ], + "type": "edge", + "inVLabel": [ + "software" + ], + "outVLabel": [ + "person" + ], + "inV": 11, + "outV": 7, + "properties": { + "since": 2011 + } + }, + { + "id": 19, + "label": [ + "uses" + ], + "type": "edge", + "inVLabel": [ + "software" + ], + "outVLabel": [ + "person" + ], + "inV": 10, + "outV": 7, + "properties": { + "skill": 5 + } + }, + { + "id": 20, + "label": [ + "uses" + ], + "type": "edge", + "inVLabel": [ + "software" + ], + "outVLabel": [ + "person" + ], + "inV": 11, + "outV": 7, + "properties": { + "skill": 4 + } + }, + { + "id": 21, + "label": [ + "develops" + ], + "type": "edge", + "inVLabel": [ + "software" + ], + "outVLabel": [ + "person" + ], + "inV": 10, + "outV": 8, + "properties": { + "since": 2012 + } + }, + { + "id": 22, + "label": [ + "uses" + ], + "type": "edge", + "inVLabel": [ + "software" + ], + "outVLabel": [ + "person" + ], + "inV": 10, + "outV": 8, + "properties": { + "skill": 3 + } + }, + { + "id": 23, + "label": [ + "uses" + ], + "type": "edge", + "inVLabel": [ + "software" + ], + "outVLabel": [ + "person" + ], + "inV": 11, + "outV": 8, + "properties": { + "skill": 3 + } + }, + { + "id": 24, + "label": [ + "uses" + ], + "type": "edge", + "inVLabel": [ + "software" + ], + "outVLabel": [ + "person" + ], + "inV": 10, + "outV": 9, + "properties": { + "skill": 5 + } + }, + { + "id": 25, + "label": [ + "uses" + ], + "type": "edge", + "inVLabel": [ + "software" + ], + "outVLabel": [ + "person" + ], + "inV": 11, + "outV": 9, + "properties": { + "skill": 3 + } + }, + { + "id": 26, + "label": [ + "traverses" + ], + "type": "edge", + "inVLabel": [ + "software" + ], + "outVLabel": [ + "software" + ], + "inV": 11, + "outV": 10 + } + ] } ---- -==== Vertex +==== Path + +Object with two required keys: "labels" and "objects" + +"labels" is a `g:List` of `g:Set` of labels of the steps traversed + +"objects" is a `g:List` of objects traversed [source,json] ---- { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 0 - }, - "value" : "marko", - "label" : "name" + "@type": "g:Path", + "@value": { + "labels": { + "@type": "g:List", + "@value": [ + { + "@type": "g:Set", + "@value": [] + }, + { + "@type": "g:Set", + "@value": [] + }, + { + "@type": "g:Set", + "@value": [] } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 6 - }, - "value" : "san diego", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 1997 + ] + }, + "objects": { + "@type": "g:List", + "@value": [ + { + "@type": "g:Vertex", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 1 }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2001 + "label": { + "@type": "g:List", + "@value": [ + "person" + ] } } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 7 - }, - "value" : "santa cruz", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2001 + }, + { + "@type": "g:Vertex", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 10 }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2004 + "label": { + "@type": "g:List", + "@value": [ + "software" + ] } } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 8 - }, - "value" : "brussels", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2004 + }, + { + "@type": "g:Vertex", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 11 }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2005 + "label": { + "@type": "g:List", + "@value": [ + "software" + ] } } } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 9 - }, - "value" : "santa fe", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2005 - } - } - } - } ] + ] } } } ---- -==== VertexProperty - [source,json] ---- { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 0 + "labels": [ + [], + [], + [] + ], + "objects": [ + { + "id": 1, + "label": [ + "person" + ], + "type": "vertex" }, - "value" : "marko", - "label" : "name" - } -} ----- - - -=== Graph Process - -==== Barrier - -[source,json] ----- -{ - "@type" : "g:Barrier", - "@value" : "normSack" -} ----- - -==== Binding - -A "Binding" refers to a `Bytecode.Binding`. - -[source,json] ----- -{ - "@type" : "g:Binding", - "@value" : { - "key" : "x", - "value" : { - "@type" : "g:Int32", - "@value" : 1 - } - } -} ----- - -==== BulkSet - -[source,json] ----- -{ - "@type" : "g:BulkSet", - "@value" : [ "marko", { - "@type" : "g:Int64", - "@value" : 1 - }, "josh", { - "@type" : "g:Int64", - "@value" : 2 - } ] -} ----- - -==== Bytecode - -The following `Bytecode` example represents the traversal of `g.V().hasLabel('person').out().in().tree()`. Obviously the serialized `Bytecode` woudl be quite different for the endless variations of commands that could be used together in the Gremlin language. - -[source,json] ----- -{ - "@type" : "g:Bytecode", - "@value" : { - "step" : [ [ "V" ], [ "hasLabel", "person" ], [ "out" ], [ "in" ], [ "tree" ] ] - } -} ----- - -==== Cardinality - -[source,json] ----- -{ - "@type" : "g:Cardinality", - "@value" : "list" -} ----- - -==== Column - -[source,json] ----- -{ - "@type" : "g:Column", - "@value" : "keys" -} ----- - -==== Direction - -[source,json] ----- -{ - "@type" : "g:Direction", - "@value" : "OUT" -} ----- - -==== DT - -[source,json] ----- -{ - "@type" : "g:DT", - "@value" : "minute" -} ----- - -==== Lambda - -[source,json] ----- -{ - "@type" : "g:Lambda", - "@value" : { - "script" : "{ it.get() }", - "language" : "gremlin-groovy", - "arguments" : 1 - } -} ----- - -==== Merge - -[source,json] ----- -{ - "@type" : "g:Merge", - "@value" : "onMatch" -} ----- - -==== Metrics - -[source,json] ----- -{ - "@type" : "g:Metrics", - "@value" : { - "@type" : "g:Map", - "@value" : [ "dur", { - "@type" : "g:Double", - "@value" : 100.0 - }, "counts", { - "@type" : "g:Map", - "@value" : [ "traverserCount", { - "@type" : "g:Int64", - "@value" : 4 - }, "elementCount", { - "@type" : "g:Int64", - "@value" : 4 - } ] - }, "name", "TinkerGraphStep(vertex,[~label.eq(person)])", "annotations", { - "@type" : "g:Map", - "@value" : [ "percentDur", { - "@type" : "g:Double", - "@value" : 25.0 - } ] - }, "id", "7.0.0()", "metrics", { - "@type" : "g:List", - "@value" : [ { - "@type" : "g:Metrics", - "@value" : { - "@type" : "g:Map", - "@value" : [ "dur", { - "@type" : "g:Double", - "@value" : 100.0 - }, "counts", { - "@type" : "g:Map", - "@value" : [ "traverserCount", { - "@type" : "g:Int64", - "@value" : 7 - }, "elementCount", { - "@type" : "g:Int64", - "@value" : 7 - } ] - }, "name", "VertexStep(OUT,vertex)", "annotations", { - "@type" : "g:Map", - "@value" : [ "percentDur", { - "@type" : "g:Double", - "@value" : 25.0 - } ] - }, "id", "3.0.0()" ] - } - } ] - } ] - } -} ----- - -==== Operator - -[source,json] ----- -{ - "@type" : "g:Operator", - "@value" : "sum" -} ----- - -==== Order - -[source,json] ----- -{ - "@type" : "g:Order", - "@value" : "shuffle" -} ----- - -==== P - -`P` expects a single value of a `List` of values. There is special handling for `List` values when it comes to `within`, `without`, `inside`, `outside` and `between`. For `inside`, `outside` and `between`, the expectation is that the collection contain two objects (the rest will be ignored) and those two objects become the arguments to those methods. For `within` and `without`, these methods will accept an arbitrary number of objects in the collection. - -[source,json] ----- -{ - "@type" : "g:P", - "@value" : { - "predicate" : "gt", - "value" : { - "@type" : "g:Int32", - "@value" : 0 + { + "id": 10, + "label": [ + "software" + ], + "type": "vertex" + }, + { + "id": 11, + "label": [ + "software" + ], + "type": "vertex" } - } + ] } ---- -==== P within +==== Property -Please see <<_p,P>> for additional information on `within`. +JSON Object with two required keys: "key" and "value" + +"key" is a `String` + +"value" is any GraphSON 4.0 type [source,json] ---- { - "@type" : "g:P", - "@value" : { - "predicate" : "within", - "value" : { - "@type" : "g:List", - "@value" : [ { - "@type" : "g:Int32", - "@value" : 1 - } ] + "@type": "g:Property", + "@value": { + "key": "since", + "value": { + "@type": "g:Int32", + "@value": 2009 } } } ---- -==== P without - -Please see <<_p,P>> for additional information on `within`. - [source,json] ---- { - "@type" : "g:P", - "@value" : { - "predicate" : "without", - "value" : { - "@type" : "g:List", - "@value" : [ { - "@type" : "g:Int32", - "@value" : 1 - }, { - "@type" : "g:Int32", - "@value" : 2 - } ] - } - } + "key" : "since", + "value" : 2009 } ---- -==== P and - -[source,json] ----- -{ - "@type" : "g:P", - "@value" : { - "predicate" : "and", - "value" : [ { - "@type" : "g:P", - "@value" : { - "predicate" : "gt", - "value" : { - "@type" : "g:Int32", - "@value" : 0 - } - } - }, { - "@type" : "g:P", - "@value" : { - "predicate" : "lt", - "value" : { - "@type" : "g:Int32", - "@value" : 10 - } - } - } ] - } -} ----- +==== Tree -==== P or +JSON Object with one or more possibly nested "key" "value" pairs +"key" is an Element (`g:Vertex`, `g:Edge`, `g:VertexProperty`) +"value" is a `g:Tree` making this a recursively defined structure [source,json] ---- { - "@type" : "g:P", - "@value" : { - "predicate" : "or", - "value" : [ { - "@type" : "g:P", - "@value" : { - "predicate" : "gt", - "value" : { - "@type" : "g:Int32", - "@value" : 0 - } - } - }, { - "@type" : "g:P", - "@value" : { - "predicate" : "within", - "value" : { - "@type" : "g:List", - "@value" : [ { - "@type" : "g:Int32", - "@value" : -1 - }, { - "@type" : "g:Int32", - "@value" : -10 - }, { - "@type" : "g:Int32", - "@value" : -100 - } ] + "@type": "g:Tree", + "@value": [ + { + "key": { + "@type": "g:Vertex", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 10 + }, + "label": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "properties": { + "name": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 4 + }, + "value": "gremlin", + "label": { + "@type": "g:List", + "@value": [ + "name" + ] + } + } + } + ] + } } + }, + "value": { + "@type": "g:Tree", + "@value": [ + { + "key": { + "@type": "g:Vertex", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 11 + }, + "label": { + "@type": "g:List", + "@value": [ + "software" + ] + }, + "properties": { + "name": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 5 + }, + "value": "tinkergraph", + "label": { + "@type": "g:List", + "@value": [ + "name" + ] + } + } + } + ] + } + } + }, + "value": { + "@type": "g:Tree", + "@value": [] + } + } + ] } - } ] - } -} ----- - -==== Pick - -[source,json] ----- -{ - "@type" : "g:Pick", - "@value" : "any" -} ----- - -==== Pop - -[source,json] ----- -{ - "@type" : "g:Pop", - "@value" : "all" -} ----- - -==== Scope - -[source,json] ----- -{ - "@type" : "g:Scope", - "@value" : "local" -} ----- - -==== T - -[source,json] ----- -{ - "@type" : "g:T", - "@value" : "label" + } + ] } ---- -==== TextP - [source,json] ---- -{ - "@type" : "g:TextP", - "@value" : { - "predicate" : "containing", - "value" : "ark" +[ + { + "key": { + "id": 10, + "label": [ + "software" + ], + "type": "vertex", + "properties": { + "name": [ + { + "id": 4, + "value": "gremlin" + } + ] + } + }, + "value": [ + { + "key": { + "id": 11, + "label": [ + "software" + ], + "type": "vertex", + "properties": { + "name": [ + { + "id": 5, + "value": "tinkergraph" + } + ] + } + }, + "value": [] + } + ] } -} +] ---- -==== TraversalMetrics +==== Vertex -[source,json] ----- -{ - "@type" : "g:TraversalMetrics", - "@value" : { - "@type" : "g:Map", - "@value" : [ "dur", { - "@type" : "g:Double", - "@value" : 0.004 - }, "metrics", { - "@type" : "g:List", - "@value" : [ { - "@type" : "g:Metrics", - "@value" : { - "@type" : "g:Map", - "@value" : [ "dur", { - "@type" : "g:Double", - "@value" : 100.0 - }, "counts", { - "@type" : "g:Map", - "@value" : [ "traverserCount", { - "@type" : "g:Int64", - "@value" : 4 - }, "elementCount", { - "@type" : "g:Int64", - "@value" : 4 - } ] - }, "name", "TinkerGraphStep(vertex,[~label.eq(person)])", "annotations", { - "@type" : "g:Map", - "@value" : [ "percentDur", { - "@type" : "g:Double", - "@value" : 25.0 - } ] - }, "id", "7.0.0()" ] - } - }, { - "@type" : "g:Metrics", - "@value" : { - "@type" : "g:Map", - "@value" : [ "dur", { - "@type" : "g:Double", - "@value" : 100.0 - }, "counts", { - "@type" : "g:Map", - "@value" : [ "traverserCount", { - "@type" : "g:Int64", - "@value" : 13 - }, "elementCount", { - "@type" : "g:Int64", - "@value" : 13 - } ] - }, "name", "VertexStep(OUT,vertex)", "annotations", { - "@type" : "g:Map", - "@value" : [ "percentDur", { - "@type" : "g:Double", - "@value" : 25.0 - } ] - }, "id", "2.0.0()" ] - } - }, { - "@type" : "g:Metrics", - "@value" : { - "@type" : "g:Map", - "@value" : [ "dur", { - "@type" : "g:Double", - "@value" : 100.0 - }, "counts", { - "@type" : "g:Map", - "@value" : [ "traverserCount", { - "@type" : "g:Int64", - "@value" : 7 - }, "elementCount", { - "@type" : "g:Int64", - "@value" : 7 - } ] - }, "name", "VertexStep(OUT,vertex)", "annotations", { - "@type" : "g:Map", - "@value" : [ "percentDur", { - "@type" : "g:Double", - "@value" : 25.0 - } ] - }, "id", "3.0.0()" ] - } - }, { - "@type" : "g:Metrics", - "@value" : { - "@type" : "g:Map", - "@value" : [ "dur", { - "@type" : "g:Double", - "@value" : 100.0 - }, "counts", { - "@type" : "g:Map", - "@value" : [ "traverserCount", { - "@type" : "g:Int64", - "@value" : 1 - }, "elementCount", { - "@type" : "g:Int64", - "@value" : 1 - } ] - }, "name", "TreeStep", "annotations", { - "@type" : "g:Map", - "@value" : [ "percentDur", { - "@type" : "g:Double", - "@value" : 25.0 - } ] - }, "id", "4.0.0()" ] - } - } ] - } ] - } -} ----- +JSON Object with required keys: "id", "label", "properties" + +"id" is any GraphSON 4.0 type + +"label" is a `g:List` of `String` + +"properties" is an Object containing Arrays of `g:VertexProperty` -==== Traverser +The untyped version has one additional required key "type" which is always "vertex". [source,json] ---- { - "@type" : "g:Traverser", - "@value" : { - "bulk" : { - "@type" : "g:Int64", - "@value" : 1 + "@type": "g:Vertex", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 1 }, - "value" : { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 0 - }, - "value" : "marko", - "label" : "name" + "label": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "properties": { + "name": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 0 + }, + "value": "marko", + "label": { + "@type": "g:List", + "@value": [ + "name" + ] } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 6 + } + } + ], + "location": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 6 + }, + "value": "san diego", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 1997 }, - "value" : "san diego", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 1997 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2001 - } + "endTime": { + "@type": "g:Int32", + "@value": 2001 } } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 7 + } + }, + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 7 + }, + "value": "santa cruz", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2001 }, - "value" : "santa cruz", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2001 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2004 - } + "endTime": { + "@type": "g:Int32", + "@value": 2004 } } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 8 + } + }, + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 8 + }, + "value": "brussels", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2004 }, - "value" : "brussels", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2004 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2005 - } + "endTime": { + "@type": "g:Int32", + "@value": 2005 } } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 9 - }, - "value" : "santa fe", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2005 - } + } + }, + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 9 + }, + "value": "santa fe", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2005 } } - } ] + } } - } + ] } } } ---- - -=== RequestMessage - -==== Authentication Response - -The following `RequestMessage` is an example of the response that should be made to a SASL-based authentication challenge. - [source,json] ---- { - "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", - "op" : "authentication", - "processor" : "", - "args" : { - "@type" : "g:Map", - "@value" : [ "saslMechanism", "PLAIN", "sasl", "AHN0ZXBocGhlbgBwYXNzd29yZA==" ] + "id": 1, + "label": [ + "person" + ], + "type": "vertex", + "properties": { + "name": [ + { + "id": 0, + "value": "marko" + } + ], + "location": [ + { + "id": 6, + "value": "san diego", + "properties": { + "startTime": 1997, + "endTime": 2001 + } + }, + { + "id": 7, + "value": "santa cruz", + "properties": { + "startTime": 2001, + "endTime": 2004 + } + }, + { + "id": 8, + "value": "brussels", + "properties": { + "startTime": 2004, + "endTime": 2005 + } + }, + { + "id": 9, + "value": "santa fe", + "properties": { + "startTime": 2005 + } + } + ] } } ---- -==== Session Eval +==== VertexProperty -The following `RequestMessage` is an example of a simple session request for a script evaluation with parameters. +JOSN Object with required keys: "id", "value", "label", "properties" + +"id" is any type GraphSON 4.0 type + +"value" is any type GraphSON 4.0 type + +"label" is a `g:List` of `String` + +"properties" contains an Array of "g:Property" (metaproperties) [source,json] ---- { - "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", - "op" : "eval", - "processor" : "session", - "args" : { - "@type" : "g:Map", - "@value" : [ "gremlin", "g.V(x)", "language", "gremlin-groovy", "session", "unique-session-identifier", "bindings", { - "@type" : "g:Map", - "@value" : [ "x", { - "@type" : "g:Int32", - "@value" : 1 - } ] - } ] + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 0 + }, + "value": "marko", + "label": { + "@type": "g:List", + "@value": [ + "name" + ] + } } } ---- -==== Session Eval Aliased - -The following `RequestMessage` is an example of a session request for a script evaluation with an alias that binds the `TraversalSource` of "g" to "social". - [source,json] ---- { - "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", - "op" : "eval", - "processor" : "session", - "args" : { - "@type" : "g:Map", - "@value" : [ "gremlin", "social.V(x)", "language", "gremlin-groovy", "aliases", { - "@type" : "g:Map", - "@value" : [ "g", "social" ] - }, "session", "unique-session-identifier", "bindings", { - "@type" : "g:Map", - "@value" : [ "x", { - "@type" : "g:Int32", - "@value" : 1 - } ] - } ] - } + "id": 0, + "value": "marko", + "label": [ + "name" + ] } ---- -==== Session Close +=== Graph Process + +==== Direction -The following `RequestMessage` is an example of a request to close a session. +JSON String of the enum value. [source,json] ---- { - "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", - "op" : "close", - "processor" : "session", - "args" : { - "@type" : "g:Map", - "@value" : [ "session", "unique-session-identifier" ] - } + "@type" : "g:Direction", + "@value" : "OUT" } ---- -==== Sessionless Eval +[source,text] +---- +"OUT" +---- -The following `RequestMessage` is an example of a simple sessionless request for a script evaluation with parameters. +==== T + +JSON String of the enum value. [source,json] ---- { - "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", - "op" : "eval", - "processor" : "", - "args" : { - "@type" : "g:Map", - "@value" : [ "gremlin", "g.V(x)", "language", "gremlin-groovy", "bindings", { - "@type" : "g:Map", - "@value" : [ "x", { - "@type" : "g:Int32", - "@value" : 1 - } ] - } ] - } + "@type" : "g:T", + "@value" : "label" } ---- -==== Sessionless Eval Aliased +[source,text] +---- +"label" +---- + +=== RequestMessage + +==== Standard -The following `RequestMessage` is an example of a sessionless request for a script evaluation with an alias that binds the `TraversalSource` of "g" to "social". +The following `RequestMessage` is an example of a simple sessionless request for a script evaluation with parameters. [source,json] ---- { - "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", - "op" : "eval", - "processor" : "", - "args" : { - "@type" : "g:Map", - "@value" : [ "gremlin", "social.V(x)", "language", "gremlin-groovy", "aliases", { - "@type" : "g:Map", - "@value" : [ "g", "social" ] - }, "bindings", { - "@type" : "g:Map", - "@value" : [ "x", { - "@type" : "g:Int32", - "@value" : 1 - } ] - } ] + "gremlin": "g.V(x)", + "fields": { + "@type": "g:Map", + "@value": [ + "materializeProperties", + "tokens", + "timeoutMs", + { + "@type": "g:Int64", + "@value": 1000 + }, + "g", + "g", + "bindings", + { + "@type": "g:Map", + "@value": [ + "x", + { + "@type": "g:Int32", + "@value": 1 + } + ] + }, + "language", + "gremlin-groovy" + ] } } ---- - -=== ResponseMessage - -==== Authentication Challenge - -When authentication is enabled, an initial request to the server will result in an authentication challenge. The typical response message will appear as follows, but handling it could be different depending on the SASL implementation (e.g. multiple challenges may be requested in some cases, but not in the default provided by Gremlin Server). - [source,json] ---- { - "requestId" : "41d2e28a-20a4-4ab0-b379-d810dede3786", - "status" : { - "message" : "", - "code" : 407, - "attributes" : { - "@type" : "g:Map", - "@value" : [ ] - } - }, - "result" : { - "data" : null, - "meta" : { - "@type" : "g:Map", - "@value" : [ ] - } + "gremlin": "g.V(x)", + "fields": { + "materializeProperties": "tokens", + "timeoutMs": 1000, + "g": "g", + "bindings": { + "x": 1 + }, + "language": "gremlin-groovy" } } ---- +=== ResponseMessage + ==== Standard Result The following `ResponseMessage` is a typical example of the typical successful response Gremlin Server will return when returning results from a script. @@ -5534,346 +2828,383 @@ The following `ResponseMessage` is a typical example of the typical successful r [source,json] ---- { - "requestId" : "41d2e28a-20a4-4ab0-b379-d810dede3786", - "status" : { - "message" : "", - "code" : 200, - "attributes" : { - "@type" : "g:Map", - "@value" : [ ] - } - }, - "result" : { - "data" : { - "@type" : "g:List", - "@value" : [ { - "@type" : "g:Vertex", - "@value" : { - "id" : { - "@type" : "g:Int32", - "@value" : 1 - }, - "label" : "person", - "properties" : { - "name" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 0 - }, - "value" : "marko", - "label" : "name" - } - } ], - "location" : [ { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 6 - }, - "value" : "san diego", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 1997 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2001 + "result": { + "data": { + "@type": "g:List", + "@value": [ + { + "@type": "g:Vertex", + "@value": { + "id": { + "@type": "g:Int32", + "@value": 1 + }, + "label": { + "@type": "g:List", + "@value": [ + "person" + ] + }, + "properties": { + "name": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 0 + }, + "value": "marko", + "label": { + "@type": "g:List", + "@value": [ + "name" + ] + } } } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 7 + ], + "location": [ + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 6 + }, + "value": "san diego", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 1997 + }, + "endTime": { + "@type": "g:Int32", + "@value": 2001 + } + } + } }, - "value" : "santa cruz", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2001 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2004 + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 7 + }, + "value": "santa cruz", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2001 + }, + "endTime": { + "@type": "g:Int32", + "@value": 2004 + } + } } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 8 }, - "value" : "brussels", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2004 - }, - "endTime" : { - "@type" : "g:Int32", - "@value" : 2005 + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 8 + }, + "value": "brussels", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2004 + }, + "endTime": { + "@type": "g:Int32", + "@value": 2005 + } + } } - } - } - }, { - "@type" : "g:VertexProperty", - "@value" : { - "id" : { - "@type" : "g:Int64", - "@value" : 9 }, - "value" : "santa fe", - "label" : "location", - "properties" : { - "startTime" : { - "@type" : "g:Int32", - "@value" : 2005 + { + "@type": "g:VertexProperty", + "@value": { + "id": { + "@type": "g:Int64", + "@value": 9 + }, + "value": "santa fe", + "label": { + "@type": "g:List", + "@value": [ + "location" + ] + }, + "properties": { + "startTime": { + "@type": "g:Int32", + "@value": 2005 + } + } } } - } - } ] + ] + } } } - } ] - }, - "meta" : { - "@type" : "g:Map", - "@value" : [ ] + ] } + }, + "status": { + "code": "200 OK", + "message": "", + "exception": "" } } ---- - -=== Extended - -Note that the "extended" types require the addition of the separate `GraphSONXModuleV3d0` module as follows: - -[source,java] ----- -mapper = GraphSONMapper.build(). - typeInfo(TypeInfo.PARTIAL_TYPES). - addCustomModule(GraphSONXModuleV3.build()). - version(GraphSONVersion.V3_0).create().createMapper() ----- - -==== BigDecimal - [source,json] ---- { - "@type" : "gx:BigDecimal", - "@value" : 123456789987654321123456789987654321 + "result": { + "data": [ + { + "id": 1, + "label": [ + "person" + ], + "type": "vertex", + "properties": { + "name": [ + { + "id": 0, + "value": "marko" + } + ], + "location": [ + { + "id": 6, + "value": "san diego", + "properties": { + "startTime": 1997, + "endTime": 2001 + } + }, + { + "id": 7, + "value": "santa cruz", + "properties": { + "startTime": 2001, + "endTime": 2004 + } + }, + { + "id": 8, + "value": "brussels", + "properties": { + "startTime": 2004, + "endTime": 2005 + } + }, + { + "id": 9, + "value": "santa fe", + "properties": { + "startTime": 2005 + } + } + ] + } + } + ] + }, + "status": { + "code": "200 OK", + "message": "", + "exception": "" + } } ---- -==== BigInteger - -[source,json] ----- -{ - "@type" : "gx:BigInteger", - "@value" : 123456789987654321123456789987654321 -} ----- +==== Error Result -==== Byte +The following `ResponseMessage` is a typical example of the typical successful response Gremlin Server will return when returning results from a script. [source,json] ---- { - "@type" : "gx:Byte", - "@value" : 1 + "result": { + "data": { + "@type": "g:List", + "@value": [] + } + }, + "status": { + "code": "500 Internal Server Error", + "message": "A timeout occurred during traversal evaluation", + "exception": "ServerTimeoutExceededException" + } } ---- -==== ByteBuffer - [source,json] ---- { - "@type" : "gx:ByteBuffer", - "@value" : "c29tZSBieXRlcyBmb3IgeW91" + "result": { + "data": [] + }, + "status": { + "code": "500 Internal Server Error", + "message": "A timeout occurred during traversal evaluation", + "exception": "ServerTimeoutExceededException" + } } ---- -==== Char +=== Extended -[source,json] +Note that the "extended" types require the addition of the separate `GraphSONXModuleV4d0` module as follows: + +[source,java] ---- -{ - "@type" : "gx:Char", - "@value" : "x" -} +mapper = GraphSONMapper.build(). + typeInfo(TypeInfo.PARTIAL_TYPES). + addCustomModule(GraphSONXModuleV4.build()). + version(GraphSONVersion.V4_0).create().createMapper() ---- -==== Duration +==== BigDecimal -The following example is a `Duration` of five days. +A JSON Number. [source,json] ---- { - "@type" : "gx:Duration", - "@value" : "PT120H" + "@type" : "gx:BigDecimal", + "@value" : 123456789987654321123456789987654321 } ---- -==== InetAddress - -[source,json] +[source,text] ---- -{ - "@type" : "gx:InetAddress", - "@value" : "localhost" -} +123456789987654321123456789987654321 ---- -==== Instant - -[source,json] ----- -{ - "@type" : "gx:Instant", - "@value" : "2016-12-14T16:39:19.349Z" -} ----- +==== BigInteger -==== LocalDate +A JSON Number. [source,json] ---- { - "@type" : "gx:LocalDate", - "@value" : "2016-01-01" + "@type" : "gx:BigInteger", + "@value" : 123456789987654321123456789987654321 } ---- -==== LocalDateTime - -[source,json] +[source,text] ---- -{ - "@type" : "gx:LocalDateTime", - "@value" : "2016-01-01T12:30" -} +123456789987654321123456789987654321 ---- -==== LocalTime +==== Byte + +A JSON Number with the same range as a 1-byte signed integer. [source,json] ---- { - "@type" : "gx:LocalTime", - "@value" : "12:30:45" + "@type" : "gx:Byte", + "@value" : 1 } ---- -==== MonthDay - -[source,json] +[source,text] ---- -{ - "@type" : "gx:MonthDay", - "@value" : "--01-01" -} +1 ---- -==== OffsetDateTime +==== Binary + +JSON String containing base64-encoded bytes [source,json] ---- { - "@type" : "gx:OffsetDateTime", - "@value" : "2007-12-03T10:15:30+01:00" + "@type" : "gx:Binary", + "@value" : "c29tZSBieXRlcyBmb3IgeW91" } ---- -==== OffsetTime - -[source,json] +[source,text] ---- -{ - "@type" : "gx:OffsetTime", - "@value" : "10:15:30+01:00" -} +"c29tZSBieXRlcyBmb3IgeW91" ---- -==== Period +==== Char -The following example is a `Period` of one year, six months and fifteen days. +A JSON String containing a single UTF-8 encoded character. [source,json] ---- { - "@type" : "gx:Period", - "@value" : "P1Y6M15D" + "@type" : "gx:Char", + "@value" : "x" } ---- -==== Short - -[source,json] +[source,text] ---- -{ - "@type" : "gx:Int16", - "@value" : 100 -} +"x" ---- -==== Year +==== Duration -The following example is of the `Year` "2016". +JSON String with ISO-8601 seconds based representation. The following example is a `Duration` of five days. [source,json] ---- { - "@type" : "gx:Year", - "@value" : "2016" + "@type" : "gx:Duration", + "@value" : "PT120H" } ---- -==== YearMonth - -The following example is a `YearMonth` of "June 2016" - -[source,json] +[source,text] ---- -{ - "@type" : "gx:YearMonth", - "@value" : "2016-06" -} +"PT120H" ---- -==== ZonedDateTime +==== Short + +A JSON Number with the same range as a 2-byte signed integer. [source,json] ---- { - "@type" : "gx:ZonedDateTime", - "@value" : "2016-12-23T12:12:24.000000036+02:00[GMT+02:00]" + "@type" : "gx:Int16", + "@value" : 100 } ---- -==== ZoneOffset - -The following example is a `ZoneOffset` of three hours, six minutes, and nine seconds. - -[source,json] +[source,text] ---- -{ - "@type" : "gx:ZoneOffset", - "@value" : "+03:06:09" -} +100 ---- diff --git a/docs/src/upgrade/release-4.x.x.asciidoc b/docs/src/upgrade/release-4.x.x.asciidoc index 00cc92e01ac..16e0c91cbdc 100644 --- a/docs/src/upgrade/release-4.x.x.asciidoc +++ b/docs/src/upgrade/release-4.x.x.asciidoc @@ -174,6 +174,24 @@ removed. As a result, all translators in .NET, Python, Go and Javascript have be See: link:https://issues.apache.org/jira/browse/TINKERPOP-3028[TINKERPOP-3028] +==== Changes to Serialization + +The GLVs will only support GraphBinary V4 and GraphSON support has been removed. This means that the serializer option +that was available in most GLVs has been removed. GraphBinary is a more compact format and has support for the same +types. This should lead to increased performance for users upgrading from any version of GraphSON to GraphBinary. + +The number of serializable types has been reduced in V4. For example, only a single temporal type remains. You have two +options when trying to work with data types whose serializer has been removed: first, you can attempt to convert the +data to another type that still have a serializer or, second, the type may have been too specific and therefore removed +in which case your provider should have a Provider Defined Type (PDT) for it. See the next paragraph for information on +PDTs. + +Custom serializers have also been removed so if you previously included those as part of your application, they should +now be removed. In its place, PDTs have been introduced. In particular, there is the Primitive PDT and the Composite +PDT. Primitive PDTs are string-based representations of a primitive type supported by your provider. Composite types +contain a map of fields. You should consult your provider's documentation to determine what types of fields a +particular PDT may contain. + === Upgrading for Providers ==== Renaming NoneStep to DiscardStep @@ -181,6 +199,55 @@ NoneStep, which was primarily used by `iterate()` to discard traversal results i DiscardStep. In its place is a new list filtering NoneStep, which takes a predicate as an argument and passes lists with no elements matching the predicate. +==== Changes to Serialization + +The V4 versions of GraphBinary and GraphSON are being introduced. Support for the older versions of GraphBinary (V1) +and GraphSON (V1-3) is removed. Additionally, the GLVs will only use GraphBinary, the Gremlin Server, however, can +still serialize both GraphSON and GraphBinary. The following is a list of the major changes to the GraphBinary format: + +* Removed type serializers: +** Period +** Date +** TimeStamp +** Instant +** ZonedDateTime +** OffsetTime +** LocalDateTime +** LocalDate +** LocalTime +** MonthDay +** YearMonth +** Year +** ZoneOffset +** BulkSet +** Class +** Binding +** Bytecode +** Barrier +** Cardinality +** Column +** Operator +** Order +** Pick +** Pop +** Scope +** Merge +** DT +** Lambda +** P +** Traverser +** TextP +** TraversalStrategy +** Metrics +** TraversalMetrics +** InetAddress +* Byte is redefined from being unsigned byte to a signed byte. +* List has a `0x02` value_flag used to denote bulking. +* Map has a `0x02` value_flag used to denote ordering. +* `Element` (Vertex, Edge, VertexProperty) labels have been changed from `String` to `List` of `String`. +* `Element` (Vertex, Edge, VertexProperty) properties are no longer null and are `List` of `Property`. +* Custom is replaced with Provider Defined Types + ==== Graph System Providers ===== AbstractAuthenticatorHandler Constructor