Transformation of UML datatypes
In this section are specified transformation rules for UML datatypes and enumerations. Overview of transformation rules for UML datatypes provides an overview of the section coverage.
UML element | Rules in core ontology layer | Rules in data shape layer | Rules in reasoning layer |
---|---|---|---|
Primitive datatype |
|||
Structured datatype |
|||
Enumeration |
|||
Enumeration item |
Primitive datatype
The UML primitive type defines a predefined datatype without any substructure. The UML specification [uml2.5] predefines five primitive types: String, Integer, Boolean, UnlimitedNatural and Real. Here we extended those to the list provided in Mapping of UML primitive types to XSD datatypes.

Specify datatype declaration axiom for UML datatype as follows:
-
UML primitive datatypes are declared as the mapped XSD datatype in Mapping of UML primitive types to XSD datatypes.
-
XSD and RDF(S) datatypes are declared as such.
-
Model specific datatypes are declared as such.
Ideally, in the implementation, this rule would be combined with the relevant rules (those for the core ontology layer) in the Transformation of UML descriptors section, to provide labels and documentation for the datatype at the time of its creation. |
UML datatype | XSD datatype |
---|---|
Boolean |
xsd:boolean |
Float |
xsd:float |
Integer |
xsd:integer |
Char |
xsd:string |
String |
xsd:string |
Short |
xsd:short |
Long |
xsd:long |
Decimal |
xsd:decimal |
Real |
xsd:float |
Date |
xsd:date |
Numeric |
xsd:integer |
Text |
xsd:string |
UML primitive datatype declaration (String) in Turtle syntax
|
UML primitive datatype declaration (String) in RDF/XML syntax
|
XSD and RDF(S) datatype declaration in Turtle syntax
|
XSD and RDF(S) datatype declaration in RDF/XML syntax
|
Model specific datatype declaration in Turtle syntax
|
Model specific datatype declaration in RDF/XML syntax
|
Structured datatypes
The UML structured datatype [uml2.5] has attributes and is used to define complex data types. The structured datatypes should be treated as classes.
Specify OWL class declaration axiom for UML structured datatype.
See applicable rules in Section on Class Rules.
Enumeration
UML Enumerations [uml2.5] are kinds of datatypes, having zero or more values that correspond to one of user-defined literals. They are transformed into SKOS [skos-spec] concept schemes comprising enumeration values represented as SKOS concepts.
Two possible cases of UML enumerations can be identified:
-
enumeration without items: such an enumeration is used as a reference to an externally defined controlled list.
-
enumeration with items: such an enumeration serves as a complete representation of a controlled list defined within the UML model.



Normally, the controlled list represented by UML Enumerations will be defined externally and represented as an enumeration without items in the UML model. In order to be able to validate some data against the generated SHACL shapes, these controlled lists need to be imported. Moreover, the restriction module should be also imported into the SHACL module, alongside the OWL core module. |
Specify SKOS concept scheme instantiation axiom for a UML enumeration.
Ideally, in the implementation, this rule would be combined with the relevant rules (those for the core ontology layer) in the Transformation of UML descriptors section, to provide labels and documentation for the class/individual representing the enumeration at the time of its creation. |
Concept scheme instantiation in Turtle syntax
|
Concept scheme instantiation in RDF/XML syntax
|
The tool does not generate SHACL shapes for concept schemes (skos:ConceptScheme ) used to represent controlled lists. It is recommended to download the SHACL shapes for SKOS [skos-shacl] and use these for validation purposes.
|
For a UML enumeration, specify an equivalent class restriction covering the set of individuals that are skos:inScheme
of this enumeration.
In-scheme equivalent class in Turtle syntax
|
In-scheme equivalent class in RDF/XML syntax
|
Specify SKOS concept instantiation axiom for each UML enumeration item.
Ideally, in the implementation, this rule would be combined with the relevant rules (those for the core ontology layer) in the Transformation of UML descriptors section, to provide labels and documentation for the individual representing the enumeration item at the time of its creation. |
Concept scheme items instantiation in Turtle syntax
|
Concept scheme items instantiation in RDF/XML syntax
|
Specify a restrictive SHACL NodeShape for items of an enumeration for each UML Enumeration in the defining mode (based on the constraint level set for the UML Enumeration as defined in rule:enumeration-constraint-level). The URIs of the node shape is deterministically generated from the UML Enumeration name. Set a constraint for the enumeration item belonging to a concept scheme represented by the enumeration URI.
Restrictive shape in Turtle syntax
|
Restrictive shape in RDF/XML syntax
|