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

Fix the description of the record field annotation for link validation #631

Merged
merged 2 commits into from
Dec 5, 2022

Conversation

tom-tan
Copy link
Member

@tom-tan tom-tan commented Nov 19, 2022

The spec says:

If the value of jsonldPredicate is an object, and that object contains the field _type with the value @id, the field is a link field subject to link validation.

However, it is not correct because identity: false (or unspecified identity) is also needed as described in the section of JsonldPredicate#_type.

This request fixes it by clarifying the value of identity in addition to the field _type.

@tom-tan
Copy link
Member Author

tom-tan commented Nov 20, 2022

Uh...

Let me clarify the specification.

Which is correct?

  • A field is the link field iff it has the jsonldPredicate field with _type: @id and identity: false (this request clarifies this case)
  • A field is the link field iff it has the jsonldPredicate field with _type: @id, but its resolution rule is controlled with the value of identity

If the latter is correct, I will fix this request to mention the identity field.

@tetron
Copy link
Member

tetron commented Nov 21, 2022

A field is the link field iff it has the jsonldPredicate field with _type: @id, but its resolution rule is controlled with the value of identity.

If the latter is correct, I will fix this request to mention the identity field.

Identity controls which resolution rule to use. But also, identity: true means that it is not a reference, it is original object identifier, so the runtime should not do link validation to check that the identifier exists somewhere else. So link validation should be done on fields with either "identity: false" or identity is not specified.

Another way of specifying that a field is an identifier is with _id: @id.

It is inherited from JSON-LD where @id is used in various places in the context to mean something is a URI.

I can't recall exactly why I made a separate identity field, I imagine I needed finer grained control over the behavior for some special field but I do not remember the specific example. I'd have to dig into the git history.

@tetron
Copy link
Member

tetron commented Nov 21, 2022

Ok, I refreshed my memory.

There are fields that are identifiers. They identify the object they are found on.

However there are also fields whose values have the "identity" property. These are expanded like identifiers, but they don't identify the object they are found on, they just exist as a standalone value. The main example of this are the symbols of an enumeration.

@mr-c
Copy link
Member

mr-c commented Nov 21, 2022

Ok, I refreshed my memory.

There are fields that are identifiers. They identify the object they are found on.

However there are also fields whose values have the "identity" property. These are expanded like identifiers, but they don't identify the object they are found on, they just exist as a standalone value. The main example of this are the symbols of an enumeration.

Thanks @tetron ; do we need to change/clarify the text still?

@codecov
Copy link

codecov bot commented Dec 5, 2022

Codecov Report

Merging #631 (93ba1c6) into main (e0113b5) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #631   +/-   ##
=======================================
  Coverage   83.43%   83.43%           
=======================================
  Files          20       20           
  Lines        4039     4039           
  Branches     1096     1096           
=======================================
  Hits         3370     3370           
  Misses        426      426           
  Partials      243      243           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@mergify mergify bot merged commit cd16408 into main Dec 5, 2022
@mergify mergify bot deleted the clarify-link-annotation branch December 5, 2022 18:04
@tom-tan tom-tan mentioned this pull request Dec 6, 2022
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

Successfully merging this pull request may close these issues.

3 participants