Skip to content

Commit ea9df73

Browse files
authored
Feature/update to latest aspect model loader version (#52)
* Update JS AML version to be based on SAMM 2.1.0
1 parent 2bd2693 commit ea9df73

25 files changed

+372
-131
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,21 +206,22 @@ File _app/shared/types/movement.types.ts_
206206

207207
```typescript
208208
export interface Movement {
209-
moving: boolean;
210-
speedLimitWarning: WarningLevel;
209+
isMoving: boolean;
210+
speed: number;
211+
speedLimitWarning: TrafficLight;
211212
position: SpatialPosition;
212213
}
213214

214-
export enum WarningLevel {
215+
export enum TrafficLight {
215216
Green = 'green',
216217
Yellow = 'yellow',
217218
Red = 'red',
218219
}
219220

220221
export interface SpatialPosition {
221-
x: number;
222-
y: number;
223-
z: number;
222+
latitude: number;
223+
longitude: number;
224+
altitude?: number;
224225
}
225226
```
226227

documentation/js-sdk-guide/modules/tooling-guide/examples/Movement.ttl

Lines changed: 81 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,76 +9,109 @@
99
#
1010
# SPDX-License-Identifier: MPL-2.0
1111

12-
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:1.0.0#> .
13-
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:1.0.0#> .
14-
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:1.0.0#> .
12+
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.1.0#> .
13+
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#> .
14+
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.1.0#> .
15+
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.1.0#> .
16+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
17+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
1518
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
16-
@prefix : <urn:samm:org.eclipse.examples.movement:2.1.0#> .
19+
@prefix : <urn:samm:org.eclipse.examples:2.1.0#> .
1720

1821
:Movement a samm:Aspect ;
19-
samm:preferredName "Movement"@en ;
22+
samm:name "Movement" ;
23+
samm:preferredName "movement"@en ;
2024
samm:description "Aspect for movement information"@en ;
21-
samm:properties ( :moving :speedLimitWarning :position :startDate :endDate ) ;
22-
samm:operations () .
25+
samm:properties ( :isMoving :position :speed :speedLimitWarning ) ;
26+
samm:operations ( ) ;
27+
samm:events ( ) .
2328

24-
:moving a samm:Property ;
25-
samm:preferredName "Moving"@en ;
26-
samm:description "Flag indicating if the position is changing"@en ;
29+
:isMoving a samm:Property ;
30+
samm:name "isMoving" ;
31+
samm:preferredName "is moving"@en ;
32+
samm:description "Flag indicating whether the asset is currently moving"@en ;
2733
samm:characteristic samm-c:Boolean .
2834

29-
:startDate a samm:Property ;
30-
samm:preferredName "Start Date"@en ;
31-
samm:description "Date, when the batch was started"@en ;
32-
samm:characteristic samm-c:Timestamp .
33-
34-
:endDate a samm:Property ;
35-
samm:preferredName "End Date"@en ;
36-
samm:description "Date, when the last part of the batch was produced"@en ;
37-
samm:characteristic samm-c:Timestamp .
38-
39-
:speedLimitWarning a samm:Property ;
40-
samm:preferredName "Speed Limit Warning"@en ;
41-
samm:description "Indicates if speed limit is adhered to."@en ;
42-
samm:characteristic :WarningLevel .
43-
4435
:position a samm:Property ;
45-
samm:preferredName "Position"@en ;
36+
samm:name "position" ;
37+
samm:preferredName "position"@en ;
4638
samm:description "Indicates a position"@en ;
4739
samm:characteristic :SpatialPositionCharacteristic .
4840

41+
:speed a samm:Property ;
42+
samm:name "speed" ;
43+
samm:preferredName "speed"@en ;
44+
samm:description "speed of vehicle"@en ;
45+
samm:characteristic :Speed .
46+
47+
:speedLimitWarning a samm:Property ;
48+
samm:name "speedLimitWarning" ;
49+
samm:preferredName "speed limit warning"@en ;
50+
samm:description "Indicates if the speed limit is adhered to."@en ;
51+
samm:characteristic :TrafficLight .
52+
4953
:SpatialPositionCharacteristic a samm-c:SingleEntity ;
50-
samm:preferredName "Spatial Position Characteristic"@en ;
51-
samm:description "Represents a single location in space."@en ;
54+
samm:name "SpatialPositionCharacteristic" ;
55+
samm:preferredName "spatial position characteristic"@en ;
56+
samm:description "Represents a single position in space with optional z coordinate."@en ;
5257
samm:dataType :SpatialPosition .
5358

54-
:WarningLevel a samm-c:Enumeration ;
55-
samm:preferredName "Warning Level"@en ;
59+
:Speed a samm-c:Measurement ;
60+
samm:name "Speed" ;
61+
samm:preferredName "speed"@en ;
62+
samm:description "Scalar representation of speed of an object in kilometers per hour."@en ;
63+
samm:dataType xsd:float ;
64+
samm-c:unit unit:kilometrePerHour .
65+
66+
:TrafficLight a samm-c:Enumeration ;
67+
samm:name "TrafficLight" ;
68+
samm:preferredName "warning level"@en ;
5669
samm:description "Represents if speed of position change is within specification (green), within tolerance (yellow), or outside specification (red)."@en ;
5770
samm:dataType xsd:string ;
5871
samm-c:values ( "green" "yellow" "red" ) .
5972

6073
:SpatialPosition a samm:Entity ;
61-
samm:preferredName "Spatial Position"@en ;
62-
samm:description "Position in space, described along three axis, with the third axis optional, if all positions are in a plane."@en ;
63-
samm:properties ( :x :y :z ) .
74+
samm:name "SpatialPosition" ;
75+
samm:preferredName "spatial position"@en ;
76+
samm:description "Represents latitude, longitude and altitude information in the WGS84 geodetic reference datum"@en ;
77+
samm:see <https://www.w3.org/2003/01/geo/> ;
78+
samm:properties ( :latitude :longitude [ samm:property :altitude; samm:optional true ] ) .
6479

65-
:x a samm:Property ;
66-
samm:preferredName "x"@en ;
67-
samm:description "x coordinate in space"@en ;
68-
samm:characteristic :Coordinate .
80+
:latitude a samm:Property ;
81+
samm:name "latitude" ;
82+
samm:preferredName "latitude"@en ;
83+
samm:description "latitude coordinate in space (WGS84)"@en ;
84+
samm:see <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ;
85+
samm:characteristic :Coordinate ;
86+
samm:exampleValue "9.1781"^^xsd:decimal .
6987

70-
:y a samm:Property ;
71-
samm:preferredName "y"@en ;
72-
samm:description "y coordinate in space"@en ;
73-
samm:characteristic :Coordinate .
88+
:longitude a samm:Property ;
89+
samm:name "longitude" ;
90+
samm:preferredName "longitude"@en ;
91+
samm:description "longitude coordinate in space (WGS84)"@en ;
92+
samm:see <http://www.w3.org/2003/01/geo/wgs84_pos#long> ;
93+
samm:characteristic :Coordinate ;
94+
samm:exampleValue "48.80835"^^xsd:decimal .
7495

75-
:z a samm:Property ;
76-
samm:preferredName "z"@en ;
77-
samm:description "z coordinate in space"@en ;
78-
samm:characteristic :Coordinate .
96+
:altitude a samm:Property ;
97+
samm:name "altitude" ;
98+
samm:preferredName "altitude"@en ;
99+
samm:description "Elevation above sea level zero"@en ;
100+
samm:see <http://www.w3.org/2003/01/geo/wgs84_pos#alt> ;
101+
samm:characteristic :MetresAboveMeanSeaLevel ;
102+
samm:exampleValue "153"^^xsd:float .
79103

80104
:Coordinate a samm-c:Measurement ;
81-
samm:preferredName "Coordinate"@en ;
82-
samm:description "Represents a coordinate along an axis in space."@en ;
105+
samm:name "Coordinate" ;
106+
samm:preferredName "coordinate"@en ;
107+
samm:description "Representing the geographical coordinate"@en ;
108+
samm:dataType xsd:decimal ;
109+
samm-c:unit unit:degreeUnitOfAngle .
110+
111+
:MetresAboveMeanSeaLevel a samm-c:Measurement ;
112+
samm:name "MetresAboveMeanSeaLevel" ;
113+
samm:preferredName "metres above mean sea level"@en ;
114+
samm:description "Signifies the vertical distance in reference to a historic mean sea level as a vertical datum"@en ;
115+
samm:see <https://en.wikipedia.org/wiki/Height_above_sea_level> ;
83116
samm:dataType xsd:float ;
84-
samm-c:unit unit:metre .
117+
samm-c:unit unit:metre .

documentation/js-sdk-guide/modules/tooling-guide/examples/movement.types.ts

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,36 @@
1111
* SPDX-License-Identifier: MPL-2.0
1212
*/
1313

14-
/**
15-
* Aspect for movement information
16-
*/
14+
export interface MultiLanguageText {
15+
/** key defines the locale. Value is the translated text for that locale. */
16+
[key: string]: string;
17+
}
18+
19+
/** Aspect for movement information */
1720
export interface Movement {
18-
/** Flag indicating if the position is changing */
19-
moving: boolean;
20-
/** Indicates if speed limit is adhered to. */
21-
speedLimitWarning: WarningLevel;
21+
/** Flag indicating whether the asset is currently moving */
22+
isMoving: boolean;
2223
/** Indicates a position */
2324
position: SpatialPosition;
25+
/** speed of vehicle */
26+
speed: number;
27+
/** Indicates if the speed limit is adhered to. */
28+
speedLimitWarning: TrafficLight;
2429
}
2530

26-
/**
27-
* Represents if speed of position change is within specification (green), within tolerance (yellow), or outside specification (red).
28-
*/
29-
export enum WarningLevel {
31+
/** Represents latitude, longitude and altitude information in the WGS84 geodetic reference datum */
32+
export interface SpatialPosition {
33+
/** latitude coordinate in space (WGS84) */
34+
latitude: number;
35+
/** longitude coordinate in space (WGS84) */
36+
longitude: number;
37+
/** Elevation above sea level zero */
38+
altitude?: number;
39+
}
40+
41+
/** Represents if speed of position change is within specification (green), within tolerance (yellow), or outside specification (red). */
42+
export enum TrafficLight {
3043
Green = 'green',
3144
Yellow = 'yellow',
3245
Red = 'red',
3346
}
34-
35-
/**
36-
* Position in space, described along three axis, with the third axis optional, if all positions are in a plane.
37-
*/
38-
export interface SpatialPosition {
39-
/** x coordinate in space */
40-
x: number;
41-
/** y coordinate in space */
42-
y: number;
43-
/** z coordinate in space */
44-
z: number;
45-
}
21.3 KB
Loading
48.1 KB
Loading
56 KB
Loading
45.7 KB
Loading
24.2 KB
Loading

documentation/js-sdk-guide/modules/tooling-guide/pages/card-generation.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A schematics will be generated using the following command:
2525
ng generate [collection-name]:[schematics-name]
2626

2727

28-
For demonstration purposes, the https://github.com/eclipse-esmf/esmf-aspect-model-editor/blob/main/core/apps/ame/src/assets/aspect-models/org.esmf.examples.movement/1.0.0/Movement.ttl[Movement.ttl,window=_blank,opts=nofollow] Aspect Model will be used.
28+
For demonstration purposes, the https://github.com/eclipse-esmf/esmf-aspect-model-editor/blob/main/core/apps/ame/src/assets/aspect-models/org.eclipse.examples/1.0.0/Movement.ttl[Movement.ttl,window=_blank,opts=nofollow] Aspect Model will be used.
2929
Below is a detailed representation of the command-line interface steps which generates a card component using the Movement.ttl Aspect Model file by running the command.
3030

3131
NOTE: Before running any schematics commands make sure you are in the Angular project folder where you want to generate the new component.

0 commit comments

Comments
 (0)