hydra.validate.pg module

Validation functions for property graphs.

hydra.validate.pg.append_finding_edge(p: ValidationProfile, acc: ValidationResult[T0], finding: object) ValidationResult[T0]

Append a rule-tagged InvalidEdgeError finding to a ValidationResult.

hydra.validate.pg.append_finding_graph(p: ValidationProfile, acc: ValidationResult[T0], finding: object) ValidationResult[T0]

Append a rule-tagged InvalidGraphError finding to a ValidationResult.

hydra.validate.pg.append_finding_property(p: ValidationProfile, acc: ValidationResult[T0], finding: object) ValidationResult[T0]

Append a rule-tagged InvalidElementPropertyError finding to a ValidationResult.

hydra.validate.pg.append_finding_vertex(p: ValidationProfile, acc: ValidationResult[T0], finding: object) ValidationResult[T0]

Append a rule-tagged InvalidVertexError finding to a ValidationResult, classifying as error or warning per the profile and respecting maxErrors/maxWarnings bounds.

hydra.validate.pg.default_pg_profile() ValidationProfile

The default validation profile for property-graph validation. Every PG rule classified as an error; no warnings; maxErrors=1, maxWarnings=20.

hydra.validate.pg.enabled_pg(p: ValidationProfile, rule_name: Name) bool

True iff the given rule name appears in the profile’s errorRules or warningRules.

hydra.validate.pg.validate_edge(p: ValidationProfile, check_value: Callable[[T0, T1], object], label_for_vertex_id: object, typ: EdgeType[T0], el: Edge[T1]) ValidationResult[InvalidEdgeError]

Validate an edge against its EdgeType under the given ValidationProfile, returning a ValidationResult InvalidEdgeError.

hydra.validate.pg.validate_graph(p: ValidationProfile, acc0: ValidationResult[object], check_value: Callable[[T1, T0], object], schema: GraphSchema[T1], graph: Graph[T0]) ValidationResult[object]

Validate a property graph against a GraphSchema under the given ValidationProfile, threading a ValidationResult InvalidGraphError accumulator. Errors hard-stop traversal once maxErrors is reached.

hydra.validate.pg.validate_properties(p: ValidationProfile, check_value: Callable[[T0, T1], object], types: Sequence[PropertyType[T0]], props: Mapping[PropertyKey, T1]) ValidationResult[InvalidElementPropertyError]

Validate a map of properties against a list of PropertyType under the given ValidationProfile, returning a ValidationResult InvalidElementPropertyError.

hydra.validate.pg.validate_vertex(p: ValidationProfile, check_value: Callable[[T0, T1], object], typ: VertexType[T0], el: Vertex[T1]) ValidationResult[InvalidVertexError]

Validate a vertex against its VertexType under the given ValidationProfile, returning a ValidationResult InvalidVertexError.