owl_structural_model/
class_axiom.rs1use crate::{Axiom, AxiomAnnotations, ClassExpression, Entity, OperandSet, StructuralModelError};
3use iri_rfc3987::Iri;
4impl<L, B> Axiom<L, B> {
5 #[must_use]
7 pub fn declaration(entity: Entity) -> Self {
8 Self::Declaration {
9 entity,
10 annotations: AxiomAnnotations::empty(),
11 }
12 }
13 #[must_use]
15 pub fn sub_class_of(
16 sub_class: ClassExpression<L, B>,
17 super_class: ClassExpression<L, B>,
18 ) -> Self {
19 Self::SubClassOf {
20 sub_class,
21 super_class,
22 annotations: AxiomAnnotations::empty(),
23 }
24 }
25 pub fn equivalent_classes(
29 classes: Vec<ClassExpression<L, B>>,
30 ) -> Result<Self, StructuralModelError> {
31 Ok(Self::EquivalentClasses {
32 classes: OperandSet::try_new(classes)?,
33 annotations: AxiomAnnotations::empty(),
34 })
35 }
36 pub fn disjoint_classes(
40 classes: Vec<ClassExpression<L, B>>,
41 ) -> Result<Self, StructuralModelError> {
42 Ok(Self::DisjointClasses {
43 classes: OperandSet::try_new(classes)?,
44 annotations: AxiomAnnotations::empty(),
45 })
46 }
47 pub fn disjoint_union(
51 class: Iri<String>,
52 classes: Vec<ClassExpression<L, B>>,
53 ) -> Result<Self, StructuralModelError> {
54 Ok(Self::DisjointUnion {
55 class,
56 classes: OperandSet::try_new(classes)?,
57 annotations: AxiomAnnotations::empty(),
58 })
59 }
60}