Subject: [Cbor] 7049bis: The concept of "optional tagging" is not really used in practice #126

From: Carsten Bormann <[email-masked]>
Date: Wed, 23 Oct 2019 13:38:10 +0200

Section 3.4 talks about "optional tagging" as a secondary purpose of tags. But in today's CBOR protocols, tags are rarely "optional" in the sense that they can simply be left out without a change in semantics, as 3.4 para 3 implies.

This concept comes up again in 4.2.2, where "optional tagging" is outlawed in deterministic encoding (but then the text goes on to explain that protocols might choose to retain tags, but doesn't say why).

Proposal: Get rid of any discussion of “optional tagging". 
(Of course, understanding/processing tags remains an optional feature of a decoder.)

https://github.com/cbor-wg/CBORbis/issues/126

Grüße, Carsten

---

From: Carsten Bormann <[email-masked]>
Date: Wed, 23 Oct 2019 15:04:07 +0200

… and I dropped a PR addressing this and other remaining tag issues (#107).

https://github.com/cbor-wg/CBORbis/pull/127

I hope there is still some time for reading this before 1500Z…

Grüße, Carsten

> On Oct 23, 2019, at 13:38, Carsten Bormann <[email-masked]> wrote:
> 
> _______________________________________________
> CBOR mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/cbor

---

From: Christophe Lohr <[email-masked]>
Date: Thu, 24 Oct 2019 10:50:59 +0200

> This concept comes up again in 4.2.2, where "optional tagging" is outlawed in deterministic encoding (but then the text goes on to explain that protocols might choose to retain tags, but doesn't sa…

To be honest, I don't really understand how much optional are tags.

A CDD rule with tags matchs cbor items with tags and reject cbor items
without tags. Tags are not optional from the data-model point of view.

Moreover, please consider this CDDL objective:
(https://tools.ietf.org/html/rfc7049#section-1.1)

   3.  Data must be able to be decoded without a schema description.
       *  Similar to JSON, encoded data should be self-describing so
          that a generic decoder can be written.

Well, how to do this without putting tags everywhere for everything?
(Or I need more explanation about what is "self-describing" and what is
a "schema description")

Let say I receive data. How may I know that this number is a temperature
and not a distance, and that this byte-string is an uuid and not a small
picture?

The first way is to have a schema (written or not): That is to say a
certain preliminary knowledge of expected data which tell me that this
number at this place or associated to this map-key is a temperature.
The second way is to decorate data with tags, all data.
A third way is a compromise between the two first ones: I have a certain
level of preliminary knoledge of what data are (a kind of schema
description), with possibly some missing parts that are filled by tags.

But the only way to decode data _without_ a schema description is to
have tags everywhere for everything.
Surprisingly, json has no tags and is claimed to be self-describing. Is
it really? I'm lost.

My feeling is that this objective CBOR should be not so demanding.

Best regards,
Christophe