Skip to content

Hyper-Schema clarification: Is "One Link Per Target and Relation Type" still valid with "anchor"? #9

Open
@ryangalamb

Description

@ryangalamb

Now that we can change the context of a link using "anchor" and "anchorPointer", does the following statement from section 8.1 still hold true?

for each target resource and link relation type pair, schema authors SHOULD only define a single LDO.

Using anchors, we can define multiple different links using the same target by changing the context. For (contrived) example, if we're representing links in hierarchical data:

"links": [
  {
    "rel": "up",
    "href": "parent",
    "anchor": "parent/foo"
  },
  {
    "rel": "up",
    "href": "parent",
    "anchor": "parent/bar"
  }
]

As mentioned in the anchor example in section 9.4, using anchor with rel=top is an attractive solution to the lack of an IANA-registered "down" relationship.

While my example seems (to me) like it would be valid, it runs afoul of the "One Link Per Target and Relation Type" rule. Both links have a relationship type of "up" and a target of "parent".

Is the phrasing for section 8.1 a relic from before "anchor" was in the spec? Or am I misunderstanding something about how anchors are supposed to work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions