Re: ODP: ODP: Re: Replace hydra:Error with application/problem+json

2015-09-28 19:30 GMT+02:00 Dietrich Schulten <ds@escalon.de>:

> A json-ld file is json with a linked-data context. Without a context, the
> problem+json attributes are invisible to a json-ld processor. That is by
> specification,  "JSON keys that do not expand to an IRI
> <http://www.w3.org/TR/json-ld/#dfn-iri>, (...) are not Linked Data and
> thus ignored when processed."
>
Yep.

> The context can be linked in via a Link header or it can be embedded with
> @context, in which case the media type *must* be application/ld+json,
> otherwise the semantics of @context is undefined. In problem+json there is
> no @context attribute, and there is no RDF vocab yet which defines its
> attributes.
>
Aha. The fact that adhering to JSON-LD syntax without using
application/ld+json (or the mentioned Link header) is useless was unknown
to me until now.

> What do you have in mind when you say "rewrite so it is compatible"?
>
Rewrite the JSON in the specification so it's JSON-LD compatible. With
@context and everything.

> Trouble is that the problem+json attribute semantics has not yet been
> published in a way that can be mapped to RDF by a machine. There is a
> relax-ng schema, but unlike xml schema with id attributes, relax-ng cannot
> be re-used for RDF (afaik). Just stating that the rfc is also an RDF
> vocabulary is not sufficient, it must be published and the json-ld response
> must point to it somehow.
>
My thought was that is should be possible to embed this semantic in the
specification, by rewriting it so it also defined an RDF vocabulary and so
the JSON was JSON-LD compatible.

> The media types ld+json and problem+json are mutually exclusive, I am
> afraid there is no third way.
>
That's very sad, since using a more specific MIME type (as long as it's
standardized and widely adopted; which I espect problem+json to be) is
highly desirable. I thought having `@context` was enough. The best
compromise would be a Link header then, I guess?

-- 
Asbjørn Ulsberg           -=|=-        asbjorn@ulsberg.no
«He's a loathsome offensive brute, yet I can't look away»

Received on Monday, 28 September 2015 22:20:42 UTC