pub enum Component<Value = DefaultTerm, Count = Value, Flags = Value, Pattern = Value, Named = Iri<String>> {
Show 35 variants
Class(Named),
Datatype(Named),
NodeKind(NodeKind),
MinCount(Count),
MaxCount(Count),
MinExclusive(Value),
MinInclusive(Value),
MaxExclusive(Value),
MaxInclusive(Value),
MinLength(Count),
MaxLength(Count),
Pattern {
pattern: Pattern,
flags: Option<Flags>,
},
LanguageIn(Vec<LanguageTag>),
UniqueLang(bool),
Equals(ShaclPath<Named>),
Disjoint(ShaclPath<Named>),
LessThan(ShaclPath<Named>),
LessThanOrEquals(ShaclPath<Named>),
And(Vec<Value>),
Or(Vec<Value>),
Not(Value),
Xone(Vec<Value>),
Node(Value),
QualifiedValueShape {
shape: Value,
min_count: Option<Count>,
max_count: Option<Count>,
disjoint: bool,
},
HasValue(Value),
In(Vec<Value>),
Closed {
is_closed: bool,
ignored_properties: Vec<Named>,
},
Sparql(Box<SparqlConstraint<Value>>),
Expression(Box<ExpressionConstraint<Value, Named>>),
Custom(CustomConstraint<Value, Named>),
SingleLine(bool),
MemberShape(Value),
MinListLength(Count),
MaxListLength(Count),
UniqueMembers(bool),
}Expand description
A Core, SPARQL, or AF constraint declaration applied to a shape.
Integer count and length parameters use Count, which defaults to the
caller’s RDF value type. Consumers may instead supply a compiled comparison
type without imposing a machine-integer limit on the structural model.
Regex flags and patterns use independent Flags and Pattern types,
also defaulting to Value. Consumers may retain an RDF reference beside
a compiled representation without requiring an owned lexical string.
Variants§
Class(Named)
sh:class — the value must be an instance of the class.
Datatype(Named)
sh:datatype — the value must have the given datatype.
NodeKind(NodeKind)
sh:nodeKind — the value must have the given RDF node kind.
MinCount(Count)
sh:minCount.
MaxCount(Count)
sh:maxCount.
MinExclusive(Value)
sh:minExclusive.
MinInclusive(Value)
sh:minInclusive.
MaxExclusive(Value)
sh:maxExclusive.
MaxInclusive(Value)
sh:maxInclusive.
MinLength(Count)
sh:minLength.
MaxLength(Count)
sh:maxLength.
Pattern
sh:pattern with optional sh:flags.
Fields
pattern: PatternOriginal RDF pattern value, or a caller-defined compiled representation.
LanguageIn(Vec<LanguageTag>)
sh:languageIn, with each member checked as a BCP 47 language tag.
UniqueLang(bool)
sh:uniqueLang.
Equals(ShaclPath<Named>)
sh:equals.
Disjoint(ShaclPath<Named>)
sh:disjoint.
LessThan(ShaclPath<Named>)
sh:lessThan.
LessThanOrEquals(ShaclPath<Named>)
sh:lessThanOrEquals.
And(Vec<Value>)
sh:and.
Or(Vec<Value>)
sh:or.
Not(Value)
sh:not.
Xone(Vec<Value>)
sh:xone.
Node(Value)
sh:node.
QualifiedValueShape
sh:qualifiedValueShape with optional min/max counts.
Fields
shape: ValueThe shape to count conforming values against.
HasValue(Value)
sh:hasValue.
In(Vec<Value>)
sh:in.
Closed
sh:closed with sh:ignoredProperties.
Fields
Sparql(Box<SparqlConstraint<Value>>)
A sh:sparql constraint declaration.
Expression(Box<ExpressionConstraint<Value, Named>>)
A sh:expression constraint declaration.
Custom(CustomConstraint<Value, Named>)
A use of a separately declared custom component.
SingleLine(bool)
sh:singleLine from the SHACL 1.2 Core 2026-10-14 Working Draft.
When true, literal values must not contain U+000A through U+000D. False explicitly permits multiline values. This declaration is at risk in the draft; representing it does not implement constraint evaluation.
MemberShape(Value)
sh:memberShape from the SHACL 1.2 Core 2026-10-14 Working Draft.
Each value must be a well-formed SHACL list whose members conform to this caller-owned shape reference. The consumer checks and evaluates it.
MinListLength(Count)
Draft sh:minListLength, using the independent caller-owned count type.
The consumer checks the non-negative integer parameter and list structure.
MaxListLength(Count)
Draft sh:maxListLength, using the independent caller-owned count type.
The consumer checks the non-negative integer parameter and list structure.
UniqueMembers(bool)
Draft sh:uniqueMembers — require distinct members when true.
Both true and false require a well-formed SHACL list. False relaxes only the uniqueness check, not list well-formedness. Evaluation is consumer-owned.