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

Example 3 is misleading v.a.v. JSON-LD #12

Open
iherman opened this issue Feb 1, 2018 · 3 comments
Open

Example 3 is misleading v.a.v. JSON-LD #12

iherman opened this issue Feb 1, 2018 · 3 comments
Assignees

Comments

@iherman
Copy link
Member

iherman commented Feb 1, 2018

The text before Example 5 gives the impression that example 5 is, in fact, in JSON-LD. Unfortunately, this is not true, because the @dir is not a valid keywords in JSON-LD 1.0 and is currently not included JSON-LD 1.1.

I have just raised an issue for JSON-LD 1.1 to include a separate @dir keyword albeit without mapping into RDF that cannot (alas!) properly represent the direction of a string literal. As W3C is considering the creation of a JSON-LD Working Group, that may eventually officialize JSON-LD 1.1, this may at least settle this problem on the JSON-LD level.

@aphillips
Copy link
Contributor

I've updated the text here (the document itself has been hugely reorganized in the past week). I agree that there are a number of potential action items. This issue being kept open because not yet ready to close.

@iherman
Copy link
Member Author

iherman commented Feb 5, 2019

@aphillips, note that, since then, the relevant JSON-LD issue has been closed with no action. The overall feeling is that the missing directionality is a matter to be solved on the RDF level and adding some hack into what is, after all, a serialization of RDF is a mistake.

@iherman
Copy link
Member Author

iherman commented Feb 15, 2019

@aphillips I looked at the latest document (dated February 13), and the example is still wrong. There are several issues.

(The example number has changed. It is now Example 3, in §5.2. I have changed the title of the issue.)

  • (minor) context is incomplete; it should at least include a @vocab to make it correct.
  • it is unclear whether the intention is to use value, language, and dir are meant to be aliases of the corresponding JSON-LD keywords (for the first two) or whether they are 'just' JSON-LD terms.
    • In the former case (see JSON-LD playground example) the JSON-LD is simply incorrect; the dir argument is not accepted per JSON-LD syntax
    • in the latter case (see JSON-LD playground example) what you get is not what you expect. The value of "title" is not a string, but it is a separate object with three values which, from a JSON-LD data model point of view is fundamentally different.

Similar errors appear in Examples 4-7, which make them all invalid.

(This is also one reason why Example 4 does not work, ref #13.)

My overall advise would be not to use JSON-LD in the examples. On the other hand, it should be noted that JSON-LD is constrained in its syntax by the current restrictions of RDF and, thereby, only recommendation in §4.5 seems to be feasible for JSON-LD based encodings for now as far the base direction issue is concerned. Specific applications of JSON-LD may also set a default value for the base direction but... that is all that can be done for the time being.

@iherman iherman changed the title Example 5 is misleading v.a.v. JSON-LD Example 3 is misleading v.a.v. JSON-LD Feb 15, 2019
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