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

Decide what to do with value entries in node objects. #21

Open
timothee-haudebourg opened this issue Oct 26, 2021 · 1 comment
Open

Comments

@timothee-haudebourg
Copy link
Owner

timothee-haudebourg commented Oct 26, 2021

For now in src/expansion/node.rs, is the expanded node only contains value entries (i.e. @language or @direction entries), then it is ignored (None is returned and the node is dropped).

It is not clear if this is the correct behavior or not.

  • Should we throw an error?
  • Should we keep ignoring it?

The JSON-LD API expansion algorithm only covers the case where the node only contains a @language entry, in which case it is ignored:

If result is a map that contains only the entry @language, return null.

More complex cases are not covered. In the playground, only the d map is dropped.

{
  "http://a": {
    "@id": "http://a",
    "@language": "fr"
  },
  "http://b": {
    "@id": "http://b",
    "@language": "en",
    "@direction": "ltr"
  },
  "http://c": {
    "@id": "http://c",
    "@direction": "ltr"
  },
  "http://d": {
    "@language": "fr"
  },
  "http://e": {
    "@language": "en",
    "@direction": "ltr"
  },
  "http://f": {
    "@direction": "ltr"
  }
}
@timothee-haudebourg
Copy link
Owner Author

See w3c/json-ld-api#535

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

1 participant