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

Parse Link headers #1

Open
bblfish opened this issue Mar 14, 2014 · 0 comments
Open

Parse Link headers #1

bblfish opened this issue Mar 14, 2014 · 0 comments

Comments

@bblfish
Copy link
Member

bblfish commented Mar 14, 2014

Does rdflib parse link headers? Probably not. If not then below is a Link header parser written by deiu. It should probably be added to rdflib.js so that the graph with the links can show them. Is there in fact one graph per request made? ( otherwise adding triples like that to a graph could end up confusing )

16:25 bblfish: I wrote a Link header parser in javascript: https://gist.github.com/deiu/9335803
16:26 bblfish: can it work with more than one link relation per Link?
16:27 deiu: Yes
16:27 bblfish: I mean deal with the following
16:27 bblfish: $ curl -I --cert ../eg/test-localhost.pem:test -k https://localhost:8443/2013/card
16:27 bblfish: HTTP/1.1 200 OK
16:27 bblfish: Access-Control-Allow-Origin: *
16:27 bblfish: Allow: OPTIONS, GET, HEAD
16:27 bblfish: Content-Type: text/turtle
16:27 bblfish: Accept-Patch: application/sparql-update
16:27 bblfish: Link: <card.acl>; rel=acl, <http://www.w3.org/ns/ldp#Resource>; rel=type
16:27 bblfish: Content-Length: 0
16:27 deiu: You do: var links = parseLinkHeader(xhr.getResponseHeader('Link'));
16:28 deiu: and then: links['acl']['href'] outputs card.ac
16:28 deiu: card.acl
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

No branches or pull requests

2 participants