shacl_ir/components/disjoint.rs
1use iri_s::IriS;
2use std::fmt::Display;
3
4/// sh:disjoint specifies the condition that the set of value nodes is disjoint
5/// with the set of objects of the triples that have the focus node as subject
6/// and the value of sh:disjoint as predicate.
7///
8/// https://www.w3.org/TR/shacl/#DisjointConstraintComponent
9#[derive(Debug, Clone)]
10pub struct Disjoint {
11 iri: IriS,
12}
13
14impl Disjoint {
15 pub fn new(iri: IriS) -> Self {
16 Disjoint { iri }
17 }
18
19 pub fn iri(&self) -> &IriS {
20 &self.iri
21 }
22}
23
24impl Display for Disjoint {
25 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26 write!(f, "Disjoint: {}", self.iri())
27 }
28}