<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.5.7 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
]>

<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>
<?rfc compact="yes"?>
<?rfc comments="yes"?>

<rfc ipr="trust200902" docName="draft-bormann-cbor-edn-literals-00" category="info">

  <front>
    <title abbrev="CBOR EDN Literals">Application-Oriented Literals in CBOR Extended Diagnostic Notation</title>

    <author initials="C." surname="Bormann" fullname="Carsten Bormann">
      <organization>Universität Bremen TZI</organization>
      <address>
        <postal>
          <street>Postfach 330440</street>
          <city>Bremen</city>
          <code>D-28359</code>
          <country>Germany</country>
        </postal>
        <phone>+49-421-218-63921</phone>
        <email>cabo@tzi.org</email>
      </address>
    </author>

    <date year="2021" month="October" day="06"/>

    
    
    <keyword>Internet-Draft</keyword>

    <abstract>


<t>The Concise Binary Object Representation, CBOR (RFC 8949) defines a "diagnostic notation" in order to
be able to converse about CBOR data items without having to resort to
binary data.</t>

<t>​This document specifies how to add application-oriented extensions to
the diagnostic notation.  It then defines two such extensions for the use of
CBOR diagnostic notation with CoRAL and Constrained Resource Identifiers (draft-ietf-core-coral, draft-ietf-core-href).</t>



    </abstract>


    <note title="" removeInRFC="true">


<t>The content of this draft may preferably be
distributed to a number of different documents.
This is to be decided.</t>


    </note>


  </front>

  <middle>


<section anchor="intro"><name>Introduction</name>

<t>For the Concise Binary Object Representation, CBOR,
<xref section="8" sectionFormat="of" target="RFC8949"/>
defines a "diagnostic notation" in order to
be able to converse about CBOR data items without having to resort to
binary data.
Diagnostic notation is based on JSON, with extensions
for representing CBOR constructs such as binary data and tags.
(Standardizing this together with the actual interchange format does
not serve to create another interchange format, but enables the use of
a shared diagnostic notation in tools for and documents about CBOR.)</t>

<t>This document specifies how to add application-oriented extensions to
the diagnostic notation.  It then defines two such extensions for the use of
CBOR diagnostic notation with CoRAL and Constrained Resource Identifiers <xref target="I-D.ietf-core-coral"/> <xref target="I-D.ietf-core-href"/>.</t>

</section>
<section anchor="application-oriented-extension-literals"><name>Application-Oriented Extension Literals</name>

<t>This document extends the syntax used in diagnostic notation for byte
string literals to also be available for application-oriented extensions.</t>

<t>As per <xref section="8" sectionFormat="of" target="RFC8949"/>, the diagnostic notation can notate byte
strings in a number of <xref target="RFC4648"/> base encodings, where the encoded text
is enclosed in single quotes, prefixed by an identifier (&gt;h&lt; for
base16, &gt;b32&lt; for base32, &gt;h32&lt; for base32hex, &gt;b64&lt; for base64 or
base64url).</t>

<t>This syntax can be thought to establish a name space, with the names
"h", "b32", "h32", and "b64" taken, but other names being unallocated.
The present specification defines additional names for this namespace,
which we call <em>application-extension identifiers</em>.
For the quoted string, the same rules apply as for byte strings.
In particular, the escaping rules of JSON strings are applied
equivalently for application-oriented extensions, e.g., <spanx style="verb">\\</spanx> stands
for a single backslash and <spanx style="verb">\'</spanx> stands for a single quote.</t>

<t>An application-extension identifier is a name consisting of a
lower-case ASCII letter (a-z) and zero or more additional ASCII
characters that are either lower-case letters or digits (a-z0-9).</t>

<t>Application-extension identifiers are registered in a registry
(<xref target="sec-iana"/>).
Prefixing a single-quoted string, an application-extension identifier
is used to build an application-oriented extension literal, which
stands for a CBOR data item the value of which is derived from the
text given in the single-quoted string using a procedure defined in
the specification for an application-extension identifier.</t>

<t>Examples for application-oriented extensions to CBOR diagnostic
notation can be found in the following sections.</t>

</section>
<section anchor="the-cri-extension"><name>The "cri" Extension</name>

<t>The application-extension identifier "cri" is used to notate a
Constrained Resource Identifier literal as per <xref target="I-D.ietf-core-href"/>.</t>

