Install
openclaw skills install graph-constraint-generatorGenerate structural, semantic, and property constraints for knowledge graph schemas including RDF/OWL ontologies and property graph models.
openclaw skills install graph-constraint-generatorGenerate constraints for knowledge graph schemas to enforce data integrity.
This skill automatically creates structural, semantic, and property constraints suitable for RDF/OWL ontologies and Neo4j property graphs.
Input Schema:
Student: student_id (unique), name (required), email
Course: course_code (unique), title (required), credits
Relationship: (Student)-[:ENROLLED_IN]->(Course)
Generated Constraints:
Unique:
Student.student_id UNIQUE
Course.course_code UNIQUE
Required:
Student.name (min 1)
Course.title (min 1)
Relationships:
(Student)-[:ENROLLED_IN]->(Course) [min 1]
Ensure properties uniquely identify nodes
CREATE CONSTRAINT student_id_unique ON (s:Student) REQUIRE s.student_id IS UNIQUE
Define mandatory properties
Student.name IS REQUIRED
Course.title IS REQUIRED
Define allowed graph connections
(Student)-[:ENROLLED_IN]->(Course)
(Professor)-[:TEACHES]->(Course)
Define relationship occurrence limits
Student → ENROLLED_IN → Course (minimum: 1)
Professor → TEACHES → Course (maximum: 10)
Define semantic relationship constraints
:writes rdfs:domain :Researcher ;
rdfs:range :Paper .
Ensure property values match types
student_id: String
credits: Integer
gpa: Float
CREATE CONSTRAINT student_id_unique ON (s:Student) REQUIRE s.student_id IS UNIQUE
CREATE INDEX ON (s:Student)(name)
:StudentShape a sh:NodeShape ;
sh:targetClass :Student ;
sh:property [
sh:path :student_id ;
sh:minCount 1 ;
sh:maxCount 1
] .
:writes rdfs:domain :Researcher ;
rdfs:range :Paper ;
rdf:type owl:ObjectProperty .
✓ Define unique identifiers early
✓ Avoid overly restrictive constraints
✓ Keep domain/range rules clear
✓ Validate data frequently
✓ Combine database and semantic constraints
✓ Document constraint reasoning
✓ Test constraints before production
See constraint-patterns.md for constraint design patterns and example-constraints.md for domain constraint examples.
Version: 1.0.0