Skip to main content

Semantic Definition Format (SDF): Mapping files
draft-bormann-asdf-sdf-mapping-03

Document Type Active Internet-Draft (individual)
Authors Carsten Bormann , Jan Romann
Last updated 2023-12-03
RFC stream (None)
Intended RFC status (None)
Formats
Additional resources GitHub Repository
Stream Stream state (No stream defined)
Consensus boilerplate Unknown
RFC Editor Note (None)
IESG IESG state I-D Exists
Telechat date (None)
Responsible AD (None)
Send notices to (None)
draft-bormann-asdf-sdf-mapping-03
ASDF                                                     C. Bormann, Ed.
Internet-Draft                                    Universität Bremen TZI
Intended status: Standards Track                               J. Romann
Expires: 5 June 2024                                  Universität Bremen
                                                         3 December 2023

            Semantic Definition Format (SDF): Mapping files
                   draft-bormann-asdf-sdf-mapping-03

Abstract

   The Semantic Definition Format (SDF) is a format for domain experts
   to use in the creation and maintenance of data and interaction models
   that describe Things, i.e., physical objects that are available for
   interaction over a network.  It was created as a common language for
   use in the development of the One Data Model liaison organization
   (OneDM) definitions.  Tools convert this format to database formats
   and other serializations as needed.

   An SDF specification often needs to be augmented by additional
   information that is specific to its use in a particular ecosystem or
   application.  SDF mapping files provide a mechanism to represent this
   augmentation.

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-bormann-asdf-sdf-mapping/.

   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/.  Subscribe at
   https://www.ietf.org/mailman/listinfo/asdf/.

   Source for this draft and an issue tracker can be found at
   https://github.com/cabo/sdf-mapping.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

Bormann & Romann           Expires 5 June 2024                  [Page 1]
Internet-Draft                 SDF Mapping                 December 2023

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on 5 June 2024.

Copyright Notice

   Copyright (c) 2023 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents (https://trustee.ietf.org/
   license-info) in effect on the date of publication of this document.
   Please review these documents carefully, as they describe your rights
   and restrictions with respect to this document.  Code Components
   extracted from this document must include Revised BSD License text as
   described in Section 4.e of the Trust Legal Provisions and are
   provided without warranty as described in the Revised BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
     1.1.  Terminology and Conventions . . . . . . . . . . . . . . .   3
   2.  Overview  . . . . . . . . . . . . . . . . . . . . . . . . . .   3
     2.1.  Example Definition 1 (ecosystem: IPSO/OMA)  . . . . . . .   4
     2.2.  Example Definition 2 (ecosystem: W3C WoT) . . . . . . . .   4
   3.  Formal Syntax of SDF mapping files  . . . . . . . . . . . . .   7
   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   9
     4.1.  Media Type  . . . . . . . . . . . . . . . . . . . . . . .   9
     4.2.  Registries  . . . . . . . . . . . . . . . . . . . . . . .  10
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .  10
   6.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  10
     6.1.  Normative References  . . . . . . . . . . . . . . . . . .  10
     6.2.  Informative References  . . . . . . . . . . . . . . . . .  11
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  11
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  11

Bormann & Romann           Expires 5 June 2024                  [Page 2]
Internet-Draft                 SDF Mapping                 December 2023

1.  Introduction

   The Semantic Definition Format (SDF) is a format for domain experts
   to use in the creation and maintenance of data and interaction models
   that describe Things, i.e., physical objects that are available for
   interaction over a network.  It was created as a common language for
   use in the development of the One Data Model liaison organization
   (OneDM) definitions.  Tools convert this format to database formats
   and other serializations as needed.

   An SDF specification often needs to be augmented by additional
   information that is specific to its use in a particular ecosystem or
   application.  SDF mapping files provide a mechanism to represent this
   augmentation.

1.1.  Terminology and Conventions

   The definitions of [I-D.ietf-asdf-sdf] apply.

   The term "byte" is used in its now-customary sense as a synonym for
   "octet".

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in
   BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

