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

Issue with dropping @language-only objects during expansion #284

Closed
kasei opened this issue Dec 24, 2019 · 2 comments
Closed

Issue with dropping @language-only objects during expansion #284

kasei opened this issue Dec 24, 2019 · 2 comments

Comments

@kasei
Copy link

@kasei kasei commented Dec 24, 2019

Test t0008 expands:

{
  "@context": {
    "ex": "http://example.org/vocab#"
  },
  "@id": "http://example.org/test",
  "ex:test": { "@value": "test",  "@language": "en" },
  "ex:drop-lang-only": { "@language": "en" },
  "ex:keep-full-value": { "@value": "only value" }
}

to:

[
  {
    "@id": "http://example.org/test",
    "http://example.org/vocab#test": [ { "@value": "test", "@language": "en" } ],
    "http://example.org/vocab#keep-full-value": [ {"@value": "only value"} ]
  }
]

Based on the current text of expansion algorithm steps 18 and 21, ex:drop-lang-only should not be dropped. (Expansion 13.9 will recursively call expansion on "ex:drop-lang-only": { "@language": "en" }, and steps 18 and 21 will result in an empty array being returned.)

After a discussion with @gkellogg on irc, I believe the fix to this is to update step 18 from:

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

to:

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

@gkellogg gkellogg added the wr:open label Dec 24, 2019
gkellogg added a commit that referenced this issue Dec 25, 2019
…<var>result</var> to `null`.

For #284.
@gkellogg

This comment has been minimized.

Copy link
Member

@gkellogg gkellogg commented Dec 25, 2019

@kasei changes in PR #287. Let us know if you're satisfied.

@kasei

This comment has been minimized.

Copy link
Author

@kasei kasei commented Dec 26, 2019

@gkellogg looks good, thanks!

gkellogg added a commit that referenced this issue Dec 26, 2019
…<var>result</var> to `null`.

For #284.
@gkellogg gkellogg added this to Editorial work complete in JSON-LD Management Dec 26, 2019
gkellogg added a commit that referenced this issue Dec 26, 2019
…<var>result</var> to `null`.

For #284.
@gkellogg gkellogg closed this Jan 10, 2020
@gkellogg gkellogg removed this from Editorial work complete in JSON-LD Management Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.