Repository navigation
Add Descriptor references and WoT/OPC UA CloudEvents mappings - #1406
marcschier wants to merge 61 commits into
Conversation
marcschier
left a comment
There was a problem hiding this comment.
Feedback from review: Try to first make due with the core header vocabulary, and source is a perfect place for wotid and version is part of it.
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
328daf2 to
b9e3c1f
Compare
| "inspection": { | ||
| "class": "endpoint", |
There was a problem hiding this comment.
Both "inspection" and "endpoint" seem pretty generic words - should they have namespaces?
Also, if I remember correctly, "class" is what we define in this spec, and "inspection" is (sort of) instance specific... I think it might be better to invert this:
{
"entries": {
"io.xregistry.endpoint": {
"com.bigco.inspection": { .... }
}
}
}
So that a consumer can quickly find the entries of interest based on "class" - then each variant of that class is grouped and all in one spot. This is easier than having to scan all entries for a certain class.
Unless you want to be able to group all info about "inspection" under one object???
I'm not sure that's better for reuse though. Let's say there are 5 different "classes" (or related bits of metadata) and each might have a certain value that's duplicated for each "class". Would it be good to have a single entry for that class that isn't linked to one app-specific set of metadata? Does this even make sense?
There was a problem hiding this comment.
inspection is local to this Descriptor, so another Descriptor can use the same name without a collision. endpoint is a well-known class defined here. A consumer that knows the entry name can look it up directly; one looking for all endpoints can scan or index by class. Grouping by class would help that second lookup and still allow several entries of a class. It would also change the JSON shape for every profile, so I'd compare the two lookups on the call before switching.
| } | ||
| ``` | ||
|
|
||
| A static HTTP server or an [xRegistry](https://xregistry.io) server can serve |
There was a problem hiding this comment.
Let's remove this from here and save it for the definition of the url attribute below because this is basically going to be a normative statement about it's value and what it points to. I'd like it to say something like: it can be any absolute URI - abstract or concrete. And if concrete, then we have no requirement on how it's hosted. Needs wordsmithing.
There was a problem hiding this comment.
The hosting point and the identifier question are separate. describedby currently points to a document the client can retrieve with HTTP GET; an entry's url links to a document that can be included in a bundle. If we allow abstract URIs in either field, we need to decide what clients do when the value cannot be dereferenced. The identifiers entry already provides a place for aliases that need no retrieval.
| ### describedby | ||
|
|
||
| - Type: `URI` | ||
| - Description: The URL of the Descriptor for this event. |
There was a problem hiding this comment.
s/Descriptor/Descriptor document/
There was a problem hiding this comment.
The describedby description now says “The URL of the Descriptor document for this event.” See d3a18f2.
| - Constraints: | ||
| - REQUIRED. | ||
| - MUST be a non-empty absolute HTTP(S) URL without a fragment. | ||
| - The URL MUST support retrieval of the Descriptor by HTTP `GET`. |
There was a problem hiding this comment.
The HTTP GET requirement now refers to the “Descriptor document” in d3a18f2.
| - REQUIRED. | ||
| - MUST be a non-empty absolute HTTP(S) URL without a fragment. | ||
| - The URL MUST support retrieval of the Descriptor by HTTP `GET`. | ||
| A successful response serving the Descriptor metadata MUST use |
There was a problem hiding this comment.
Changed “Descriptor metadata” to “Descriptor document” in the response media-type rule in d3a18f2.
| } | ||
| ``` | ||
|
|
||
| Extensions MAY add members to the document and its entries. |
There was a problem hiding this comment.
How about:
Additional extension attributes MAY be specified within each entry and at the top-level JSON
object (see the `...` above). Consumers are expected to silently ignore unknown
extension attributes, unless environmental constraints dictate strict adherence to
well-known metadata.
There was a problem hiding this comment.
d3a18f2 allows extension members at the top level and in entries. Consumers should ignore unknown members unless the applicable profile or deployment requires rejection.
Signed-off-by: Marc <marcschier@hotmail.com>
Replace shared entries and bundling with extension-owned properties. Update profile schemas and examples and incorporate inline feedback. Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
Signed-off-by: Marc <marcschier@hotmail.com>
|
@duglin - please see if this now matches what we discussed |
Signed-off-by: Marc <marcschier@hotmail.com>
| reserves `age` and defines it as an integer can use `"age": 18`. | ||
|
|
||
| Consumers SHOULD ignore properties they do not recognize, including | ||
| extension members within a profile's objects, unless the applicable |
There was a problem hiding this comment.
let's drop the word "profile" (and "member") since you never really define it, and I think it would easier to not define a new term and instead just refer to it as you already have been... e.g. "property".
So: Consumers SHOULD ignore properties they do not recognize, including extension nested properties.
I think we can just stop there because the SHOULD implies they can reject if it they need to and we don't define how they know that and, more importantly, we don't say what to do if they do reject it. All of that is out of scope for us.
| profile or deployment requires rejection. Each profile defines which | ||
| inputs it needs and how to handle unavailable or invalid inputs. | ||
|
|
||
| For a published Descriptor version, the Publisher MUST keep its properties |
There was a problem hiding this comment.
I'm not sure we can say MUST in these two spots - that could imply "forever". Let's either use SHOULD or talk about how it's "STRONGLY RECOMMENDED".
| publish a new version when those inputs change. | ||
|
|
||
| ## Descriptor properties | ||
|
|
There was a problem hiding this comment.
I think we need an intro sentence for this section. Something like:
This specification defines the following well-known Descriptor properties. In the future, additional commonly used properties can be added by submitting a change request to this specification.
|
|
||
| `schema` is an object. Its REQUIRED `url` MUST be an absolute, | ||
| fragment-free HTTP(S) URL of a schema document for the event's `data`. | ||
| The OPTIONAL `format` identifies the linked schema's format. When present, |
There was a problem hiding this comment.
What "format" attribute? is this old?
I think we may need to explain why this is here since CE itself defines a schema URL attribute. If we keep it, and I'm not sure we should, then we should make it clear that this would probably only be used when schemaurl isn't in the CE AND there are other properties in the Descriptor doc because 'schema' being the only one is kind of silly when they should just use the CE attribute. But I'm really not sure we should encourage people to NOT use the CE one..... except maybe in cases where most consumers don't need it???
| names. An extension that reserves a name specifies the property's value | ||
| type and schema, including any nested structure, and defines any selection | ||
| rules. The schema can allow any JSON type. For example, an extension that | ||
| reserves `age` and defines it as an integer can use `"age": 18`. |
There was a problem hiding this comment.
Let's add a sample Descriptor doc near this first paragraph. Having a concrete doc to look at will help people grok it. In fact, I think it would be good to show the format and the a sample.
e.g.
Pseudo-json:
{
"NAME": ANY *
}Where NAME and a non-empty string and ANY is any valid JSON data type.
And the doc MAY contain zero or more properties.
Example:
{
"endpoint": "URL",
"identifiers": [
{ "scheme": "URL", "value: "xxx" }
]
}|
|
||
| ### Endpoint | ||
|
|
||
| `endpoint` is an object. Its REQUIRED `url` MUST be an absolute, |
There was a problem hiding this comment.
it's just a URL not an object, right?
| | `scheme` | An [absolute URI][Absolute URI] identifying the identifier scheme. | | ||
| | `value` | The identifier in that scheme, represented as a string. | | ||
|
|
||
| Two identifiers match only if both strings match exactly. Consumers MUST |
| fragment-free HTTP(S) URL of an xRegistry [Endpoint Group][Endpoint Group]'s | ||
| metadata. | ||
|
|
||
| ### Identifiers |
There was a problem hiding this comment.
I think more info is needed here to explain when this one should be used - it's too generic to just say it's an alias.
|
|
||
| Two identifiers match only if both strings match exactly. Consumers MUST | ||
| NOT normalize either string, including by changing case or percent-encoding. | ||
|
|
There was a problem hiding this comment.
Aren't you missing the definition of the other ones?
|
|
||
| ## Descriptor properties | ||
|
|
||
| | Property | Definition | |
There was a problem hiding this comment.
you may want to include, in the section that fully defines each, a pseudo json showing the format for each - at least in the non-scalar cases, and a concrete example. Keeping it short, of course.
Consumers often need information shared across an event stream, such as a payload schema, a Thing Description, or OPC UA writer metadata. A single
describedbyURL lets Producers publish that information separately instead of repeating it in each event.Proposed Changes
describedby, an HTTP(S) URL that returns a JSON object. Extensions define their own top-level properties and value shapes. A static HTTP server can serve a Descriptor; xRegistry hosting is specified separately in xregistry/spec#796.describedbyfor the WoT mapping. Its Descriptor selects a Thing Description and, optionally, an affordance. The mapping defines how to name and version event types while preserving the Core meanings ofsourceandsubject.opcuaproperty for shared publisher, writer, and dataset metadata, and the mapping for events that also use WoT. Standalone OPC UA does not require a Descriptor. In both mappings, an event'sdataschematakes precedence over the Descriptor'sschemaproperty.usdassetproperty so one event can reference one or more assets and associate the event or individual payload fields with prims.Release Note