Skip to content

Commit fa420b3

Browse files
committed
add example WoT models to be served via Ditto website
1 parent e233b03 commit fa420b3

17 files changed

+752
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"@context": [
3+
"https://www.w3.org/2022/wot/td/v1.1"
4+
],
5+
"@type": "tm:ThingModel",
6+
"title": "Colored Lamp",
7+
"version": {
8+
"model": "1.0.0"
9+
},
10+
"links": [
11+
{
12+
"rel": "tm:extends",
13+
"href": "https://eclipse.dev/ditto/wot/example-models/switchable-1.0.0.tm.jsonld",
14+
"type": "application/tm+json"
15+
}
16+
],
17+
"tm:optional": [],
18+
"properties": {
19+
"color": {
20+
"title": "Color",
21+
"description": "The current color.",
22+
"type": "object",
23+
"properties": {
24+
"r": {
25+
"title": "Red",
26+
"type": "integer",
27+
"minimum": 0,
28+
"maximum": 255
29+
},
30+
"g": {
31+
"title": "Green",
32+
"type": "integer",
33+
"minimum": 0,
34+
"maximum": 255
35+
},
36+
"b": {
37+
"title": "Blue",
38+
"type": "integer",
39+
"minimum": 0,
40+
"maximum": 255
41+
},
42+
"w": {
43+
"title": "White",
44+
"type": "integer",
45+
"minimum": 0,
46+
"maximum": 255
47+
}
48+
},
49+
"required": [
50+
"r",
51+
"g",
52+
"b"
53+
]
54+
}
55+
}
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"@context": [
3+
"https://www.w3.org/2022/wot/td/v1.1",
4+
{
5+
"time": "http://www.w3.org/2006/time#"
6+
}
7+
],
8+
"@type": "tm:ThingModel",
9+
"title": "Connection Status",
10+
"version": {
11+
"model": "1.0.0"
12+
},
13+
"tm:optional": [],
14+
"properties": {
15+
"readySince": {
16+
"@type": "time:Instant",
17+
"title": "Ready since",
18+
"description": "Timestamp when the device or the connectivity endpoint signals that the device is connected and stays connected at least for some time and is ready for receiving information.",
19+
"type": "string",
20+
"format": "date-time",
21+
"unit": "xsd:dateTime"
22+
},
23+
"readyUntil": {
24+
"@type": "time:Instant",
25+
"title": "Ready until",
26+
"description": "Timestamp until when device or the connectivity endpoint signals that it stays ready for receiving information; if it signals that it stays connected and is ready until further notice then this timestamp is symbolically set to a timestamp that is at least 1 year ahead of now.",
27+
"type": "string",
28+
"format": "date-time",
29+
"unit": "xsd:dateTime"
30+
}
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"@context": [
3+
"https://www.w3.org/2022/wot/td/v1.1",
4+
{
5+
"om2": "http://www.ontology-of-units-of-measure.org/resource/om-2/"
6+
}
7+
],
8+
"@type": "tm:ThingModel",
9+
"title": "Dimmable Colored Lamp",
10+
"version": {
11+
"model": "1.0.0"
12+
},
13+
"links": [
14+
{
15+
"rel": "tm:extends",
16+
"href": "https://eclipse.dev/ditto/wot/example-models/colored-lamp-1.0.0.tm.jsonld",
17+
"type": "application/tm+json"
18+
}
19+
],
20+
"tm:optional": [],
21+
"properties": {
22+
"dimmer-level": {
23+
"@type": "om2:Percentage",
24+
"title": "Dimmer level",
25+
"type": "number",
26+
"unit": "om2:percent",
27+
"minimum": 0.0,
28+
"maximum": 1.0,
29+
"multipleOf": 0.001
30+
}
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"@context": [
3+
"https://www.w3.org/2022/wot/td/v1.1",
4+
{
5+
"om2": "http://www.ontology-of-units-of-measure.org/resource/om-2/",
6+
"time": "http://www.w3.org/2006/time#"
7+
}
8+
],
9+
"@type": "tm:ThingModel",
10+
"title": "Floor Lamp",
11+
"description": "A smart floor lamp with 3 dimmable and color changing spots, smoke detection capability and power consumption awareness.",
12+
"version": {
13+
"model": "1.0.0"
14+
},
15+
"links": [
16+
{
17+
"rel": "tm:submodel",
18+
"href": "https://eclipse.dev/ditto/wot/example-models/dimmable-colored-lamp-1.0.0.tm.jsonld",
19+
"type": "application/tm+json",
20+
"instanceName": "Spot1"
21+
},
22+
{
23+
"rel": "tm:submodel",
24+
"href": "https://eclipse.dev/ditto/wot/example-models/dimmable-colored-lamp-1.0.0.tm.jsonld",
25+
"type": "application/tm+json",
26+
"instanceName": "Spot2"
27+
},
28+
{
29+
"rel": "tm:submodel",
30+
"href": "https://eclipse.dev/ditto/wot/example-models/dimmable-colored-lamp-1.0.0.tm.jsonld",
31+
"type": "application/tm+json",
32+
"instanceName": "Spot3"
33+
},
34+
{
35+
"rel": "tm:submodel",
36+
"href": "https://eclipse.dev/ditto/wot/example-models/connection-status-1.0.0.tm.jsonld",
37+
"type": "application/tm+json",
38+
"instanceName": "ConnectionStatus"
39+
},
40+
{
41+
"rel": "tm:submodel",
42+
"href": "https://eclipse.dev/ditto/wot/example-models/power-consumption-aware-1.0.0.tm.jsonld",
43+
"type": "application/tm+json",
44+
"instanceName": "PowerConsumptionAwareness"
45+
},
46+
{
47+
"rel": "tm:submodel",
48+
"href": "https://eclipse.dev/ditto/wot/example-models/smoke-detector-1.0.0.tm.jsonld",
49+
"type": "application/tm+json",
50+
"instanceName": "SmokeDetection"
51+
},
52+
{
53+
"rel": "tm:submodel",
54+
"href": "https://eclipse.dev/ditto/wot/example-models/colored-lamp-1.0.0.tm.jsonld",
55+
"type": "application/tm+json",
56+
"instanceName": "Status-LED"
57+
}
58+
],
59+
"tm:optional": [],
60+
"properties": {
61+
"manufacturer": {
62+
"title": "Manufacturer",
63+
"type": "string",
64+
"readOnly": true
65+
},
66+
"serialNo": {
67+
"title": "Serial number",
68+
"type": "string",
69+
"readOnly": true
70+
}
71+
},
72+
"actions": {
73+
"switch-all-spots": {
74+
"title": "Switch all spots",
75+
"description": "Switches all spots (1-3) on/off based on the passed in boolean.",
76+
"type": "boolean"
77+
},
78+
"switch-all-spots-on-for-duration": {
79+
"title": "Switch all spots on for duration",
80+
"description": "Switches all spots (1-3) on for a given duration, then switches back to their previous state.",
81+
"tm:ref": "https://eclipse.dev/ditto/wot/example-models/switchable-1.0.0.tm.jsonld#/actions/switch-on-for-duration"
82+
}
83+
}
84+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"@context": [
3+
"https://www.w3.org/2022/wot/td/v1.1",
4+
{
5+
"om2": "http://www.ontology-of-units-of-measure.org/resource/om-2/"
6+
}
7+
],
8+
"@type": "tm:ThingModel",
9+
"title": "Power Consumption Aware",
10+
"version": {
11+
"model": "1.0.0"
12+
},
13+
"tm:optional": [],
14+
"properties": {
15+
"reportPowerConsumption": {
16+
"title": "Report power consumption",
17+
"description": "Configuration whether the current power consumption should be published via event 'reportedPowerConsumption'.",
18+
"type": "object",
19+
"properties": {
20+
"enabled": {
21+
"title": "Reporting enabled",
22+
"type": "boolean",
23+
"default": false
24+
},
25+
"interval": {
26+
"@type": "time:Duration",
27+
"title": "Reporting interval",
28+
"type": "integer",
29+
"unit": "time:seconds",
30+
"default": 30
31+
}
32+
}
33+
}
34+
},
35+
"events": {
36+
"current-power-consumption": {
37+
"title": "Current power consumption",
38+
"description": "Measurement of the current power consumption.",
39+
"data": {
40+
"@type": "om2:Power",
41+
"title": "Consumption in kW.",
42+
"type": "number",
43+
"unit": "om2:kilowatt",
44+
"minimum": 0.0
45+
}
46+
}
47+
}
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"@context": [
3+
"https://www.w3.org/2022/wot/td/v1.1",
4+
{
5+
"om2": "http://www.ontology-of-units-of-measure.org/resource/om-2/"
6+
}
7+
],
8+
"@type": "tm:ThingModel",
9+
"title": "Acceleration Sensor",
10+
"version": {
11+
"model": "1.0.0"
12+
},
13+
"tm:optional": [],
14+
"properties": {
15+
"currentAcceleration": {
16+
"@type": "om2:Acceleration",
17+
"title": "Current acceleration",
18+
"description": "The last or current measured acceleration in the three (X/Y/Z) dimensions measured in 'm/s²'.",
19+
"type": "object",
20+
"properties": {
21+
"x": {
22+
"title": "X dimension",
23+
"type": "number",
24+
"unit": "om2:metrePerSecond-TimeSquared"
25+
},
26+
"y": {
27+
"title": "Y dimension",
28+
"type": "number",
29+
"unit": "om2:metrePerSecond-TimeSquared"
30+
},
31+
"z": {
32+
"title": "Z dimension",
33+
"type": "number",
34+
"unit": "om2:metrePerSecond-TimeSquared"
35+
}
36+
},
37+
"required": ["x","y","z"]
38+
}
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"@context": [
3+
"https://www.w3.org/2022/wot/td/v1.1",
4+
{
5+
"om2": "http://www.ontology-of-units-of-measure.org/resource/om-2/"
6+
}
7+
],
8+
"@type": "tm:ThingModel",
9+
"title": "Altitude Sensor",
10+
"version": {
11+
"model": "1.0.0"
12+
},
13+
"links": [
14+
{
15+
"rel": "tm:extends",
16+
"href": "https://eclipse.dev/ditto/wot/example-models/sensors/min-max-aware-sensor-1.0.0.tm.jsonld",
17+
"type": "application/tm+json"
18+
}
19+
],
20+
"tm:optional": [],
21+
"properties": {
22+
"currentAltitude": {
23+
"@type": "om2:Height",
24+
"title": "Current altitude",
25+
"description": "The last or current measured altitude above sea level in 'm'.",
26+
"type": "number",
27+
"unit": "om2:metre"
28+
},
29+
"minMeasuredAltitude": {
30+
"@type": "om2:Height",
31+
"title": "Minimum measured altitude",
32+
"description": "The minimum measured altitude above sea level since power ON or reset in 'm'.",
33+
"type": "number",
34+
"unit": "om2:metre"
35+
},
36+
"maxMeasuredAltitude": {
37+
"@type": "om2:Height",
38+
"title": "Maximum measured altitude",
39+
"description": "The maximum measured altitude above sea level since power ON or reset in 'm'.",
40+
"type": "number",
41+
"unit": "om2:metre"
42+
}
43+
}
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"@context": [
3+
"https://www.w3.org/2022/wot/td/v1.1",
4+
{
5+
"om2": "http://www.ontology-of-units-of-measure.org/resource/om-2/"
6+
}
7+
],
8+
"@type": "tm:ThingModel",
9+
"title": "Angular Velocity Sensor",
10+
"version": {
11+
"model": "1.0.0"
12+
},
13+
"tm:optional": [],
14+
"properties": {
15+
"currentAngularVelocity": {
16+
"@type": "om2:AngularVelocity",
17+
"title": "Current acceleration",
18+
"description": "The last or current measured angular velocity in the three (X/Y/Z) dimension measured in 'rad/s'.",
19+
"type": "object",
20+
"properties": {
21+
"x": {
22+
"title": "X dimension",
23+
"type": "integer",
24+
"unit": "om2:radianPerSecond-Time"
25+
},
26+
"y": {
27+
"title": "Y dimension",
28+
"type": "integer",
29+
"unit": "om2:radianPerSecond-Time"
30+
},
31+
"z": {
32+
"title": "Z dimension",
33+
"type": "integer",
34+
"unit": "om2:radianPerSecond-Time"
35+
}
36+
},
37+
"required": ["x","y","z"]
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)