Subject: [core] Ordering question for draft-hartke-t2trg-coral

From: Jim Schaad <[email-masked]>
Date: Wed, 7 Aug 2019 09:51:19 -0700

Klaus,

In the process of working on this, I am trying to determine if there is a
real ordering to the items in a document or not.  The only reason that I can
see for having one is the possibility directives change the current context.
If one stores all of this as absolute paths (or relative to a known point),
one could synthesis the base directive on the fly when doing serialization
and thus the order of links and forms would not be significant.

Can you confirm this?

Jim

---

From: Klaus Hartke <[email-masked]>
Date: Thu, 8 Aug 2019 12:21:52 +0200

Hi Jim,

> and thus the order of links and forms would not be significant.

in the serializations, elements clearly have an order on the wire, and
the meaning of each elements depends on the current processor state
("current context") that changes based on the directives processed so
far:

    #base <coap://foo.example/>
    quux </1>
    #base <coap://bar.example/>
    quux </2>

is not equivalent to

    #base <coap://foo.example/>
    quux </2>
    #base <coap://bar.example/>
    quux </1>

In the data model, the question is valid whether a link `quux
<coap://foo.example/1>` followed by a link `quux
<coap://bar.example/2>` is semantically equivalent to the link `quux
<coap://bar.example/2>` followed by the link `quux
<coap://foo.example/1>`:

Is

    #base <coap://foo.example/>
    quux </1>
    #base <coap://bar.example/>
    quux </2>

equivalent to

    #base <coap://bar.example/>
    quux </2>
    #base <coap://foo.example/>
    quux </1>

?

This question is currently left open in draft-hartke-t2trg-coral-09.
I'd say the answer mostly depends on the semantics of the link
relation types. E.g.,:

* a link to the mother of a person followed by a link to their father
is probably equivalent to a link to their father followed by a link to
their mother;

* a link to a resource with sz 100 followed by a link to a resource
with sz 50 is probably not equivalent to a link with sz 50 followed a
link with size 100 if the client requests the links be sorted by sz;

* a link to a resource with ct Link-Format followed by a link to a
resource with ct CoRAL is probably not equivalent to a link with ct
CoRAL followed by a link with ct Link-Format if the server wants to
express that the CoRAL alternative should be preferred.

Klaus

---

From: Jim Schaad <[email-masked]>
Date: Thu, 8 Aug 2019 13:34:53 -0700

Klaus,

Some responses in line.  This was the problem I was thinking about as a dictionary in my pubsub node would be an easier way to access the values.  But if order is important then that will not work.

jim

-----Original Message-----
From: Klaus Hartke <[email-masked]> 
Sent: Thursday, August 8, 2019 3:22 AM
To: Jim Schaad <[email-masked]>
Cc: [email-masked]; [email-masked] WG <[email-masked]>
Subject: Re: [core] Ordering question for draft-hartke-t2trg-coral

Hi Jim,

> In the process of working on this, I am trying to determine if there 
> is a real ordering to the items in a document or not.  The only reason 
> that I can see for having one is the possibility directives change the current context.
> If one stores all of this as absolute paths (or relative to a known 
> point), one could synthesis the base directive on the fly when doing 
> serialization and thus the order of links and forms would not be significant.

in the serializations, elements clearly have an order on the wire, and the meaning of each elements depends on the current processor state ("current context") that changes based on the directives processed so
far:

is not equivalent to

[JLS] In terms of the base directive, this does not bother me because I would do the normalization as part of the parsing process.  I am worried that somebody may come up with a new directive for which this would not be the case.  New directives can also cause problems in the future because how do I deserialize an object when I find a directive I don't understand.

In the data model, the question is valid whether a link `quux <coap://foo.example/1>` followed by a link `quux <coap://bar.example/2>` is semantically equivalent to the link `quux <coap://bar.example/2>` followed by the link `quux
<coap://foo.example/1>`:

Is

equivalent to

?

This question is currently left open in draft-hartke-t2trg-coral-09.
I'd say the answer mostly depends on the semantics of the link relation types. E.g.,:

* a link to the mother of a person followed by a link to their father is probably equivalent to a link to their father followed by a link to their mother;
[JLS] Right, these can be considered to be completely independent items.

* a link to a resource with sz 100 followed by a link to a resource with sz 50 is probably not equivalent to a link with sz 50 followed a link with size 100 if the client requests the links be sorted by sz;
[JLS] But in this case, you are talking about having the items sorted at the time it is serialized.  So in this case you are actually asking for the order to be changed from the original one to a new order.  If this causes other unintentional order changes that would cause a problem.

* a link to a resource with ct Link-Format followed by a link to a resource with ct CoRAL is probably not equivalent to a link with ct CoRAL followed by a link with ct Link-Format if the server wants to express that the CoRAL alternative should be preferred.
[JLS] This one kind a begs the question should a multivalued link be setup as an array of values rather than something that the client could accidently change the of order if it does not expect to have multiple values.  In that case it would presumable get the last value which would be wrong.  I realize that having an array of values gives a problem because that is also what a ciri looks like and there would need to be a way to distinguish them.

Klaus