Skip to main content

shacl_ir/components/
node_kind.rs

1use shacl_ast::node_kind::NodeKind;
2use std::fmt::Display;
3
4/// sh:nodeKind specifies a condition to be satisfied by the RDF node kind of
5/// each value node.
6///
7/// https://www.w3.org/TR/shacl/#NodeKindConstraintComponent
8#[derive(Debug, Clone)]
9pub struct Nodekind {
10    node_kind: NodeKind,
11}
12
13impl Nodekind {
14    pub fn new(node_kind: NodeKind) -> Self {
15        Nodekind { node_kind }
16    }
17
18    pub fn node_kind(&self) -> &NodeKind {
19        &self.node_kind
20    }
21}
22
23impl Display for Nodekind {
24    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25        write!(f, "NodeKind: {:?}", self.node_kind())
26    }
27}