Class Schema
-
- All Implemented Interfaces:
-
io.github.cfraser.graphguard.plugin.Validator.Rule
@JvmRecord() public final class Schema extends Record implements Validator.Rule
A Schema describes the nodes and relationships in a Neo4j database via the (potentially) interconnected graphs.
Schema implements Validator.Rule, thus has the capability to validate that a Cypher query adheres to the nodes and relationships defined in the graphs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classSchema.GraphA Graph is a KList of nodes that specify the expected entities in a Neo4j database.
public final classSchema.NodeA Node in the graph.
public final classSchema.RelationshipA Relationship in the graph.
public final classSchema.PropertyA Property on a Node or Relationship.
public final classSchema.Metadata
-
Field Summary
Fields Modifier and Type Field Description private final List<Schema.Graph>graphs
-
Method Summary
Modifier and Type Method Description final List<Schema.Graph>getGraphs()the Schema.Graphs defining the Schema.Nodes and Schema.Relationships Validator.Rule.Violationvalidate(String cypher, Map<String, Object> parameters)Validate the cypher and parameters. -
-
Method Detail
-
getGraphs
final List<Schema.Graph> getGraphs()
the Schema.Graphs defining the Schema.Nodes and Schema.Relationships
-
validate
Validator.Rule.Violation validate(String cypher, Map<String, Object> parameters)
Validate the cypher and parameters.
- Parameters:
cypher- a Cypher queryparameters- the cypher parameters- Returns:
Violation if the cypher and parameters violate the Rule, otherwise
null
-
-
-
-