Skip to content

Commit

Permalink
Merge pull request eclipse-thingweb#455 from fatadel/advanced-tm-vali…
Browse files Browse the repository at this point in the history
…dation-2

resolve tms using node-wot td-tools
  • Loading branch information
egekorkan authored Feb 21, 2023
2 parents c19d8f8 + 7920cd1 commit ae3ac03
Show file tree
Hide file tree
Showing 8 changed files with 388 additions and 14 deletions.
118 changes: 118 additions & 0 deletions packages/core/examples/tds/valid/usingRecursiveTM.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"id": "urn:required",
"$comment": "example 57 of the spec",
"@context": [
"https://www.w3.org/2022/wot/td/v1.1"
],
"title": "The title",
"description": "The description",
"securityDefinitions": {
"basic_sc": {
"scheme": "basic",
"in": "header"
}
},
"security": "basic_sc",
"properties": {
"status": {
"type": "string",
"description": "current status of the lamp (on|off)",
"readOnly": true,
"writeOnly": false,
"observable": false,
"enum": [
"on_value",
"off_value",
"error_value"
],
"forms": [
{
"op": "readproperty",
"href": "http://127.0.13.232:4563/status",
"contentType": "application/json"
}
]
},
"dim": {
"type": "integer",
"readOnly": true,
"writeOnly": false,
"observable": false,
"minimum": 0,
"maximum": 100,
"forms": [
{
"op": "readproperty",
"href": "http://127.0.13.232:4563/dim",
"contentType": "application/json"
}
]
}
},
"actions": {
"led_fadeIn": {
"title": "fadeIn",
"safe": true,
"idempotent": true,
"input": {
"type": "number",
"description": "fadeIn in ms",
"readOnly": true,
"writeOnly": false,
"observable": false
},
"forms": [
{
"op": "invokeaction",
"href": "http://127.0.13.211:4563/fadeIn",
"contentType": "application/json"
}
]
},
"led_fadeOut": {
"title": "fadeOut",
"safe": true,
"idempotent": true,
"input": {
"type": "number",
"description": "fadeOut in ms",
"readOnly": true,
"writeOnly": false,
"observable": false
},
"forms": [
{
"op": "invokeaction",
"href": "http://127.0.13.211:4563/fadeOut",
"contentType": "application/json"
}
]
}
},
"links": [
{
"rel": "type",
"href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/master/packages/core/examples/tms/valid/extend.json",
"type": "application/td+json"
}
],
"events": {
"overheating": {
"description": "Lamp reaches a critical temperature (overheating)",
"data": {
"type": "string",
"readOnly": true,
"writeOnly": false,
"observable": false
},
"forms": [
{
"href": "https://mylamp.example.com/oh",
"subprotocol": "longpoll",
"contentType": "application/json",
"op": ["subscribeevent"]
}
]
}
}
}
25 changes: 25 additions & 0 deletions packages/core/examples/tds/warning/unavailableDirectTm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"@context": "https://www.w3.org/2022/wot/td/v1.1",
"@type": "Thing",
"id": "urn:example:123-321-123-321",
"title": "MyLampThing",
"description": "My very lamp thingy.",
"version": {
"instance": "1.0.0",
"model": "1.0.0"
},
"links": [
{
"rel": "type",
"href": "https://example.com/models/colored-lamp-1.0.0.tm.jsonld",
"type": "application/tm+json"
}
],
"securityDefinitions": {
"basic_sc": {
"scheme": "basic",
"in": "header"
}
},
"security": "basic_sc"
}
25 changes: 25 additions & 0 deletions packages/core/examples/tds/warning/unavailableRecursiveTm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"@context": "https://www.w3.org/2022/wot/td/v1.1",
"@type": "Thing",
"id": "urn:example:123-321-123-321",
"title": "MyLampThing",
"description": "My very lamp thingy.",
"version": {
"instance": "1.0.0",
"model": "1.0.0"
},
"links": [
{
"rel": "type",
"href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/master/packages/core/examples/tms/invalid/unavailableParent.json",
"type": "application/tm+json"
}
],
"securityDefinitions": {
"basic_sc": {
"scheme": "basic",
"in": "header"
}
},
"security": "basic_sc"
}
15 changes: 15 additions & 0 deletions packages/core/examples/tms/invalid/unavailableParent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": ["https://www.w3.org/2022/wot/td/v1.1"],
"@type": "tm:ThingModel",
"title": "Dimmable Colored Lamp",
"version": {
"model": "1.0.0"
},
"links": [
{
"rel": "tm:extends",
"href": "https://example.com/models/colored-lamp-1.0.0.tm.jsonld",
"type": "application/tm+json"
}
]
}
Loading

0 comments on commit ae3ac03

Please sign in to comment.