idnits 2.17.1 draft-bormann-asdf-sdf-compact-02.txt: -(3): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(217): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(218): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == There are 6 instances of lines with non-ascii characters in the document. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack a Security Considerations section. ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** There are 7 instances of too long lines in the document, the longest one being 19 characters in excess of 72. == There are 2 instances of lines with non-RFC2606-compliant FQDNs in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (28 February 2022) is 785 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Outdated reference: A later version (-18) exists of draft-ietf-asdf-sdf-10 Summary: 3 errors (**), 0 flaws (~~), 4 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 T2TRG C. Bormann, Ed. 3 Internet-Draft Universität Bremen TZI 4 Intended status: Informational 28 February 2022 5 Expires: 1 September 2022 7 Semantic Definition Format (SDF) for Data and Interactions of Things: 8 Compact Notation 9 draft-bormann-asdf-sdf-compact-02 11 Abstract 13 The Semantic Definition Format (SDF) is a format for domain experts 14 to use in the creation and maintenance of data and interaction models 15 in the Internet of Things. It was created as a common language for 16 use in the development of the One Data Model liaison organization 17 (OneDM) definitions. Tools convert this format to database formats 18 and other serializations as needed. 20 The SDF format is mainly intended for interchange between machine 21 generation and machine processing. However, there is often a need 22 for humans to look at and edit SDF models. 24 Similar to the way Relax-NG as defined in ISO/IEC 19757-2 has an XML 25 format and a compact format (Annex C), this specification defines a 26 compact format to go along SDF's JSON format. 28 The present version of this document is mostly a proof of concept, 29 but was deemed useful to obtain initial feedback on the approach 30 taken. 32 About This Document 34 This note is to be removed before publishing as an RFC. 36 Status information for this document may be found at 37 https://datatracker.ietf.org/doc/draft-bormann-asdf-sdf-compact/. 39 Discussion of this document takes place on the A Semantic Definition 40 Format for Data and Interactions of Things (asdf) Working Group 41 mailing list (mailto:asdf@ietf.org), which is archived at 42 https://mailarchive.ietf.org/arch/browse/asdf/. 44 Status of This Memo 46 This Internet-Draft is submitted in full conformance with the 47 provisions of BCP 78 and BCP 79. 49 Internet-Drafts are working documents of the Internet Engineering 50 Task Force (IETF). Note that other groups may also distribute 51 working documents as Internet-Drafts. The list of current Internet- 52 Drafts is at https://datatracker.ietf.org/drafts/current/. 54 Internet-Drafts are draft documents valid for a maximum of six months 55 and may be updated, replaced, or obsoleted by other documents at any 56 time. It is inappropriate to use Internet-Drafts as reference 57 material or to cite them other than as "work in progress." 59 This Internet-Draft will expire on 1 September 2022. 61 Copyright Notice 63 Copyright (c) 2022 IETF Trust and the persons identified as the 64 document authors. All rights reserved. 66 This document is subject to BCP 78 and the IETF Trust's Legal 67 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 68 license-info) in effect on the date of publication of this document. 69 Please review these documents carefully, as they describe your rights 70 and restrictions with respect to this document. Code Components 71 extracted from this document must include Revised BSD License text as 72 described in Section 4.e of the Trust Legal Provisions and are 73 provided without warranty as described in the Revised BSD License. 75 Table of Contents 77 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 78 2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 3 79 2.1. Example Definition . . . . . . . . . . . . . . . . . . . 4 80 3. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 81 3.1. Normative References . . . . . . . . . . . . . . . . . . 5 82 3.2. Informative References . . . . . . . . . . . . . . . . . 5 83 Appendix A. Example in SDF JSON format . . . . . . . . . . . . . 5 84 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 7 85 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 7 87 1. Introduction 89 The Semantic Definition Format (SDF) is a format for domain experts 90 to use in the creation and maintenance of data and interaction models 91 in the Internet of Things. It was created as a common language for 92 use in the development of the One Data Model liaison organization 93 (OneDM) definitions. Tools convert this format to database formats 94 and other serializations as needed. 96 The SDF format is mainly intended for interchange between machine 97 generation and machine processing. However, there is often a need 98 for humans to look at and edit SDF models. 100 Similar to the way Relax-NG as defined in ISO/IEC 19757-2 has an XML 101 format and a compact format (Annex C), this specification defines a 102 compact format to go along SDF's JSON format. 104 The present version of this document is mostly a proof of concept, 105 but was deemed useful to obtain initial feedback on the approach 106 taken. 108 (References: [I-D.ietf-asdf-sdf], [RELAXNG].) 110 The intention is to be able to bidirectionally translate between 111 compact and JSON form, without appreciable semantic losses. This 112 will allow viewing SDF in compact form, apply edits if needed, and 113 then continuing processing it in JSON form. As a limitation of this 114 approach, it will be difficult to always recreate the order of map 115 entries (members of JSON objects) in the JSON form; this order is 116 essentially arbitrary as maps (JSON objects) in JSON are unordered. 117 (In the long run, it may be useful to define a canonical order in the 118 SDF specification or here.) 120 An initial prototype of a converter from compact form to JSON form 121 was constructed during the ASDF/WISHI hackathon preceding IETF110. A 122 more complete, bidirectionally operating version of this tool is 123 planned for release soon. 125 2. Overview 127 The SDF compact format is a YAML file [YAML]; a good part of the work 128 needed for a compact representation is already done by the increased 129 user-friendliness of YAML over JSON. 131 In addition, all the sections defined with named<...> in the CDDL 132 definition of SDF have been compacted into map entries with space- 133 separated keys, giving the kind first and the name next. This saves 134 the need for another level of hierarchy and reminds the reader of the 135 kind of item being specified. 137 The map key description is replaced by :, which also is rendered in 138 the most compact form possible in YAML. 140 The dataqualities readable, writable, and observable, together with 141 optionality, are compressed into a four-character map key: The first 142 three are translated into rwo when set (default in SDF) and into --- 143 when not set. The fourth character is ? for optional and ! for 144 required. 146 The value of this abbreviated key is a CDDL [RFC8610] rendition of 147 the attributes defined in the jsonschema production in Appendix A of 148 [I-D.ietf-asdf-sdf]. To further reduce noise, a top-level array 149 production in the CDDL can be represented as an array in the YAML 150 (i.e., does not require additional quotes). 152 2.1. Example Definition 154 This is an SDF-compact version of a slightly modified copy of the 155 sdfobject-cadence.sdf.json model found at the time of writing in 156 OneDM's SDF playground. (This example was chosen more or less 157 randomly; better examples can probably be found. The modification is 158 the addition of a unit quality.) 160 info: 161 copyright: Copyright 2018-2019 Open Connectivity Foundation, Inc. All rights reserved. 162 version: '2019-06-11' 163 title: Cadence 164 license: https://github.com/one-data-model/oneDM/blob/master/LICENSE 166 object cadence: 167 :: This Resource describes the cadence, which is the number of 168 revolutions of crank per minute when cyclists pedal the 169 pedals. The unit, which is the default unit, is rpm. The cadence 170 Property is a read-only value that is provided by the 171 server. When range (from "oic. r. baseresource") is omitted the 172 default is 0 to +MAXFLOAT. 173 property cadence: 174 r-o!: integer .ge 0 175 unit: 1/min 176 :: This Property describes the rate at which a cyclist is pedalling/turning 177 the pedals. 178 property range: 179 r-o?: [2*2 integer] 180 :: The valid range for the Property in the Resource as an integer. 181 The first value in the array is the minimum value, the second value in the 182 array is the maximum value. 183 property step: 184 r-o?: integer 185 :: Step value across the defined range when the range is an integer. This 186 is the increment for valid values across the range; so if range is 0..10 187 and step is 2 then valid values are 0,2,4,6,8,10. 189 The result of automatically converting this YAML file using the 190 prototype sdfc tool back into the JSON form of SDF is given in 191 Appendix A. Except for the unit addition, it is semantically 192 identical to the sdfobject-cadence.sdf.json. Differences are visible 193 in the order of map entries (members in JSON objects); a future 194 version of the sdfc tool could attempt to preserve more of this 195 order, even though it does not carry semantics. 197 3. References 199 3.1. Normative References 201 [I-D.ietf-asdf-sdf] 202 Koster, M. and C. Bormann, "Semantic Definition Format 203 (SDF) for Data and Interactions of Things", Work in 204 Progress, Internet-Draft, draft-ietf-asdf-sdf-10, 16 205 January 2022, . 208 [RFC8610] Birkholz, H., Vigano, C., and C. Bormann, "Concise Data 209 Definition Language (CDDL): A Notational Convention to 210 Express Concise Binary Object Representation (CBOR) and 211 JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, 212 June 2019, . 214 3.2. Informative References 216 [RELAXNG] ISO/IEC, "Information technology — Document Schema 217 Definition Language (DSDL) — Part 2: Regular-grammar-based 218 validation — RELAX NG", ISO/IEC 19757-2, 15 December 2008. 220 [YAML] Ben-Kiki, O., Evans, C., and I. dot Net, "YAML Ain't 221 Markup Language (YAML™) version 1.2", Revision 1.2.2, 1 222 October 2021, . 224 Appendix A. Example in SDF JSON format 226 =============== NOTE: '\' line wrapping per RFC 8792 ================ 228 { 229 "info": { 230 "title": "Cadence", 231 "license": "https://github.com/one-data-model/oneDM/blob/master/\ 232 LICENSE", 233 "version": "2019-06-11", 234 "copyright": "Copyright 2018-2019 Open Connectivity Foundation, \ 235 Inc. All rights reserved." 236 }, 237 "sdfObject": { 238 "cadence": { 239 "description": "This Resource describes the cadence, which is \ 240 the number of revolutions of crank per minute when cyclists pedal \ 241 the pedals. The unit, which is the default unit, is rpm. The \ 242 cadence Property is a read-only value that is provided by the server\ 243 . When range (from \"oic. r. baseresource\") is omitted the default \ 244 is 0 to +MAXFLOAT.", 245 "sdfProperty": { 246 "step": { 247 "type": "integer", 248 "writable": false, 249 "description": "Step value across the defined range when \ 250 the range is an integer. This is the increment for valid values \ 251 across the range; so if range is 0..10 and step is 2 then valid \ 252 values are 0,2,4,6,8,10." 253 }, 254 "range": { 255 "type": "array", 256 "items": { 257 "type": "integer" 258 }, 259 "maxItems": 2, 260 "minItems": 2, 261 "writable": false, 262 "description": "The valid range for the Property in the \ 263 Resource as an integer. The first value in the array is the minimum \ 264 value, the second value in the array is the maximum value." 265 }, 266 "cadence": { 267 "type": "integer", 268 "minimum": 0, 269 "writable": false, 270 "description": "This Property describes the rate at which \ 271 a cyclist is pedalling/turning the pedals." 272 } 273 }, 274 "sdfRequired": [ 275 "#/sdfObject/cadence/sdfProperty/cadence" 276 ] 277 } 278 } 279 } 281 Acknowledgements 283 The idea for this draft originated at the IETF110 ASDF/WISHI 284 hackathon. The author would like to thank the attendees for initial 285 feedback. 287 Author's Address 289 Carsten Bormann (editor) 290 Universität Bremen TZI 291 Postfach 330440 292 D-28359 Bremen 293 Germany 294 Phone: +49-421-218-63921 295 Email: cabo@tzi.org