2.  Overview

   An SDF mapping file provides augmentation information for one or more
   SDF definitions.  Its main contents is a map from SDF name references
   (Section 4.3 of [I-D.ietf-asdf-sdf]) to a set of qualities.

   When processing the mapping file together with one or more SDF
   definitions, these qualities are added to the SDF definition at the
   referenced name, as in a merge-patch operation [RFC7396].  Note that
   this is somewhat similar to the way sdfRef (Section 4.4 of
   [I-D.ietf-asdf-sdf]) works, but in a mapping file the arrows point in
   the inverse direction (from the augmenter to the augmented).

Bormann & Romann           Expires 5 June 2024                  [Page 3]
Internet-Draft                 SDF Mapping                 December 2023

2.1.  Example Definition 1 (ecosystem: IPSO/OMA)

   An example for an SDF mapping file is given in Figure 1.  This
   mapping file is meant to attach to an SDF specification published by
   OneDM, and to add qualities relevant to the IPSO/OMA ecosystem.
   // Note that this example uses namespaces to identify elements of
   // the referenced specification(s), but has un-namespaced quality
   // names.  These two kinds of namespaces are probably unrelated, and
   // we may need to add quality namespacing to SDF (independent of a
   // potential feature to add namespace references to definitions that
   // are not intended to go into the default namespace — these are SDF
   // definition namespaces and not quality namespaces, which are one
   // meta-level higher).

   *  Start of mapping file for certain OneDM playground models:

   {
     "info": {
       "title": "IPSO ID mapping"
     },
     "namespace": {
       "onedm": "https://onedm.org/models"
     },
     "defaultNamespace": "onedm",
     "map": {
       "#/sdfObject/Digital_Input": {
         "id": 3200
       },
       "#/sdfObject/Digital_Input/sdfProperty/Digital_Input_State": {
         "id": 5500
       },
       "#/sdfObject/Digital_Input/sdfProperty/Digital_Input_Counter": {
         "id": 5501
       }
     }
   }

             Figure 1: A simple example of an SDF mapping file

2.2.  Example Definition 2 (ecosystem: W3C WoT)

   This example shows a translation of a hypothetical W3C WoT Thing
   Model into an SDF model plus a mapping file to catch Thing Model
   attributes that don't currently have SDF qualities defined.
   // The example probably would be more useful with, say, protocol
   // bindings.  This is left for a future version of this example, and/
   // or a future specification that specifically addresses how to map
   // Thing Models into SDF.  (There is also the separate requirement to

Bormann & Romann           Expires 5 June 2024                  [Page 4]
Internet-Draft                 SDF Mapping                 December 2023

   // transform a Thing Description into the kind of information that
   // can be represented in SDF plus instance information, such as IP
   // addresses or specific node names.)  Finally, namespaces are all
   // wrong in this example.

   *  The input: WoT Thing Model

   {
       "@context": ["http://www.w3.org/ns/td"],
       "@type" : "tm:ThingModel",
       "title": "Lamp Thing Model",
       "titles": {
         "en": "Lamp Thing Model",
         "de": "Thing Model für eine Lampe"
       },
       "properties": {
           "status": {
               "description": "Current status of the lamp",
               "descriptions": {
                 "en": "Current status of the lamp",
                 "de": "Aktueller Status der Lampe"
               },
               "type": "string",
               "readOnly": true
           }
       }
   }

                      Figure 2: Input: WoT Thing Model

   *  The output: SDF model

Bormann & Romann           Expires 5 June 2024                  [Page 5]
Internet-Draft                 SDF Mapping                 December 2023

   {
     "info": {
       "title": "Lamp Thing Model"
     },
     "namespaces": {
       "wot": "http://www.w3.org/ns/td"
     },
     "defaultNamespace": "wot",
     "sdfObject": {
       "LampThingModel": {
         "label": "Lamp Thing Model",
         "sdfProperty": {
           "status": {
             "description": "Current status of the lamp",
             "writable": false,
             "type": "string"
           }
         }
       }
     }
   }

                       Figure 3: Output 1: SDF Model

   *  The other output: SDF mapping file

Bormann & Romann           Expires 5 June 2024                  [Page 6]
Internet-Draft                 SDF Mapping                 December 2023

   {
     "info": {
       "title": "Lamp Thing Model: WoT TM mapping"
     },
     "namespace": {
       "wot": "http://www.w3.org/ns/td"
     },
     "defaultNamespace": "wot",
     "map": {
       "#/sdfObject/LampThingModel": {
         "titles": {
           "en": "Lamp Thing Model",
           "de": "Thing Model für eine Lampe"
         }
       },
       "#/sdfObject/LampThingModel/sdfProperty/status": {
         "descriptions": {
           "en": "Current status of the lamp",
           "de": "Aktueller Status der Lampe"
         }
       }
     }
   }

                    Figure 4: Output 2: SDF Mapping File

3.  Formal Syntax of SDF mapping files

   An SDF mapping file has three optional components that are taken
   unchanged from SDF: The info block, the namespace declaration, and
   the default namespace.  The mandatory fourth component, the "map",
   contains the mappings from an SDF name reference (usually a namespace
   and a JSON pointer) to a nested map providing a set of qualities to
   be merged in at the site identified in the name reference.

   Figure 5 describes the syntax of SDF mapping files using CDDL
   [RFC8610].

   start = sdf-mapping

   sdf-mapping = {
    ; info will be required in most process policies
    ? info: sdfinfo
    ? namespace: named<text>
    ? defaultNamespace: text
    map: { * global-sdf-pointer => additionalqualities}
   }

Bormann & Romann           Expires 5 June 2024                  [Page 7]
Internet-Draft                 SDF Mapping                 December 2023

   ; we can't really be much more specific here:
   additionalqualities = named<any>

   ; --------------------------------- import from SDF-base:

   sdfinfo = {
    ? title: text
    ? description: text
    ? version: text
    ? copyright: text
    ? license: text
    ? modified: modified-date-time
    ? features: [
                  * (any .feature "feature-name") ; EXTENSION-POINT
                ]
    optional-comment
    EXTENSION-POINT<"info-ext">
   }

   ; Shortcut for a map that gives names to instances of X
   ; (has keys of type text and values of type X)
   named<X> = { * text => X }

   ; EXTENSION-POINT is only used in framework syntax
   EXTENSION-POINT<f> = ( * (quality-name .feature f) => any )
   quality-name = text .regexp "([a-z][a-z0-9]*:)?[a-z$][A-Za-z$0-9]*"

   ; rough CURIE or JSON Pointer syntax:
   global-sdf-pointer = text .regexp ".*[:#].*"

   optional-comment = (
    ? $comment: text       ; source code comments only, no semantics
   )

   modified-date-time = text .abnf modified-dt-abnf
   modified-dt-abnf = "modified-dt" .det rfc3339z

   ; RFC 3339 sans time-numoffset, slightly condensed
   rfc3339z = '
      date-fullyear   = 4DIGIT
      date-month      = 2DIGIT  ; 01-12
      date-mday       = 2DIGIT  ; 01-28, 01-29, 01-30, 01-31 based on
                                ; month/year
      time-hour       = 2DIGIT  ; 00-23
      time-minute     = 2DIGIT  ; 00-59
      time-second     = 2DIGIT  ; 00-58, 00-59, 00-60 based on leap sec
                                ; rules
      time-secfrac    = "." 1*DIGIT

Bormann & Romann           Expires 5 June 2024                  [Page 8]
Internet-Draft                 SDF Mapping                 December 2023

      DIGIT           =  %x30-39 ; 0-9

      partial-time    = time-hour ":" time-minute ":" time-second
                        [time-secfrac]
      full-date       = date-fullyear "-" date-month "-" date-mday

      modified-dt     = full-date ["T" partial-time "Z"]
   '

               Figure 5: CDDL definition of SDF mapping file

4.  IANA Considerations

4.1.  Media Type

   IANA is requested to add the following Media-Type to the "Media
   Types" registry.

   +==================+==============================+=============+
   | Name             | Template                     | Reference   |
   +==================+==============================+=============+
   | sdf-mapping+json | application/sdf-mapping+json | RFC XXXX,   |
   |                  |                              | Section 4.1 |
   +------------------+------------------------------+-------------+

              Table 1: A media type for SDF mapping files

   // RFC Editor: please replace RFC XXXX with this RFC number and
   // remove this note.

   Type name:  application
   Subtype name:  sdf-mapping+json
   Required parameters:  none
   Optional parameters:  none
   Encoding considerations:  binary (JSON is UTF-8-encoded text)
   Security considerations:  Section 5 of RFC XXXX
   Interoperability considerations:  none
   Published specification:  Section 4.1 of RFC XXXX
   Applications that use this media type:  Tools for data and
      interaction modeling that describes Things, i.e., physical objects
      that are available for interaction over a network
   Fragment identifier considerations:  A JSON Pointer fragment
      identifier may be used, as defined in Section 6 of [RFC6901].
   Person & email address to contact for further information:  ASDF WG
      mailing list (asdf@ietf.org), or IETF Applications and Real-Time
      Area (art@ietf.org)
   Intended usage:  COMMON

Bormann & Romann           Expires 5 June 2024                  [Page 9]
Internet-Draft                 SDF Mapping                 December 2023

   Restrictions on usage:  none
   Author/Change controller:  IETF
   Provisional registration:  no

4.2.  Registries

   (TBD: After future additions, check if we need any.)

5.  Security Considerations

   Some wider issues are discussed in [RFC8576].

   (Specifics: TBD.)

6.  References

6.1.  Normative References

   [I-D.ietf-asdf-sdf]
              Koster, M., Bormann, C., and A. Keränen, "Semantic
              Definition Format (SDF) for Data and Interactions of
              Things", Work in Progress, Internet-Draft, draft-ietf-
              asdf-sdf-17, 5 November 2023,
              <https://datatracker.ietf.org/doc/html/draft-ietf-asdf-
              sdf-17>.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/rfc/rfc2119>.

   [RFC6901]  Bryan, P., Ed., Zyp, K., and M. Nottingham, Ed.,
              "JavaScript Object Notation (JSON) Pointer", RFC 6901,
              DOI 10.17487/RFC6901, April 2013,
              <https://www.rfc-editor.org/rfc/rfc6901>.

   [RFC7396]  Hoffman, P. and J. Snell, "JSON Merge Patch", RFC 7396,
              DOI 10.17487/RFC7396, October 2014,
              <https://www.rfc-editor.org/rfc/rfc7396>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/rfc/rfc8174>.

Bormann & Romann           Expires 5 June 2024                 [Page 10]
Internet-Draft                 SDF Mapping                 December 2023

   [RFC8610]  Birkholz, H., Vigano, C., and C. Bormann, "Concise Data
              Definition Language (CDDL): A Notational Convention to
              Express Concise Binary Object Representation (CBOR) and
              JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610,
              June 2019, <https://www.rfc-editor.org/rfc/rfc8610>.

6.2.  Informative References

   [RFC8576]  Garcia-Morchon, O., Kumar, S., and M. Sethi, "Internet of
              Things (IoT) Security: State of the Art and Challenges",
              RFC 8576, DOI 10.17487/RFC8576, April 2019,
              <https://www.rfc-editor.org/rfc/rfc8576>.

Acknowledgements

   This draft is based on discussions in the Thing-to-Thing Research
   Group (T2TRG) and the SDF working group.  Input for Section 2.1 was
   provided by Ari Keränen.

Authors' Addresses

   Carsten Bormann (editor)
   Universität Bremen TZI
   Postfach 330440
   D-28359 Bremen
   Germany
   Phone: +49-421-218-63921
   Email: cabo@tzi.org

   Jan Romann
   Universität Bremen
   Germany
   Email: jan.romann@uni-bremen.de

Bormann & Romann           Expires 5 June 2024                 [Page 11]