Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ryangalamb opened this issue Mar 24, 2020 · 1 comment

Comments

@ryangalamb
Copy link

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?

@handrews
Copy link
Contributor

@rjmill good catch. Yes, it should be something like "for each context, target, and link relation type triple, schema authors SHOULD..."

@handrews handrews transferred this issue from json-schema-org/json-schema-spec Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants