Skip to main content

Component

Enum Component 

Source
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: Pattern

Original RDF pattern value, or a caller-defined compiled representation.

§flags: Option<Flags>

Original RDF flags 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: Value

The shape to count conforming values against.

§min_count: Option<Count>

Minimum number of conforming values.

§max_count: Option<Count>

Maximum number of conforming values.

§disjoint: bool

Whether sibling qualified shapes use disjoint value sets.

§

HasValue(Value)

sh:hasValue.

§

In(Vec<Value>)

sh:in.

§

Closed

sh:closed with sh:ignoredProperties.

Fields

§is_closed: bool

Whether the shape is closed.

§ignored_properties: Vec<Named>

Properties exempt from the closure check.

§

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.

Implementations§

Source§

impl<Value, Count, Flags, Pattern, Named> Component<Value, Count, Flags, Pattern, Named>

Source

pub const fn kind_name(&self) -> &'static str

Return the SHACL constraint kind name.

Source§

impl<Value: Debug, Count: Debug, Flags: Debug, Pattern: Debug, Named: AsRef<str>> Component<Value, Count, Flags, Pattern, Named>

Source

pub fn display_value(&self) -> String

Return a human-readable display value for this component.

Trait Implementations§

Source§

impl<Value: Clone, Count: Clone, Flags: Clone, Pattern: Clone, Named: Clone> Clone for Component<Value, Count, Flags, Pattern, Named>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Value: Debug, Count: Debug, Flags: Debug, Pattern: Debug, Named: Debug> Debug for Component<Value, Count, Flags, Pattern, Named>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, Value, Count, Flags, Pattern, Named> Deserialize<'de> for Component<Value, Count, Flags, Pattern, Named>
where Value: Deserialize<'de>, Count: Deserialize<'de>, Flags: Deserialize<'de>, Pattern: Deserialize<'de>, Named: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<Value: Eq, Count: Eq, Flags: Eq, Pattern: Eq, Named: Eq> Eq for Component<Value, Count, Flags, Pattern, Named>

Source§

impl<Value: Hash, Count: Hash, Flags: Hash, Pattern: Hash, Named: Hash> Hash for Component<Value, Count, Flags, Pattern, Named>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<Value: Ord, Count: Ord, Flags: Ord, Pattern: Ord, Named: Ord> Ord for Component<Value, Count, Flags, Pattern, Named>

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl<Value: PartialEq, Count: PartialEq, Flags: PartialEq, Pattern: PartialEq, Named: PartialEq> PartialEq for Component<Value, Count, Flags, Pattern, Named>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<Value: PartialOrd, Count: PartialOrd, Flags: PartialOrd, Pattern: PartialOrd, Named: PartialOrd> PartialOrd for Component<Value, Count, Flags, Pattern, Named>

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<Value, Count, Flags, Pattern, Named> Serialize for Component<Value, Count, Flags, Pattern, Named>
where Value: Serialize, Count: Serialize, Flags: Serialize, Pattern: Serialize, Named: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<Value: PartialEq, Count: PartialEq, Flags: PartialEq, Pattern: PartialEq, Named: PartialEq> StructuralPartialEq for Component<Value, Count, Flags, Pattern, Named>

Auto Trait Implementations§

§

impl<Value, Count, Flags, Pattern, Named> Forget for Component<Value, Count, Flags, Pattern, Named>

§

impl<Value, Count, Flags, Pattern, Named> Freeze for Component<Value, Count, Flags, Pattern, Named>
where Named: Freeze, Count: Freeze, Value: Freeze, Pattern: Freeze, Option<Flags>: Freeze, ShaclPath<Named>: Freeze, Vec<Value>: Freeze, Option<Count>: Freeze, Vec<Named>: Freeze, Box<SparqlConstraint<Value>>: Freeze, Box<ExpressionConstraint<Value, Named>>: Freeze, CustomConstraint<Value, Named>: Freeze,

§

impl<Value, Count, Flags, Pattern, Named> Move for Component<Value, Count, Flags, Pattern, Named>

§

impl<Value, Count, Flags, Pattern, Named> RefUnwindSafe for Component<Value, Count, Flags, Pattern, Named>

§

impl<Value, Count, Flags, Pattern, Named> Send for Component<Value, Count, Flags, Pattern, Named>
where Named: Send, Count: Send, Value: Send, Pattern: Send, Option<Flags>: Send, ShaclPath<Named>: Send, Vec<Value>: Send, Option<Count>: Send, Vec<Named>: Send, Box<SparqlConstraint<Value>>: Send, Box<ExpressionConstraint<Value, Named>>: Send, CustomConstraint<Value, Named>: Send,

§

impl<Value, Count, Flags, Pattern, Named> Sync for Component<Value, Count, Flags, Pattern, Named>
where Named: Sync, Count: Sync, Value: Sync, Pattern: Sync, Option<Flags>: Sync, ShaclPath<Named>: Sync, Vec<Value>: Sync, Option<Count>: Sync, Vec<Named>: Sync, Box<SparqlConstraint<Value>>: Sync, Box<ExpressionConstraint<Value, Named>>: Sync, CustomConstraint<Value, Named>: Sync,

§

impl<Value, Count, Flags, Pattern, Named> Unpin for Component<Value, Count, Flags, Pattern, Named>
where Named: Unpin, Count: Unpin, Value: Unpin, Pattern: Unpin, Option<Flags>: Unpin, ShaclPath<Named>: Unpin, Vec<Value>: Unpin, Option<Count>: Unpin, Vec<Named>: Unpin, Box<SparqlConstraint<Value>>: Unpin, Box<ExpressionConstraint<Value, Named>>: Unpin, CustomConstraint<Value, Named>: Unpin,

§

impl<Value, Count, Flags, Pattern, Named> UnsafeUnpin for Component<Value, Count, Flags, Pattern, Named>
where Named: UnsafeUnpin, Count: UnsafeUnpin, Value: UnsafeUnpin, Pattern: UnsafeUnpin, Option<Flags>: UnsafeUnpin, ShaclPath<Named>: UnsafeUnpin, Vec<Value>: UnsafeUnpin, Option<Count>: UnsafeUnpin, Vec<Named>: UnsafeUnpin, Box<SparqlConstraint<Value>>: UnsafeUnpin, Box<ExpressionConstraint<Value, Named>>: UnsafeUnpin, CustomConstraint<Value, Named>: UnsafeUnpin,

§

impl<Value, Count, Flags, Pattern, Named> UnwindSafe for Component<Value, Count, Flags, Pattern, Named>
where Named: UnwindSafe, Count: UnwindSafe, Value: UnwindSafe, Pattern: UnwindSafe, Option<Flags>: UnwindSafe, ShaclPath<Named>: UnwindSafe, Vec<Value>: UnwindSafe, Option<Count>: UnwindSafe, Vec<Named>: UnwindSafe, Box<SparqlConstraint<Value>>: UnwindSafe, Box<ExpressionConstraint<Value, Named>>: UnwindSafe, CustomConstraint<Value, Named>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.