-
Notifications
You must be signed in to change notification settings - Fork 0
wot-specs: revise WoT Binding and add registry-first Connectivity 1.1 #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
028952d
Add WoT Binding and registry-first Connectivity V2
marcschier 8a0cc12
wot: fix ns0 well-known BrowseNames and WoT Binding placeholder rule IDs
marcschier d5f53a8
wot-specs: address PR #17 review — WoT Connectivity 1.1 (incorporate …
marcschier 5597a12
Normalize imported WoT 1.02 model source
marcschier 9af0498
wot-specs: address PR #17 review — uav:eventType, portable ExpandedNo…
marcschier 2d528d0
Make WoT NodeSet conversion native-first
marcschier b795602
Address WoT model concept review feedback
marcschier dbeb751
Fix WoT Binding feedback lint
marcschier 5cda512
Merge branch 'main' into wot-binding-xregistry
marcschier 51c4439
Address WoT mapping review feedback
marcschier eb58ccc
Merge remote-tracking branch 'origin/wot-binding-xregistry' into wot-…
marcschier 777af9b
Prefer context prefixes for WoT QualifiedNames
marcschier 6232678
Clarify WoT registry resolution and retirement
marcschier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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,47 @@ | ||
| # OPC UA — Web of Things (WoT) Binding | ||
|
|
||
| A complete, standalone draft revision of the OPC UA companion specification for Web of Things connectivity. It is not an addendum: the specification can be read on its own. It preserves every namespace, prefix, term, and normative behaviour of the published baseline and adds a collision-safe model and platform vocabulary together with semantic-first, bidirectional NodeSet2 conversion. | ||
|
|
||
| > Experimental and non-normative. Nothing here is official or endorsed by the OPC Foundation or the W3C; `opcfoundation.org` namespace URIs are used for prototyping only. | ||
|
|
||
| ## Purpose | ||
|
|
||
| - Describe an OPC UA interface as a W3C Thing Description or Thing Model, using the preserved Read / Write / Observe / Call and security vocabulary. | ||
| - Express the structural facts of an OPC UA type — composition, references, groups, units, scaling, configuration, metadata, and modelling rules — in a Thing Model. | ||
| - Pair definitive ExpandedNodeIds with NamespaceUri-qualified model names such as `ua:HasOrderedComponent` so type-level concepts remain semantically readable without weakening instance identity. | ||
| - Convert between an OPC UA NodeSet2 information model and a Thing Description or Thing Model without loss through the semantic/readable vocabulary, adding the complete `uav:nodes` projection only when source facts cannot yet be expressed. Unmapped WoT members survive as pointer-addressed NodeSet extension residue; `uav:nodeSet` is reserved for explicit byte archival or a demonstrated final fallback. | ||
|
|
||
| ## Sources | ||
|
|
||
| - [OPC 10101 — OPC UA for WoT Binding](https://reference.opcfoundation.org/specs/OPC-10101/) — the published version superseded by this draft. | ||
| - [W3C Web of Things (WoT) Thing Description 1.1](https://www.w3.org/TR/wot-thing-description11/) and [WoT Binding Templates](https://www.w3.org/TR/wot-binding-templates/). | ||
| - [OPC 10000-3](https://reference.opcfoundation.org/specs/OPC-10000-3/), [10000-4](https://reference.opcfoundation.org/specs/OPC-10000-4/), [10000-5](https://reference.opcfoundation.org/specs/OPC-10000-5/), [10000-6](https://reference.opcfoundation.org/specs/OPC-10000-6/), [10000-7](https://reference.opcfoundation.org/specs/OPC-10000-7/). | ||
| - [QUDT](http://qudt.org/) for quantity kinds and units; [RFC 6901](https://www.rfc-editor.org/rfc/rfc6901), [RFC 4648](https://www.rfc-editor.org/rfc/rfc4648), and [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986). | ||
| - Two architecture decision records (ADR 0029 and ADR 0032) are used only as design inputs for the model vocabulary; a design-input crosswalk is kept, informatively, under [`../extras/WoT-Binding/adr-to-uav-crosswalk.md`](../extras/WoT-Binding/adr-to-uav-crosswalk.md) — **not** in the normative specification. No vocabulary, prefix, or namespace of those inputs is reused. | ||
|
|
||
| ## Artifacts | ||
|
|
||
| - [`OPC-UA-WoT-Binding.md`](OPC-UA-WoT-Binding.md) — the full specification. | ||
| - [`opc-ua-wot-binding.context.jsonld`](opc-ua-wot-binding.context.jsonld) — the JSON-LD context binding the `uav` prefix and every documented term. | ||
| - [`opc-ua-wot-binding.schema.json`](opc-ua-wot-binding.schema.json) — the extension and preservation JSON Schema (2020-12). | ||
| - [`examples/`](examples/) — worked examples: | ||
| - [`01-opcua-td-pump.jsonld`](examples/01-opcua-td-pump.jsonld) — a Thing Description using the preserved Read / Write / Observe / Call and security vocabulary. | ||
| - [`02-thing-model-pump.jsonld`](examples/02-thing-model-pump.jsonld) — a Thing Model using the model and platform vocabulary. | ||
| - [`03-nodeset-preservation-envelope.jsonld`](examples/03-nodeset-preservation-envelope.jsonld) — a `uav:nodeSet` preservation envelope carrying a canonical NodeSet2 baseline. | ||
| - [`04-type-reference-modelling-rule.jsonld`](examples/04-type-reference-modelling-rule.jsonld) — type, semantic model-name/reference (including `ua:HasOrderedComponent` plus its `i=49` fallback), and modelling-rule mappings. | ||
| - [`05-native-node-model.jsonld`](examples/05-native-node-model.jsonld) — the exceptional schema-complete `uav:nodes` representation without an opaque envelope. | ||
| - [`tools/validate_local.py`](tools/validate_local.py) — the deterministic, standard-library validator. | ||
|
|
||
| ## Namespace and prefix | ||
|
|
||
| The vocabulary namespace is `http://opcfoundation.org/UA/WoT-Binding/`, bound to the prefix `uav`. Both are preserved unchanged from the published baseline. | ||
|
|
||
| ## Validation | ||
|
|
||
| Run the validator from the repository root (standard library only, no dependencies): | ||
|
|
||
| ```bash | ||
| python wot-specs/WoT-Binding/tools/validate_local.py | ||
| ``` | ||
|
|
||
| It checks that every JSON and JSON-LD artifact parses, that the context contains every documented `uav` term, that each example declares the `uav` context, that the native example uses `uav:NodeModel` profile `1.0` without an envelope, that each exceptional envelope's base64 and SHA-256 are valid and decode to a well-formed `UANodeSet` root, that internal relative references resolve, that every NodeId-valued readable term in an example is a portable ExpandedNodeId (never the session-local `ns=<index>` form), that `@type: uav:eventType` is never paired with `uav:isEvent: false`, and that no forbidden vendor prefix, namespace, or legacy modelling-language name appears. It prints `OK` and exits `0` on success. |
This file contains hidden or 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,84 @@ | ||
| { | ||
| "@context": [ | ||
| "https://www.w3.org/2022/wot/td/v1.1", | ||
| { "uav": "http://opcfoundation.org/UA/WoT-Binding/" }, | ||
| "../opc-ua-wot-binding.context.jsonld" | ||
| ], | ||
| "@type": "uav:object", | ||
| "id": "urn:dev:opcua:pump-01", | ||
| "title": "Pump 01", | ||
| "description": "A Thing Description of a single OPC UA Object using only the preserved OPC 10101 vocabulary: Read, Write, Observe (Monitor) and Call, plus the explicit OPC UA security schemes.", | ||
| "uav:browseName": "nsu=http://example.com/demo/pump;Pump", | ||
| "uav:id": "nsu=http://example.com/demo/pump;s=Pump", | ||
| "links": [ | ||
| { "rel": "uav:componentOf", "href": "nsu=http://example.com/demo/pump;s=Line01" } | ||
| ], | ||
| "securityDefinitions": { | ||
| "opcua_channel_sc": { | ||
| "scheme": "uav:channelsec", | ||
| "uav:securityMode": "SignAndEncrypt", | ||
| "uav:securityPolicy": "Aes256_Sha256_RsaPss" | ||
| }, | ||
| "opcua_authentication_sc": { | ||
| "scheme": "uav:authentication", | ||
| "uav:userIdentityToken": "UserName" | ||
| }, | ||
| "opcua_sc": { | ||
| "scheme": "combo", | ||
| "allOf": ["opcua_channel_sc", "opcua_authentication_sc"] | ||
| } | ||
| }, | ||
| "security": "opcua_sc", | ||
| "base": "opc.tcp://opcuademo.com:4840", | ||
| "properties": { | ||
| "pumpSpeed": { | ||
| "@type": "uav:variable", | ||
| "title": "Pump Speed", | ||
| "uav:browseName": "nsu=http://example.com/demo/pump;PumpSpeed", | ||
| "uav:browsePath": "/Objects/{http://example.com/demo/pump}Pump/{http://example.com/demo/pump}PumpSpeed", | ||
| "type": "number", | ||
| "unit": "rpm", | ||
| "readOnly": true, | ||
| "observable": true, | ||
| "forms": [ | ||
| { | ||
| "href": "/?id=nsu=http://example.com/demo/pump;s=PumpSpeed", | ||
| "contentType": "application/octet-stream", | ||
| "op": ["readproperty", "observeproperty"] | ||
| } | ||
| ] | ||
| }, | ||
| "speedSetpoint": { | ||
| "@type": "uav:variable", | ||
| "title": "Speed Setpoint", | ||
| "uav:browseName": "nsu=http://example.com/demo/pump;SpeedSetpoint", | ||
| "uav:browsePath": "/Objects/{http://example.com/demo/pump}Pump/{http://example.com/demo/pump}SpeedSetpoint", | ||
| "type": "number", | ||
| "unit": "rpm", | ||
| "readOnly": false, | ||
| "observable": true, | ||
| "forms": [ | ||
| { | ||
| "href": "/?id=nsu=http://example.com/demo/pump;s=SpeedSetpoint", | ||
| "contentType": "application/octet-stream", | ||
| "op": ["readproperty", "writeproperty", "observeproperty"] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "actions": { | ||
| "reset": { | ||
| "@type": "uav:method", | ||
| "title": "Reset", | ||
| "uav:browseName": "nsu=http://example.com/demo/pump;Reset", | ||
| "uav:browsePath": "/Objects/{http://example.com/demo/pump}Pump/{http://example.com/demo/pump}Reset", | ||
| "forms": [ | ||
| { | ||
| "href": "/?id=nsu=http://example.com/demo/pump;s=Reset", | ||
| "contentType": "application/octet-stream", | ||
| "op": ["invokeaction"] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
114 changes: 114 additions & 0 deletions
114
wot-specs/WoT-Binding/examples/02-thing-model-pump.jsonld
This file contains hidden or 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,114 @@ | ||
| { | ||
| "@context": [ | ||
| "https://www.w3.org/2022/wot/td/v1.1", | ||
| { | ||
| "uav": "http://opcfoundation.org/UA/WoT-Binding/", | ||
| "pump": "http://example.com/demo/pump#", | ||
| "qudt-quantitykind": "http://qudt.org/vocab/quantitykind/" | ||
| }, | ||
| "../opc-ua-wot-binding.context.jsonld" | ||
| ], | ||
| "@type": ["tm:ThingModel", "uav:objectType"], | ||
| "title": "PumpType", | ||
| "description": "A Thing Model of an OPC UA ObjectType that exercises the model and platform vocabulary: composition, groups, membership, references, units and scaling, configuration, metadata and modelling rules.", | ||
| "uav:browseName": "nsu=http://example.com/demo/pump;PumpType", | ||
| "uav:id": "nsu=http://example.com/demo/pump;i=1001", | ||
| "uav:isComposite": true, | ||
| "uav:includeInherited": true, | ||
| "uav:additionalProperties": false, | ||
| "uav:nameNamespace": "http://example.com/demo/pump#", | ||
| "uav:semanticId": "http://example.com/ontology/Pump", | ||
| "uav:congruentTypeName": "pump:PumpType", | ||
| "uav:congruentType": "nsu=http://example.com/demo/pump;i=1001", | ||
| "uav:contains": ["Impeller"], | ||
| "uav:metadata": { | ||
| "revision": 3, | ||
| "maintainer": "Modeling Working Group" | ||
| }, | ||
| "uav:propertyGroups": [ | ||
| { | ||
| "title": "Operational", | ||
| "description": "Live operational data.", | ||
| "uav:semanticId": "http://example.com/ontology/Operational" | ||
| }, | ||
| { "title": "Nameplate" } | ||
| ], | ||
| "uav:eventGroups": [{ "title": "Diagnostics" }], | ||
| "uav:actionGroups": [{ "title": "Maintenance" }], | ||
| "links": [ | ||
| { | ||
| "rel": "uav:componentModel", | ||
| "href": "./04-type-reference-modelling-rule.jsonld", | ||
| "uav:refName": "Impeller", | ||
| "uav:refId": "i=47" | ||
| }, | ||
| { | ||
| "rel": "pump:DriveReference", | ||
| "href": "https://example.com/models/MotorType.tm.jsonld", | ||
| "uav:refName": "Drive", | ||
| "uav:refId": "nsu=http://example.com/demo/pump;i=4002" | ||
| }, | ||
| { "rel": "uav:capability", "href": "https://example.com/capabilities/telemetry" }, | ||
| { "rel": "uav:reference", "href": "https://example.com/models/NameplateType.tm.jsonld" } | ||
| ], | ||
| "properties": { | ||
| "pumpSpeed": { | ||
| "@type": "uav:variableType", | ||
| "title": "Pump Speed", | ||
| "uav:browseName": "nsu=http://example.com/demo/pump;PumpSpeed", | ||
| "type": "number", | ||
| "unit": "qudt-quantitykind:AngularVelocity", | ||
| "uav:modellingRule": "Mandatory", | ||
| "uav:memberOf": "Operational", | ||
| "uav:unitProperty": "/properties/pumpSpeed/unit", | ||
| "uav:scaleFactor": 0.1, | ||
| "uav:decimalPlaces": 2, | ||
| "observable": true, | ||
| "readOnly": true | ||
| }, | ||
| "serialNumber": { | ||
| "@type": "uav:variableType", | ||
| "title": "Serial Number", | ||
| "uav:browseName": "nsu=http://example.com/demo/pump;SerialNumber", | ||
| "type": "string", | ||
| "uav:modellingRule": "Mandatory", | ||
| "uav:memberOf": "Nameplate" | ||
| }, | ||
| "stage": { | ||
| "@type": "uav:variableType", | ||
| "title": "Stage", | ||
| "uav:browseName": "nsu=http://example.com/demo/pump;Stage", | ||
| "type": "number", | ||
| "uav:modellingRule": "MandatoryPlaceholder", | ||
| "uav:memberOf": "Operational" | ||
| } | ||
| }, | ||
| "actions": { | ||
| "reset": { | ||
| "@type": "uav:method", | ||
| "title": "Reset", | ||
| "uav:browseName": "nsu=http://example.com/demo/pump;Reset", | ||
| "uav:modellingRule": "Optional", | ||
| "uav:memberOf": "Maintenance", | ||
| "uav:actionConfiguration": { "timeoutMs": 5000, "confirm": true }, | ||
| "uav:externalSchema": "https://example.com/schemas/reset-args.json" | ||
| } | ||
| }, | ||
| "events": { | ||
| "overTemperature": { | ||
| "@type": "uav:eventType", | ||
| "title": "Over Temperature", | ||
| "uav:isEvent": true, | ||
| "uav:browseName": "nsu=http://example.com/demo/pump;OverTemperatureEventType", | ||
| "uav:memberOf": "Diagnostics", | ||
| "uav:semanticId": "http://example.com/ontology/OverTemperature", | ||
| "uav:eventConfiguration": { "severity": 500 }, | ||
| "data": { | ||
| "type": "object", | ||
| "properties": { | ||
| "temperature": { "type": "number", "unit": "qudt-quantitykind:Temperature" } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.