Conventions on Attributes of uml:Class elements
Conventional recommendations on Attributes
Title: Attribute names |
Identifier: rule:attributes-names-with-verb |
Statement: It is recommended to use a verb in the attribute name, such as "has-" or "is-". |
Description:
When creating attribute names, it is conventional to use simple nouns such as "name", "weight", "colour". Attributes are a special type of relations that describe an entity in terms of its qualities. And so, to be consistent with the above convention and in order to increase the clarity, it is recommended to employ the prefix "has-" for each attribute, even if it does not add much to the term’s meaning. So, it is preferred to use terms such as "hasName", "hasWeight" and "hasColour".
It is recommended to use simple nouns for attribute names prepended with the verb "has-".
It is recommended to avoid duplicate attribute names across multiple classes. Unless, by design, attributes with the same name are shared across multiple classes.
Title: Attribute multiplicity |
Identifier: rule:attributes-multiplicity |
Statement: Attributes shall be assigned cardinality specifications contextualised to the class carrying them. |
Description:
The attribute multiplicity should be specified indicating the minimum and maximum cardinality. The default [1] multiplicity shall be interpreted as unspecified, and expressed as [0..*] in the OWL model.
In special cases, a list of custom default multiplicities is defined for the transformation script. That means that some data types or classes that are used as attribute types are paired with a default multiplicity, for example "1..1", "0..1", "2..2".
uml:Class attributes
Title: Attribute datatypes |
Identifier: rule:attributes-datatypes |
Statement: uml:Attribute shall be defined with generally accepted primitive datatypes. |
Description:
Each uml:Attribute must have a name and an attribute type. uml:Attribute is mostly transformed into owl:DataProperty and in some controlled cases into owl:ObjectProperty. High preference shall be given to using OWL 2 compliant XSD [xsd] and RDF [rdf] standard datatypes. [See convention on Primitive Data types]
In cases when a property needs to be defined as ranging on an unknown controlled list or authority table constitute a special case. They can be expressed as uml:Attribute with the datatype skos:Concept
. These attributes are transformed into owl:ObjectProperty in a manner similarly to uml:Association.
An attribute may contain an alias, used as an alternative label. It can be specified via uml:Tags. [See convention on uml:Tags]
Title: Attribute name reuse |
Identifier: rule:attributes-reuse |
Statement: Attribute names can be reused only as attributes in other classes, not as relations. |
Description:
It is mandatory to avoid using the same name in an attribute and in a relation, unless an additional rule that handles intentional exceptions exists.
The definition and datatype (and in most cases also the multiplicity) of the attribute should be the same in all classes where it is reused.