sdml_core/stdlib/
sdml.rs

1/*!
2This Rust module contains the SDML model of the SDML library module `sdml`.
3*/
4
5use crate::model::{
6    annotations::{AnnotationOnlyBody, HasAnnotations},
7    modules::Module,
8    HasBody,
9};
10use std::str::FromStr;
11
12// ------------------------------------------------------------------------------------------------
13// Public Types
14// ------------------------------------------------------------------------------------------------
15
16pub const MODULE_NAME: &str = "sdml";
17pub const MODULE_URL: &str = "http://sdml.io/sdml-owl.ttl#";
18
19/* Classes */
20pub const ANNOTATION_PROPERTY: &str = "AnnotationProperty";
21pub const CARDINALITY: &str = "Cardinality";
22pub const MAP_TYPE: &str = "MapType";
23pub const CONSTRAINT: &str = "Constraint";
24pub const DEFINITION: &str = "Definition";
25pub const DATATYPE: &str = "Datatype";
26pub const DIMENSION: &str = "Dimension";
27pub const ENTITY: &str = "Entity";
28pub const ENUMERATION: &str = "Enumeration";
29pub const EVENT: &str = "Event";
30pub const FORMAL_CONSTRAINT: &str = "FormalConstraint";
31pub const IMPORT: &str = "Import";
32pub const IMPORT_STATEMENT: &str = "ImportStatement";
33pub const INFORMAL_CONSTRAINT: &str = "InformalConstraint";
34pub const MEMBER: &str = "Member";
35pub const MEMBER_IMPORT: &str = "MemberImport";
36pub const MODULE: &str = "Module";
37pub const MODULE_IMPORT: &str = "ModuleImport";
38pub const ORDERING_CONSTRAINT: &str = "OrderingConstraint";
39pub const PROPERTY: &str = "Property";
40pub const RDF: &str = "Rdf";
41pub const STRUCTURE: &str = "Structure";
42pub const SEQUENCE: &str = "Sequence";
43pub const TYPE_CLASS: &str = "TypeClass";
44pub const TYPE_VARIANT: &str = "TypeVariant";
45pub const UNION: &str = "Union";
46pub const UNKNOWN: &str = "Unknown";
47pub const VALUE_VARIANT: &str = "ValueVariant";
48pub const ANNOTATION: &str = "Annotation";
49pub const UNIQUENESS_CONSTRAINT: &str = "UniquenessConstraint";
50
51/* Datatypes */
52pub const BINARY: &str = "binary";
53pub const BOOLEAN: &str = "boolean";
54pub const CONTROLLED_LANGUAGE: &str = "controlledLanguage";
55pub const DECIMAL: &str = "decimal";
56pub const DOUBLE: &str = "double";
57pub const INTEGER: &str = "integer";
58pub const IRI: &str = "iri";
59pub const LANGUAGE: &str = "language";
60pub const STRING: &str = "string";
61pub const UNSIGNED: &str = "unsigned";
62
63pub const IDENTIFIER: &str = "identifier";
64pub const QUALIFIED_IDENTIFIER: &str = "qualifiedIdentifier";
65pub const IDENTIFIER_REFERENCE: &str = "identifierReference";
66
67/* Properties */
68pub const HAS_ANNOTATION: &str = "hasAnnotation";
69pub const HAS_CARDINALITY: &str = "hasCardinality";
70pub const CONTROLLED_LANG_STRING: &str = "controlledLangString";
71pub const HAS_CONSTRAINT: &str = "hasConstraint";
72pub const HAS_DEFINITION: &str = "hasDefinition";
73pub const DOMAIN_TYPE: &str = "domainType";
74pub const DOMAIN_VALUE: &str = "domainValue";
75pub const HAS_ELEMENT: &str = "hasElement";
76pub const HAS_IMPORT_STATEMENT: &str = "hasImportStatement";
77pub const HAS_MEMBER: &str = "hasMember";
78pub const IDENTITY_MEMBER: &str = "identityMember";
79pub const NAME: &str = "name";
80pub const RANGE_TYPE: &str = "rangeType";
81pub const RANGE_VALUE: &str = "rangeValue";
82pub const SOURCE_ENTITY: &str = "sourceEntity";
83pub const SOURCE_LOCATION: &str = "sourceLocation";
84pub const HAS_TYPE: &str = "hasType";
85pub const HAS_TYPE_VARIANT: &str = "hasTypeVariant";
86pub const HAS_VALUE_VARIANT: &str = "hasValueVariant";
87pub const END_BYTE: &str = "endByte";
88pub const START_BYTE: &str = "startByte";
89pub const MAX_OCCURS: &str = "maxOccurs";
90pub const MIN_OCCURS: &str = "minOccurs";
91pub const ORDERING: &str = "ordering";
92pub const SRC_LABEL: &str = "srcLabel";
93pub const UNIQUENESS: &str = "uniqueness";
94
95/* Values */
96pub const ORDERED: &str = "Ordered";
97pub const UNIQUE: &str = "Unique";
98pub const NONUNIQUE: &str = "NonUnique";
99pub const UNORDERED: &str = "Unordered";
100
101// ------------------------------------------------------------------------------------------------
102// Public Functions
103// ------------------------------------------------------------------------------------------------
104
105module_function!(|| {
106    let module_uri: url::Url = url::Url::parse(MODULE_URL).unwrap();
107
108    module!(
109        id!(unchecked sdml), module_uri ; call |module: Module|
110        module.with_imports([import_statement!(
111            id!(unchecked owl),
112            id!(unchecked rdf),
113            id!(unchecked rdfs),
114            id!(unchecked skos),
115            id!(unchecked xsd)
116        )])
117            .with_definitions([
118                // ---------------------------------------------------------------------------------
119                // Classes ❱ Traits
120                // ---------------------------------------------------------------------------------
121                rdf!(
122                    id!(unchecked Annotated) ;
123                    class ;
124                    call |body: AnnotationOnlyBody|
125                    body.with_annotations([
126                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
127                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Annotated"@en)),
128                    ])).into(),
129                rdf!(
130                    id!(unchecked annotation) ;
131                    property id!(unchecked owl:ObjectProperty) ;
132                    call |body: AnnotationOnlyBody|
133                    body.with_annotations([
134                        annotation!(id!(unchecked rdfs:domain), id!(unchecked Annotated)),
135                        annotation!(id!(unchecked rdfs:range), id!(unchecked Annotation)),
136                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
137                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("annotation"@en)),
138                   ])).into(),
139                rdf!(
140                    id!(unchecked Named) ;
141                    class ;
142                    call |body: AnnotationOnlyBody|
143                    body.with_annotations([
144                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
145                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Named"@en)),
146                    ])).into(),
147                rdf!(
148                    id!(unchecked name) ;
149                    property id!(unchecked  owl:DatatypeProperty) ;
150                    call |body: AnnotationOnlyBody|
151                    body.with_annotations([
152                        annotation!(id!(unchecked rdfs:domain), id!(unchecked Named)),
153                        annotation!(id!(unchecked rdfs:range), id!(unchecked Identifier)),
154                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
155                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("name"@en)),
156                   ])).into(),
157                // ---------------------------------------------------------------------------------
158                // Classes ❱ Annotations
159                // ---------------------------------------------------------------------------------
160                rdf!(
161                    id!(unchecked Annotation) ;
162                    class ;
163                    call |body: AnnotationOnlyBody|
164                    body.with_annotations([
165                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
166                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Annotation"@en)),
167                    ])).into(),
168                rdf!(
169                    id!(unchecked AnnotationProperty) ;
170                    class id!(unchecked Annotation),  id!(unchecked owl:AnnotationProperty) ;
171                    call |body: AnnotationOnlyBody|
172                    body.with_annotations([
173                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
174                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Annotation Property"@en)),
175                        annotation!(id!(unchecked owl:disjointWith), id!(unchecked Constraint)),
176                    ])).into(),
177                rdf!(
178                    id!(unchecked Constraint) ;
179                    class  id!(unchecked Annotation) ;
180                    call |body: AnnotationOnlyBody|
181                    body.with_annotations([
182                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
183                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Constraint"@en)),
184                        annotation!(id!(unchecked owl:disjointWith), id!(unchecked AnnotationProperty)),
185                    ])).into(),
186                rdf!(
187                    id!(unchecked InformalConstraint) ;
188                    class  id!(unchecked Constraint) ;
189                    call |body: AnnotationOnlyBody|
190                    body.with_annotations([
191                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
192                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Informal Constraint"@en)),
193                        annotation!(id!(unchecked owl:disjointWith), id!(unchecked FormalConstraint)),
194                    ])).into(),
195                rdf!(
196                    id!(unchecked FormalConstraint) ;
197                    class  id!(unchecked Constraint) ;
198                    call |body: AnnotationOnlyBody|
199                    body.with_annotations([
200                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
201                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Formal Constraint"@en)),
202                        annotation!(id!(unchecked owl:disjointWith), id!(unchecked InformalConstraint)),
203                    ])).into(),
204                // ---------------------------------------------------------------------------------
205                // Classes ❱ Modules & Imports
206                // ---------------------------------------------------------------------------------
207                rdf!(
208                    id!(unchecked Module) ;
209                    class  id!(unchecked Annotated) ;
210                    call |body: AnnotationOnlyBody|
211                    body.with_annotations([
212                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
213                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Module"@en)),
214                    ])).into(),
215                rdf!(
216                    id!(unchecked imports) ;
217                    property id!(unchecked owl:ObjectProperty) ;
218                    call |body: AnnotationOnlyBody|
219                    body.with_annotations([
220                        annotation!(id!(unchecked rdfs:domain), id!(unchecked Module)),
221                        annotation!(id!(unchecked rdfs:range), id!(unchecked ImportStatement)),
222                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
223                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("imports"@en)),
224                   ])).into(),
225                rdf!(
226                    id!(unchecked hasDefinition) ;
227                    property id!(unchecked owl:ObjectProperty) ;
228                    call |body: AnnotationOnlyBody|
229                    body.with_annotations([
230                        annotation!(id!(unchecked rdfs:domain), id!(unchecked Module)),
231                        annotation!(id!(unchecked rdfs:range), id!(unchecked Definition)),
232                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
233                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("has definition"@en)),
234                   ])).into(),
235                rdf!(
236                    id!(unchecked ImportStatement) ;
237                    class ;
238                    call |body: AnnotationOnlyBody|
239                    body.with_annotations([
240                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
241                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Import Statement"@en)),
242                    ])).into(),
243                rdf!(
244                    id!(unchecked import) ;
245                    property id!(unchecked owl:ObjectProperty) ;
246                    call |body: AnnotationOnlyBody|
247                    body.with_annotations([
248                        annotation!(id!(unchecked rdfs:domain), id!(unchecked ImportStatement)),
249                        annotation!(id!(unchecked rdfs:range), id!(unchecked Import)),
250                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
251                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("import"@en)),
252                   ])).into(),
253                rdf!(
254                    id!(unchecked Import) ;
255                    class ;
256                    call |body: AnnotationOnlyBody|
257                    body.with_annotations([
258                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
259                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Import"@en)),
260                    ])).into(),
261                rdf!(
262                    id!(unchecked imported) ;
263                    property id!(unchecked owl:ObjectProperty) ;
264                    call |body: AnnotationOnlyBody|
265                    body.with_annotations([
266                        annotation!(id!(unchecked rdfs:domain), id!(unchecked Import)),
267                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
268                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("imported"@en)),
269                   ])).into(),
270                rdf!(
271                    id!(unchecked rename) ;
272                    property id!(unchecked owl:ObjectProperty) ;
273                    call |body: AnnotationOnlyBody|
274                    body.with_annotations([
275                        annotation!(id!(unchecked rdfs:domain), id!(unchecked Import)),
276                        annotation!(id!(unchecked rdfs:range), id!(unchecked Identifier)),
277                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
278                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("imported"@en)),
279                   ])).into(),
280                rdf!(
281                    id!(unchecked MemberImport) ;
282                    class  id!(unchecked Import) ;
283                    call |body: AnnotationOnlyBody|
284                    body.with_annotations([
285                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
286                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Member Import"@en)),
287                        annotation!(id!(unchecked owl:disjointWith), id!(unchecked ModuleImport)),
288                    ])).into(),
289                rdf!(
290                    id!(unchecked importedMember) ;
291                    property id!(unchecked owl:DatatypeProperty),  id!(unchecked imported) ;
292                    call |body: AnnotationOnlyBody|
293                    body.with_annotations([
294                        annotation!(id!(unchecked rdfs:domain), id!(unchecked MemberImport)),
295                        annotation!(id!(unchecked rdfs:range), id!(unchecked QualifiedIdentifier)),
296                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
297                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("imported member"@en)),
298                   ])).into(),
299                rdf!(
300                    id!(unchecked ModuleImport) ;
301                    class id!(unchecked Import) ;
302                    call |body: AnnotationOnlyBody|
303                    body.with_annotations([
304                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
305                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Module Import"@en)),
306                        annotation!(id!(unchecked owl:disjointWith), id!(unchecked MemberImport)),
307                    ])).into(),
308                rdf!(
309                    id!(unchecked importedModule) ;
310                    property id!(unchecked owl:DatatypeProperty),  id!(unchecked imported) ;
311                    call |body: AnnotationOnlyBody|
312                    body.with_annotations([
313                        annotation!(id!(unchecked rdfs:domain), id!(unchecked ModuleImport)),
314                        annotation!(id!(unchecked rdfs:range), id!(unchecked Identifier)),
315                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
316                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("imported module"@en)),
317                   ])).into(),
318                rdf!(
319                    id!(unchecked importedModuleVersion) ;
320                    property id!(unchecked owl:DatatypeProperty) ;
321                    call |body: AnnotationOnlyBody|
322                    body.with_annotations([
323                        annotation!(id!(unchecked rdfs:domain), id!(unchecked ModuleImport)),
324                        annotation!(id!(unchecked rdfs:range), id!(unchecked xsd:AnyURI)),
325                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
326                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("imported module's version"@en)),
327                   ])).into(),
328                // ---------------------------------------------------------------------------------
329                // Classes ❱ Definitions
330                // ---------------------------------------------------------------------------------
331                 rdf!(
332                    id!(unchecked AnyType) ;
333                    class id!(unchecked owl:Class) ;
334                    call |body: AnnotationOnlyBody|
335                    body.with_annotations([
336                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
337                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Any Type"@en)),
338                       annotation!(id!(unchecked skos:altLabel), rdf_str!("Thing"@en)),
339                       annotation!(id!(unchecked skos:altLabel), rdf_str!("Anything"@en)),
340                    ])).into(),
341                 rdf!(
342                    id!(unchecked SumType) ;
343                    class  id!(unchecked Anytype) ;
344                    call |body: AnnotationOnlyBody|
345                    body.with_annotations([
346                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
347                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Sum Type"@en)),
348                    ])).into(),
349                 rdf!(
350                    id!(unchecked ProductType) ;
351                    class  id!(unchecked Anytype) ;
352                    call |body: AnnotationOnlyBody|
353                    body.with_annotations([
354                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
355                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Product Type"@en)),
356                    ])).into(),
357                rdf!(
358                    id!(unchecked Definition) ;
359                    class  id!(unchecked Annotated) ;
360                    call |body: AnnotationOnlyBody|
361                    body.with_annotations([
362                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
363                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Definition"@en)),
364                    ])).into(),
365                rdf!(
366                    id!(unchecked Datatype) ;
367                    class  id!(unchecked Definition),  id!(unchecked AnyType) ;
368                    call |body: AnnotationOnlyBody|
369                    body.with_annotations([
370                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
371                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Datatype"@en)),
372                        annotation!(id!(unchecked owl:equivalentClass), id!(unchecked rdfs:Datatype)),
373                    ])).into(),
374                rdf!(
375                    id!(unchecked Entity) ;
376                    class  id!(unchecked Definition),  id!(unchecked ProductType) ;
377                    call |body: AnnotationOnlyBody|
378                    body.with_annotations([
379                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
380                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Entity"@en)),
381                    ])).into(),
382                rdf!(
383                    id!(unchecked Enum) ;
384                    class id!(unchecked Definition),  id!(unchecked SumType) ;
385                    call |body: AnnotationOnlyBody|
386                    body.with_annotations([
387                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
388                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Enumeration"@en)),
389                    ])).into(),
390                rdf!(
391                    id!(unchecked Event) ;
392                    class  id!(unchecked Definition),  id!(unchecked ProductType) ;
393                    call |body: AnnotationOnlyBody|
394                    body.with_annotations([
395                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
396                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Event"@en)),
397                    ])).into(),
398                rdf!(
399                    id!(unchecked Property) ;
400                    class  id!(unchecked Definition) ;
401                    call |body: AnnotationOnlyBody|
402                    body.with_annotations([
403                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
404                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Property"@en)),
405                    ])).into(),
406                rdf!(
407                    id!(unchecked Rdf) ;
408                    class  id!(unchecked Definition) ;
409                    call |body: AnnotationOnlyBody|
410                    body.with_annotations([
411                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
412                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Rdf"@en)),
413                    ])).into(),
414                rdf!(
415                    id!(unchecked Structure) ;
416                    class  id!(unchecked Definition),  id!(unchecked ProductType) ;
417                    call |body: AnnotationOnlyBody|
418                    body.with_annotations([
419                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
420                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Structure"@en)),
421                    ])).into(),
422                rdf!(
423                    id!(unchecked TypeClass) ;
424                    class  id!(unchecked Definition),  id!(unchecked AnyType) ;
425                    call |body: AnnotationOnlyBody|
426                    body.with_annotations([
427                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
428                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("TypeClass"@en)),
429                    ])).into(),
430                rdf!(
431                    id!(unchecked Union) ;
432                    class  id!(unchecked Definition),  id!(unchecked SumType) ;
433                    call |body: AnnotationOnlyBody|
434                    body.with_annotations([
435                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
436                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Union"@en)),
437                    ])).into(),
438                // ---------------------------------------------------------------------------------
439                // Classes ❱ Members & Variants
440                // ---------------------------------------------------------------------------------
441                rdf!(
442                    id!(unchecked Cardinality) ;
443                    class ;
444                    call |body: AnnotationOnlyBody|
445                    body.with_annotations([
446                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
447                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Cardinality"@en)),
448                    ])).into(),
449                rdf!(
450                    id!(unchecked Ordering) ;
451                    class  id!(unchecked rdfs:Literal) ;
452                    call |body: AnnotationOnlyBody|
453                    body.with_annotations([
454                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
455                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Ordering"@en)),
456                    ])).into(),
457                rdf!(
458                    id!(unchecked ordering) ;
459                    property  id!(unchecked owl:DatatypeProperty) ;
460                    call |body: AnnotationOnlyBody|
461                    body.with_annotations([
462                        annotation!(id!(unchecked owl:minCardinality), v!(id!(unchecked xsd:nonNegativeInteger), 0)),
463                        annotation!(id!(unchecked owl:maxCardinality), v!(id!(unchecked xsd:nonNegativeInteger), 1)),
464                        annotation!(id!(unchecked rdfs:domain), id!(unchecked Cardinality)),
465                        annotation!(id!(unchecked rdfs:range), id!(unchecked Ordering)),
466                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
467                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("ordering"@en)),
468                   ])).into(),
469                rdf!(
470                    id!(unchecked Uniqueness) ;
471                    class  id!(unchecked rdfs:Literal) ;
472                    call |body: AnnotationOnlyBody|
473                    body.with_annotations([
474                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
475                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Uniqueness"@en)),
476                    ])).into(),
477                rdf!(
478                    id!(unchecked uniqueness) ;
479                    property  id!(unchecked owl:DatatypeProperty) ;
480                    call |body: AnnotationOnlyBody|
481                    body.with_annotations([
482                        annotation!(id!(unchecked owl:minCardinality), v!(id!(unchecked xsd:nonNegativeInteger), 0)),
483                        annotation!(id!(unchecked owl:maxCardinality), v!(id!(unchecked xsd:nonNegativeInteger), 1)),
484                        annotation!(id!(unchecked rdfs:domain), id!(unchecked Cardinality)),
485                        annotation!(id!(unchecked rdfs:range), id!(unchecked Uniqueness)),
486                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
487                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("uniqueness"@en)),
488                   ])).into(),
489                rdf!(
490                    id!(unchecked minCardinality) ;
491                    property  id!(unchecked owl:DatatypeProperty) ;
492                    call |body: AnnotationOnlyBody|
493                    body.with_annotations([
494                        annotation!(id!(unchecked owl:minCardinality), v!(id!(unchecked xsd:nonNegativeInteger), 1)),
495                        annotation!(id!(unchecked owl:maxCardinality), v!(id!(unchecked xsd:nonNegativeInteger), 1)),
496                        annotation!(id!(unchecked rdfs:domain), id!(unchecked Cardinality)),
497                        annotation!(id!(unchecked rdfs:range), id!(unchecked xsd:nonNegativeInteger)),
498                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
499                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("minimum cardinality"@en)),
500                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("minimum occurs"@en)),
501                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("minimum count"@en)),
502                   ])).into(),
503                rdf!(
504                    id!(unchecked maxCardinality) ;
505                    property  id!(unchecked owl:DatatypeProperty) ;
506                    call |body: AnnotationOnlyBody|
507                    body.with_annotations([
508                        annotation!(id!(unchecked owl:minCardinality), v!(id!(unchecked xsd:nonNegativeInteger), 0)),
509                        annotation!(id!(unchecked owl:maxCardinality), v!(id!(unchecked xsd:nonNegativeInteger), 1)),
510                        annotation!(id!(unchecked rdfs:domain), id!(unchecked Cardinality)),
511                        annotation!(id!(unchecked rdfs:range), id!(unchecked xsd:nonNegativeInteger)),
512                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
513                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("maximum cardinality"@en)),
514                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("maximum occurs"@en)),
515                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("maximum count"@en)),
516                   ])).into(),
517                rdf!(
518                    id!(unchecked Variant) ;
519                    class  id!(unchecked Annotated), id!(unchecked Named) ;
520                    call |body: AnnotationOnlyBody|
521                    body.with_annotations([
522                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
523                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Variant"@en)),
524                    ])).into(),
525                rdf!(
526                    id!(unchecked TypeVariant) ;
527                    class  id!(unchecked Variant) ;
528                    call |body: AnnotationOnlyBody|
529                    body.with_annotations([
530                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
531                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Type Variant"@en)),
532                        annotation!(id!(unchecked owl:disjointWith), id!(unchecked ValueVariant)),
533                    ])).into(),
534                rdf!(
535                    id!(unchecked as) ;
536                    property  id!(unchecked owl:DatatypeProperty) ;
537                    call |body: AnnotationOnlyBody|
538                    body.with_annotations([
539                        annotation!(id!(unchecked rdfs:domain), id!(unchecked TypeVariant)),
540                        annotation!(id!(unchecked rdfs:range), id!(unchecked Identifier)),
541                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
542                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("as"@en)),
543                   ])).into(),
544                 rdf!(
545                    id!(unchecked ValueVariant) ;
546                    class  id!(unchecked Variant) ;
547                    call |body: AnnotationOnlyBody|
548                    body.with_annotations([
549                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
550                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Value Variant"@en)),
551                        annotation!(id!(unchecked owl:disjointWith), id!(unchecked TypeVariant)),
552                    ])).into(),
553                // ---------------------------------------------------------------------------------
554                // Classes ❱ Values
555                // ---------------------------------------------------------------------------------
556                rdf!(
557                    id!(unchecked hasElement) ;
558                    property id!(unchecked owl:DatatypeProperty) ;
559                    call |body: AnnotationOnlyBody|
560                    body.with_annotations([
561                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
562                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("has element"@en)),
563                   ])).into(),
564                // ---------------------------------------------------------------------------------
565                // Classes ❱ Values ❱ Identifiers
566                // ---------------------------------------------------------------------------------
567                rdf!(
568                    id!(unchecked Identifier) ;
569                    datatype ;
570                    call |body: AnnotationOnlyBody|
571                    body.with_annotations([
572                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
573                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Datatype"@en)),
574                   ])).into(),
575                rdf!(
576                    id!(unchecked QualifiedIdentifier) ;
577                    class  ;
578                    call |body: AnnotationOnlyBody|
579                    body.with_annotations([
580                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
581                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Qualified Identifier"@en)),
582                    ])).into(),
583                 rdf!(
584                    id!(unchecked IdentifierReference) ;
585                    class  ;
586                    call |body: AnnotationOnlyBody|
587                    body.with_annotations([
588                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
589                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Identifier Reference"@en)),
590                    ])).into(),
591                // ---------------------------------------------------------------------------------
592                // Datatypes
593                // ---------------------------------------------------------------------------------
594                rdf!(
595                    id!(unchecked Binary) ;
596                    datatype ;
597                    call |body: AnnotationOnlyBody|
598                    body.with_annotations([
599                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
600                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Binary"@en)),
601                        annotation!(id!(unchecked owl:equivalentClass), id!(unchecked xsd:hexBinary)),
602                   ])).into(),
603                rdf!(
604                    id!(unchecked Boolean) ;
605                    datatype ;
606                    call |body: AnnotationOnlyBody|
607                    body.with_annotations([
608                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
609                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("Boolean"@en)),
610                        annotation!(id!(unchecked owl:equivalentClass), id!(unchecked xsd:boolean)),
611                   ])).into(),
612                // ---------------------------------------------------------------------------------
613                // Individuals
614                // ---------------------------------------------------------------------------------
615                rdf!(
616                    id!(unchecked nonunique) ;
617                    individual  id!(unchecked Uniqueness) ;
618                    call |body: AnnotationOnlyBody|
619                    body.with_annotations([
620                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
621                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("nonunique"@en)),
622                        annotation!(id!(unchecked owl:differentFrom), id!(unchecked nunique)),
623                    ])).into(),
624                rdf!(
625                    id!(unchecked unique) ;
626                    individual  id!(unchecked Uniqueness) ;
627                    call |body: AnnotationOnlyBody|
628                    body.with_annotations([
629                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
630                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("unique"@en)),
631                        annotation!(id!(unchecked owl:differentFrom), id!(unchecked nonunique)),
632                    ])).into(),
633                rdf!(
634                    id!(unchecked unordered) ;
635                    individual  id!(unchecked Ordering) ;
636                    call |body: AnnotationOnlyBody|
637                    body.with_annotations([
638                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
639                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("unordered"@en)),
640                        annotation!(id!(unchecked owl:differentFrom), id!(unchecked ordered)),
641                    ])).into(),
642                rdf!(
643                    id!(unchecked ordered) ;
644                    individual  id!(unchecked Ordering) ;
645                    call |body: AnnotationOnlyBody|
646                    body.with_annotations([
647                        annotation!(id!(unchecked rdfs:isDefinedBy), id!(unchecked sdml)),
648                        annotation!(id!(unchecked skos:prefLabel), rdf_str!("ordered"@en)),
649                        annotation!(id!(unchecked owl:differentFrom), id!(unchecked unordered)),
650                    ])).into(),
651            ])
652    )
653});