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