Skip to content

how to use the frame and framed profiles? #133

@VladimirAlexiev

Description

@VladimirAlexiev

#132 cites the text of two specs regarding frame and framed profiles:

https://www.w3.org/TR/json-ld11-framing/#iana-considerations:

http://www.w3.org/ns/json-ld#framed
To specify a JSON-LD Frame.
The http://www.w3.org/ns/json-ld#framed SHOULD be used when serving and requesting a JSON-LD frame document.

https://w3c.github.io/json-ld-syntax/#application-ld-json

This specification defines six values for the profile parameter.
http://www.w3.org/ns/json-ld#frame
To request or specify a JSON-LD frame document.
http://www.w3.org/ns/json-ld#framed
To request or specify framed JSON-LD document form.

The third spec https://w3c.github.io/json-ld-api/, as far as I can see, does not specify where the frame and context parameters come from in HTTP exchange.


So it would be nice to give some examples on correct use of HTTP headers regarding the use of specific context and frame.
From what I could glean by googling (please comment whether that's correct!)

REQUEST

I1. To request a particular profile/context for jsonld,
according to https://www.rubydoc.info/gems/triannon#get-a-particular-anno:

Accept: application/ld+json; profile="http://www.w3.org/ns/oa-context-20130208.json"
Accept: application/ld+json; profile="http://iiif.io/api/presentation/2/context.json"

I2. To request a particular context for "jsonld as json" (note: type pertains to the context document, not the payload document):

Accept: application/json
Link: http://www.w3.org/ns/oa.json; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"

I3. To request jsonld with a particular context and frame

Accept: application/ld+json; profile="http://www.w3.org/ns/json-ld#framed"
Link: http://example.org/context.jsonld; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
Link: http://example.org/frame.jsonld;   rel="http://www.w3.org/ns/json-ld#frame";   type="application/ld+json"

RESPONSE

O1. jsonld as json with a particular context:

Content-Type: application/json
Link: https://example.org/context.jsonld; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"

O2. jsonld that is framed and uses a particular context (the Links are redundant)

Content-Type: application/ld+json; profile="http://www.w3.org/ns/json-ld#framed"
Link: http://example.org/context.jsonld; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
Link: http://example.org/frame.jsonld;   rel="http://www.w3.org/ns/json-ld#frame";   type="application/ld+json"

O3. jsonld that uses a particular context,
according to https://iiif.io/api/presentation/3.0/#63-responses:

Content-Type: application/ld+json;profile="http://iiif.io/api/presentation/3/context.json"

Questions

  • Q1. Is profile used to specify the kind of jsonld (eg framed, compacted, expanded),
    • or the context (i.e. are the iiif and triannon examples wrong?)
  • Q2. Can one use multiple Link headers as per I3, O2?
  • Q3. (!) How can one specify which version to fetch, 1.0 or 1.1? The version may have significant performance impact, at least for Java-based repos, because jsonld-java (old) supports only 1.0 but is 4.6x faster than titanium (new) that supports 1.1: JSON-LD 1.1 support eclipse-rdf4j/rdf4j#3654

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions