Skip to content
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

quick fix for Link header handling for json-ld #1125

Closed
wants to merge 4 commits into from

Conversation

datadavev
Copy link

Fixes RDFLib/rdflib-jsonld#85

Proposed Changes

  • Add support for handling Link header responses

PR is a minimal implementation to get rdflib-jsonld to work with schema.org remote context reference.

TBD:

  • Can multiple Link headers returned (e.g. to reference different content types)?
  • Do other RDF formats leverage the Link header in HTTP response is specific to JSON-LD?

@coveralls
Copy link

coveralls commented Jun 26, 2020

Coverage Status

Coverage decreased (-0.03%) to 75.762% when pulling 89989b7 on datadavev:issue_rdflib-jsonld_85 into c050f27 on RDFLib:master.

@ashleysommer
Copy link
Contributor

ashleysommer commented Aug 10, 2020

Hi @datadavev
Is the cgi import and empty <B> fix related to the json-ld link header fix? Looks like you might've pushed that commit into the wrong branch.

@datadavev
Copy link
Author

datadavev commented Aug 10, 2020

Hi @datadavev
Is the cgi import and empty <B> fix related to the json-ld link header fix? Looks like you might've pushed that commit into the wrong branch.

Ah, indeed - I'll adjust. Thanks

@nicholascar
Copy link
Member

Hi @datadavev, there are two issues with this PR:

  1. JSON-LD isn't yet in RDFlib core, although we hope it will be soon, so that this PR won't apply for many cases. If we were to pass it, it would need to do a better job of knowing that JSON-LD was enable, not just looking for the format "json-ld".
  2. Link headers in HTTP can be used for all kinds of things, e.g. description of related resources, not just redirects, so your Link header parsing function needs a lot more information to only get redirects.

Sorry but I'm going to have to close this. Please feel free to re-issue it after we've included JSON-LD in RDFlib core (Coming soon!) and after having a bit more of a go at parsing Link headers a bit more carefully.

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

Successfully merging this pull request may close these issues.

Schema.org moving from HTTP Content Negotiation to JSON-LD 1.1 "Link:" header for context file
4 participants