From 27f2fc595b516303ad0822f3c093841a795cd420 Mon Sep 17 00:00:00 2001 From: James Thompson Date: Sat, 10 May 2025 13:51:45 +1000 Subject: [PATCH 1/5] task: #1339 split OPCUA document into Extensions & Adapters doc Signed-off-by: James Thompson --- cloudevents/adapters/README.md | 1 + cloudevents/adapters/opcua.md | 245 ++++++++++++++++++++++++++ cloudevents/extensions/README.md | 2 +- cloudevents/extensions/opcua.md | 293 +------------------------------ 4 files changed, 250 insertions(+), 291 deletions(-) create mode 100644 cloudevents/adapters/opcua.md diff --git a/cloudevents/adapters/README.md b/cloudevents/adapters/README.md index ffba38edc..94692a794 100644 --- a/cloudevents/adapters/README.md +++ b/cloudevents/adapters/README.md @@ -14,3 +14,4 @@ algorithms that should be used: - [CouchDB](./couchdb.md) - [GitHub](./github.md) - [GitLab](./gitlab.md) +- [OPC Unified Architecture](./opcua.md) diff --git a/cloudevents/adapters/opcua.md b/cloudevents/adapters/opcua.md new file mode 100644 index 000000000..c994750c4 --- /dev/null +++ b/cloudevents/adapters/opcua.md @@ -0,0 +1,245 @@ +# OPC Unified Architecture CloudEvents Adapter + +This document describes how to convert [OPC UA](https://reference.opcfoundation.org/Core/Part1/v105/docs/) [PubSub](https://reference.opcfoundation.org/Core/Part14/v105/docs/) dataset into CloudEvents. + +All OPC UA events are converted into CloudEvents using the same pattern as described in the following table: + +## Core Mapping + +| CloudEvents Attribute | Value | Remark | +| :-------------------- | :----------------------------------------------| :-------------------- | +| `id` | `MessageId` mapped from [Network Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.3#Table163) | | +| `source` | `applicationUri` of the OPC UA server mapped from [Application Description](https://reference.opcfoundation.org/Core/Part4/v104/docs/7.1) | Alternatively a customer configured identifier like a unified namespace path | +| `type` | `MessageType` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164). | +| `datacontenttype` | `application/json` for OPC UA PubSub JSON payload. | MAY be appended with `+gzip` when the payload is gzip compressed. | +| `dataschema` | OPC UA provides type information as part of PubSub metadata messages. | For non OPC UA consumers or when different payload encoding like Avro is used, it is REQUIRED to provide schema information (based on metadata information) in a separate format like [JSON schema](https://json-schema.org/specification) or [Avro schema](https://avro.apache.org/docs/1.11.1/specification/) or others. | +| `time` | `Timestamp` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | | +| `data` | content of the OPCUA event | | + +## Message specific Mapping + +### Metadata + +A metadata message is indicated by setting the type property to `ua-metadata` + +| CloudEvents Attribute | Value | Remark | +| :-------------------- | :----------------------------------------------| :-------------------- | +| `subject` | `DataSetWriterId` or `DataSetWriterName` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164). | | + +### Keyframe + +A keyframe message is indicated by setting the type property to `ua-keyframe` + +| CloudEvents Attribute | Value | Remark | +| :-------------------- | :----------------------------------------------| :-------------------- | +| `subject` | `DataSetWriterId` or `DataSetWriterName` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164). | | +| `sequence` | `SequenceNumber` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | Attribute as defined by [sequence extensions](./sequence.md) | + +### Deltaframe + +A deltaframe message is indicated by setting the type property to `ua-deltaframe` + +| CloudEvents Attribute | Value | Remark | +| :-------------------- | :----------------------------------------------| :-------------------- | +| `subject` | `DataSetWriterId` or `DataSetWriterName` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164). | | +| `sequence` | `SequenceNumber` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | Attribute as defined by [sequence extensions](./sequence.md) | + +### Event + +An event message is indicated by setting the type property to `ua-event` + +| CloudEvents Attribute | Value | Remark | +| :-------------------- | :----------------------------------------------| :-------------------- | +| `subject` | `DataSetWriterId` or `DataSetWriterName` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164). | | +| `sequence` | `SequenceNumber` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | Attribute as defined by [sequence extensions](./sequence.md) | + +## Recomended Extension Mapping + +It is recomended that the below extensions are also implemented. + +| CloudEvents Attribute | Value | Remark | +| :-------------------- | :----------------------------------------------| :-------------------- | +| `traceparent` | | Attribute as defined by [distributed-tracing extension](./distributed-tracing.md) to allow tracing from event publisher towards consumer. | +| `tracestate` | | Attribute as defined by [distributed-tracing extension](./distributed-tracing.md) MAY be used to allow tracing from event publisher towards consumer. | +| `recordedtime` | | Attribute as defined by [recordedtime extension](./recordedtime.md) to determine the latency between event publisher towards consumer. | + +## General Constraints + +- OPC UA messages MUST use `binary-mode` of CloudEvents. +- OPC UA PubSub JSON messages MUST be encoded using non-reversible encoding as the decoding information is contained in metadata messages or by schema referenced via `dataschema` attribute. +- Payload of OPC UA PubSub JSON messages MUST NOT contain Network Message Header and Data Set Header as that information is mapped into CloudEvents attributes. +- OPC UA PubSub JSON messages MUST contain exactly one dataset message. + +## Examples + +### Metadata message + +The metadata message helps Cloud applications to understand the semantics and structure of dataset messages. + +```text +------------------ PUBLISH ------------------- + +Topic Name: opcua/json/DataSetMetaData/publisher-on-ot-edge +Content Type: application/json; charset=utf-8 + +------------- User Properties ---------------- + +specversion: 1.0 +type: ua-metadata +time: 2024-03-28T21:56:24Z +id: 1234-1234-1234 +source: urn:factory:aggregationserver:opcua +datacontenttype: application/json; charset=utf-8 +subject: energy-consumption-asset + .... further attributes ... + +------------------ payload ------------------- + +{ + ... application data (OPC UA PubSub metadata) ... + "ConfigurationVersion": { + "MajorVersion": 672338910, + "MinorVersion": 672341762 + } + ... +} + +----------------------------------------------- +``` + +### Telemetry message + +The telemetry or data messages contain values of all OPC UA nodes that had changed in a given period of time (`ua-deltaframe`) or contain values for all OPC UA nodes that were monitored (`ua-keyframe`). The complete list of monitored OPC UA nodes as well as the related type information are defined in the metadata message. The attributes `opcuametadatamajorversion` and `opcuametadataminorversion` are used to reference the correct metadata message. The `ua-deltaframe` messages will be used for hot and/or cold path processing and `ua-keyframe` messages can additional be used to update last-known-value tables. + +```text +------------------ PUBLISH ------------------- + +Topic Name: opcua/json/DataSetMessage/publisher-on-ot-edge +Content Type: application/json; charset=utf-8 + +------------- User Properties ---------------- + +specversion: 1.0 +type: ua-deltaframe +time: 2024-03-28T21:56:42Z +id: 1235-1235-1235 +source: urn:factory:aggregationserver:opcua +datacontenttype: application/json; charset=utf-8 +subject: energy-consumption-asset +sequence: 7 +traceparent: 4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-00000011 +recordedtime: 2024-03-28T21:56:43Z +opcuametadatamajorversion: 672338910 +opcuametadataminorversion: 672341762 + .... further attributes ... + +------------------ payload ------------------- + +{ + ... application data + (OPC UA PubSub JSON single dataset Message)... +} + +----------------------------------------------- +``` + +#### OPC UA PubSub JSON single dataset Message + +Using CloudEvents and model the OPC UA PubSub header information as CloudEvent attributes enables integration into various system (independent from used protocols) and simplifies the payload structure. + +```text +{ + "IsRunning": { + "Value": true, + "SourceTimestamp": "2024-03-29T07:31:19.555Z" + }, + "EnergyConsumption": { + "Value": 31 + "SourceTimestamp": "2024-03-29T07:31:37.546Z", + "StatusCode": { + "Code":1073741824, + "Symbol":"Uncertain" + } + }, + "EnergyPeak": { + "Value": 54 + "SourceTimestamp": "2024-03-29T07:31:06.978Z" + }, + "EnergyLow": { + "Value": 22 + "SourceTimestamp": "2024-03-29T07:31:17.582Z" + } +} + +``` + +### Event message + +The event message will contain a single event and the identifier of this event is added to the `subject` to allow routing it into different systems without parsing the payload. Events are routed for example in systems like Manufacturing Execution Systems (MES), Supervisory Control and Data Acquisition systems (SCADA), Alerting Systems or Operation Technology Operator Terminals (HMI Clients) and also in hot and/or cold path processing. The attributes `opcuametadatamajorversion` and `opcuametadataminorversion` are used to reference the correct metadata message. + +```text +------------------ PUBLISH ------------------- + +Topic Name: opcua/json/DataSetMessage/publisher-on-ot-edge +Content Type: application/json; charset=utf-8 + +------------- User Properties ---------------- + +specversion: 1.0 +type: ua-event +time: 2024-03-28T21:57:01Z +id: 1236-1237-1238 +source: urn:factory:aggregationserver:opcua +datacontenttype: application/json; charset=utf-8 +subject: energy-consumption-asset/444321 +sequence: 18 +traceparent: caffef3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-00000011 +recordedtime: 2024-03-28T21:57:01Z +opcuametadatamajorversion: 672338910 +opcuametadataminorversion: 672341762 + .... further attributes ... + +------------------ payload ------------------- + +{ + ... application data + (OPC UA PubSub JSON Single Event Message)... +} + +----------------------------------------------- +``` + +### Telemetry message with different Encoding + +One major benefit of CloudEvents for OPC UA is that it is possible to support other encoding and external schema, while keeping the same OPC UA information for routing. + +The example below uses Avro binary encoded payload, with the corresponding schema referenced by `dataschema`. The `source` will be defined by an customer defined hierarchical path. + +```text +------------------ PUBLISH ------------------- + +Topic Name: bottling-company/amsterdam/FillingArea1/FillingLine9/Cell1/Conveyor +Content Type: application/avro + +------------- User Properties ---------------- + +specversion: 1.0 +type: ua-keyframe +time: 2024-03-28T23:59:59Z +id: 6235-7235-8235 +source: bottling-company/amsterdam/FillingArea1/FillingLine9/Cell1/Conveyor +datacontenttype: application/avro +subject: energy-consumption-asset +dataschema: http://example.com/schemas/energy-consumption-asset/v1.8 +sequence: 3141 +traceparent: 22222f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-00000011 +recordedtime: 2024-03-28T23:59:59Z + .... further attributes ... + +------------------ payload ------------------- + + ... application data + (OPC UA PubSub Single DataSet Message as AVRO binary)... + +----------------------------------------------- +``` diff --git a/cloudevents/extensions/README.md b/cloudevents/extensions/README.md index 0b66ea88d..5667fd099 100644 --- a/cloudevents/extensions/README.md +++ b/cloudevents/extensions/README.md @@ -47,7 +47,7 @@ for more information. - [Deprecation](deprecation.md) - [Distributed Tracing](distributed-tracing.md) - [Expiry Time](expirytime.md) -- [OPC UA](opcua.md) +- [OPC Unified Architecture](opcua.md) - [Partitioning](partitioning.md) - [Recorded Time](recordedtime.md) - [Sampling](sampledrate.md) diff --git a/cloudevents/extensions/opcua.md b/cloudevents/extensions/opcua.md index fbbfa7fbc..c3dcf0976 100644 --- a/cloudevents/extensions/opcua.md +++ b/cloudevents/extensions/opcua.md @@ -1,4 +1,4 @@ -# OPC UA +# OPC Unified Architecture This extension defines the mapping of [OPC UA](https://reference.opcfoundation.org/Core/Part1/v105/docs/) [PubSub](https://reference.opcfoundation.org/Core/Part14/v105/docs/) dataset to @@ -19,92 +19,13 @@ For example, an attribute being marked as "REQUIRED" does not mean it needs to be in all CloudEvents, rather it needs to be included only when this extension is being used. -## Mapping of REQUIRED Attributes - -### id - -MUST map to [Network Message -Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.3#Table163) -field `MessageId`. - -### source - -MUST either map to [Application -Description](https://reference.opcfoundation.org/Core/Part4/v104/docs/7.1) field -`applicationUri` of the OPC UA server or to a customer configured identifier -like a unified namespace path. - -### type - -MUST map to [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) -field `MessageType`. - -## Mapping of OPTIONAL Attributes - -### datacontenttype - -MUST be `application/json` for OPC UA PubSub JSON payload and MAY be appended with -`+gzip` when the payload is gzip compressed. - -### dataschema - -OPC UA provides type information as part of PubSub metadata messages, for non -OPC UA consumers or when different payload encoding like Avro is used, it is -REQUIRED to provide schema information (based on metadata information) in a -separate format like [JSON schema](https://json-schema.org/specification) or -[Avro schema](https://avro.apache.org/docs/1.11.1/specification/) or others. For -those cases the attribute references the schema and is used for versioning. - -### subject - -For metadata, event and data messages (type one of `ua-metadata`, `ua-keyframe`, -`ua-deltaframe`, `ua-event`), `subject` MUST map to either [Data Set Message -Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) -field `DataSetWriterId` or `DataSetWriterName`. - -For event messages (type equals to `ua-event`) `subject` MUST be appended with -"/" and [Base Event Type](https://reference.opcfoundation.org/Core/Part5/v104/docs/6.4.2) -field `EventId`. - -### time - -MUST map to [Data Set Message -Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) -field `Timestamp`. - -## Mapping for other extensions - -The following well-known extensions attributes MUST be used for data messages and -event messages (type one of `ua-keyframe`, `ua-deltaframe`, `ua-event`). - -### sequence - -Attribute as defined by [sequence extensions](./sequence.md) MUST map to [Data -Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) -field `SequenceNumber`. - -### traceparent - -Attribute as defined by [distributed-tracing extension](./distributed-tracing.md) -to allow tracing from event publisher towards consumer. - -### tracestate - -Attribute as defined by [distributed-tracing extension](./distributed-tracing.md) -MAY be used to allow tracing from event publisher towards consumer. - -### recordedtime - -Attribute as defined by [recordedtime extension](./recordedtime.md) to -determine the latency between event publisher towards consumer. - ## Attributes ### opcuametadatamajorversion - Type: `Integer` - Description: Links dataset message to the current version of the metadata. -Contains value from `MajorVersion` of [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) field `MetaDataVersion`. +Contains value from `MajorVersion` of [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) field `MetaDataVersion`. - Constraints - OPTIONAL but MUST NOT be present if `dataschema` is used @@ -121,216 +42,8 @@ field `MetaDataVersion`. ### opcuastatus - Type: `Integer` -- Description: Defines the overall status of the data set message, maps to -[Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) field `Status`. +- Description: Defines the overall status of the data set message, maps to [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) field `Status`. - Constraints - OPTIONAL - REQUIRED if status is not _Good_ - MAY be omitted if status is _Good_ - -## General Constraints - -- OPC UA messages MUST use `binary-mode` of CloudEvents. -- OPC UA PubSub JSON messages MUST be encoded using non-reversible encoding as -the decoding information is contained in metadata messages or by schema -referenced via `dataschema` attribute. -- Payload of OPC UA PubSub JSON messages MUST NOT contain Network Message Header -and Data Set Header as that information is mapped into CloudEvents attributes. -- OPC UA PubSub JSON messages MUST contain exactly one dataset message. - -## Examples - -### Metadata message - -The metadata message helps Cloud applications to understand the semantics and -structure of dataset messages. - -```text ------------------- PUBLISH ------------------- - -Topic Name: opcua/json/DataSetMetaData/publisher-on-ot-edge -Content Type: application/json; charset=utf-8 - -------------- User Properties ---------------- - -specversion: 1.0 -type: ua-metadata -time: 2024-03-28T21:56:24Z -id: 1234-1234-1234 -source: urn:factory:aggregationserver:opcua -datacontenttype: application/json; charset=utf-8 -subject: energy-consumption-asset - .... further attributes ... - ------------------- payload ------------------- - -{ - ... application data (OPC UA PubSub metadata) ... - "ConfigurationVersion": { - "MajorVersion": 672338910, - "MinorVersion": 672341762 - } - ... -} - ------------------------------------------------ -``` - -### Telemetry message - -The telemetry or data messages contain values of all OPC UA nodes that had -changed in a given period of time (`ua-deltaframe`) or contain values for all -OPC UA nodes that were monitored (`ua-keyframe`). -The complete list of monitored OPC UA nodes as well as the related type -information are defined in the metadata message. The attributes -`opcuametadatamajorversion` and `opcuametadataminorversion` are used to -reference the correct metadata message. The `ua-deltaframe` messages will be -used for hot and/or cold path processing and `ua-keyframe` messages can -additional be used to update last-known-value tables. - - -```text ------------------- PUBLISH ------------------- - -Topic Name: opcua/json/DataSetMessage/publisher-on-ot-edge -Content Type: application/json; charset=utf-8 - -------------- User Properties ---------------- - -specversion: 1.0 -type: ua-deltaframe -time: 2024-03-28T21:56:42Z -id: 1235-1235-1235 -source: urn:factory:aggregationserver:opcua -datacontenttype: application/json; charset=utf-8 -subject: energy-consumption-asset -sequence: 7 -traceparent: 4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-00000011 -recordedtime: 2024-03-28T21:56:43Z -opcuametadatamajorversion: 672338910 -opcuametadataminorversion: 672341762 - .... further attributes ... - ------------------- payload ------------------- - -{ - ... application data - (OPC UA PubSub JSON single dataset Message)... -} - ------------------------------------------------ -``` - -#### OPC UA PubSub JSON single dataset Message - -Using CloudEvents and model the OPC UA PubSub header information as CloudEvent -attributes enables integration into various system (independent from used -protocols) and simplifies the payload structure. - -```text -{ - "IsRunning": { - "Value": true, - "SourceTimestamp": "2024-03-29T07:31:19.555Z" - }, - "EnergyConsumption": { - "Value": 31 - "SourceTimestamp": "2024-03-29T07:31:37.546Z", - "StatusCode": { - "Code":1073741824, - "Symbol":"Uncertain" - } - }, - "EnergyPeak": { - "Value": 54 - "SourceTimestamp": "2024-03-29T07:31:06.978Z" - }, - "EnergyLow": { - "Value": 22 - "SourceTimestamp": "2024-03-29T07:31:17.582Z" - } -} - -``` - -### Event message - -The event message will contain a single event and the identifier of this event is -added to the `subject` to allow routing it into different systems without parsing -the payload. Events are routed for example in systems like Manufacturing Execution -Systems (MES), Supervisory Control and Data Acquisition systems (SCADA), -Alerting Systems or Operation Technology Operator Terminals (HMI Clients) and -also in hot and/or cold path processing. The attributes -`opcuametadatamajorversion` and `opcuametadataminorversion` are used to -reference the correct metadata message. - -```text ------------------- PUBLISH ------------------- - -Topic Name: opcua/json/DataSetMessage/publisher-on-ot-edge -Content Type: application/json; charset=utf-8 - -------------- User Properties ---------------- - -specversion: 1.0 -type: ua-event -time: 2024-03-28T21:57:01Z -id: 1236-1237-1238 -source: urn:factory:aggregationserver:opcua -datacontenttype: application/json; charset=utf-8 -subject: energy-consumption-asset/444321 -sequence: 18 -traceparent: caffef3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-00000011 -recordedtime: 2024-03-28T21:57:01Z -opcuametadatamajorversion: 672338910 -opcuametadataminorversion: 672341762 - .... further attributes ... - ------------------- payload ------------------- - -{ - ... application data - (OPC UA PubSub JSON Single Event Message)... -} - ------------------------------------------------ -``` - -### Telemetry message with different Encoding - -One major benefit of CloudEvents for OPC UA is that it is possible to support -other encoding and external schema, while keeping the same OPC UA information for -routing. - -The example below uses Avro binary encoded payload, with the corresponding schema -referenced by `dataschema`. The `source` will be defined by an customer defined -hierarchical path. - -```text ------------------- PUBLISH ------------------- - -Topic Name: bottling-company/amsterdam/FillingArea1/FillingLine9/Cell1/Conveyor -Content Type: application/avro - -------------- User Properties ---------------- - -specversion: 1.0 -type: ua-keyframe -time: 2024-03-28T23:59:59Z -id: 6235-7235-8235 -source: bottling-company/amsterdam/FillingArea1/FillingLine9/Cell1/Conveyor -datacontenttype: application/avro -subject: energy-consumption-asset -dataschema: http://example.com/schemas/energy-consumption-asset/v1.8 -sequence: 3141 -traceparent: 22222f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-00000011 -recordedtime: 2024-03-28T23:59:59Z - .... further attributes ... - ------------------- payload ------------------- - - ... application data - (OPC UA PubSub Single DataSet Message as AVRO binary)... - ------------------------------------------------ -``` From 16d361d02e3f61522db429b4672bec60394371fc Mon Sep 17 00:00:00 2001 From: James Thompson Date: Sat, 10 May 2025 14:05:06 +1000 Subject: [PATCH 2/5] Fix build Signed-off-by: James Thompson --- cloudevents/adapters/opcua.md | 12 ++++++------ cloudevents/languages/he/adapters/opcua.md | 3 +++ cloudevents/languages/he/extensions/opcua.md | 3 ++- cloudevents/languages/zh-CN/adapters/opcua.md | 6 ++++++ cloudevents/languages/zh-CN/extensions/opcua.md | 2 +- 5 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 cloudevents/languages/he/adapters/opcua.md create mode 100644 cloudevents/languages/zh-CN/adapters/opcua.md diff --git a/cloudevents/adapters/opcua.md b/cloudevents/adapters/opcua.md index c994750c4..952260b19 100644 --- a/cloudevents/adapters/opcua.md +++ b/cloudevents/adapters/opcua.md @@ -33,7 +33,7 @@ A keyframe message is indicated by setting the type property to `ua-keyframe` | CloudEvents Attribute | Value | Remark | | :-------------------- | :----------------------------------------------| :-------------------- | | `subject` | `DataSetWriterId` or `DataSetWriterName` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164). | | -| `sequence` | `SequenceNumber` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | Attribute as defined by [sequence extensions](./sequence.md) | +| `sequence` | `SequenceNumber` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | Attribute as defined by [sequence extensions](./../extensions/sequence.md) | ### Deltaframe @@ -42,7 +42,7 @@ A deltaframe message is indicated by setting the type property to `ua-deltafram | CloudEvents Attribute | Value | Remark | | :-------------------- | :----------------------------------------------| :-------------------- | | `subject` | `DataSetWriterId` or `DataSetWriterName` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164). | | -| `sequence` | `SequenceNumber` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | Attribute as defined by [sequence extensions](./sequence.md) | +| `sequence` | `SequenceNumber` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | Attribute as defined by [sequence extensions](./../extensions/sequence.md) | ### Event @@ -51,7 +51,7 @@ An event message is indicated by setting the type property to `ua-event` | CloudEvents Attribute | Value | Remark | | :-------------------- | :----------------------------------------------| :-------------------- | | `subject` | `DataSetWriterId` or `DataSetWriterName` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164). | | -| `sequence` | `SequenceNumber` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | Attribute as defined by [sequence extensions](./sequence.md) | +| `sequence` | `SequenceNumber` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | Attribute as defined by [sequence extensions](./../extensions/sequence.md) | ## Recomended Extension Mapping @@ -59,9 +59,9 @@ It is recomended that the below extensions are also implemented. | CloudEvents Attribute | Value | Remark | | :-------------------- | :----------------------------------------------| :-------------------- | -| `traceparent` | | Attribute as defined by [distributed-tracing extension](./distributed-tracing.md) to allow tracing from event publisher towards consumer. | -| `tracestate` | | Attribute as defined by [distributed-tracing extension](./distributed-tracing.md) MAY be used to allow tracing from event publisher towards consumer. | -| `recordedtime` | | Attribute as defined by [recordedtime extension](./recordedtime.md) to determine the latency between event publisher towards consumer. | +| `traceparent` | | Attribute as defined by [distributed-tracing extension](./../extensions/distributed-tracing.md) to allow tracing from event publisher towards consumer. | +| `tracestate` | | Attribute as defined by [distributed-tracing extension](./../extensions/distributed-tracing.md) MAY be used to allow tracing from event publisher towards consumer. | +| `recordedtime` | | Attribute as defined by [recordedtime extension](./../extensions/recordedtime.md) to determine the latency between event publisher towards consumer. | ## General Constraints diff --git a/cloudevents/languages/he/adapters/opcua.md b/cloudevents/languages/he/adapters/opcua.md new file mode 100644 index 000000000..a70441ef3 --- /dev/null +++ b/cloudevents/languages/he/adapters/opcua.md @@ -0,0 +1,3 @@ +# OPC Unified Architecture CloudEvents Adapter + +מסמך זה טרם תורגם. בבקשה תשתמשו [בגרסה האנגלית של המסמך](../../../extensions/opcua.md) לבינתיים. diff --git a/cloudevents/languages/he/extensions/opcua.md b/cloudevents/languages/he/extensions/opcua.md index 43bb9ff22..53a2c9cae 100644 --- a/cloudevents/languages/he/extensions/opcua.md +++ b/cloudevents/languages/he/extensions/opcua.md @@ -1,2 +1,3 @@ -# OPC UA +# OPC Unified Architecture + מסמך זה טרם תורגם. בבקשה תשתמשו [בגרסה האנגלית של המסמך](../../../extensions/opcua.md) לבינתיים. diff --git a/cloudevents/languages/zh-CN/adapters/opcua.md b/cloudevents/languages/zh-CN/adapters/opcua.md new file mode 100644 index 000000000..aa83541ca --- /dev/null +++ b/cloudevents/languages/zh-CN/adapters/opcua.md @@ -0,0 +1,6 @@ +# OPC Unified Architecture CloudEvents Adapter + +本文档尚未被翻译,请先阅读英文[原版文档](../../../adapters/opcua.md) 。 + +如果您迫切地需要此文档的中文翻译,请[提交一个issue](https://github.com/cloudevents/spec/issues) , +我们会尽快安排专人进行翻译。 diff --git a/cloudevents/languages/zh-CN/extensions/opcua.md b/cloudevents/languages/zh-CN/extensions/opcua.md index 850297aa9..c3a9dae13 100644 --- a/cloudevents/languages/zh-CN/extensions/opcua.md +++ b/cloudevents/languages/zh-CN/extensions/opcua.md @@ -1,4 +1,4 @@ -# OPC UA +# OPC Unified Architecture 本文档尚未被翻译,请先阅读英文[原版文档](../../../extensions/opcua.md) 。 From cbc5480ad3b5ae0b022e22599e1d71e2d4ea5615 Mon Sep 17 00:00:00 2001 From: James Thompson Date: Fri, 16 May 2025 17:30:54 +1000 Subject: [PATCH 3/5] Update opcua.md Signed-off-by: James Thompson --- cloudevents/adapters/opcua.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cloudevents/adapters/opcua.md b/cloudevents/adapters/opcua.md index 952260b19..a0e38cc02 100644 --- a/cloudevents/adapters/opcua.md +++ b/cloudevents/adapters/opcua.md @@ -34,6 +34,9 @@ A keyframe message is indicated by setting the type property to `ua-keyframe` | :-------------------- | :----------------------------------------------| :-------------------- | | `subject` | `DataSetWriterId` or `DataSetWriterName` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164). | | | `sequence` | `SequenceNumber` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | Attribute as defined by [sequence extensions](./../extensions/sequence.md) | +| `traceparent` | | Attribute as defined by [distributed-tracing extension](./../extensions/distributed-tracing.md) to allow tracing from event publisher towards consumer. | +| `tracestate` | | Attribute as defined by [distributed-tracing extension](./../extensions/distributed-tracing.md) MAY be used to allow tracing from event publisher towards consumer. | +| `recordedtime` | | Attribute as defined by [recordedtime extension](./../extensions/recordedtime.md) to determine the latency between event publisher towards consumer. | ### Deltaframe @@ -43,6 +46,9 @@ A deltaframe message is indicated by setting the type property to `ua-deltafram | :-------------------- | :----------------------------------------------| :-------------------- | | `subject` | `DataSetWriterId` or `DataSetWriterName` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164). | | | `sequence` | `SequenceNumber` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | Attribute as defined by [sequence extensions](./../extensions/sequence.md) | +| `traceparent` | | Attribute as defined by [distributed-tracing extension](./../extensions/distributed-tracing.md) to allow tracing from event publisher towards consumer. | +| `tracestate` | | Attribute as defined by [distributed-tracing extension](./../extensions/distributed-tracing.md) MAY be used to allow tracing from event publisher towards consumer. | +| `recordedtime` | | Attribute as defined by [recordedtime extension](./../extensions/recordedtime.md) to determine the latency between event publisher towards consumer. | ### Event @@ -52,13 +58,6 @@ An event message is indicated by setting the type property to `ua-event` | :-------------------- | :----------------------------------------------| :-------------------- | | `subject` | `DataSetWriterId` or `DataSetWriterName` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164). | | | `sequence` | `SequenceNumber` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | Attribute as defined by [sequence extensions](./../extensions/sequence.md) | - -## Recomended Extension Mapping - -It is recomended that the below extensions are also implemented. - -| CloudEvents Attribute | Value | Remark | -| :-------------------- | :----------------------------------------------| :-------------------- | | `traceparent` | | Attribute as defined by [distributed-tracing extension](./../extensions/distributed-tracing.md) to allow tracing from event publisher towards consumer. | | `tracestate` | | Attribute as defined by [distributed-tracing extension](./../extensions/distributed-tracing.md) MAY be used to allow tracing from event publisher towards consumer. | | `recordedtime` | | Attribute as defined by [recordedtime extension](./../extensions/recordedtime.md) to determine the latency between event publisher towards consumer. | From 5a13b1cb0cad7fab8e844c0735bbea5b543de3c8 Mon Sep 17 00:00:00 2001 From: James Thompson Date: Fri, 16 May 2025 17:48:35 +1000 Subject: [PATCH 4/5] Update opcua.md Signed-off-by: James Thompson --- cloudevents/adapters/opcua.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cloudevents/adapters/opcua.md b/cloudevents/adapters/opcua.md index a0e38cc02..901888a88 100644 --- a/cloudevents/adapters/opcua.md +++ b/cloudevents/adapters/opcua.md @@ -4,7 +4,7 @@ This document describes how to convert [OPC UA](https://reference.opcfoundation. All OPC UA events are converted into CloudEvents using the same pattern as described in the following table: -## Core Mapping +## Common Mapping | CloudEvents Attribute | Value | Remark | | :-------------------- | :----------------------------------------------| :-------------------- | @@ -15,6 +15,9 @@ All OPC UA events are converted into CloudEvents using the same pattern as descr | `dataschema` | OPC UA provides type information as part of PubSub metadata messages. | For non OPC UA consumers or when different payload encoding like Avro is used, it is REQUIRED to provide schema information (based on metadata information) in a separate format like [JSON schema](https://json-schema.org/specification) or [Avro schema](https://avro.apache.org/docs/1.11.1/specification/) or others. | | `time` | `Timestamp` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | | | `data` | content of the OPCUA event | | +| `opcuametadatamajorversion` | `MajorVersion` in MetaDataVersion field mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | | +| `opcuametadataminorversion` | `MinorVersion` in MetaDataVersion field mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | | +| `opcuastatus` | `Status` mapped from [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) | | ## Message specific Mapping From eb208f3ebdc8ff78ae85f61b6dec85a2bc94bb6b Mon Sep 17 00:00:00 2001 From: James Thompson Date: Fri, 16 May 2025 17:56:37 +1000 Subject: [PATCH 5/5] Update opcua.md Signed-off-by: James Thompson --- cloudevents/extensions/opcua.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cloudevents/extensions/opcua.md b/cloudevents/extensions/opcua.md index c3dcf0976..cfd81391e 100644 --- a/cloudevents/extensions/opcua.md +++ b/cloudevents/extensions/opcua.md @@ -25,7 +25,6 @@ is being used. - Type: `Integer` - Description: Links dataset message to the current version of the metadata. -Contains value from `MajorVersion` of [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) field `MetaDataVersion`. - Constraints - OPTIONAL but MUST NOT be present if `dataschema` is used @@ -33,16 +32,13 @@ Contains value from `MajorVersion` of [Data Set Message Header](https://referenc - Type: `Integer` - Description: Links dataset message to the current version of the metadata. -Contains value from `MinorVersion` of [Data Set Message -Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) -field `MetaDataVersion`. - Constraints - OPTIONAL but MUST NOT be present if `dataschema` is used ### opcuastatus - Type: `Integer` -- Description: Defines the overall status of the data set message, maps to [Data Set Message Header](https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4#Table164) field `Status`. +- Description: Defines the overall status of the data set message. - Constraints - OPTIONAL - REQUIRED if status is not _Good_