owl_structural_model/axiom.rs
1//! All 37 OWL 2 axiom families.
2
3use crate::{
4 AnnotationSubject, AnnotationValue, AxiomAnnotations, ClassExpression, DataRange, Entity,
5 Individual, KeyProperties, ObjectPropertyExpression, OperandSet, SubObjectPropertyExpression,
6 UnorderedPair,
7};
8use iri_rfc3987::Iri;
9
10/// A structural OWL 2 axiom, independent of a backend or reasoner.
11#[derive(Debug, Clone, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
12#[serde(deny_unknown_fields)]
13pub enum Axiom<L = crate::OwlLiteral, B = crate::BlankNodeId> {
14 /// The `Declaration` axiom family.
15 Declaration {
16 /// The entity operand.
17 entity: Entity,
18 /// Unordered, recursively nested axiom annotations.
19 annotations: AxiomAnnotations<L, B>,
20 },
21 /// The `SubClassOf` axiom family.
22 SubClassOf {
23 /// The sub class operand.
24 sub_class: ClassExpression<L, B>,
25 /// The super class operand.
26 super_class: ClassExpression<L, B>,
27 /// Unordered, recursively nested axiom annotations.
28 annotations: AxiomAnnotations<L, B>,
29 },
30 /// The `EquivalentClasses` axiom family.
31 EquivalentClasses {
32 /// The classes operand.
33 classes: OperandSet<ClassExpression<L, B>, 2>,
34 /// Unordered, recursively nested axiom annotations.
35 annotations: AxiomAnnotations<L, B>,
36 },
37 /// The `DisjointClasses` axiom family.
38 DisjointClasses {
39 /// The classes operand.
40 classes: OperandSet<ClassExpression<L, B>, 2>,
41 /// Unordered, recursively nested axiom annotations.
42 annotations: AxiomAnnotations<L, B>,
43 },
44 /// The `DisjointUnion` axiom family.
45 DisjointUnion {
46 /// The class operand.
47 class: Iri<String>,
48 /// The classes operand.
49 classes: OperandSet<ClassExpression<L, B>, 2>,
50 /// Unordered, recursively nested axiom annotations.
51 annotations: AxiomAnnotations<L, B>,
52 },
53 /// The `SubObjectPropertyOf` axiom family.
54 SubObjectPropertyOf {
55 /// The sub property operand.
56 sub_property: SubObjectPropertyExpression,
57 /// The super property operand.
58 super_property: ObjectPropertyExpression,
59 /// Unordered, recursively nested axiom annotations.
60 annotations: AxiomAnnotations<L, B>,
61 },
62 /// The `FunctionalObjectProperty` axiom family.
63 FunctionalObjectProperty {
64 /// The property operand.
65 property: ObjectPropertyExpression,
66 /// Unordered, recursively nested axiom annotations.
67 annotations: AxiomAnnotations<L, B>,
68 },
69 /// The `InverseFunctionalObjectProperty` axiom family.
70 InverseFunctionalObjectProperty {
71 /// The property operand.
72 property: ObjectPropertyExpression,
73 /// Unordered, recursively nested axiom annotations.
74 annotations: AxiomAnnotations<L, B>,
75 },
76 /// The `ReflexiveObjectProperty` axiom family.
77 ReflexiveObjectProperty {
78 /// The property operand.
79 property: ObjectPropertyExpression,
80 /// Unordered, recursively nested axiom annotations.
81 annotations: AxiomAnnotations<L, B>,
82 },
83 /// The `IrreflexiveObjectProperty` axiom family.
84 IrreflexiveObjectProperty {
85 /// The property operand.
86 property: ObjectPropertyExpression,
87 /// Unordered, recursively nested axiom annotations.
88 annotations: AxiomAnnotations<L, B>,
89 },
90 /// The `SymmetricObjectProperty` axiom family.
91 SymmetricObjectProperty {
92 /// The property operand.
93 property: ObjectPropertyExpression,
94 /// Unordered, recursively nested axiom annotations.
95 annotations: AxiomAnnotations<L, B>,
96 },
97 /// The `AsymmetricObjectProperty` axiom family.
98 AsymmetricObjectProperty {
99 /// The property operand.
100 property: ObjectPropertyExpression,
101 /// Unordered, recursively nested axiom annotations.
102 annotations: AxiomAnnotations<L, B>,
103 },
104 /// The `TransitiveObjectProperty` axiom family.
105 TransitiveObjectProperty {
106 /// The property operand.
107 property: ObjectPropertyExpression,
108 /// Unordered, recursively nested axiom annotations.
109 annotations: AxiomAnnotations<L, B>,
110 },
111 /// The `EquivalentObjectProperties` axiom family.
112 EquivalentObjectProperties {
113 /// The properties operand.
114 properties: OperandSet<ObjectPropertyExpression, 2>,
115 /// Unordered, recursively nested axiom annotations.
116 annotations: AxiomAnnotations<L, B>,
117 },
118 /// The `DisjointObjectProperties` axiom family.
119 DisjointObjectProperties {
120 /// The properties operand.
121 properties: OperandSet<ObjectPropertyExpression, 2>,
122 /// Unordered, recursively nested axiom annotations.
123 annotations: AxiomAnnotations<L, B>,
124 },
125 /// The `InverseObjectProperties` axiom family.
126 InverseObjectProperties {
127 /// The properties operand.
128 properties: UnorderedPair<ObjectPropertyExpression>,
129 /// Unordered, recursively nested axiom annotations.
130 annotations: AxiomAnnotations<L, B>,
131 },
132 /// The `ObjectPropertyDomain` axiom family.
133 ObjectPropertyDomain {
134 /// The property operand.
135 property: ObjectPropertyExpression,
136 /// The domain operand.
137 domain: ClassExpression<L, B>,
138 /// Unordered, recursively nested axiom annotations.
139 annotations: AxiomAnnotations<L, B>,
140 },
141 /// The `ObjectPropertyRange` axiom family.
142 ObjectPropertyRange {
143 /// The property operand.
144 property: ObjectPropertyExpression,
145 /// The range operand.
146 range: ClassExpression<L, B>,
147 /// Unordered, recursively nested axiom annotations.
148 annotations: AxiomAnnotations<L, B>,
149 },
150 /// The `SubDataPropertyOf` axiom family.
151 SubDataPropertyOf {
152 /// The sub property operand.
153 sub_property: Iri<String>,
154 /// The super property operand.
155 super_property: Iri<String>,
156 /// Unordered, recursively nested axiom annotations.
157 annotations: AxiomAnnotations<L, B>,
158 },
159 /// The `EquivalentDataProperties` axiom family.
160 EquivalentDataProperties {
161 /// The properties operand.
162 properties: OperandSet<Iri<String>, 2>,
163 /// Unordered, recursively nested axiom annotations.
164 annotations: AxiomAnnotations<L, B>,
165 },
166 /// The `DisjointDataProperties` axiom family.
167 DisjointDataProperties {
168 /// The properties operand.
169 properties: OperandSet<Iri<String>, 2>,
170 /// Unordered, recursively nested axiom annotations.
171 annotations: AxiomAnnotations<L, B>,
172 },
173 /// The `DataPropertyDomain` axiom family.
174 DataPropertyDomain {
175 /// The property operand.
176 property: Iri<String>,
177 /// The domain operand.
178 domain: ClassExpression<L, B>,
179 /// Unordered, recursively nested axiom annotations.
180 annotations: AxiomAnnotations<L, B>,
181 },
182 /// The `DataPropertyRange` axiom family.
183 DataPropertyRange {
184 /// The property operand.
185 property: Iri<String>,
186 /// The range operand.
187 range: DataRange<L>,
188 /// Unordered, recursively nested axiom annotations.
189 annotations: AxiomAnnotations<L, B>,
190 },
191 /// The `FunctionalDataProperty` axiom family.
192 FunctionalDataProperty {
193 /// The property operand.
194 property: Iri<String>,
195 /// Unordered, recursively nested axiom annotations.
196 annotations: AxiomAnnotations<L, B>,
197 },
198 /// The `DatatypeDefinition` axiom family.
199 DatatypeDefinition {
200 /// The datatype operand.
201 datatype: Iri<String>,
202 /// The range operand.
203 range: DataRange<L>,
204 /// Unordered, recursively nested axiom annotations.
205 annotations: AxiomAnnotations<L, B>,
206 },
207 /// The `HasKey` axiom family.
208 HasKey {
209 /// The class operand.
210 class: ClassExpression<L, B>,
211 /// The properties operand.
212 properties: KeyProperties,
213 /// Unordered, recursively nested axiom annotations.
214 annotations: AxiomAnnotations<L, B>,
215 },
216 /// The `SameIndividual` axiom family.
217 SameIndividual {
218 /// The individuals operand.
219 individuals: OperandSet<Individual<B>, 2>,
220 /// Unordered, recursively nested axiom annotations.
221 annotations: AxiomAnnotations<L, B>,
222 },
223 /// The `DifferentIndividuals` axiom family.
224 DifferentIndividuals {
225 /// The individuals operand.
226 individuals: OperandSet<Individual<B>, 2>,
227 /// Unordered, recursively nested axiom annotations.
228 annotations: AxiomAnnotations<L, B>,
229 },
230 /// The `ClassAssertion` axiom family.
231 ClassAssertion {
232 /// The class operand.
233 class: ClassExpression<L, B>,
234 /// The individual operand.
235 individual: Individual<B>,
236 /// Unordered, recursively nested axiom annotations.
237 annotations: AxiomAnnotations<L, B>,
238 },
239 /// The `ObjectPropertyAssertion` axiom family.
240 ObjectPropertyAssertion {
241 /// The property operand.
242 property: ObjectPropertyExpression,
243 /// The source operand.
244 source: Individual<B>,
245 /// The target operand.
246 target: Individual<B>,
247 /// Unordered, recursively nested axiom annotations.
248 annotations: AxiomAnnotations<L, B>,
249 },
250 /// The `NegativeObjectPropertyAssertion` axiom family.
251 NegativeObjectPropertyAssertion {
252 /// The property operand.
253 property: ObjectPropertyExpression,
254 /// The source operand.
255 source: Individual<B>,
256 /// The target operand.
257 target: Individual<B>,
258 /// Unordered, recursively nested axiom annotations.
259 annotations: AxiomAnnotations<L, B>,
260 },
261 /// The `DataPropertyAssertion` axiom family.
262 DataPropertyAssertion {
263 /// The property operand.
264 property: Iri<String>,
265 /// The source operand.
266 source: Individual<B>,
267 /// The value operand.
268 value: L,
269 /// Unordered, recursively nested axiom annotations.
270 annotations: AxiomAnnotations<L, B>,
271 },
272 /// The `NegativeDataPropertyAssertion` axiom family.
273 NegativeDataPropertyAssertion {
274 /// The property operand.
275 property: Iri<String>,
276 /// The source operand.
277 source: Individual<B>,
278 /// The value operand.
279 value: L,
280 /// Unordered, recursively nested axiom annotations.
281 annotations: AxiomAnnotations<L, B>,
282 },
283 /// The `AnnotationAssertion` axiom family.
284 AnnotationAssertion {
285 /// The property operand.
286 property: Iri<String>,
287 /// The subject operand.
288 subject: AnnotationSubject<B>,
289 /// The value operand.
290 value: AnnotationValue<L, B>,
291 /// Unordered, recursively nested axiom annotations.
292 annotations: AxiomAnnotations<L, B>,
293 },
294 /// The `SubAnnotationPropertyOf` axiom family.
295 SubAnnotationPropertyOf {
296 /// The sub property operand.
297 sub_property: Iri<String>,
298 /// The super property operand.
299 super_property: Iri<String>,
300 /// Unordered, recursively nested axiom annotations.
301 annotations: AxiomAnnotations<L, B>,
302 },
303 /// The `AnnotationPropertyDomain` axiom family.
304 AnnotationPropertyDomain {
305 /// The property operand.
306 property: Iri<String>,
307 /// The domain operand.
308 domain: Iri<String>,
309 /// Unordered, recursively nested axiom annotations.
310 annotations: AxiomAnnotations<L, B>,
311 },
312 /// The `AnnotationPropertyRange` axiom family.
313 AnnotationPropertyRange {
314 /// The property operand.
315 property: Iri<String>,
316 /// The range operand.
317 range: Iri<String>,
318 /// Unordered, recursively nested axiom annotations.
319 annotations: AxiomAnnotations<L, B>,
320 },
321}