We need a tool to validate elements (vertices or edges) in the Property Graph data model (hydra/langs/tinkerpop/propertyGraph) against element types (vertex or edge types). This validator will operate at the level of individual elements (and therefore in linear time w.r.t. the number of elements), not at the level of a whole graph. It will check for vertices that:
The label of the element matches the label of the type
The id of the element conforms to the id type of the element type
Each property of the element conforms to the corresponding property of the element type
No properties are present in the element which are not present in the element type
Additionally for edges, it will check that:
The label of the out-vertex matches the out-vertex label of the edge type
The label of the in-vertex matches the in-vertex label of the edge type
The immediate need for the validator is in Java, but it may be worthwhile to write the utility in the Haskell DSL so that it can be used in both languages. This code is likely to be used in additional TinkerPop language variants in the future.
Note: the implementation also validates graphs against schemas, in addition to validating vertices against vertex types and edges against edge types. Migration into the DSL is still TODO.
We need a tool to validate elements (vertices or edges) in the Property Graph data model (
hydra/langs/tinkerpop/propertyGraph
) against element types (vertex or edge types). This validator will operate at the level of individual elements (and therefore in linear time w.r.t. the number of elements), not at the level of a whole graph. It will check for vertices that:Additionally for edges, it will check that:
The immediate need for the validator is in Java, but it may be worthwhile to write the utility in the Haskell DSL so that it can be used in both languages. This code is likely to be used in additional TinkerPop language variants in the future.