<t>The text of the literal is a URI Reference as per <xref target="RFC3986"/> or an IRI
Reference as per <xref target="RFC3987"/>.</t>

<t>The value of the literal is a CRI that can be converted to the text of
the literal using the procedure of <xref section="6.1" sectionFormat="of" target="I-D.ietf-core-href"/>.
Note that there may be more than one CRI that can be converted to the
URI/IRI given; implementations are expected to favor the simplest
variant available and make non-surprising choices otherwise.</t>

<t>As an example, the CBOR diagnostic notation</t>

<figure><sourcecode type="CBORdiag"><![CDATA[
cri'https://example.com/bottarga/shaved'
]]></sourcecode></figure>

<t>is equivalent to</t>

<figure><sourcecode type="CBORdiag"><![CDATA[
[-4, ["example", "com"], ["bottarga", "shaved"]]
]]></sourcecode></figure>

</section>
<section anchor="the-dt-extension"><name>The "dt" Extension</name>

<t>The application-extension identifier "dt" is used to notate a
date/time literal that can be used as an Epoch-Based Date/Time as per
<xref section="3.4.2" sectionFormat="of" target="RFC8949"/>.</t>

<t>The text of the literal is a Standard Date/Time String as per
<xref section="3.4.1" sectionFormat="of" target="RFC8949"/>.</t>

<t>The value of the literal is a number representing the result of a
conversion of the given Standard Date/Time String to an Epoch-Based
Date/Time.
If fractional seconds are given in the text (production
<spanx style="verb">time-fraction</spanx> in <xref section="A" sectionFormat="of" target="RFC3339"/>), the value is a
floating-point number; the value is an integer number otherwise.</t>

<t>As an example, the CBOR diagnostic notation</t>

<figure><sourcecode type="CBORdiag"><![CDATA[
dt'1969-07-21T02:56:16Z'
]]></sourcecode></figure>

<t>is equivalent to</t>

<figure><sourcecode type="CBORdiag"><![CDATA[
-14159024
]]></sourcecode></figure>

</section>
<section anchor="sec-iana"><name>IANA Considerations</name>

<t>IANA is requested to create a registry [[where?]] for
application-extension identifiers, with the initial content shown in
<xref target="tab-iana"/>.</t>

<texttable title="Initial Content of application extension
identifier registry" anchor="tab-iana">
      <ttcol align='left'>application-extension identifier</ttcol>
      <ttcol align='left'>description</ttcol>
      <ttcol align='left'>reference</ttcol>
      <c>h</c>
      <c>Reserved</c>
      <c>RFC8949</c>
      <c>b32</c>
      <c>Reserved</c>
      <c>RFC8949</c>
      <c>h32</c>
      <c>Reserved</c>
      <c>RFC8949</c>
      <c>b64</c>
      <c>Reserved</c>
      <c>RFC8949</c>
      <c>cri</c>
      <c>Constrained Resource Identifier</c>
      <c>RFCthis</c>
      <c>dt</c>
      <c>Date/Time</c>
      <c>RFCthis</c>
</texttable>

<t><cref anchor="todo1">(Define policy; detailed template)</cref></t>

</section>
<section anchor="security-considerations"><name>Security considerations</name>

<t>The security considerations of <xref target="RFC8949"/> and <xref target="RFC8610"/> apply.</t>

<t><cref anchor="todo2">Anything else meaningful to say here?</cref></t>

</section>


  </middle>

  <back>

    <references title='Normative References'>





<reference anchor='RFC8610' target='https://www.rfc-editor.org/info/rfc8610'>
<front>
<title>Concise Data Definition Language (CDDL): A Notational Convention to Express Concise Binary Object Representation (CBOR) and JSON Data Structures</title>
<author fullname='H. Birkholz' initials='H.' surname='Birkholz'><organization/></author>
<author fullname='C. Vigano' initials='C.' surname='Vigano'><organization/></author>
<author fullname='C. Bormann' initials='C.' surname='Bormann'><organization/></author>
<date month='June' year='2019'/>
<abstract><t>This document proposes a notational convention to express Concise Binary Object Representation (CBOR) data structures (RFC 7049).  Its main goal is to provide an easy and unambiguous way to express structures for protocol messages and data formats that use CBOR or JSON.</t></abstract>
</front>
<seriesInfo name='RFC' value='8610'/>
<seriesInfo name='DOI' value='10.17487/RFC8610'/>
</reference>



