hydra.pg.rdf.environment module

Environment types for property graph to RDF mapping.

class hydra.pg.rdf.environment.PgRdfEnvironment(encode_vertex_id: Annotated[Callable[[V], Iri], 'A function which encodes a vertex id as an RDF IRI'], encode_vertex_label: Annotated[Callable[[VertexLabel], Iri], 'A function which encodes a vertex label as an RDF IRI'], encode_edge_id: Annotated[Callable[[V], Iri], 'A function which encodes an edge id as an RDF IRI'], encode_edge_label: Annotated[Callable[[EdgeLabel], Iri], 'A function which encodes an edge label as an RDF IRI'], encode_property_key: Annotated[Callable[[PropertyKey], Iri], 'A function which encodes a property key as an RDF IRI'], encode_property_value: Annotated[Callable[[V], Literal], 'A function which encodes a property value as an RDF literal'])

Bases: Generic[V]

The environment for property graph to RDF mapping.

class Builder(_encode_vertex_id: 'Callable[[V], hydra.rdf.syntax.Iri]' = None, _encode_vertex_label: 'Callable[[hydra.pg.model.VertexLabel], hydra.rdf.syntax.Iri]' = None, _encode_edge_id: 'Callable[[V], hydra.rdf.syntax.Iri]' = None, _encode_edge_label: 'Callable[[hydra.pg.model.EdgeLabel], hydra.rdf.syntax.Iri]' = None, _encode_property_key: 'Callable[[hydra.pg.model.PropertyKey], hydra.rdf.syntax.Iri]' = None, _encode_property_value: 'Callable[[V], hydra.rdf.syntax.Literal]' = None)

Bases: Generic[V]

build()
encode_edge_id(encode_edge_id)
encode_edge_label(encode_edge_label)
encode_property_key(encode_property_key)
encode_property_value(encode_property_value)
encode_vertex_id(encode_vertex_id)
encode_vertex_label(encode_vertex_label)
ENCODE_EDGE_ID = Name(value='encodeEdgeId')
ENCODE_EDGE_LABEL = Name(value='encodeEdgeLabel')
ENCODE_PROPERTY_KEY = Name(value='encodePropertyKey')
ENCODE_PROPERTY_VALUE = Name(value='encodePropertyValue')
ENCODE_VERTEX_ID = Name(value='encodeVertexId')
ENCODE_VERTEX_LABEL = Name(value='encodeVertexLabel')
TYPE_ = Name(value='hydra.pg.rdf.environment.PgRdfEnvironment')
static builder()
encode_edge_id: Annotated[Callable[[V], Iri], 'A function which encodes an edge id as an RDF IRI']
encode_edge_label: Annotated[Callable[[EdgeLabel], Iri], 'A function which encodes an edge label as an RDF IRI']
encode_property_key: Annotated[Callable[[PropertyKey], Iri], 'A function which encodes a property key as an RDF IRI']
encode_property_value: Annotated[Callable[[V], Literal], 'A function which encodes a property value as an RDF literal']
encode_vertex_id: Annotated[Callable[[V], Iri], 'A function which encodes a vertex id as an RDF IRI']
encode_vertex_label: Annotated[Callable[[VertexLabel], Iri], 'A function which encodes a vertex label as an RDF IRI']
with_encode_edge_id(encode_edge_id)
with_encode_edge_label(encode_edge_label)
with_encode_property_key(encode_property_key)
with_encode_property_value(encode_property_value)
with_encode_vertex_id(encode_vertex_id)
with_encode_vertex_label(encode_vertex_label)