-
Notifications
You must be signed in to change notification settings - Fork 47
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
Define conneg interaction with media types that have a profile param #261
Comments
I think the proposed HTTP header is Will this likely be solved by just establishing an order of precedence for profiles? In the case of multiple requests across protocols (e.g. HTTP header & URI query string arg) that which has been set by a human will override a machine request so |
Yes, sorry -- The issue is that there needs to be a rule to determine the precedence between the HTTP headers that can carry the same information. Within a single header, There are four options that I can see:
My personal opinion (not speaking as chair of or on behalf of the JSON-LD WG) is that Accept should take precedence as breaking existing systems is to be avoided whenever possible. |
I agree that in the event of two conflicting headers, the more established one should take precedence (so Accept over Accept-Profile) unless it’s more likely that one is a deliberate choice, the other a config artifact. Can we say that scheme selection in Accept headers is common or often used? Is it used elsewhere other than in JSON-LD? Knowledge of such practice (I don’t have it) will assist in determining sensible precedence. |
I too agree that it would make more sense to let @nicholascar wrote:
The use of the
I don't know about all media types, but of the RDF-relevant ones only JSON-LD (application/ld+json) specifies the use of a |
From the IETF submission I thought this mechanism was discussed (use of profile in Accept) and use of Accept-Profile chose instead. Should we be looking to bring JSON-LD into new, shared, mechanics of Accept-Profile rather than catering for it as a one-off? |
The W3C is responsible for the registration of application/ld+json and the JSON-LD WG could update it to give precedence to Accept-Schema, when there's an RFC for it. |
@azaroth42 to add additional use cases specific to JSON-LD here. |
From discussion at TPAC, adding JSON-LD relevant scenarios: Given the graph,
available at 1. Client has no preferencesThe server has some data (as per example above) and wants to make it available. The server must be able to do what it wants, in the case of no content negotiation preferences expressed by the client. It must be able to express the choice it has made, if any. It should be able to express a way to discover the other options for retrieval. Request: No additional headers. Response:
Status: This works today, using the 2. Client requests server-known contextThe client wants to have the same RDF data, but in an alternative context to change the representation to use the keys it knows. Request:
Response:
Status: This works today, using the 3. Client requests specification defined profileJSON-LD 1.0 defines several profiles for different forms of the data, such as the difference between compacted and expanded. Expanded JSON-LD does not have a context, all of the information needed to construct the triples is present in the data. Request
Response:
4. Client requests a server-known frameFrames allow the restructuring of the graph and the addition of default values if not present in the data instance. Frames have a context, and hence these are not orthogonal. Assuming a frame, with the URI Request:
Response:
5. Client requests profile with URI unknown to the serverThe client might put a URI in to the profile parameter that the server does not recognize. In this scenario, the server might choose to retrieve the representation from that URI and attempt to process it as a context or frame (currently distinguished via the This scenario resolves to scenarios 2 or 4, but with additional complexity for the server to complete the request. The server must be able to express that it did not attempt to dereference the URI, and instead delivered different data. 6. Client requests a profile that would change the predicates, without changing the semanticsAnd here I feel we leave the JSON-LD space and enter the Accept-Profile space. Clients might wish to retrieve the same resource, but using different ontologies rather than just different surface syntax via JSON-LD contexts. For example, instead of schema.org, the client might prefer FOAF or Dublin Core or CIDOC-CRM. This would be orthogonal to context/frame, as each ontology's representation might have several different contexts. It is also orthogonal to media type, as the triples could be retrieved in Turtle, RDF/XML or other serializations. Request:
Response:
|
Thanks for the explanation Rob. I'm starting to come to terms with the JSON-LD methods and motivations. Yes your characterisation of 6. seems to be correct to me. Perhaps we have an issue here with overloading of the term 'profile'? I think I see very different schema-like (JSON-LD) and information model-like (scenario 6.) use going on here. |
@azaroth42 Please see Issue #662. Does this cover the points here? |
Closing as #662 is closed and we feel we have addressed this. all JSON-LD profiling work v. Profile Conneg will be reviewed later. |
Some media types already have a profile parameter, such as JSON-LD. The profile negotiation deliverable should define how conflicts between it's syntax and profiles specified in the media type are handled.
For example, a server would need to deterministically handle:
(edited to fix header name)
The text was updated successfully, but these errors were encountered: