Skip to content

Create additional assertions via contexts #64

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

Closed
azaroth42 opened this issue Sep 4, 2018 · 4 comments
Closed

Create additional assertions via contexts #64

azaroth42 opened this issue Sep 4, 2018 · 4 comments

Comments

@azaroth42
Copy link
Contributor

azaroth42 commented Sep 4, 2018

(This is a meta-issue)

Many existing JSON structures use simple "short cut" properties when there is only a single piece of information known about an intermediate resource. For example, if only the name of the author of a book is known then a creator property with a literal value is shorthand for a longer assertion chain of that the book was created by some actor that has the given name.

Thus:

{
  "type": "Book",
  "creator": "J.R.R. Tolkien"
}

Could be expanded to:

{
  "type": "Book",
  "created_by": {
    "type": "Actor",
    "label": "J.R.R. Tolkien"
  }
}

This could be added to the context for creator:

"creator": {
  "@type": "@nest", 
  "@values": {"@type": "Actor", "@property": "label", "@id": "created_by"}
}

Or similar.

@azaroth42
Copy link
Contributor Author

I'm a strong 👎 on this sort of thing. I believe that contexts should not do data transformation, only assert a mapping between JSON keys and the graph structure that already exists. This is a reductio argument against #7 and #15.

@iherman
Copy link
Member

iherman commented Sep 5, 2018

We do have exactly this issue in the Web Publication Manifest and the draft includes a separate "canonical manifest" section that defines a number of transformation steps like this one.

However, even with this example around, I am wary of such feature for JSON-LD 1.1. We should not use the context feature for data transformation. It may open pandora's box. We may want to look at this issue in general at some point, but that may have to be treated separately and probably needs a longer incubator period. For example, even if we did it, we should may want to have an explicitly different mechanism defined for this, not part of @context but a separate @transform patterns to make it more explicit and not make @context even more complex that it is. It may also touch on RDF graph transformations, ie, not necessarily bound to a particular serialization.

At this moment, I am 👎 on this...

@BigBlueHat
Copy link
Member

BigBlueHat commented Sep 5, 2018

FWIW, Google's Structured Data Testing Tool (which only supports one vocabulary: Schema.org) makes some undeclared assumptions (based on that single vocabulary) which amount to this sort of coercion.

You can see a more complete description in this comment over at the WPUB repo, but essentially, there's an unexpressed "default" Thing class into which string values get coerced:

{"@context": "http://schema.org/", "@type": "Book",
 "publisher": "asdf"}

becomes

{"@context": "http://schema.org/", "@type": "Book",
 "publisher": {"@type": "Thing", "name": "asdf"}}

This does feel like it moves the needle from vocabulary into ontology.

@azaroth42
Copy link
Contributor Author

On the call of 2018-09-07, the WG resolved to close this issue won't fix, with the same rationale as #7. The use cases should be discussed in the CG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants