hydra.pg.graphson.syntax module

A syntax model for TinkerPop’s GraphSON format. This model is designed to be as inclusive as possible, supporting GraphSON 4.0 as well as earlier versions. See https://github.com/apache/tinkerpop/blob/master/docs/src/dev/io/graphson.asciidoc.

class hydra.pg.graphson.syntax.AdjacentEdge(id: Value, vertex_id: Value, properties: Mapping[PropertyKey, Value])

Bases: object

A GraphSON edge as referenced from an adjacent vertex, with its own properties.

class Builder(_id: 'Value' = None, _vertex_id: 'Value' = None, _properties: 'Mapping[PropertyKey, Value]' = None)

Bases: object

build()
id(id)
properties(properties)
vertex_id(vertex_id)
ID = Name(value='id')
PROPERTIES = Name(value='properties')
TYPE_ = Name(value='hydra.pg.graphson.syntax.AdjacentEdge')
VERTEX_ID = Name(value='vertexId')
static builder()
id: Value
properties: Mapping[PropertyKey, Value]
vertex_id: Value
with_id(id)
with_properties(properties)
with_vertex_id(vertex_id)
class hydra.pg.graphson.syntax.BigDecimalValue(value: T)

Bases: Node[str]

A GraphSON big-decimal value, represented as a string.

TYPE_ = Name(value='hydra.pg.graphson.syntax.BigDecimalValue')
class hydra.pg.graphson.syntax.CompositeTypedValue(type: TypeName, fields: Map)

Bases: object

A GraphSON composite value tagged with a GraphSON type name.

class Builder(_type: 'TypeName' = None, _fields: 'Map' = None)

Bases: object

build()
fields(fields)
type(type)
FIELDS = Name(value='fields')
TYPE = Name(value='type')
TYPE_ = Name(value='hydra.pg.graphson.syntax.CompositeTypedValue')
static builder()
fields: Map
type: TypeName
with_fields(fields)
with_type(type)
class hydra.pg.graphson.syntax.DateTime(value: T)

Bases: Node[str]

A GraphSON date-time value, represented as a string.

TYPE_ = Name(value='hydra.pg.graphson.syntax.DateTime')
class hydra.pg.graphson.syntax.DoubleValue

Bases: object

DoubleValueFinite | DoubleValueInfinity | DoubleValueNegativeInfinity | DoubleValueNotANumber

FINITE = Name(value='finite')
INFINITY = Name(value='infinity')
NEGATIVE_INFINITY = Name(value='negativeInfinity')
NOT_A_NUMBER = Name(value='notANumber')
TYPE_ = Name(value='hydra.pg.graphson.syntax.DoubleValue')
class hydra.pg.graphson.syntax.DoubleValueFinite(value: T)

Bases: Node[float]

class hydra.pg.graphson.syntax.DoubleValueInfinity

Bases: object

class hydra.pg.graphson.syntax.DoubleValueNegativeInfinity

Bases: object

class hydra.pg.graphson.syntax.DoubleValueNotANumber

Bases: object

class hydra.pg.graphson.syntax.Duration(value: T)

Bases: Node[str]

A GraphSON duration value, represented as a string.

TYPE_ = Name(value='hydra.pg.graphson.syntax.Duration')
class hydra.pg.graphson.syntax.EdgeLabel(value: T)

Bases: Node[str]

A GraphSON edge label, represented as a string.

TYPE_ = Name(value='hydra.pg.graphson.syntax.EdgeLabel')
class hydra.pg.graphson.syntax.FloatValue

Bases: object

FloatValueFinite | FloatValueInfinity | FloatValueNegativeInfinity | FloatValueNotANumber

FINITE = Name(value='finite')
INFINITY = Name(value='infinity')
NEGATIVE_INFINITY = Name(value='negativeInfinity')
NOT_A_NUMBER = Name(value='notANumber')
TYPE_ = Name(value='hydra.pg.graphson.syntax.FloatValue')
class hydra.pg.graphson.syntax.FloatValueFinite(value: T)

