idnits 2.17.1 draft-bormann-asdf-sdf-compact-01.txt: -(3): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(219): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(220): 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 5 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 13 instances of too long lines in the document, the longest one being 282 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 (6 September 2021) is 956 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Missing Reference: 'TM' is mentioned on line 223, but not defined == Outdated reference: A later version (-18) exists of draft-ietf-asdf-sdf-07 Summary: 3 errors (**), 0 flaws (~~), 5 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 6 September 2021 5 Expires: 10 March 2022 7 Semantic Definition Format (SDF) for Data and Interactions of Things: 8 Compact Notation 9 draft-bormann-asdf-sdf-compact-01 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 often is 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 Contributing 34 Recent versions of this document are available at its GitHub 35 repository https://github.com/cabo/sdfc (https://github.com/cabo/ 36 sdfc) -- this also provides an issue tracker as well as a way to 37 supply "pull requests". 39 General discussion of this SDF Internet-Draft happens on the mailing 40 list of the IETF ASDF Working Group, asdf@ietf.org (subscribe at 41 https://www.ietf.org/mailman/listinfo/asdf 42 (https://www.ietf.org/mailman/listinfo/asdf)). 44 The IETF Note Well applies (https://www.ietf.org/about/note-well/ 45 (https://www.ietf.org/about/note-well/)). 47 Status of This Memo 49 This Internet-Draft is submitted in full conformance with the 50 provisions of BCP 78 and BCP 79. 52 Internet-Drafts are working documents of the Internet Engineering 53 Task Force (IETF). Note that other groups may also distribute 54 working documents as Internet-Drafts. The list of current Internet- 55 Drafts is at https://datatracker.ietf.org/drafts/current/. 57 Internet-Drafts are draft documents valid for a maximum of six months 58 and may be updated, replaced, or obsoleted by other documents at any 59 time. It is inappropriate to use Internet-Drafts as reference 60 material or to cite them other than as "work in progress." 62 This Internet-Draft will expire on 10 March 2022. 64 Copyright Notice 66 Copyright (c) 2021 IETF Trust and the persons identified as the 67 document authors. All rights reserved. 69 This document is subject to BCP 78 and the IETF Trust's Legal 70 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 71 license-info) in effect on the date of publication of this document. 72 Please review these documents carefully, as they describe your rights 73 and restrictions with respect to this document. Code Components 74 extracted from this document must include Simplified BSD License text 75 as described in Section 4.e of the Trust Legal Provisions and are 76 provided without warranty as described in the Simplified BSD License. 78 Table of Contents 80 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 81 2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 3 82 2.1. Example Definition . . . . . . . . . . . . . . . . . . . 4 83 3. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 84 3.1. Normative References . . . . . . . . . . . . . . . . . . 5 85 3.2. Informative References . . . . . . . . . . . . . . . . . 6 86 Appendix A. Example in SDF JSON format . . . . . . . . . . . . . 6 87 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 7 88 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 7 90 1. Introduction 92 The Semantic Definition Format (SDF) is a format for domain experts 93 to use in the creation and maintenance of data and interaction models 94 in the Internet of Things. It was created as a common language for 95 use in the development of the One Data Model liaison organization 96 (OneDM) definitions. Tools convert this format to database formats 97 and other serializations as needed. 99 The SDF format is mainly intended for interchange between machine 100 generation and machine processing. However, there often is a need 101 for humans to look at and edit SDF models. 103 Similar to the way Relax-NG as defined in ISO/IEC 19757-2 has an XML 104 format and a compact format (Annex C), this specification defines a 105 compact format to go along SDF's JSON format. 107 The present version of this document is mostly a proof of concept, 108 but was deemed useful to obtain initial feedback on the approach 109 taken. 111 (References: [I-D.ietf-asdf-sdf], [RELAXNG].) 113 The intention is to be able to bidirectionally translate between 114 compact and JSON form, without appreciable semantic losses. This 115 will allow viewing SDF in compact form, apply edits if needed, and 116 then continuing processing it in JSON form. As a limitation of this 117 approach, it will be difficult to always recreate the order of map 118 entries (members of JSON objects) in the JSON form; this order is 119 essentially arbitrary as maps (JSON objects) in JSON are unordered. 120 (In the long run, it may be useful to define a canonical order in the 121 SDF specification or here.) 123 An initial prototype of a converter from compact form to JSON form 124 was constructed during the ASDF/WISHI hackathon preceding IETF110. A 125 more complete, bidirectionally operating version of this tool is 126 planned for release soon. 128 2. Overview 130 The SDF compact format is a YAML file [YAML]; a good part of the work 131 needed for a compact representation is already done by the increased 132 user-friendliness of YAML over JSON. 134 In addition, all the sections defined with "named<...>" in the CDDL 135 definition of SDF have been compacted into map entries with space- 136 separated keys, giving the kind first and the name next. This saves 137 the need for another level of hierarchy and reminds the reader of the 138 kind of item being specified. 140 The map key "description" is replaced by ":", which also is rendered 141 in the most compact form possible in YAML. 143 The dataqualities readable, writable, and observable, together with 144 optionality, are compressed into a four-character map key: The first 145 three are translated into "rwo" when set (default in SDF) and into 146 "---" when not set. The fourth character is "?" for optional and "!" 147 for required. 149 The value of this abbreviated key is a CDDL [RFC8610] rendition of 150 the attributes defined in the jsonschema production in Appendix A of 151 [I-D.ietf-asdf-sdf]. To further reduce noise, a top-level array 152 production in the CDDL can be represented as an array in the YAML 153 (i.e., does not require additional quotes). 155 2.1. Example Definition 157 This is an SDF-compact version of a slightly modified copy of the 158 sdfobject-cadence.sdf.json model found at the time of writing in 159 OneDM's SDF playground. (This example was chosen more or less 160 randomly; better examples can probably be found. The modification is 161 the addition of a "unit" quality.) 162 info: 163 copyright: Copyright 2018-2019 Open Connectivity Foundation, Inc. All rights reserved. 164 version: '2019-06-11' 165 title: Cadence 166 license: https://github.com/one-data-model/oneDM/blob/master/LICENSE 168 object cadence: 169 :: This Resource describes the cadence, which is the number of 170 revolutions of crank per minute when cyclists pedal the 171 pedals. The unit, which is the default unit, is rpm. The cadence 172 Property is a read-only value that is provided by the 173 server. When range (from "oic. r. baseresource") is omitted the 174 default is 0 to +MAXFLOAT. 175 property cadence: 176 r-o!: integer .ge 0 177 unit: 1/min 178 :: This Property describes the rate at which a cyclist is pedalling/turning 179 the pedals. 180 property range: 181 r-o?: [2*2 integer] 182 :: The valid range for the Property in the Resource as an integer. 183 The first value in the array is the minimum value, the second value in the 184 array is the maximum value. 185 property step: 186 r-o?: integer 187 :: Step value across the defined range when the range is an integer. This 188 is the increment for valid values across the range; so if range is 0..10 189 and step is 2 then valid values are 0,2,4,6,8,10. 191 The result of automatically converting this YAML file using the 192 prototype "sdfc" tool back into the JSON form of SDF is given in 193 Appendix A. Except for the "unit" addition, it is semantically 194 identical to the sdfobject-cadence.sdf.json. Differences are visible 195 in the order of map entries (members in JSON objects); a future 196 version of the "sdfc" tool could attempt to preserve more of this 197 order, even though it does not carry semantics. 199 3. References 201 3.1. Normative References 203 [I-D.ietf-asdf-sdf] 204 Koster, M. and C. Bormann, "Semantic Definition Format 205 (SDF) for Data and Interactions of Things", Work in 206 Progress, Internet-Draft, draft-ietf-asdf-sdf-07, 12 July 207 2021, . 210 [RFC8610] Birkholz, H., Vigano, C., and C. Bormann, "Concise Data 211 Definition Language (CDDL): A Notational Convention to 212 Express Concise Binary Object Representation (CBOR) and 213 JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, 214 June 2019, . 216 3.2. Informative References 218 [RELAXNG] ISO/IEC, "Information technology — Document Schema 219 Definition Language (DSDL) — Part 2: Regular-grammar-based 220 validation — RELAX NG", ISO/IEC 19757-2, 15 December 2008. 222 [YAML] Ben-Kiki, O., Evans, C., and I.d. Net, "YAML Ain't Markup 223 Language (YAML[TM]) Version 1.2", 3rd Edition, October 224 2009, . 226 Appendix A. Example in SDF JSON format 227 { 228 "info": { 229 "title": "Cadence", 230 "license": "https://github.com/one-data-model/oneDM/blob/master/LICENSE", 231 "version": "2019-06-11", 232 "copyright": "Copyright 2018-2019 Open Connectivity Foundation, Inc. All rights reserved." 233 }, 234 "sdfObject": { 235 "cadence": { 236 "description": "This Resource describes the cadence, which is the number of revolutions of crank per minute when cyclists pedal the pedals. The unit, which is the default unit, is rpm. The cadence Property is a read-only value that is provided by the server. When range (from \"oic. r. baseresource\") is omitted the default is 0 to +MAXFLOAT.", 237 "sdfProperty": { 238 "step": { 239 "type": "integer", 240 "writable": false, 241 "description": "Step value across the defined range when the range is an integer. This is the increment for valid values across the range; so if range is 0..10 and step is 2 then valid values are 0,2,4,6,8,10." 242 }, 243 "range": { 244 "type": "array", 245 "items": { 246 "type": "integer" 247 }, 248 "maxItems": 2, 249 "minItems": 2, 250 "writable": false, 251 "description": "The valid range for the Property in the Resource as an integer. The first value in the array is the minimum value, the second value in the array is the maximum value." 252 }, 253 "cadence": { 254 "type": "integer", 255 "minimum": 0, 256 "writable": false, 257 "description": "This Property describes the rate at which a cyclist is pedalling/turning the pedals." 258 } 259 }, 260 "sdfRequired": [ 261 "#/sdfObject/cadence/sdfProperty/cadence" 262 ] 263 } 264 } 265 } 267 Acknowledgements 269 The idea for this draft originated at the IETF110 ASDF/WISHI 270 hackathon. The author would like to thank the attendees for initial 271 feedback. 273 Author's Address 274 Carsten Bormann (editor) 275 Universität Bremen TZI 276 Postfach 330440 277 D-28359 Bremen 278 Germany 280 Phone: +49-421-218-63921 281 Email: cabo@tzi.org