owl_structural_model/
data_axiom.rs1use crate::{
3 Axiom, AxiomAnnotations, ClassExpression, DataRange, KeyProperties, OperandSet,
4 StructuralModelError,
5};
6use iri_rfc3987::Iri;
7impl<L, B> Axiom<L, B> {
8 #[must_use]
10 pub fn sub_data_property_of(sub_property: Iri<String>, super_property: Iri<String>) -> Self {
11 Self::SubDataPropertyOf {
12 sub_property,
13 super_property,
14 annotations: AxiomAnnotations::empty(),
15 }
16 }
17 pub fn equivalent_data_properties(
21 properties: Vec<Iri<String>>,
22 ) -> Result<Self, StructuralModelError> {
23 Ok(Self::EquivalentDataProperties {
24 properties: OperandSet::try_new(properties)?,
25 annotations: AxiomAnnotations::empty(),
26 })
27 }
28 pub fn disjoint_data_properties(
32 properties: Vec<Iri<String>>,
33 ) -> Result<Self, StructuralModelError> {
34 Ok(Self::DisjointDataProperties {
35 properties: OperandSet::try_new(properties)?,
36 annotations: AxiomAnnotations::empty(),
37 })
38 }
39 #[must_use]
41 pub fn data_property_domain(property: Iri<String>, domain: ClassExpression<L, B>) -> Self {
42 Self::DataPropertyDomain {
43 property,
44 domain,
45 annotations: AxiomAnnotations::empty(),
46 }
47 }
48 #[must_use]
50 pub fn data_property_range(property: Iri<String>, range: DataRange<L>) -> Self {
51 Self::DataPropertyRange {
52 property,
53 range,
54 annotations: AxiomAnnotations::empty(),
55 }
56 }
57 #[must_use]
59 pub fn functional_data_property(property: Iri<String>) -> Self {
60 Self::FunctionalDataProperty {
61 property,
62 annotations: AxiomAnnotations::empty(),
63 }
64 }
65 #[must_use]
67 pub fn datatype_definition(datatype: Iri<String>, range: DataRange<L>) -> Self {
68 Self::DatatypeDefinition {
69 datatype,
70 range,
71 annotations: AxiomAnnotations::empty(),
72 }
73 }
74 #[must_use]
76 pub fn has_key(class: ClassExpression<L, B>, properties: KeyProperties) -> Self {
77 Self::HasKey {
78 class,
79 properties,
80 annotations: AxiomAnnotations::empty(),
81 }
82 }
83}