-
Notifications
You must be signed in to change notification settings - Fork 152
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
embedded @context triple lost in toRDF processing #540
Comments
JSON-LD |
@elf-pavlik thank you for the explanation. In this particular API, the IRI of the As a corollary, an |
I agree with Elf's answer, but not your conclusions. A reference to the context document is necessary to understand the mapping between the JSON representation and the triples it encodes. There are two ways to link the context, either with the link header described in section 6.8 or with the The registered media-type is definitely #521 is just to clarify in the text of the spec that scoped contexts are unique per mapped term, not per URI, and thus two different mappings of the same class with a different JSON term can have two different context definitions. This is a possible solution to (IIIF/api#1195). Scoped contexts also solve the problem of |
You understand that the problem we face is that it is not possible to round trip the expected serialization format with an embedded |
Sure. The same triples could be mapped to different JSON by different contexts. It's not a property of the resource, it's a function of the serialization. For ease of use and to ensure that the JSON can be treated as a document, not only an online transaction, it is embedded within the representation. |
Since The main focus here is with the service nodes that currently require embedded [1] https://www.w3.org/TR/json-ld/#interpreting-json-as-json-ld |
I'm unclear on what the embedded context is being used for. You say the If you need to provide custom per-"service" context information the in-progress JSON-LD 1.1 scoped contexts feature might be of use in the future. It would allow you to have a single top-level context document that could provide custom per- |
@davidlehn see this. I completely agree that Yet, another solid rationale for not including embedded service |
My apologies, I wrote flattened while I should have write compacted (already edited my initial comment). As we see in https://www.w3.org/TR/json-ld/#iana-considerations content negotiation could include
If you want to get 'back out' JSON-LD compacted with particular context, you have to provide that particular context to the compaction function. The example in the playground seems to use the same |
To reiterate, the primary considerations for JSON/JSON-LD API specifiers on how to define
The language of 6.8 "Please note that JSON-LD documents served with the application/ld+json media type must have all context information, including references to external contexts, within the body of the document" is imo, questionable.
The gist shows that if a compacted document that has an |
If you talk about gist from your initial comment, when you select compacted tab in the bottom, you have choice on the right to paste the value for
Expanded form has no context information and it includes that no information within the body of the document. If document has compacted form (or any of embedded documents undergone compaction), then they have context information and for As for API related comments, I think that more general discussion might fit better venue like https://www.w3.org/community/hydra/ IMO JSON based API should define some |
Have you looked at the referenced test? If an I agree that this is not the proper forum to be discussing API related issues. Nonetheless, section 6.8 of the core spec is significant to the general point that I need to make about how One additional aspect that you address is related to performance. Including Thus the principle mechanism where a service is identified with many duplicate |
As you quoted, the spec states in https://www.w3.org/TR/json-ld/#interpreting-json-as-json-ld
I does NOT state anything like "not allowed for
AFAIK none of JSON-LD specs puts any restrictions on caching the external context document, I think implementations should follow standard HTTP caching practices.
I don't know Java and find it hard to make sense out of that test. Looking at:
I see that compaction function requires JSON-LD document and the context to use in compaction as separate argument. If provided JSON-LD document had some
Once again, if the input document has some |
If the
Can an expanded document be served with [1] https://github.com/jsonld-java/jsonld-java/blob/master/core/src/main/java/com/github/jsonldjava/core/JsonLdApi.java#L194-L195 |
This happens because source document lacks
We can see it in expanded form tab in playground (just one statement left). |
RE: processor performance considerations of embedded While HTTP caching will typically assist with large payloads, the client side issue with {
"@context": [{"root_context": "value"},{"embedded_context": "value"}]
} This improves compacted JSON-LD deserialization (i.e. using expansion) performance exponentially. |
To the original issue, that I propose to close the issue, |
I agree with the most recent suggestion by @azaroth42 (I do not think that this is a real bug. I would close as "can not reproduce".) |
As shown in this gist, embedded
@context
triples are lost when processing from JSON-LD to RDF.Is this expected or rather a consequence of the special characteristics of the
@context
keyword for from JSON-LD processors?One solution would be to map only the embedded
@context
(s) to a property IRI that would be recognizable for fromRDF processors to deserialize, similar to@type
and rdf:type, or alias a different keyword for this embedded@context
functionality that would have a corresponding property IRI.Possibly relates to #521
The text was updated successfully, but these errors were encountered: