Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify usage of AbstractEntity as datatype #266

Merged
6 changes: 2 additions & 4 deletions documentation/modules/ROOT/pages/modeling-guidelines.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,8 @@ include::example$extending-entity-declaration-inheritance.ttl[tags=extending-ent
[[declaring-abstract-entities]]
==== Declaring Abstract Entities

In contrast to Entities, Abstract Entities cannot directly be used as data types. The main use case
for Abstract Entities is to share Properties across multiple Entities. This can be achieved through
inheritance: Abstract Entities can extend other Entities and Abstract Entities and can themselves be
extended in a manner not dissimilar to how abstract classes are used in many programming languages.
In contrast to Entities, Abstract Entities cannot directly be instantiated. A Characteristic class may have a type `samm:entity` or `samm:AbstractEntity`. But for a Characteristic instance, it cannot have a type `samm:AbstractEntity`. If there is an instance created from a Characteristic that uses an Abstract Entity as its type, this Characteristic instance's dataType must be a sub-Entity of the Abstract Entity.
KobOp marked this conversation as resolved.
Show resolved Hide resolved
The main use case for Abstract Entities is to share Properties across multiple Entities. This can be achieved through inheritance: Abstract Entities can extend other Entities and Abstract Entities and can themselves be extended in a manner not dissimilar to how abstract classes are used in many programming languages.

In the following example, both `SteeringWheel` and `Seat` _extend_ the Abstract Entity
`VehicleComponent`. Both inherit the `typeNumber` and the `manufacturer` Properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ samm:CharacteristicShape
filter ( not exists { $this rdf:type/rdfs:subClassOf* samm-c:Collection } )
# exclude 'Trait' Characteristic since it refers to the datatype via its baseCharacteristic
filter ( not exists { $this rdf:type/rdfs:subClassOf* samm-c:Trait } )
# exclude 'AbstractEntity' Characteristic since it is not allowed for Characteristic instance
filter ( not exists { $this rdf:type/rdfs:subClassOf* samm:AbstractEntity } )
# find all characteristic instances which do not define a data type
filter ( not exists { $this samm:dataType [] } ) .
filter ( not exists { $this rdf:type/rdfs:subClassOf*/samm:dataType [] } )
Expand Down
Loading