|
1 | | -meta { |
2 | | - name: GenerateAASX |
3 | | - type: http |
4 | | - seq: 27 |
5 | | -} |
6 | | - |
7 | | -post { |
8 | | - url: http://localhost:{{port}}/ame/api/generate/aasx |
9 | | - body: text |
10 | | - auth: none |
11 | | -} |
12 | | - |
13 | | -headers { |
14 | | - Content-Type: text/plain |
15 | | -} |
16 | | - |
17 | | -body:text { |
18 | | - @prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.2.0#> . |
19 | | - @prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.2.0#> . |
20 | | - @prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.2.0#> . |
21 | | - @prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.2.0#> . |
22 | | - @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . |
23 | | - @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . |
24 | | - @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . |
25 | | - @prefix : <urn:samm:org.eclipse.examples:1.0.0#> . |
26 | | - |
27 | | - :Movement a samm:Aspect ; |
28 | | - samm:preferredName "movement"@en ; |
29 | | - samm:description "Aspect for movement information"@en ; |
30 | | - samm:properties ( :isMoving :position :speed :speedLimitWarning ) ; |
31 | | - samm:operations ( ) ; |
32 | | - samm:events ( ) . |
33 | | - |
34 | | - :isMoving a samm:Property ; |
35 | | - samm:preferredName "is moving"@en ; |
36 | | - samm:description "Flag indicating whether the asset is currently moving"@en ; |
37 | | - samm:characteristic samm-c:Boolean . |
38 | | - |
39 | | - :position a samm:Property ; |
40 | | - samm:preferredName "position"@en ; |
41 | | - samm:description "Indicates a position"@en ; |
42 | | - samm:characteristic :SpatialPositionCharacteristic . |
43 | | - |
44 | | - :speed a samm:Property ; |
45 | | - samm:preferredName "speed"@en ; |
46 | | - samm:description "speed of vehicle"@en ; |
47 | | - samm:characteristic :Speed . |
48 | | - |
49 | | - :speedLimitWarning a samm:Property ; |
50 | | - samm:preferredName "speed limit warning"@en ; |
51 | | - samm:description "Indicates if the speed limit is adhered to."@en ; |
52 | | - samm:characteristic :TrafficLight . |
53 | | - |
54 | | - :SpatialPositionCharacteristic a samm-c:SingleEntity ; |
55 | | - samm:preferredName "spatial position characteristic"@en ; |
56 | | - samm:description "Represents a single position in space with optional z coordinate."@en ; |
57 | | - samm:dataType :SpatialPosition . |
58 | | - |
59 | | - :Speed a samm-c:Measurement ; |
60 | | - samm:preferredName "speed"@en ; |
61 | | - samm:description "Scalar representation of speed of an object in kilometers per hour."@en ; |
62 | | - samm:dataType xsd:float ; |
63 | | - samm-c:unit unit:kilometrePerHour . |
64 | | - |
65 | | - :TrafficLight a samm-c:Enumeration ; |
66 | | - samm:preferredName "warning level"@en ; |
67 | | - samm:description "Represents if speed of position change is within specification (green), within tolerance (yellow), or outside specification (red)."@en ; |
68 | | - samm:dataType xsd:string ; |
69 | | - samm-c:values ( "green" "yellow" "red" ) . |
70 | | - |
71 | | - :SpatialPosition a samm:Entity ; |
72 | | - samm:preferredName "spatial position"@en ; |
73 | | - samm:description "Represents latitude, longitude and altitude information in the WGS84 geodetic reference datum"@en ; |
74 | | - samm:see <https://www.w3.org/2003/01/geo/> ; |
75 | | - samm:properties ( :latitude :longitude [ samm:property :altitude; samm:optional true ] ) . |
76 | | - |
77 | | - :latitude a samm:Property ; |
78 | | - samm:preferredName "latitude"@en ; |
79 | | - samm:description "latitude coordinate in space (WGS84)"@en ; |
80 | | - samm:see <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ; |
81 | | - samm:characteristic :Coordinate ; |
82 | | - samm:exampleValue "9.1781"^^xsd:decimal . |
83 | | - |
84 | | - :longitude a samm:Property ; |
85 | | - samm:preferredName "longitude"@en ; |
86 | | - samm:description "longitude coordinate in space (WGS84)"@en ; |
87 | | - samm:see <http://www.w3.org/2003/01/geo/wgs84_pos#long> ; |
88 | | - samm:characteristic :Coordinate ; |
89 | | - samm:exampleValue "48.80835"^^xsd:decimal . |
90 | | - |
91 | | - :altitude a samm:Property ; |
92 | | - samm:preferredName "altitude"@en ; |
93 | | - samm:description "Elevation above sea level zero"@en ; |
94 | | - samm:see <http://www.w3.org/2003/01/geo/wgs84_pos#alt> ; |
95 | | - samm:characteristic :MetresAboveMeanSeaLevel ; |
96 | | - samm:exampleValue "153"^^xsd:float . |
97 | | - |
98 | | - :Coordinate a samm-c:Measurement ; |
99 | | - samm:preferredName "coordinate"@en ; |
100 | | - samm:description "Representing the geographical coordinate"@en ; |
101 | | - samm:dataType xsd:decimal ; |
102 | | - samm-c:unit unit:degreeUnitOfAngle . |
103 | | - |
104 | | - :MetresAboveMeanSeaLevel a samm-c:Measurement ; |
105 | | - samm:preferredName "metres above mean sea level"@en ; |
106 | | - samm:description "Signifies the vertical distance in reference to a historic mean sea level as a vertical datum"@en ; |
107 | | - samm:see <https://en.wikipedia.org/wiki/Height_above_sea_level> ; |
108 | | - samm:dataType xsd:float ; |
109 | | - samm-c:unit unit:metre . |
110 | | - |
111 | | -} |
112 | | - |
113 | | -tests { |
114 | | - test("Status code is 200", function() { |
115 | | - expect(res.getStatus()).to.equal(200); |
116 | | - }); |
117 | | - test("Response body is valid", function () { |
118 | | - const data = res.getBody(); |
119 | | - expect(data).to.contains("aasx"); |
120 | | - }) |
121 | | -} |
| 1 | +meta { |
| 2 | + name: GenerateAASX |
| 3 | + type: http |
| 4 | + seq: 27 |
| 5 | +} |
| 6 | + |
| 7 | +post { |
| 8 | + url: http://localhost:{{port}}/ame/api/generate/aasx |
| 9 | + body: multipartForm |
| 10 | + auth: none |
| 11 | +} |
| 12 | + |
| 13 | +headers { |
| 14 | + uri: blob://movement.ttl |
| 15 | +} |
| 16 | + |
| 17 | +body:text { |
| 18 | + @prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.2.0#> . |
| 19 | + @prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.2.0#> . |
| 20 | + @prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.2.0#> . |
| 21 | + @prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.2.0#> . |
| 22 | + @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . |
| 23 | + @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . |
| 24 | + @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . |
| 25 | + @prefix : <urn:samm:org.eclipse.examples:1.0.0#> . |
| 26 | + |
| 27 | + :Movement a samm:Aspect ; |
| 28 | + samm:preferredName "movement"@en ; |
| 29 | + samm:description "Aspect for movement information"@en ; |
| 30 | + samm:properties ( :isMoving :position :speed :speedLimitWarning ) ; |
| 31 | + samm:operations ( ) ; |
| 32 | + samm:events ( ) . |
| 33 | + |
| 34 | + :isMoving a samm:Property ; |
| 35 | + samm:preferredName "is moving"@en ; |
| 36 | + samm:description "Flag indicating whether the asset is currently moving"@en ; |
| 37 | + samm:characteristic samm-c:Boolean . |
| 38 | + |
| 39 | + :position a samm:Property ; |
| 40 | + samm:preferredName "position"@en ; |
| 41 | + samm:description "Indicates a position"@en ; |
| 42 | + samm:characteristic :SpatialPositionCharacteristic . |
| 43 | + |
| 44 | + :speed a samm:Property ; |
| 45 | + samm:preferredName "speed"@en ; |
| 46 | + samm:description "speed of vehicle"@en ; |
| 47 | + samm:characteristic :Speed . |
| 48 | + |
| 49 | + :speedLimitWarning a samm:Property ; |
| 50 | + samm:preferredName "speed limit warning"@en ; |
| 51 | + samm:description "Indicates if the speed limit is adhered to."@en ; |
| 52 | + samm:characteristic :TrafficLight . |
| 53 | + |
| 54 | + :SpatialPositionCharacteristic a samm-c:SingleEntity ; |
| 55 | + samm:preferredName "spatial position characteristic"@en ; |
| 56 | + samm:description "Represents a single position in space with optional z coordinate."@en ; |
| 57 | + samm:dataType :SpatialPosition . |
| 58 | + |
| 59 | + :Speed a samm-c:Measurement ; |
| 60 | + samm:preferredName "speed"@en ; |
| 61 | + samm:description "Scalar representation of speed of an object in kilometers per hour."@en ; |
| 62 | + samm:dataType xsd:float ; |
| 63 | + samm-c:unit unit:kilometrePerHour . |
| 64 | + |
| 65 | + :TrafficLight a samm-c:Enumeration ; |
| 66 | + samm:preferredName "warning level"@en ; |
| 67 | + samm:description "Represents if speed of position change is within specification (green), within tolerance (yellow), or outside specification (red)."@en ; |
| 68 | + samm:dataType xsd:string ; |
| 69 | + samm-c:values ( "green" "yellow" "red" ) . |
| 70 | + |
| 71 | + :SpatialPosition a samm:Entity ; |
| 72 | + samm:preferredName "spatial position"@en ; |
| 73 | + samm:description "Represents latitude, longitude and altitude information in the WGS84 geodetic reference datum"@en ; |
| 74 | + samm:see <https://www.w3.org/2003/01/geo/> ; |
| 75 | + samm:properties ( :latitude :longitude [ samm:property :altitude; samm:optional true ] ) . |
| 76 | + |
| 77 | + :latitude a samm:Property ; |
| 78 | + samm:preferredName "latitude"@en ; |
| 79 | + samm:description "latitude coordinate in space (WGS84)"@en ; |
| 80 | + samm:see <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ; |
| 81 | + samm:characteristic :Coordinate ; |
| 82 | + samm:exampleValue "9.1781"^^xsd:decimal . |
| 83 | + |
| 84 | + :longitude a samm:Property ; |
| 85 | + samm:preferredName "longitude"@en ; |
| 86 | + samm:description "longitude coordinate in space (WGS84)"@en ; |
| 87 | + samm:see <http://www.w3.org/2003/01/geo/wgs84_pos#long> ; |
| 88 | + samm:characteristic :Coordinate ; |
| 89 | + samm:exampleValue "48.80835"^^xsd:decimal . |
| 90 | + |
| 91 | + :altitude a samm:Property ; |
| 92 | + samm:preferredName "altitude"@en ; |
| 93 | + samm:description "Elevation above sea level zero"@en ; |
| 94 | + samm:see <http://www.w3.org/2003/01/geo/wgs84_pos#alt> ; |
| 95 | + samm:characteristic :MetresAboveMeanSeaLevel ; |
| 96 | + samm:exampleValue "153"^^xsd:float . |
| 97 | + |
| 98 | + :Coordinate a samm-c:Measurement ; |
| 99 | + samm:preferredName "coordinate"@en ; |
| 100 | + samm:description "Representing the geographical coordinate"@en ; |
| 101 | + samm:dataType xsd:decimal ; |
| 102 | + samm-c:unit unit:degreeUnitOfAngle . |
| 103 | + |
| 104 | + :MetresAboveMeanSeaLevel a samm-c:Measurement ; |
| 105 | + samm:preferredName "metres above mean sea level"@en ; |
| 106 | + samm:description "Signifies the vertical distance in reference to a historic mean sea level as a vertical datum"@en ; |
| 107 | + samm:see <https://en.wikipedia.org/wiki/Height_above_sea_level> ; |
| 108 | + samm:dataType xsd:float ; |
| 109 | + samm-c:unit unit:metre . |
| 110 | + |
| 111 | +} |
| 112 | + |
| 113 | +body:multipart-form { |
| 114 | + aspectModel: @file(./TestingFiles/Movement.ttl) |
| 115 | +} |
| 116 | + |
| 117 | +tests { |
| 118 | + test("Status code is 200", function() { |
| 119 | + expect(res.getStatus()).to.equal(200); |
| 120 | + }); |
| 121 | + test("Response body is valid", function () { |
| 122 | + const data = res.getBody(); |
| 123 | + expect(data).to.contains("aasx"); |
| 124 | + }) |
| 125 | +} |
0 commit comments