idnits 2.17.1 draft-bormann-asdf-sdf-compact-00.txt: -(3): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(200): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding -(201): 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 (7 March 2021) is 1145 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Missing Reference: 'TM' is mentioned on line 204, but not defined == Outdated reference: A later version (-18) exists of draft-ietf-asdf-sdf-03 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 7 March 2021 5 Expires: 8 September 2021 7 Semantic Definition Format (SDF) for Data and Interactions of Things: 8 Compact Notation 9 draft-bormann-asdf-sdf-compact-00 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 8 September 2021. 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 . . . . . . . . . . . . . . . . . . . . . . . . 2 81 2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 3 82 2.1. Example Definition . . . . . . . . . . . . . . . . . . . 4 83 3. References . . . . . . . . . . . . . . . . . . . . . . . . . 4 84 3.1. Normative References . . . . . . . . . . . . . . . . . . 4 85 3.2. Informative References . . . . . . . . . . . . . . . . . 5 86 Appendix A. Example in SDF JSON format . . . . . . . . . . . . . 5 87 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 6 88 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 6 90 1. Introduction 92 (See Abstract for now.) [I-D.ietf-asdf-sdf] [RELAXNG] 93 The intention is to be able to bidirectionally translate between 94 compact and JSON form, without appreciable semantic losses. This 95 will allow viewing SDF in compact form, apply edits if needed, and 96 then continuing processing it in JSON form. As a limitation of this 97 approach, it will be difficult to always recreate the order of map 98 entries (members of JSON objects) in the JSON form; this order is 99 essentially arbitrary as maps (JSON objects) in JSON are unordered. 100 (In the long run, it may be useful to define a canonical order in the 101 SDF specification or here.) 103 An initial prototype of a converter from compact form to JSON form 104 was constructed during the ASDF/WISHI hackathon preceding IETF110. A 105 more complete, bidirectionally operating version of this tool is 106 planned for release in week 12 of 2021. 108 2. Overview 110 The SDF compact format is a YAML file [YAML]; a good part of the work 111 needed for a compact representation is already done by the increased 112 user-friendliness of YAML over JSON. 114 In addition, all the sections defined with "named<...>" in the CDDL 115 definition of SDF have been compacted into map entries with space- 116 separated keys, giving the kind first and the name next. This saves 117 the need for another level of hierarchy and reminds the reader of the 118 kind of item being specified. 120 The map key "description" is replaced by ":", which also is rendered 121 in the most compact form possible in YAML. 123 The dataqualities readable, writable, and observable, together with 124 optionality, are compressed into a four-character map key: The first 125 three are translated into "rwo" when set (default in SDF) and into 126 "---" when not set. The fourth character is "?" for optional and "!" 127 for required. 129 The value of this abbreviated key is a CDDL [RFC8610] rendition of 130 the attributes defined in the jsonschema production in Appendix A of 131 [I-D.ietf-asdf-sdf]. To further reduce noise, a top-level array 132 production in the CDDL can be represented as an array in the YAML 133 (i.e., does not require additional quotes). 135 2.1. Example Definition 137 This is an SDF-compact version of a slightly modified copy of the 138 sdfobject-cadence.sdf.json model found at the time of writing in 139 OneDM's SDF playground. (This example was chosen more or less 140 randomly; better examples can probably be found. The modification is 141 the addition of a "unit" quality.) 143 info: 144 copyright: Copyright 2018-2019 Open Connectivity Foundation, Inc. All rights reserved. 145 version: '2019-06-11' 146 title: Cadence 147 license: https://github.com/one-data-model/oneDM/blob/master/LICENSE 149 object cadence: 150 :: This Resource describes the cadence, which is the number of 151 revolutions of crank per minute when cyclists pedal the 152 pedals. The unit, which is the default unit, is rpm. The cadence 153 Property is a read-only value that is provided by the 154 server. When range (from "oic. r. baseresource") is omitted the 155 default is 0 to +MAXFLOAT. 156 property cadence: 157 r-o!: integer .ge 0 158 unit: 1/min 159 :: This Property describes the rate at which a cyclist is pedalling/turning 160 the pedals. 161 property range: 162 r-o?: [2*2 integer] 163 :: The valid range for the Property in the Resource as an integer. 164 The first value in the array is the minimum value, the second value in the 165 array is the maximum value. 166 property step: 167 r-o?: integer 168 :: Step value across the defined range when the range is an integer. This 169 is the increment for valid values across the range; so if range is 0..10 170 and step is 2 then valid values are 0,2,4,6,8,10. 172 The result of automatically converting this YAML file using the 173 prototype "sdfc" tool back into the JSON form of SDF is given in 174 Appendix A. Except for the "unit" addition, it is semantically 175 identical to the sdfobject-cadence.sdf.json. Differences are visible 176 in the order of map entries (members in JSON objects); a future 177 version of the "sdfc" tool could attempt to preserve more of this 178 order, even though it does not carry semantics. 180 3. References 182 3.1. Normative References 184 [I-D.ietf-asdf-sdf] 185 Koster, M. and C. Bormann, "Semantic Definition Format 186 (SDF) for Data and Interactions of Things", Work in 187 Progress, Internet-Draft, draft-ietf-asdf-sdf-03, 22 188 February 2021, . 191 [RFC8610] Birkholz, H., Vigano, C., and C. Bormann, "Concise Data 192 Definition Language (CDDL): A Notational Convention to 193 Express Concise Binary Object Representation (CBOR) and 194 JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, 195 June 2019, . 197 3.2. Informative References 199 [RELAXNG] ISO/IEC, "Information technology — Document Schema 200 Definition Language (DSDL) — Part 2: Regular-grammar-based 201 validation — RELAX NG", ISO/IEC 19757-2, 15 December 2008. 203 [YAML] Ben-Kiki, O., Evans, C., and I.d. Net, "YAML Ain't Markup 204 Language (YAML[TM]) Version 1.2", 3rd Edition, October 205 2009, . 207 Appendix A. Example in SDF JSON format 208 { 209 "info": { 210 "title": "Cadence", 211 "license": "https://github.com/one-data-model/oneDM/blob/master/LICENSE", 212 "version": "2019-06-11", 213 "copyright": "Copyright 2018-2019 Open Connectivity Foundation, Inc. All rights reserved." 214 }, 215 "sdfObject": { 216 "cadence": { 217 "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.", 218 "sdfProperty": { 219 "step": { 220 "type": "integer", 221 "writable": false, 222 "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." 223 }, 224 "range": { 225 "type": "array", 226 "items": { 227 "type": "integer" 228 }, 229 "maxItems": 2, 230 "minItems": 2, 231 "writable": false, 232 "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." 233 }, 234 "cadence": { 235 "type": "integer", 236 "minimum": 0, 237 "writable": false, 238 "description": "This Property describes the rate at which a cyclist is pedalling/turning the pedals." 239 } 240 }, 241 "sdfRequired": [ 242 "#/sdfObject/cadence/sdfProperty/cadence" 243 ] 244 } 245 } 246 } 248 Acknowledgements 250 The idea for this draft originated at the IETF110 ASDF/WISHI 251 hackathon. The author would like to thank the attendees for initial 252 feedback. 254 Author's Address 255 Carsten Bormann (editor) 256 Universität Bremen TZI 257 Postfach 330440 258 D-28359 Bremen 259 Germany 261 Phone: +49-421-218-63921 262 Email: cabo@tzi.org