<reference anchor='RFC8949' target='https://www.rfc-editor.org/info/rfc8949'>
<front>
<title>Concise Binary Object Representation (CBOR)</title>
<author fullname='C. Bormann' initials='C.' surname='Bormann'><organization/></author>
<author fullname='P. Hoffman' initials='P.' surname='Hoffman'><organization/></author>
<date month='December' year='2020'/>
<abstract><t>The Concise Binary Object Representation (CBOR) is a data format whose design goals include the possibility of extremely small code size, fairly small message size, and extensibility without the need for version negotiation. These design goals make it different from earlier binary serializations such as ASN.1 and MessagePack.</t><t>This document obsoletes RFC 7049, providing editorial improvements, new details, and errata fixes while keeping full compatibility with the interchange format of RFC 7049.  It does not create a new version of the format.</t></abstract>
</front>
<seriesInfo name='STD' value='94'/>
<seriesInfo name='RFC' value='8949'/>
<seriesInfo name='DOI' value='10.17487/RFC8949'/>
</reference>


<reference anchor='I-D.ietf-core-href'>
   <front>
      <title>Constrained Resource Identifiers</title>
      <author fullname='Carsten Bormann'>
	 <organization>Universität Bremen TZI</organization>
      </author>
      <author fullname='Henk Birkholz'>
	 <organization>Fraunhofer SIT</organization>
      </author>
      <date day='25' month='July' year='2021'/>
      <abstract>
	 <t>   The Constrained Resource Identifier (CRI) is a complement to the
   Uniform Resource Identifier (URI) that serializes the URI components
   in Concise Binary Object Representation (CBOR) instead of a sequence
   of characters.  This simplifies parsing, comparison and reference
   resolution in environments with severe limitations on processing
   power, code size, and memory size.

	 </t>
      </abstract>
   </front>
   <seriesInfo name='Internet-Draft' value='draft-ietf-core-href-06'/>
   <format target='https://www.ietf.org/archive/id/draft-ietf-core-href-06.txt' type='TXT'/>
</reference>



<reference anchor='RFC3339' target='https://www.rfc-editor.org/info/rfc3339'>
<front>
<title>Date and Time on the Internet: Timestamps</title>
<author fullname='G. Klyne' initials='G.' surname='Klyne'><organization/></author>
<author fullname='C. Newman' initials='C.' surname='Newman'><organization/></author>
<date month='July' year='2002'/>
<abstract><t>This document defines a date and time format for use in Internet protocols that is a profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.</t></abstract>
</front>
<seriesInfo name='RFC' value='3339'/>
<seriesInfo name='DOI' value='10.17487/RFC3339'/>
</reference>



<reference anchor='RFC3986' target='https://www.rfc-editor.org/info/rfc3986'>
<front>
<title>Uniform Resource Identifier (URI): Generic Syntax</title>
<author fullname='T. Berners-Lee' initials='T.' surname='Berners-Lee'><organization/></author>
<author fullname='R. Fielding' initials='R.' surname='Fielding'><organization/></author>
<author fullname='L. Masinter' initials='L.' surname='Masinter'><organization/></author>
<date month='January' year='2005'/>
<abstract><t>A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource.  This specification defines the generic URI syntax and a process for resolving URI references that might be in relative form, along with guidelines and security considerations for the use of URIs on the Internet.  The URI syntax defines a grammar that is a superset of all valid URIs, allowing an implementation to parse the common components of a URI reference without knowing the scheme-specific requirements of every possible identifier.  This specification does not define a generative grammar for URIs; that task is performed by the individual specifications of each URI scheme.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='STD' value='66'/>
<seriesInfo name='RFC' value='3986'/>
<seriesInfo name='DOI' value='10.17487/RFC3986'/>
</reference>



