Skip to content

Commit

Permalink
fix entity in test models, update copyright year, return a line break
Browse files Browse the repository at this point in the history
  • Loading branch information
KobOp committed Jan 19, 2024
1 parent b64f155 commit a66fe25
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 75 deletions.
2 changes: 1 addition & 1 deletion documentation/modules/ROOT/pages/modeling-guidelines.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ 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 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.
In contrast to Entities, Abstract Entities cannot directly be instantiated. A Characteristic class may have a type `samm:entity` or `samm:AbstractEntity`. But a Characteristic instance 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.
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ samm:UniqueEntityInstances
?anotherInstance a ?entityType .
filter( str( $this ) < str( ?anotherInstance ) )
filter( $this != ?anotherInstance )
{
select $this ?instance1 ( group_concat( ?part; separator=" " ) as ?serialized1 )
where {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
# Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH
#
# See the AUTHORS file(s) distributed with this work for additional
# information regarding authorship.
Expand All @@ -21,12 +21,4 @@
:TestEntityDataType a samm:Entity ;
samm:preferredName "Test Entity"@en ;
samm:description "A test Entity"@en ;
samm:properties ( :testPropertyEntityDataType ) .

:testPropertyEntityDataType a samm:Property ;
samm:preferredName "Test Property"@en ;
samm:description "A property with a text value."@en ;
samm:characteristic [
a samm:Characteristic ;
samm:dataType xsd:integer
] .
samm:properties ( ) .
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
# Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH
#
# See the AUTHORS file(s) distributed with this work for additional
# information regarding authorship.
Expand All @@ -21,12 +21,4 @@
:TestEntityDataType a samm:Entity ;
samm:preferredName "Test Entity"@en ;
samm:description "A test Entity"@en ;
samm:properties ( :testPropertyEntityDataType ) .

:testPropertyEntityDataType a samm:Property ;
samm:preferredName "Test Property"@en ;
samm:description "A property with a text value."@en ;
samm:characteristic [
a samm:Characteristic ;
samm:dataType xsd:integer
] .
samm:properties ( ) .
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
# Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH
#
# See the AUTHORS file(s) distributed with this work for additional
# information regarding authorship.
Expand All @@ -19,20 +19,10 @@
samm:dataType :ExtendingEntityAbstractEntityDataType .

:AbstractTestEntity a samm:AbstractEntity ;
samm:properties ( :abstractTestProperty ).
samm:properties ( :abstractTestProperty ).

:abstractTestProperty a samm:Property ;
samm:characteristic [
a samm:Characteristic ;
samm:dataType xsd:integer
] .
:abstractTestProperty a samm:AbstractProperty .

:ExtendingEntityAbstractEntityDataType a samm:Entity ;
samm:extends :AbstractTestEntity ;
samm:properties ( :testPropertyAbstractEntityDataType ) .

:testPropertyAbstractEntityDataType a samm:Property ;
samm:characteristic [
a samm:Characteristic ;
samm:dataType xsd:integer
] .
samm:extends :AbstractTestEntity ;
samm:properties ( ) .
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
# Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH
#
# See the AUTHORS file(s) distributed with this work for additional
# information regarding authorship.
Expand All @@ -19,23 +19,13 @@
samm:dataType :InstantiatedAbstractEntityInstance .

:AbstractTestEntity a samm:AbstractEntity ;
samm:properties ( :abstractTestProperty ).
samm:properties ( :abstractTestProperty ).

:abstractTestProperty a samm:Property ;
samm:characteristic [
a samm:Characteristic ;
samm:dataType xsd:integer
] .

:ExtendingEntityAbstractEntityDataType a samm:Entity ;
samm:extends :AbstractTestEntity ;
samm:properties ( :testPropertyAbstractEntityDataType ) .

:testPropertyAbstractEntityDataType a samm:Property ;
samm:characteristic [
a samm:Characteristic ;
samm:dataType xsd:integer
] .
samm:characteristic [
a samm:Characteristic ;
samm:dataType xsd:integer
] .

:InstantiatedAbstractEntityInstance a :AbstractTestEntity ;
:abstractTestProperty 12 .
:abstractTestProperty 12 .
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
# Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH
#
# See the AUTHORS file(s) distributed with this work for additional
# information regarding authorship.
Expand All @@ -21,12 +21,4 @@
:TestEntityDataType a samm:Entity ;
samm:preferredName "Test Entity"@en ;
samm:description "A test Entity"@en ;
samm:properties ( :testPropertyEntityDataType ) .

:testPropertyEntityDataType a samm:Property ;
samm:preferredName "Test Property"@en ;
samm:description "A property with a text value."@en ;
samm:characteristic [
a samm:Characteristic ;
samm:dataType xsd:integer
] .
samm:properties ( ) .
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
# Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH
#
# See the AUTHORS file(s) distributed with this work for additional
# information regarding authorship.
Expand All @@ -16,20 +16,19 @@
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

:TestCharacteristicInstanceWithExtededInstantiatedAbstractEntityDataType a samm:Characteristic ;
samm:dataType :InstantiatedAbstractEntityInstance .
samm:dataType :InstantiatedAbstractEntityInstance .

:AbstractTestEntity a samm:AbstractEntity ;
samm:properties ( :abstractTestProperty ).
samm:properties ( :abstractTestProperty ).

:abstractTestProperty a samm:Property ;
samm:characteristic [
a samm:Characteristic ;
samm:dataType xsd:integer
] .
samm:characteristic [
a samm:Characteristic ;
samm:dataType xsd:integer
] .

:ExtendingEntityAbstractEntityDataType a samm:Entity ;
samm:extends :AbstractTestEntity .
:ExtendingEntity a samm:Entity ;
samm:extends :AbstractTestEntity .


:InstantiatedAbstractEntityInstance a :ExtendingEntityAbstractEntityDataType ;
:abstractTestProperty 12 .
:InstantiatedAbstractEntityInstance a :ExtendingEntity ;
:abstractTestProperty 12 .

0 comments on commit a66fe25

Please sign in to comment.