Skip to content

SHACL Shape Editor

Build SHACL shapes visually — no Turtle knowledge needed. Load an existing shape file, use templates, or start from scratch.

Shape Recommender — auto-generate shapes from data
or
Prefixes ?

Shape Recommender — Methodology

The Shape Recommender uses data profiling to auto-generate SHACL constraints from instance data. It extends the approach from Mihindukulasooriya et al. (2018) "RDF Shape Induction using Knowledge Base Profiling" with novel constraint types.

Algorithm

  1. Class discovery — finds all classes with rdf:type instances
  2. Property profiling — for each class, counts property usage across all instances
  3. Constraint inference:
    • Cardinality: 90%+ coverage → sh:minCount 1; max 1 per instance → sh:maxCount 1
    • Datatype: consistent XSD type → sh:datatype
    • NodeKind: all IRI values → sh:nodeKind sh:IRI
    • sh:class (novel): 80%+ of IRI values typed as same class → sh:class
    • sh:pattern (novel): auto-detect email, URL, uppercase patterns from string values
    • sh:minLength/maxLength (novel): from string length statistics
    • sh:minInclusive/maxInclusive (novel): from numeric value ranges
    • Uniqueness (novel): all values unique → potential identifier annotation
  4. Confidence scoring — percentage of instances exhibiting each pattern

Input Modes

  • Upload TTL — client-side analysis, instant results
  • SPARQL endpoint — remote profiling via SPARQL queries (top 10 classes, 30 properties each)

References

  • Mihindukulasooriya, N., Poveda-Villalón, M., Li, D., Gómez-Pérez, A. (2018). RDF Shape Induction using Knowledge Base Profiling. SAC 2018.
  • Spahiu, B., Kontokostas, D., Hellmann, S., Auer, S. (2018). Towards Improving the Quality of Knowledge Graphs with Data-driven Ontology Patterns. ISWC 2018.

What is SHACL?

SHACL (Shapes Constraint Language) defines rules that RDF data must follow. Think of it as a "schema" for your knowledge graph.

Key Concepts

Concept What it means Example
sh:NodeShape A set of rules for a class "Rules for Person instances"
sh:targetClass Which class the rules apply to ex:Person
sh:property A constraint on a specific property "must have a name"
sh:minCount Minimum values required (0 = optional, 1 = mandatory) sh:minCount 1
sh:maxCount Maximum values allowed (1 = at most one) sh:maxCount 1
sh:datatype Value must be a specific type xsd:string, xsd:date
sh:nodeKind Value must be IRI, literal, or blank node sh:IRI
sh:pattern Value must match a regex ^[A-Z]
sh:closed Only declared properties are allowed Prevents unexpected data
sh:message Custom error message "Name is required"

Common Patterns

Mandatory property: sh:minCount 1 — the property must exist at least once

Exactly one: sh:minCount 1; sh:maxCount 1 — must have exactly one value

Optional with limit: sh:maxCount 3 — at most 3 values (but can be 0)

Type constraint: sh:datatype xsd:string — value must be a string

Email validation: sh:pattern "^[^@]+@[^@]+\\.[^@]+$" — must match email regex