Transformation of UML connectors
In this section are specified transformation rules for UML association, generalisation and dependency connectors. Transformation rules overview for UML connectors provides an overview of the section coverage.
UML element | Rules in core ontology layer | Rules in data shape layer | Rules in reasoning layer |
---|---|---|---|
Association |
|||
Association domain |
|||
Association range |
|||
Association multiplicity |
|||
Association asymmetry |
|||
Association inverse |
|||
Dependency |
|||
Dependency domain |
|||
Dependency range |
|||
Dependency multiplicity |
|||
Class generalisation |
|||
Property generalisation |
|||
Class equivalence |
|||
Property equivalence |
|||
Disjoint classes |
|||
Realisation |
Unidirectional association
A binary Association specifies a semantic relationship between two member ends represented by properties. Please note that in accordance with specification [uml2.5], the association end names are not obligatory. However, we adhere to the UML conventions , where specification of at one member ends, for unidirectional association, and two member ends, for bidirectional association, is mandatory. Moreover, provision of a connector (general) name is discouraged.

Specify object property declaration axiom for the target end of the association/dependency.
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 property at the time of its creation. |
Property declaration in Turtle syntax
|
Property declaration in RDF/XML syntax
|
Specify PropertyShape declaration axiom for each association/dependency.
Ideally, in the implementation, this rule would be combined with the relevant rules (those for the data shape layer) in the Transformation of UML descriptors section, to provide labels and documentation for the property shape at the time of its creation. |
For handling bidirectional associations refer to the Bidirectional association section. |
PropertyShape declaration for associations in Turtle syntax
|
PropertyShape declaration for associations in RDF/XML syntax
|
Association source
Specify object property domain for the target end of the association/dependency.
Domain specification in Turtle syntax
|
Domain specification in RDF/XML syntax
|
Object property domain specification for reused relations in Turtle syntax
|
Object property domain specification for reused relations in RDF/XML syntax
|
Association target
Specify object property range for the target end of the association.
Range specification in Turtle syntax
|
Range specification in RDF/XML syntax
|
Object property range specification for reused relations in Turtle syntax
|
Object property range specification for reused relations in RDF/XML syntax
|
Within the SHACL PropertyShape corresponding to an association relation linked to a given source UML Class, specify property constraints indicating the range class.
Property class constraint in Turtle syntax
|
Property class constraint in RDF/XML syntax
|
Association multiplicity
For the association/dependency target multiplicity, where min and max are different than ``*'' (any) and multiplicity is not [1..1], specify a subclass axiom where the source class specialises an anonymous restriction of properties formulated according to cases provided by rule:attribute-rc-multiplicity.
Min cardinality restriction in Turtle syntax
|
Min cardinality restriction in RDF/XML syntax
|
If the association/dependency multiplicity is exactly one, i.e. [1..1], specify a functional property axiom like in rule:attribute-rc-multiplicity-one.
Declaring a functional property in Turtle syntax
|
Declaring a functional property in RDF/XML syntax
|
Within the SHACL PropertyShape corresponding to an association/dependency relation linked to a given source UML Class, specify property constraints indicating minimum and maximum cardinality, according to cases provided by rule:attribute-ds-multiplicity.
Min cardinality constraint in Turtle syntax
|
Min cardinality constraint in RDF/XML syntax
|
Recursive association
In case of recursive associations, that are from one class to itself, (depicted in Visual representation of a UML recursive association (on the left) and OWL recursive properties with cardinality restrictions on domain class (on the right)), the transformation rules must be applied as in the case of regular unidirectional association, which are from Example R.01 to Example R.07. In addition, the association must be marked as asymmetric expressed in Example R.10 and Example R.09.

Specify an asymmetric object property axiom for each end of a recursive association.
Declaring an asymmetric property in Turtle syntax
|
Declaring an asymmetric property in RDF/XML syntax
|
Within the SHACL Node Shape corresponding to the UML Class, specify SPARQL constraint selecting instances connected by the object property in a reciprocal manner.
Adding details to a NodeShape for an asymmetric property in Turtle syntax
|
Adding details to a NodeShape for an asymmetric property in RDF/XML syntax
|
Bidirectional association
The bidirectional associations should be treated, both on source and target ends, like two unidirectional associations (see Visual representation of a UML bidirectional association (on the left) and OWL properties with cardinality restrictions on domain class (on the right)). The transformation rules from Example R.01 and Example R.02, and all the other rules for unidirectional associations shown in Transformation rules overview for UML connectors must be applied to both ends. In addition to those rules, the inverse relation axiom must be specified.

