hydra.pg.utils module

Utility functions for property graph operations.

hydra.pg.utils.example_pg_schema() Schema[T0, None, str, Error]

Example property graph schema with string values.

hydra.pg.utils.exp_string(term: Term) object

Extract a string from a term using the empty graph.

hydra.pg.utils.lazy_graph_to_elements(lg: LazyGraph[T0]) Sequence[object]

Get all elements from a lazy graph.

hydra.pg.utils.pg_element_to_json(schema: Schema[T0, T1, T2, T3], el: object) object

Convert a property graph element to JSON.

hydra.pg.utils.pg_elements_to_json(schema: Schema[T0, T1, T2, T3], els: Sequence[object]) object

Convert a list of property graph elements to JSON.

hydra.pg.utils.property_graph_elements(g: Graph[T0]) Sequence[object]

Get all elements from a property graph.

hydra.pg.utils.type_application_term_to_property_graph(schema: Schema[T0, T1, T2, Error], typ: Type, vid_type: T1, eid_type: T1, cx: T3, g: Graph) object

Convert a type-annotated term to property graph elements.