hydra.pg.graphson.coder module

Encoding functions for converting GraphSON syntax to JSON.

hydra.pg.graphson.coder.adjacent_edge_to_json(out: bool, ae: AdjacentEdge) Value

Convert a GraphSON AdjacentEdge to a JSON Value. The Bool indicates whether this is an outgoing edge.

hydra.pg.graphson.coder.double_value_to_json(v1: DoubleValue) Value

Convert a GraphSON DoubleValue to a JSON Value.

hydra.pg.graphson.coder.edge_map_to_json(out: bool, m: Mapping[EdgeLabel, Sequence[AdjacentEdge]]) object

Convert a map of edges by label to an optional JSON Value.

hydra.pg.graphson.coder.edge_property_map_to_json(m: Mapping[PropertyKey, Value]) object

Convert a map of edge properties to an optional JSON Value.

hydra.pg.graphson.coder.float_value_to_json(v1: FloatValue) Value

Convert a GraphSON FloatValue to a JSON Value.

hydra.pg.graphson.coder.map_to_json(m: Map) Value

Convert a GraphSON Map to a JSON array of alternating keys and values.

hydra.pg.graphson.coder.to_json_object(pairs: Sequence[tuple[str, object]]) Value

Create a JSON object from a list of key-value pairs, filtering out Nothing values.

hydra.pg.graphson.coder.typed_value_to_json(type_name: str, value_json: Value) Value

Create a typed JSON object with @type and @value fields.

hydra.pg.graphson.coder.value_to_json(v1: Value) Value

Convert a GraphSON Value to a JSON Value.

hydra.pg.graphson.coder.vertex_property_map_to_json(m: Mapping[PropertyKey, Sequence[VertexPropertyValue]]) object

Convert a map of vertex properties to an optional JSON Value.

hydra.pg.graphson.coder.vertex_property_value_to_json(vpv: VertexPropertyValue) Value

Convert a GraphSON VertexPropertyValue to a JSON Value.

hydra.pg.graphson.coder.vertex_to_json(v: Vertex) Value

Convert a GraphSON Vertex to a JSON Value.