Specify an inverse object property axiom between the source and target ends of the bidirectional association.
Declaring an inverse property in Turtle syntax
|
Declaring an inverse property in RDF/XML syntax
|
Unidirectional dependency
In general the UML dependency connectors should be transformed by the rules specified for UML association connectors (see Transformation rules overview for UML connectors).
The following two rules, concerning the transformation of dependency targets, are different from the rules for the transformation of association targets.
Specify object property range for the target end of the dependency.
Range specification in Turtle syntax
|
Range specification in RDF/XML syntax
|
In OWL we want to state only that the range of a Dependency connector is a skos:Concept , without committing to a specific list. We do this additional restriction in the data shape.
|
Within the SHACL PropertyShape corresponding to a dependency relation linked to a given source UML Class, constraint the range of the dependency.
Specify the suitable constraint based on the constraint level set for the UML Enumeration (as defined in rule:enumeration-constraint-level):
-
permissive: set
skos:Concept
as the expected type of an enumeration item -
restrictive: refer to a NodeShape for an enumeration item that further restricts allowed values (see the transformation rule for enumeration item).
Permissive shape in Turtle syntax
|
Permissive shape in RDF/XML syntax
|
Restrictive shape in Turtle syntax
|
Restrictive shape in RDF/XML syntax
|
Class generalisation
Generalisation [uml2.5] defines specialization relationship between Classifiers. In case of UML Classes it relates a more specific Class to a more general Class.

UML generalisation set [uml2.5] groups generalisations; incomplete and disjoint constraints indicate that the set is not complete and its specific Classes have no common instances. The UML conventions specify that all sibling classes are by default disjoint, therefore even if no generalisation set is provided it is assumed to be implicit. Sibling classes will be declared disjoint with one another in the reasoning layer (see Example R.18).
Specify subclass axiom for the generalisation between UML Classes.
Subclass declaration in Turtle syntax
|
Subclass declaration in RDF/XML syntax
|
Property generalisation
Generalisation [uml2.5] defines specialization relationship between Classifiers. In case of the UML associations it relates a more specific Association to more general Association.

Specify a sub-property axiom representing the generalisation between named roles of UML associations. Properties on the subject and object positions correspond to the association roles belonging to the same side of the association ends. Such a sub-property axiom is specified for the target side of association ends (for unidirectional associations) or for both source and target sides of the association ends (for bidirectional associations).
Property specialisation in Turtle syntax
|
Property specialisation in RDF/XML syntax
|
Class equivalence

Specify equivalent class axiom for the generalisation with <<equivalent>>
or <<complete>>
stereotype between UML Classes.
Class equivalence in Turtle syntax
|
Class equivalence in RDF/XML syntax
|
Property equivalence
Specify equivalent property axiom for the generalisation with <<equivalent>>
or <<complete>>
stereotype between UML properties.
Property equivalence in Turtle syntax
|
Property equivalence in RDF/XML syntax
|
Disjoint classes
Specify a disjoint classes axiom for all "sibling" classes, i.e. for multiple UML Classes that have generalisation connectors to the same UML Class.
For the generalisation relations depicted in Visual representation of UML generalisation (on the left) and OWL subclass relation (on the right), the generated output should have the following form.
Disjoint classes declaration in Turtle syntax
|
Disjoint classes declaration in RDF/XML syntax
|
Realisation relations
Realisation defines a relationship between an Object element and a UML Class or Enumeration element. At the moment we only provide transformation rules for UML Realization connectors that connect to UML Classes.
Declare an individual with a specified class as its type, for a UML Realization connector between a UML Object and a UML Class.
Individual declaration in Turtle syntax
|
Individual declaration in RDF/XML syntax
|