forked from eclipse-thingweb/playground
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request eclipse-thingweb#455 from fatadel/advanced-tm-vali…
…dation-2 resolve tms using node-wot td-tools
- Loading branch information
Showing
8 changed files
with
388 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
25
packages/core/examples/tds/warning/unavailableDirectTm.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
25
packages/core/examples/tds/warning/unavailableRecursiveTm.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] | ||
} |
Oops, something went wrong.