<reference anchor='RFC3987' target='https://www.rfc-editor.org/info/rfc3987'>
<front>
<title>Internationalized Resource Identifiers (IRIs)</title>
<author fullname='M. Duerst' initials='M.' surname='Duerst'><organization/></author>
<author fullname='M. Suignard' initials='M.' surname='Suignard'><organization/></author>
<date month='January' year='2005'/>
<abstract><t>This document defines a new protocol element, the Internationalized  Resource Identifier (IRI), as a complement of the Uniform Resource  Identifier (URI). An IRI is a sequence of characters from the  Universal Character Set (Unicode/ISO 10646). A mapping from IRIs to   URIs is defined, which means that IRIs can be used instead of URIs,  where appropriate, to identify resources.</t><t> The approach of defining a new protocol element was chosen instead of extending or changing the definition of URIs.  This was done in order  to allow a clear distinction and to avoid incompatibilities with  existing software. Guidelines are provided for the use and deployment of IRIs in various protocols, formats, and software components that currently deal with URIs.</t></abstract>
</front>
<seriesInfo name='RFC' value='3987'/>
<seriesInfo name='DOI' value='10.17487/RFC3987'/>
</reference>




    </references>

    <references title='Informative References'>





<reference anchor='RFC4648' target='https://www.rfc-editor.org/info/rfc4648'>
<front>
<title>The Base16, Base32, and Base64 Data Encodings</title>
<author fullname='S. Josefsson' initials='S.' surname='Josefsson'><organization/></author>
<date month='October' year='2006'/>
<abstract><t>This document describes the commonly used base 64, base 32, and base 16 encoding schemes.  It also discusses the use of line-feeds in encoded data, use of padding in encoded data, use of non-alphabet characters in encoded data, use of different encoding alphabets, and canonical encodings.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='4648'/>
<seriesInfo name='DOI' value='10.17487/RFC4648'/>
</reference>


<reference anchor='I-D.ietf-core-coral'>
   <front>
      <title>The Constrained RESTful Application Language (CoRAL)</title>
      <author fullname='Klaus Hartke'>
	 <organization>Ericsson</organization>
      </author>
      <date day='9' month='March' year='2020'/>
      <abstract>
	 <t>   The Constrained RESTful Application Language (CoRAL) defines a data
   model and interaction model as well as two specialized serialization
   formats for the description of typed connections between resources on
   the Web (&quot;links&quot;), possible operations on such resources (&quot;forms&quot;),
   and simple resource metadata.

	 </t>
      </abstract>
   </front>
   <seriesInfo name='Internet-Draft' value='draft-ietf-core-coral-03'/>
   <format target='https://www.ietf.org/archive/id/draft-ietf-core-coral-03.txt' type='TXT'/>
</reference>




    </references>


<section numbered="no" anchor="acknowledgements"><name>Acknowledgements</name>

<t>The concept of application-oriented extensions to diagnostic notation,
as well as the definition for the "dt" extension were inspired by the
CoRAL work by Klaus Hartke.</t>

<!--  LocalWords:  dedenting dedented
 -->

</section>


  </back>

<!-- ##markdown-source:
H4sIAB2SXWEAA61Y7XLbuBX9j6dAlR9xtqIsyYrWUj5ax862ajPJjpOdzqzj
JhAJiagpQguAlhXHmf7va/RN+iZ9kp4LkBJly1GmE83YJEHg4n6ce+4Foyhi
TrlMDvlzxvnRfJ6pWDil8+iNUTJ3MuGvlJNGZJarnB+/eHPKX145mSd4c6LE
NNfWqZi/1s4vY2I8NvJyWM48eb1azhId52KGnRIjJi4aazMTeR7FuIlkkkdZ
OTHKhJPWsQSXIe+2u52o047afcasE3nyQWQ6xwtnCsmYmht/a1233R60u+xC
LhfaJEM+gvImly46oe0YrBrCgolmD3iscytzW9hKylwN+ZnTcZNbbZyRE4u7
5SzcxHo2F7HzNzO4xJ4zJgqXajOEyyL8cQiGrOMWfxGM8mPB2GNhLNy18Uab
6ZD/kqtLaaxy//m34y+MhGj+7teRn2Chg4S+P8O5ExGn/OCg3eu1/btYueWw
XBAGdIJ9TqLu4cHjQTlS5M5g1p8kbbr0g/PUu+33vUHUg0u7ncOofzDodvxL
ORMqG/JYjPUf3SfVgoaMsZx0dlCTDD396fiw32ljUpJk5fOgN8AzAojnUXTS
UtJNolgbGaXwHV4ZFWYeHBxgJkXUqZksxwaH/SEvVlMGhz8iQnikKG1u3Ov3
Dod8LKy8sxH+CdKcLoxFUcTFGO5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