Bases: Node[float]

class hydra.pg.graphson.syntax.FloatValueInfinity

Bases: object

class hydra.pg.graphson.syntax.FloatValueNegativeInfinity

Bases: object

class hydra.pg.graphson.syntax.FloatValueNotANumber

Bases: object

class hydra.pg.graphson.syntax.Map(value: T)

Bases: Node[Sequence[ValuePair]]

A GraphSON map, represented as a list of key/value pairs.

TYPE_ = Name(value='hydra.pg.graphson.syntax.Map')
class hydra.pg.graphson.syntax.PrimitiveTypedValue(type: TypeName, value: str)

Bases: object

A GraphSON primitive value tagged with a GraphSON type name.

class Builder(_type: 'TypeName' = None, _value: 'str' = None)

Bases: object

build()
type(type)
value(value)
TYPE = Name(value='type')
TYPE_ = Name(value='hydra.pg.graphson.syntax.PrimitiveTypedValue')
VALUE = Name(value='value')
static builder()
type: TypeName
value: str
with_type(type)
with_value(value)
class hydra.pg.graphson.syntax.PropertyKey(value: T)

Bases: Node[str]

A GraphSON property key, represented as a string.

TYPE_ = Name(value='hydra.pg.graphson.syntax.PropertyKey')
class hydra.pg.graphson.syntax.TypeName(value: T)

Bases: Node[str]

A GraphSON type name, represented as a string.

TYPE_ = Name(value='hydra.pg.graphson.syntax.TypeName')
class hydra.pg.graphson.syntax.Uuid(value: T)

Bases: Node[str]

A GraphSON UUID value, represented as a string.

TYPE_ = Name(value='hydra.pg.graphson.syntax.Uuid')
class hydra.pg.graphson.syntax.Value

Bases: object

ValueBigDecimal | ValueBigInteger | ValueBinary | ValueBoolean | ValueByte | ValueChar | ValueComposite | ValueDateTime | ValueDouble | ValueDuration | ValueFloat | ValueInteger | ValueList | ValueLong | ValueMap | ValueNull | ValuePrimitive | ValueSet | ValueShort | ValueString | ValueUuid

BIG_DECIMAL = Name(value='bigDecimal')
BIG_INTEGER = Name(value='bigInteger')
BINARY = Name(value='binary')
BOOLEAN = Name(value='boolean')
BYTE = Name(value='byte')
CHAR = Name(value='char')
COMPOSITE = Name(value='composite')
DATE_TIME = Name(value='dateTime')
DOUBLE = Name(value='double')
DURATION = Name(value='duration')
FLOAT = Name(value='float')
INTEGER = Name(value='integer')
LIST = Name(value='list')
LONG = Name(value='long')
MAP = Name(value='map')
NULL = Name(value='null')
PRIMITIVE = Name(value='primitive')
SET = Name(value='set')
SHORT = Name(value='short')
STRING = Name(value='string')
TYPE_ = Name(value='hydra.pg.graphson.syntax.Value')
UUID = Name(value='uuid')
class hydra.pg.graphson.syntax.ValueBigDecimal(value: T)

Bases: Node[BigDecimalValue]

class hydra.pg.graphson.syntax.ValueBigInteger(value: T)

Bases: Node[int]

class hydra.pg.graphson.syntax.ValueBinary(value: T)

Bases: Node[str]

class hydra.pg.graphson.syntax.ValueBoolean(value: T)

Bases: Node[bool]

class hydra.pg.graphson.syntax.ValueByte(value: T)

Bases: Node[int]

class hydra.pg.graphson.syntax.ValueChar(value: T)

Bases: Node[int]

class hydra.pg.graphson.syntax.ValueComposite(value: T)

Bases: Node[CompositeTypedValue]

class hydra.pg.graphson.syntax.ValueDateTime(value: T)

Bases: Node[DateTime]

class hydra.pg.graphson.syntax.ValueDouble(value: T)

Bases: Node[DoubleValue]

