< draft-ietf-asdf-sdf-09.txt   draft-ietf-asdf-sdf-10.txt >
ASDF M. Koster, Ed. ASDF M. Koster, Ed.
Internet-Draft PassiveLogic Internet-Draft PassiveLogic
Intended status: Standards Track C. Bormann, Ed. Intended status: Standards Track C. Bormann, Ed.
Expires: 10 May 2022 Universität Bremen TZI Expires: 20 July 2022 Universität Bremen TZI
6 November 2021 16 January 2022
Semantic Definition Format (SDF) for Data and Interactions of Things Semantic Definition Format (SDF) for Data and Interactions of Things
draft-ietf-asdf-sdf-09 draft-ietf-asdf-sdf-10
Abstract Abstract
The Semantic Definition Format (SDF) is a format for domain experts The Semantic Definition Format (SDF) is a format for domain experts
to use in the creation and maintenance of data and interaction models to use in the creation and maintenance of data and interaction models
in the Internet of Things. It was created as a common language for in the Internet of Things. It was created as a common language for
use in the development of the One Data Model liaison organization use in the development of the One Data Model liaison organization
(OneDM) definitions. Tools convert this format to database formats (OneDM) definitions. Tools convert this format to database formats
and other serializations as needed. and other serializations as needed.
An SDF specification describes definitions of SDF Objects and their An SDF specification describes definitions of SDF Objects and their
associated interactions (Events, Actions, Properties), as well as the associated interactions (Events, Actions, Properties), as well as the
Data types for the information exchanged in those interactions. Data types for the information exchanged in those interactions.
// A JSON format representation of SDF 1.0 was defined in version // A JSON format representation of SDF 1.0 was defined in version
// (-00) of this document; version (-05) was designated as an // (-00) of this document; version (-05) was designated as an
// _implementation draft_, labeled SDF 1.1, at the IETF110 meeting of // _implementation draft_, labeled SDF 1.1, at the IETF110 meeting of
// the ASDF WG (2021-03-11). The present version (-09) adds a URN // the ASDF WG (2021-03-11). The present version (-10) collects a
// namespace for registered measurement unit names. // few smaller changes as input to the 2022-01-17 ASDF WG interim.
Contributing About This Document
This note is to be removed before publishing as an RFC.
Status information for this document may be found at
https://datatracker.ietf.org/doc/draft-ietf-asdf-sdf/.
Discussion of this document takes place on the A Semantic Definition
Format for Data and Interactions of Things (ASDF) Working Group
mailing list (mailto:asdf@ietf.org), which is archived at
https://mailarchive.ietf.org/arch/browse/asdf/.
Source for this draft and an issue tracker can be found at
https://github.com/ietf-wg-asdf/SDF.
Contributing
Recent versions of this document are available at its GitHub Recent versions of this document are available at its GitHub
repository https://github.com/ietf-wg-asdf/SDF (https://github.com/ repository https://github.com/ietf-wg-asdf/SDF (https://github.com/
ietf-wg-asdf/SDF) -- this also provides an issue tracker as well as a ietf-wg-asdf/SDF) -- this also provides an issue tracker as well as a
way to supply "pull requests". way to supply "pull requests".
General discussion of this SDF Internet-Draft happens on the mailing General discussion of this SDF Internet-Draft happens on the mailing
list of the IETF ASDF Working Group, asdf@ietf.org (subscribe at list of the IETF ASDF Working Group, asdf@ietf.org (subscribe at
https://www.ietf.org/mailman/listinfo/asdf https://www.ietf.org/mailman/listinfo/asdf
(https://www.ietf.org/mailman/listinfo/asdf)). (https://www.ietf.org/mailman/listinfo/asdf)).
skipping to change at page 2, line 20 skipping to change at page 2, line 32
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on 10 May 2022. This Internet-Draft will expire on 20 July 2022.
Copyright Notice Copyright Notice
Copyright (c) 2021 IETF Trust and the persons identified as the Copyright (c) 2022 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (https://trustee.ietf.org/ Provisions Relating to IETF Documents (https://trustee.ietf.org/
license-info) in effect on the date of publication of this document. license-info) in effect on the date of publication of this document.
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
and restrictions with respect to this document. Code Components and restrictions with respect to this document. Code Components
extracted from this document must include Simplified BSD License text extracted from this document must include Revised BSD License text as
as described in Section 4.e of the Trust Legal Provisions and are described in Section 4.e of the Trust Legal Provisions and are
provided without warranty as described in the Simplified BSD License. provided without warranty as described in the Revised BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1. Terminology and Conventions . . . . . . . . . . . . . . . 4 1.1. Terminology and Conventions . . . . . . . . . . . . . . . 4
2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1. Example Definition . . . . . . . . . . . . . . . . . . . 6 2.1. Example Definition . . . . . . . . . . . . . . . . . . . 6
2.2. Elements of an SDF model . . . . . . . . . . . . . . . . 8 2.2. Elements of an SDF model . . . . . . . . . . . . . . . . 8
2.2.1. sdfObject . . . . . . . . . . . . . . . . . . . . . . 9 2.2.1. sdfObject . . . . . . . . . . . . . . . . . . . . . . 9
2.2.2. sdfProperty . . . . . . . . . . . . . . . . . . . . . 10 2.2.2. sdfProperty . . . . . . . . . . . . . . . . . . . . . 10
2.2.3. sdfAction . . . . . . . . . . . . . . . . . . . . . . 11 2.2.3. sdfAction . . . . . . . . . . . . . . . . . . . . . . 11
2.2.4. sdfEvent . . . . . . . . . . . . . . . . . . . . . . 11 2.2.4. sdfEvent . . . . . . . . . . . . . . . . . . . . . . 11
2.2.5. sdfData . . . . . . . . . . . . . . . . . . . . . . . 12 2.2.5. sdfData . . . . . . . . . . . . . . . . . . . . . . . 12
2.2.6. sdfThing . . . . . . . . . . . . . . . . . . . . . . 12 2.2.6. sdfThing . . . . . . . . . . . . . . . . . . . . . . 12
2.2.7. sdfProduct . . . . . . . . . . . . . . . . . . . . . 12 2.2.7. sdfProduct . . . . . . . . . . . . . . . . . . . . . 12
3. SDF structure . . . . . . . . . . . . . . . . . . . . . . . . 12 3. SDF structure . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1. Information block . . . . . . . . . . . . . . . . . . . . 13 3.1. Information block . . . . . . . . . . . . . . . . . . . . 13
3.2. Namespaces section . . . . . . . . . . . . . . . . . . . 14 3.2. Namespaces block . . . . . . . . . . . . . . . . . . . . 14
3.3. Definitions section . . . . . . . . . . . . . . . . . . . 15 3.3. Definitions block . . . . . . . . . . . . . . . . . . . . 15
4. Names and namespaces . . . . . . . . . . . . . . . . . . . . 16 4. Names and namespaces . . . . . . . . . . . . . . . . . . . . 16
4.1. Structure . . . . . . . . . . . . . . . . . . . . . . . . 16 4.1. Structure . . . . . . . . . . . . . . . . . . . . . . . . 16
4.2. Contributing global names . . . . . . . . . . . . . . . . 16 4.2. Contributing global names . . . . . . . . . . . . . . . . 16
4.3. Referencing global names . . . . . . . . . . . . . . . . 17 4.3. Referencing global names . . . . . . . . . . . . . . . . 17
4.4. sdfRef . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.4. sdfRef . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.5. sdfRequired . . . . . . . . . . . . . . . . . . . . . . . 19 4.5. sdfRequired . . . . . . . . . . . . . . . . . . . . . . . 19
4.6. Common Qualities . . . . . . . . . . . . . . . . . . . . 20 4.6. Common Qualities . . . . . . . . . . . . . . . . . . . . 20
4.7. Data Qualities . . . . . . . . . . . . . . . . . . . . . 21 4.7. Data Qualities . . . . . . . . . . . . . . . . . . . . . 21
4.7.1. sdfType . . . . . . . . . . . . . . . . . . . . . . . 23 4.7.1. sdfType . . . . . . . . . . . . . . . . . . . . . . . 23
4.7.2. sdfChoice . . . . . . . . . . . . . . . . . . . . . . 24 4.7.2. sdfChoice . . . . . . . . . . . . . . . . . . . . . . 24
skipping to change at page 3, line 38 skipping to change at page 4, line 7
7.1. Media Type . . . . . . . . . . . . . . . . . . . . . . . 32 7.1. Media Type . . . . . . . . . . . . . . . . . . . . . . . 32
7.2. IETF URN Sub-namespace for Unit Names 7.2. IETF URN Sub-namespace for Unit Names
(urn:ietf:params:unit) . . . . . . . . . . . . . . . . . 32 (urn:ietf:params:unit) . . . . . . . . . . . . . . . . . 32
7.3. Registries . . . . . . . . . . . . . . . . . . . . . . . 33 7.3. Registries . . . . . . . . . . . . . . . . . . . . . . . 33
8. Security Considerations . . . . . . . . . . . . . . . . . . . 33 8. Security Considerations . . . . . . . . . . . . . . . . . . . 33
9. References . . . . . . . . . . . . . . . . . . . . . . . . . 33 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 33
9.1. Normative References . . . . . . . . . . . . . . . . . . 33 9.1. Normative References . . . . . . . . . . . . . . . . . . 33
9.2. Informative References . . . . . . . . . . . . . . . . . 35 9.2. Informative References . . . . . . . . . . . . . . . . . 35
Appendix A. Formal Syntax of SDF . . . . . . . . . . . . . . . . 36 Appendix A. Formal Syntax of SDF . . . . . . . . . . . . . . . . 36
Appendix B. json-schema.org Rendition of SDF Syntax . . . . . . 40 Appendix B. json-schema.org Rendition of SDF Syntax . . . . . . 40
Appendix C. Data Qualities inspired by json-schema.org . . . . . 79 Appendix C. Data Qualities inspired by json-schema.org . . . . . 78
C.1. type "number", type "integer" . . . . . . . . . . . . . . 79 C.1. type "number", type "integer" . . . . . . . . . . . . . . 79
C.2. type "string" . . . . . . . . . . . . . . . . . . . . . . 79 C.2. type "string" . . . . . . . . . . . . . . . . . . . . . . 79
C.3. type "boolean" . . . . . . . . . . . . . . . . . . . . . 80 C.3. type "boolean" . . . . . . . . . . . . . . . . . . . . . 80
C.4. type "array" . . . . . . . . . . . . . . . . . . . . . . 81 C.4. type "array" . . . . . . . . . . . . . . . . . . . . . . 80
C.5. type "object" . . . . . . . . . . . . . . . . . . . . . . 81 C.5. type "object" . . . . . . . . . . . . . . . . . . . . . . 81
C.6. Implementation notes . . . . . . . . . . . . . . . . . . 81 C.6. Implementation notes . . . . . . . . . . . . . . . . . . 81
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 82 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 81
Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 82 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 82
1. Introduction 1. Introduction
The Semantic Definition Format (SDF) is a format for domain experts The Semantic Definition Format (SDF) is a format for domain experts
to use in the creation and maintenance of data and interaction models to use in the creation and maintenance of data and interaction models
in the Internet of Things. It was created as a common language for in the Internet of Things. It was created as a common language for
use in the development of the One Data Model liaison organization use in the development of the One Data Model liaison organization
(OneDM) definitions. Tools convert this format to database formats (OneDM) definitions. Tools convert this format to database formats
and other serializations as needed. and other serializations as needed.
An SDF specification describes definitions of SDF Objects and their An SDF specification describes definitions of SDF Objects and their
associated interactions (Events, Actions, Properties), as well as the associated interactions (Events, Actions, Properties), as well as the
Data types for the information exchanged in those interactions. Data types for the information exchanged in those interactions.
// A JSON format representation of SDF 1.0 was defined in version // A JSON format representation of SDF 1.0 was defined in version
// (-00) of this document; version (-05) was designated as an // (-00) of this document; version (-05) was designated as an
// _implementation draft_, labeled SDF 1.1, at the IETF110 meeting of // _implementation draft_, labeled SDF 1.1, at the IETF110 meeting of
// the ASDF WG (2021-03-11). The present version (-09) adds a URN // the ASDF WG (2021-03-11). The present version (-10) collects a
// namespace for registered measurement unit names. // few smaller changes as input to the 2022-01-17 ASDF WG interim.
1.1. Terminology and Conventions 1.1. Terminology and Conventions
Thing: A physical item that is also made available in the Internet Thing: A physical item that is also made available in the Internet
of Things. The term is used here for Things that are notable for of Things. The term is used here for Things that are notable for
their interaction with the physical world beyond interaction with their interaction with the physical world beyond interaction with
humans; a temperature sensor or a light might be a Thing, but a humans; a temperature sensor or a light might be a Thing, but a
router that employs both temperature sensors and indicator lights router that employs both temperature sensors and indicator lights
might exhibit less Thingness, as the effects of its functioning might exhibit less Thingness, as the effects of its functioning
are mostly on the digital side. are mostly on the digital side.
skipping to change at page 13, line 6 skipping to change at page 13, line 6
definition in an sdfProduct group is intended to describe a class of definition in an sdfProduct group is intended to describe a class of
complete Things. complete Things.
3. SDF structure 3. SDF structure
SDF definitions are contained in SDF files. One or more SDF files SDF definitions are contained in SDF files. One or more SDF files
can work together to provide the definitions and declarations that can work together to provide the definitions and declarations that
are the payload of the SDF format. are the payload of the SDF format.
A SDF definition file contains a single JSON map (JSON object). This A SDF definition file contains a single JSON map (JSON object). This
object has three sections: the information block, the namespaces object has three blocks: the information block, the namespaces block,
section, and the definitions section. and the definitions block.
3.1. Information block 3.1. Information block
The information block contains generic meta data for the file itself The information block contains generic meta data for the file itself
and all included definitions. To enable tool integration, the and all included definitions. To enable tool integration, the
information block is optional in the grammar of SDF; most processes information block is optional in the grammar of SDF; most processes
for working with SDF files will have policies that only SDF models for working with SDF files will have policies that only SDF models
with an info block can be processed. It is therefore RECOMMENDED with an info block can be processed. It is therefore RECOMMENDED
that SDF validator tools emit a warning when no information block is that SDF validator tools emit a warning when no information block is
found. found.
The keyword (map key) that defines an information block is "info". The keyword (map key) that defines an information block is "info".
Its value is a JSON map in turn, with a set of entries that represent Its value is a JSON map in turn, with a set of entries that represent
qualities that apply to the included definition. qualities that apply to the included definition.
Qualities of the information block are shown in Table 1. Qualities of the information block are shown in Table 1.
+===========+========+==========+=================================+ +===========+========+==========+=================================+
| Quality | Type | Required | Description | | Quality | Type | Required | Description |
+===========+========+==========+=================================+ +===========+========+==========+=================================+
| title | string | yes | A short summary to be displayed | | title | string | no | A short summary to be displayed |
| | | | in search results, etc. | | | | | in search results, etc. |
+-----------+--------+----------+---------------------------------+ +-----------+--------+----------+---------------------------------+
| version | string | yes | The incremental version of the | | version | string | no | The incremental version of the |
| | | | definition, format TBD | | | | | definition, format TBD |
+-----------+--------+----------+---------------------------------+ +-----------+--------+----------+---------------------------------+
| copyright | string | yes | Link to text or embedded text | | copyright | string | no | Link to text or embedded text |
| | | | containing a copyright notice | | | | | containing a copyright notice |
+-----------+--------+----------+---------------------------------+ +-----------+--------+----------+---------------------------------+
| license | string | yes | Link to text or embedded text | | license | string | no | Link to text or embedded text |
| | | | containing license terms | | | | | containing license terms |
+-----------+--------+----------+---------------------------------+ +-----------+--------+----------+---------------------------------+
Table 1: Qualities of the Information Block Table 1: Qualities of the Information Block
While the format of the version string is marked as TBD, it is While the format of the version string is marked as TBD, it is
intended to be lexicographically increasing over the life of a model: intended to be lexicographically increasing over the life of a model:
a newer model always has a version string that string-compares higher a newer model always has a version string that string-compares higher
than all previous versions. This is easily achieved by following the than all previous versions. This is easily achieved by following the
convention to start the version with an [RFC3339] date-time or, if convention to start the version with an [RFC3339] date-time or, if
new versions are generated less frequently than once a day, just the new versions are generated less frequently than once a day, just the
full-date (i.e., YYYY-MM-DD); in many cases, that will be all that is full-date (i.e., YYYY-MM-DD); in many cases, that will be all that is
needed (see Figure 1 for an example). needed (see Figure 1 for an example).
The license string is preferably either a URI that points to a web The license string is preferably either a URI that points to a web
page with an unambiguous definition of the license, or an [SPDX] page with an unambiguous definition of the license, or an [SPDX]
license identifier. (For models to be handled by the One Data Model license identifier. (For models to be handled by the One Data Model
liaison group, this will typically be "BSD-3-Clause".) liaison group, this will typically be "BSD-3-Clause".)
3.2. Namespaces section 3.2. Namespaces block
The namespaces section contains the namespace map and the The namespaces block contains the namespace map and the
defaultNamespace setting. defaultNamespace setting.
The namespace map is a map from short names for URIs to the namespace The namespace map is a map from short names for URIs to the namespace
URIs themselves. URIs themselves.
The defaultNamespace setting selects one of the entries in the The defaultNamespace setting selects one of the entries in the
namespace map by giving its short name. The associated URI (value of namespace map by giving its short name. The associated URI (value of
this entry) becomes the default namespace for the SDF definition this entry) becomes the default namespace for the SDF definition
file. file.
skipping to change at page 14, line 38 skipping to change at page 14, line 38
| | | | URIs, to be used as | | | | | URIs, to be used as |
| | | | identifier prefixes | | | | | identifier prefixes |
+------------------+--------+----------+-----------------------+ +------------------+--------+----------+-----------------------+
| defaultNamespace | string | no | Identifies one of the | | defaultNamespace | string | no | Identifies one of the |
| | | | prefixes in the | | | | | prefixes in the |
| | | | namespace map to be | | | | | namespace map to be |
| | | | used as a default in | | | | | used as a default in |
| | | | resolving identifiers | | | | | resolving identifiers |
+------------------+--------+----------+-----------------------+ +------------------+--------+----------+-----------------------+
Table 2: Namespaces Section Table 2: Namespaces Block
The following example declares a set of namespaces and defines cap as The following example declares a set of namespaces and defines cap as
the default namespace. By convention, the values in the namespace the default namespace. By convention, the values in the namespace
map contain full URIs without a fragment identifier, and the fragment map contain full URIs without a fragment identifier, and the fragment
identifier is then added, if needed, where the namespace entry is identifier is then added, if needed, where the namespace entry is
used. used.
"namespace": { "namespace": {
"cap": "https://example.com/capability/cap", "cap": "https://example.com/capability/cap",
"zcl": "https://zcl.example.com/sdf" "zcl": "https://zcl.example.com/sdf"
}, },
"defaultNamespace": "cap" "defaultNamespace": "cap"
If no defaultNamespace setting is given, the SDF definition file does If no defaultNamespace setting is given, the SDF definition file does
not contribute to a global namespace. As the defaultNamespace is set not contribute to a global namespace. As the defaultNamespace is set
by giving a namespace short name, its presence requires a namespace by giving a namespace short name, its presence requires a namespace
map that contains a mapping for that namespace short name. map that contains a mapping for that namespace short name.
If no namespace map is given, no short names for namespace URIs are If no namespace map is given, no short names for namespace URIs are
set up, and no defaultNamespace can be given. set up, and no defaultNamespace can be given.
3.3. Definitions section 3.3. Definitions block
The Definitions section contains one or more groups, each identified The Definitions block contains one or more groups, each identified by
by a Class Name Keyword (there can only be one group per keyword; the a Class Name Keyword (there can only be one group per keyword; the
actual grouping is just a shortcut and does not carry any specific actual grouping is just a shortcut and does not carry any specific
semantics). The value of each group is a JSON map (object), the keys semantics). The value of each group is a JSON map (object), the keys
of which serve for naming the individual definitions in this group, of which serve for naming the individual definitions in this group,
and the corresponding values provide a set of qualities (name-value and the corresponding values provide a set of qualities (name-value
pairs) for the individual definition. (In short, we speak of the map pairs) for the individual definition. (In short, we speak of the map
entries as "named sets of qualities".) entries as "named sets of qualities".)
Each group may contain zero or more definitions. Each identifier Each group may contain zero or more definitions. Each identifier
defined creates a new type and term in the target namespace. defined creates a new type and term in the target namespace.
Declarations have a scope of the current definition block. Declarations have a scope of the current definition block.
skipping to change at page 17, line 23 skipping to change at page 17, line 23
4.3. Referencing global names 4.3. Referencing global names
A name reference takes the form of the production curie in A name reference takes the form of the production curie in
[W3C.NOTE-curie-20101216] (note that this excludes the production [W3C.NOTE-curie-20101216] (note that this excludes the production
safe-curie), but also limiting the IRIs involved in that production safe-curie), but also limiting the IRIs involved in that production
to URIs as per [RFC3986] and the prefixes to ASCII characters to URIs as per [RFC3986] and the prefixes to ASCII characters
[RFC0020]. [RFC0020].
A name that is contributed by the current SDF definition file can be A name that is contributed by the current SDF definition file can be
referenced by a Same-Document Reference as per section 4.4 of referenced by a Same-Document Reference as per Section 4.4 of
[RFC3986]. As there is little point in referencing the entire SDF [RFC3986]. As there is little point in referencing the entire SDF
definition file, this will be a # followed by a JSON pointer. This definition file, this will be a # followed by a JSON pointer. This
is the only kind of name reference to itself that is possible in an is the only kind of name reference to itself that is possible in an
SDF definition file that does not set a default namespace. SDF definition file that does not set a default namespace.
Name references that point outside the current SDF definition file Name references that point outside the current SDF definition file
need to contain curie prefixes. These then reference namespace need to contain curie prefixes. These then reference namespace
declarations in the namespaces section. declarations in the namespaces block.
For example, if a namespace prefix is defined: For example, if a namespace prefix is defined:
"namespace": { "namespace": {
"foo": "https://example.com/" "foo": "https://example.com/"
} }
Then this reference to that namespace: Then this reference to that namespace:
{ "sdfRef": "foo:#/sdfData/temperatureData" } { "sdfRef": "foo:#/sdfData/temperatureData" }
skipping to change at page 25, line 18 skipping to change at page 25, line 18
* anyOf * anyOf
[I-D.handrews-json-schema-validation] provides a type union called [I-D.handrews-json-schema-validation] provides a type union called
anyOf, which provides a choice between anonymous alternatives. anyOf, which provides a choice between anonymous alternatives.
What could have been What could have been
"anyOf": [ "anyOf": [
{"type": "array", "minItems": 3, "maxItems": "3", "items": { {"type": "array", "minItems": 3, "maxItems": "3", "items": {
"sdfRef": "#/sdfData/rgbVal"}}, "$ref": "#/sdfData/rgbVal"}},
{"type": "array", "minItems": 4, "maxItems": "4", "items": { {"type": "array", "minItems": 4, "maxItems": "4", "items": {
"sdfRef": "#/sdfData/cmykVal"}} "$ref": "#/sdfData/cmykVal"}}
] ]
in [I-D.handrews-json-schema-validation] can be more descriptively in [I-D.handrews-json-schema-validation] can be more descriptively
notated in SDF as: notated in SDF as:
"sdfChoice": { "sdfChoice": {
"rgb": {"type": "array", "minItems": 3, "maxItems": "3", "items": { "rgb": {"type": "array", "minItems": 3, "maxItems": "3", "items": {
"sdfRef": "#/sdfData/rgbVal"}}, "sdfRef": "#/sdfData/rgbVal"}},
"cmyk": {"type": "array", "minItems": 4, "maxItems": "4", "items": { "cmyk": {"type": "array", "minItems": 4, "maxItems": "4", "items": {
"sdfRef": "#/sdfData/cmykVal"}} "sdfRef": "#/sdfData/cmykVal"}}
skipping to change at page 33, line 29 skipping to change at page 33, line 29
8. Security Considerations 8. Security Considerations
Some wider issues are discussed in [RFC8576]. Some wider issues are discussed in [RFC8576].
(Specifics: TBD.) (Specifics: TBD.)
9. References 9. References
9.1. Normative References 9.1. Normative References
[I-D.ietf-cbor-cddl-control]
Bormann, C., "Additional Control Operators for CDDL", Work
in Progress, Internet-Draft, draft-ietf-cbor-cddl-control-
07, 21 October 2021, <https://www.ietf.org/archive/id/
draft-ietf-cbor-cddl-control-07.txt>.
[IANA.params] [IANA.params]
IANA, "Uniform Resource Name (URN) Namespace for IETF IANA, "Uniform Resource Name (URN) Namespace for IETF
Use", <https://www.iana.org/assignments/params>. Use", <https://www.iana.org/assignments/params>.
[IANA.senml] [IANA.senml]
IANA, "Sensor Measurement Lists (SenML)", IANA, "Sensor Measurement Lists (SenML)",
<https://www.iana.org/assignments/senml>. <https://www.iana.org/assignments/senml>.
[RFC0020] Cerf, V., "ASCII format for network interchange", STD 80, [RFC0020] Cerf, V., "ASCII format for network interchange", STD 80,
RFC 20, DOI 10.17487/RFC0020, October 1969, RFC 20, DOI 10.17487/RFC0020, October 1969,
skipping to change at page 35, line 10 skipping to change at page 35, line 5
[RFC8798] Bormann, C., "Additional Units for Sensor Measurement [RFC8798] Bormann, C., "Additional Units for Sensor Measurement
Lists (SenML)", RFC 8798, DOI 10.17487/RFC8798, June 2020, Lists (SenML)", RFC 8798, DOI 10.17487/RFC8798, June 2020,
<https://www.rfc-editor.org/info/rfc8798>. <https://www.rfc-editor.org/info/rfc8798>.
[RFC8949] Bormann, C. and P. Hoffman, "Concise Binary Object [RFC8949] Bormann, C. and P. Hoffman, "Concise Binary Object
Representation (CBOR)", STD 94, RFC 8949, Representation (CBOR)", STD 94, RFC 8949,
DOI 10.17487/RFC8949, December 2020, DOI 10.17487/RFC8949, December 2020,
<https://www.rfc-editor.org/info/rfc8949>. <https://www.rfc-editor.org/info/rfc8949>.
[RFC9165] Bormann, C., "Additional Control Operators for the Concise
Data Definition Language (CDDL)", RFC 9165,
DOI 10.17487/RFC9165, December 2021,
<https://www.rfc-editor.org/info/rfc9165>.
[SPDX] "SPDX License List", <https://spdx.org/licenses/>. [SPDX] "SPDX License List", <https://spdx.org/licenses/>.
[W3C.NOTE-curie-20101216] [W3C.NOTE-curie-20101216]
Birbeck, M. and S. McCarron, "CURIE Syntax 1.0", World Birbeck, M. and S. McCarron, "CURIE Syntax 1.0", World
Wide Web Consortium NOTE NOTE-curie-20101216, 16 December Wide Web Consortium NOTE NOTE-curie-20101216, 16 December
2010, <https://www.w3.org/TR/2010/NOTE-curie-20101216>. 2010, <https://www.w3.org/TR/2010/NOTE-curie-20101216>.
9.2. Informative References 9.2. Informative References
[ECMA-262] Ecma International, "ECMAScript 2020 Language [ECMA-262] Ecma International, "ECMAScript 2020 Language
Specification", ECMA Standard ECMA-262, 11th Edition, June Specification", ECMA Standard ECMA-262, 11th Edition, June
2020, <https://www.ecma-international.org/wp- 2020, <https://www.ecma-international.org/wp-
content/uploads/ECMA-262.pdf>. content/uploads/ECMA-262.pdf>.
[I-D.bormann-jsonpath-iregexp] [I-D.bormann-jsonpath-iregexp]
Bormann, C., "I-Regexp: An Interoperable Regexp Format", Bormann, C., "I-Regexp: An Interoperable Regexp Format",
Work in Progress, Internet-Draft, draft-bormann-jsonpath- Work in Progress, Internet-Draft, draft-bormann-jsonpath-
iregexp-00, 12 May 2021, <https://www.ietf.org/archive/id/ iregexp-01, 13 November 2021,
draft-bormann-jsonpath-iregexp-00.txt>. <https://www.ietf.org/archive/id/draft-bormann-jsonpath-
iregexp-01.txt>.
[I-D.handrews-json-schema-validation] [I-D.handrews-json-schema-validation]
Wright, A., Andrews, H., and B. Hutton, "JSON Schema Wright, A., Andrews, H., and B. Hutton, "JSON Schema
Validation: A Vocabulary for Structural Validation of Validation: A Vocabulary for Structural Validation of
JSON", Work in Progress, Internet-Draft, draft-handrews- JSON", Work in Progress, Internet-Draft, draft-handrews-
json-schema-validation-02, 17 September 2019, json-schema-validation-02, 17 September 2019,
<https://www.ietf.org/archive/id/draft-handrews-json- <https://www.ietf.org/archive/id/draft-handrews-json-
schema-validation-02.txt>. schema-validation-02.txt>.
[I-D.irtf-t2trg-rest-iot] [I-D.irtf-t2trg-rest-iot]
skipping to change at page 36, line 39 skipping to change at page 36, line 39
This appendix shows the framework syntax only, i.e., a syntax with This appendix shows the framework syntax only, i.e., a syntax with
liberal extension points. Since this syntax is nearly useless in liberal extension points. Since this syntax is nearly useless in
finding typos in an SDF specification, a second syntax, the finding typos in an SDF specification, a second syntax, the
validation syntax, is defined that does not include the extension validation syntax, is defined that does not include the extension
points. The validation syntax can be generated from the framework points. The validation syntax can be generated from the framework
syntax by leaving out all lines containing the string EXTENSION- syntax by leaving out all lines containing the string EXTENSION-
POINT; as this is trivial, the result is not shown here. POINT; as this is trivial, the result is not shown here.
This appendix makes use of CDDL "features" as defined in Section 4 of This appendix makes use of CDDL "features" as defined in Section 4 of
[I-D.ietf-cbor-cddl-control]. A feature named "1.0" is used to [RFC9165]. A feature named "1.0" is used to indicate parts of the
indicate parts of the syntax being deprecated towards SDF 1.1, and a syntax being deprecated towards SDF 1.1, and a feature named "1.1" is
feature named "1.1" is used to indicate new syntax intended for SDF used to indicate new syntax intended for SDF 1.1. Features whose
1.1. Features whose names end in "-ext" indicate extension points names end in "-ext" indicate extension points for further evolution.
for further evolution.
start = sdf-syntax start = sdf-syntax
sdf-syntax = { sdf-syntax = {
? info: sdfinfo ; This will be required in most process policies, but not a syntax error ? info: sdfinfo ; This will be required in most process policies, but not a syntax error
? namespace: named<text> ? namespace: named<text>
? defaultNamespace: text ? defaultNamespace: text
? sdfThing: named<thingqualities> ; Thing is a composition of objects that work together in some way ? sdfThing: named<thingqualities> ; Thing is a composition of objects that work together in some way
? sdfProduct: named<productqualities> ; Product is a composition of things and objects that can model a SKU-level instance of a product ? sdfProduct: named<productqualities> ; Product is a composition of things and objects that can model a SKU-level instance of a product
? sdfObject: named<objectqualities> ; Object is a set of Properties, Actions, and Events that together perform a particular function ? sdfObject: named<objectqualities> ; Object is a set of Properties, Actions, and Events that together perform a particular function
? sdfProperty: named<propertyqualities> ; Property represents the state of an instance of an object ? sdfProperty: named<propertyqualities> ; Property represents the state of an instance of an object
? sdfAction: named<actionqualities> ; Action is a directive to invoke an application layer verb associated with an object ? sdfAction: named<actionqualities> ; Action is a directive to invoke an application layer verb associated with an object
? sdfEvent: named<eventqualities> ; Event represents an occurrence of something associated with an object ? sdfEvent: named<eventqualities> ; Event represents an occurrence of something associated with an object
? sdfData: named<dataqualities> ; Data represents a piece of information that can be the state of a property or a parameter to an action or a signal in an event ? sdfData: named<dataqualities> ; Data represents a piece of information that can be the state of a property or a parameter to an action or a signal in an event
EXTENSION-POINT<"top-ext"> EXTENSION-POINT<"top-ext">
} }
sdfinfo = { sdfinfo = {
title: text ? title: text
version: text ? version: text
copyright: text ? copyright: text
license: text ? license: text
EXTENSION-POINT<"info-ext"> EXTENSION-POINT<"info-ext">
} }
; Shortcut for a map that gives names to instances of X (has text keys and values of type X) ; Shortcut for a map that gives names to instances of X (has text keys and values of type X)
named<X> = { * text => X } named<X> = { * text => X }
EXTENSION-POINT<f> = ( * (text .feature f) => any ) ; only used in framework syntax EXTENSION-POINT<f> = ( * (text .feature f) => any ) ; only used in framework syntax
sdf-pointer = text ; .regexp curie-regexp -- TO DO! sdf-pointer = text ; .regexp curie-regexp -- TO DO!
pointer-list = [* sdf-pointer] ; ISSUE: no point in having an empty list, no? but used for sdfRequired in odmobject-multiple_axis_joystick.sdf.json pointer-list = [* sdf-pointer] ; ISSUE: no point in having an empty list, no? but used for sdfRequired in odmobject-multiple_axis_joystick.sdf.json
skipping to change at page 37, line 38 skipping to change at page 37, line 37
commonqualities = ( commonqualities = (
? description: text ; long text (no constraints) ? description: text ; long text (no constraints)
? label: text ; short text (no constraints); default to key ? label: text ; short text (no constraints); default to key
? $comment: text ; source code comments only, no semantics ? $comment: text ; source code comments only, no semantics
? sdfRef: sdf-pointer ? sdfRef: sdf-pointer
? sdfRequired: pointer-list ; applies to qualities of properties, of data ? sdfRequired: pointer-list ; applies to qualities of properties, of data
) )
; for building hierarchy ; for building hierarchy
thingqualities = { thingqualities = {
commonqualities, commonqualities
? sdfObject: named<objectqualities> ? sdfObject: named<objectqualities>
? sdfThing: named<thingqualities> ? sdfThing: named<thingqualities>
EXTENSION-POINT<"thing-ext"> EXTENSION-POINT<"thing-ext">
} }
productqualities = thingqualities ; ISSUE: get rid of sdfProduct? productqualities = thingqualities ; ISSUE: get rid of sdfProduct?
; for single objects, or for arrays of objects (1.2) ; for single objects, or for arrays of objects (1.2)
objectqualities = { objectqualities = {
commonqualities, commonqualities
? ("minItems" .feature "1.2") => number ? ("minItems" .feature "1.2") => number
? ("maxItems" .feature "1.2") => number ? ("maxItems" .feature "1.2") => number
? sdfProperty: named<propertyqualities> ? sdfProperty: named<propertyqualities>
? sdfAction: named<actionqualities> ? sdfAction: named<actionqualities>
? sdfEvent: named<eventqualities> ? sdfEvent: named<eventqualities>
? sdfData: named<dataqualities> ? sdfData: named<dataqualities>
EXTENSION-POINT<"object-ext"> EXTENSION-POINT<"object-ext">
} }
propertyqualities = dataqualities ; the definitions in sdfData are declarations in sdfProperty propertyqualities = dataqualities ; the definitions in sdfData are declarations in sdfProperty
parameter-list = parameter-list =
pointer-list .feature (["1.0", "pointerlist-as-parameter"]) / pointer-list .feature (["1.0", "pointerlist-as-parameter"]) /
dataqualities .feature (["1.1", "dataqualities-as-parameter"]) dataqualities .feature (["1.1", "dataqualities-as-parameter"])
actionqualities = { actionqualities = {
commonqualities, commonqualities
? sdfInputData: parameter-list ; sdfRequiredInputData applies here (a bit redundant) ? sdfInputData: parameter-list ; sdfRequiredInputData applies here (a bit redundant)
? ("sdfRequiredInputData" .feature "1.0") => pointer-list ? ("sdfRequiredInputData" .feature "1.0") => pointer-list
? sdfOutputData: parameter-list ; sdfRequired applies here ? sdfOutputData: parameter-list ; sdfRequired applies here
? sdfData: named<dataqualities> ; zero or more named data type definitions that might be used in the above ? sdfData: named<dataqualities> ; zero or more named data type definitions that might be used in the above
EXTENSION-POINT<"action-ext"> EXTENSION-POINT<"action-ext">
} }
eventqualities = { eventqualities = {
commonqualities commonqualities
? sdfOutputData: parameter-list ; sdfRequired applies here ? sdfOutputData: parameter-list ; sdfRequired applies here
? sdfData: named<dataqualities> ; zero or more named data type definitions that might be used in the above ? sdfData: named<dataqualities> ; zero or more named data type definitions that might be used in the above
EXTENSION-POINT<"event-ext"> EXTENSION-POINT<"event-ext">
} }
dataqualities = { ; also propertyqualities dataqualities = { ; also propertyqualities
commonqualities, commonqualities
jsonschema, jsonschema
? ("units" .feature "1.0") => text ? ("units" .feature "1.0") => text
? ("unit" .feature "1.1") => text ? ("unit" .feature "1.1") => text
? ("scaleMinimum" .feature "1.0") => number ? ("scaleMinimum" .feature "1.0") => number
? ("scaleMaximum" .feature "1.0") => number ? ("scaleMaximum" .feature "1.0") => number
? observable: bool ? observable: bool
? readable: bool ? readable: bool
? writable: bool ? writable: bool
? nullable: bool ? nullable: bool
? ("subtype" .feature "1.0") => "byte-string" / "unix-time" ? ("subtype" .feature "1.0") => "byte-string" / "unix-time"
/ (text .feature "subtype-ext") ; EXTENSION-POINT / (text .feature "subtype-ext") ; EXTENSION-POINT
skipping to change at page 39, line 9 skipping to change at page 39, line 8
? contentFormat: text ? contentFormat: text
EXTENSION-POINT<"data-ext"> EXTENSION-POINT<"data-ext">
} }
allowed-types = number / text / bool / null allowed-types = number / text / bool / null
/ [* number] / [* text] / [* bool] / [* number] / [* text] / [* bool]
/ {* text => any} / {* text => any}
/ (any .feature "allowed-ext") ; EXTENSION-POINT / (any .feature "allowed-ext") ; EXTENSION-POINT
compound-type = ( compound-type = (
"type" => ("object" .feature "1.1"), "type" => ("object" .feature "1.1")
? required: [+text], ? required: [+text]
? properties: named<dataqualities>, ? properties: named<dataqualities>
) )
choice-type = ( choice-type = (
("sdfChoice" .feature "1.1") => named<dataqualities> ("sdfChoice" .feature "1.1") => named<dataqualities>
) )
jsonschema = ( jsonschema = (
? (("type" => "number" / "string" / "boolean" / "integer" / "array") ? (("type" => "number" / "string" / "boolean" / "integer" / "array")
// compound-type // compound-type
// choice-type // choice-type
skipping to change at page 42, line 6 skipping to change at page 42, line 5
"$ref": "#/definitions/dataqualities" "$ref": "#/definitions/dataqualities"
} }
} }
}, },
- "additionalProperties": false - "additionalProperties": false
+ "additionalProperties": { + "additionalProperties": {
+ } + }
}, },
"sdfinfo": { "sdfinfo": {
"type": "object", "type": "object",
"required": [
"title",
"version",
"copyright",
"license"
],
"properties": { "properties": {
"title": { "title": {
"type": "string" "type": "string"
}, },
"version": { "version": {
"type": "string" "type": "string"
}, },
"copyright": { "copyright": {
"type": "string" "type": "string"
}, },
 End of changes. 38 change blocks. 
66 lines changed or deleted 73 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/