w3c / dx-connegp

Content Negotiation by Profile
https://w3c.github.io/dx-connegp/connegp/
Other
6 stars 5 forks source link

Multiple canonical relation type #44

Closed YoucTagh closed 10 months ago

YoucTagh commented 1 year ago

In both Example 19 and Example 20, there is a Link header with two canonical relation type. Is this something acceptable?

The guidelines in RFC that introduce this relation type suggest that it is not:

- Specify only one canonical link relation for a resource.
YoucTagh commented 1 year ago

This comment is a summary of the discussion @youctagh, @larsgsvensson and @rob-metalinkage had on this issue during the meeting on 09 August 2023.

Problem:

In a response using the Link header, we need a way to express the default representation as well as the alternative representations. In addition, we need to express the default or preferred representation within a dimension or combination of dimensions, not just media type and profile (as mentioned in Section 7.3.2.2

... other content negotiation dimensions (language etc.)

also in Section 7.3.4

... indicate Media Type and other content negotiation dimensions.

Example:

Suppose we have a resource A identified by http://example.org/resource/a that has six representations (ri) that vary along three dimensions: media type (m), language (l), and profile (p):

We want to express that:

Proposed solution:

Use the relation types canonical and alternate (check IANA Link Relations). The former is used to define the global default representation, the latter to define an alternative representation that is neither a global default nor a dimension specific preferred representation (in our example, r2 and r3 and r4). We introduce a new relation type preferred to define the preferred representation for a dimension or combination of dimensions, which is used with the new attribute dim to specify the dimension of variability.

The Link headers to express the example are:

Link:
    <http://example.org/resource/a?m=m1&p=p1&l=l1>;
        rel="canonical";
        type="m1";        format="p1";        lang="l1",

    <http://example.org/resource/a?m=m1&p=p1&l=l1>;
        rel="preferred";
        dim="m";
        type="m1";        format="p1";        lang="l1",

    <http://example.org/resource/a?m=m1&p=p2&l=l3>;
        rel="alternate";
        type="m1";        format="p2";        lang="l3",

    <http://example.org/resource/a?m=m2&p=p1&l=l2>;
        rel="preferred";
        dim="p";
        type="m2";        format="p1";        lang="l2",

    <http://example.org/resource/a?m=m3&l=l2>;
        rel="alternate";
        type="m3";        lang="l2",

    <http://example.org/resource/a?m=m3>;
        rel="alternate";
        type="m3",

    <http://example.org/resource/a?m=m1&p=p1&l=l2>;
        rel="preferred";
        dim="m p";
        type="m1";        format="p1";        lang="l2",

    <http://example.org/resource/a?m=m2&p=p1&l=l2>;
        rel="preferred";
        dim="p l";
        type="m2";        format="p1";        lang="l2"

Notes

Note that the solution to this problem may also affect other examples such as Examples 22, 23 and 24.

rob-metalinkage commented 1 year ago

To do:

remove multiple canonical tags from example.

add or refer to text to define precedence over dimensions.

No plans to implement a more nuanced "prefered" tag, so this will determine the degree of expressivity available.

larsgsvensson commented 1 year ago

I reopen and tag as "due-for-closing"

rob-metalinkage commented 10 months ago

Resolved in PR #46