class hydra.pg.graphson.syntax.ValueDuration(value: T)

Bases: Node[Duration]

class hydra.pg.graphson.syntax.ValueFloat(value: T)

Bases: Node[FloatValue]

class hydra.pg.graphson.syntax.ValueInteger(value: T)

Bases: Node[int]

class hydra.pg.graphson.syntax.ValueList(value: T)

Bases: Node[Sequence[Value]]

class hydra.pg.graphson.syntax.ValueLong(value: T)

Bases: Node[int]

class hydra.pg.graphson.syntax.ValueMap(value: T)

Bases: Node[Map]

class hydra.pg.graphson.syntax.ValueNull

Bases: object

class hydra.pg.graphson.syntax.ValuePair(first: Value, second: Value)

Bases: object

A key/value pair in a GraphSON map.

class Builder(_first: 'Value' = None, _second: 'Value' = None)

Bases: object

build()
first(first)
second(second)
FIRST = Name(value='first')
SECOND = Name(value='second')
TYPE_ = Name(value='hydra.pg.graphson.syntax.ValuePair')
static builder()
first: Value
second: Value
with_first(first)
with_second(second)
class hydra.pg.graphson.syntax.ValuePrimitive(value: T)

Bases: Node[PrimitiveTypedValue]

class hydra.pg.graphson.syntax.ValueSet(value: T)

Bases: Node[Sequence[Value]]

class hydra.pg.graphson.syntax.ValueShort(value: T)

Bases: Node[int]

class hydra.pg.graphson.syntax.ValueString(value: T)

Bases: Node[str]

class hydra.pg.graphson.syntax.ValueUuid(value: T)

Bases: Node[Uuid]

class hydra.pg.graphson.syntax.Vertex(id: Value, label: object, in_edges: Mapping[EdgeLabel, Sequence[AdjacentEdge]], out_edges: Mapping[EdgeLabel, Sequence[AdjacentEdge]], properties: Mapping[PropertyKey, Sequence[VertexPropertyValue]])

Bases: object

A GraphSON vertex, with its incident edges and properties.

class Builder(_id: 'Value' = None, _label: 'Optional[VertexLabel]' = None, _in_edges: 'Mapping[EdgeLabel, Sequence[AdjacentEdge]]' = None, _out_edges: 'Mapping[EdgeLabel, Sequence[AdjacentEdge]]' = None, _properties: 'Mapping[PropertyKey, Sequence[VertexPropertyValue]]' = None)

Bases: object

build()
id(id)
in_edges(in_edges)
label(label)
out_edges(out_edges)
properties(properties)
ID = Name(value='id')
IN_EDGES = Name(value='inEdges')
LABEL = Name(value='label')
OUT_EDGES = Name(value='outEdges')
PROPERTIES = Name(value='properties')
TYPE_ = Name(value='hydra.pg.graphson.syntax.Vertex')
static builder()
id: Value
in_edges: Mapping[EdgeLabel, Sequence[AdjacentEdge]]
label: object
out_edges: Mapping[EdgeLabel, Sequence[AdjacentEdge]]
properties: Mapping[PropertyKey, Sequence[VertexPropertyValue]]
with_id(id)
with_in_edges(in_edges)
with_label(label)
with_out_edges(out_edges)
with_properties(properties)
class hydra.pg.graphson.syntax.VertexLabel(value: T)

Bases: Node[str]

A GraphSON vertex label, represented as a string.

TYPE_ = Name(value='hydra.pg.graphson.syntax.VertexLabel')
class hydra.pg.graphson.syntax.VertexPropertyValue(id: object, value: Value)

Bases: object

A GraphSON vertex property value, with an optional property id.

class Builder(_id: 'Optional[Value]' = None, _value: 'Value' = None)

Bases: object

build()
id(id)
value(value)
ID = Name(value='id')
TYPE_ = Name(value='hydra.pg.graphson.syntax.VertexPropertyValue')
VALUE = Name(value='value')
static builder()
id: object
value: Value
with_id(id)
with_value(value)