hbz / lobid-gnd

UI and API to the Integrated Authority File (Gemeinsame Normdatei, GND)
http://lobid.org/gnd
Eclipse Public License 2.0
24 stars 5 forks source link

Declare inbox and hub in link header #184

Closed acka47 closed 4 years ago

acka47 commented 5 years ago

We should do this on the staging system for now to be able to test https://github.com/hbz/skohub-pubsub/issues/7. For now, we must use local URLs, http://localhost:3000/inbox?target={target-URL} for the inbox and http://localhost:3000/hub for the hub. Example:

Link: <http://localhost:3000/inbox?target=http://d-nb.info/gnd/135539897>; rel="http://www.w3.org/ns/ldp#inbox"
Link: <http://localhost:3000/hub/>; rel="hub"
Link: <http://d-nb.info/gnd/135539897>; rel="self"

As one can see I am using the DNB URIs that identify the resource in the inbox link and the self link. I think this is the way to go but I am not 100% whether this is correct.

literarymachine commented 5 years ago

Links for the test setup:

Link: <https://test.skohub.io/inbox?target=http://test.lobid.org/gnd/118696432>; rel="http://www.w3.org/ns/ldp#inbox", 
      <https://test.skohub.io/hub>; rel="hub",
      <http://test.lobid.org/gnd/118696432>; rel="self"
fsteeg commented 5 years ago

Deployed to test:

curl -I http://test.lobid.org/gnd/100002617 curl -I http://test.lobid.org/gnd/100002617.json curl -I http://test.lobid.org/gnd/100002617.html curl -I http://test.lobid.org/gnd/100002617.rdf

HTTP/1.1 200 OK Link: <https://test.skohub.io/inbox?target=http://test.lobid.org/gnd/100002617>; rel=http://www.w3.org/ns/ldp#inbox, <https://test.skohub.io/hub>; rel=hub, <http://test.lobid.org/gnd/100002617>; rel=self

acka47 commented 5 years ago

I noticed that the quote are missing around the values of rel=. I think they are expected, see RFC 5988

fsteeg commented 5 years ago

I noticed that the quote are missing around the values of rel=. I think they are expected, see RFC 5988

Hm, I explicitly test for quotation marks, see https://github.com/hbz/lobid-gnd/commit/1965988d4df81ac06f2f71ce3f8a569449105edc#diff-7b6d18ce6977e12af82ab242d90349f0R55

It seems there is a newer RFC, see "Link Serialisation in HTTP Headers":

In other words, the following parameters are equivalent: x=y x="y"

So this might just be the way cURL (and others) display the value.

Assigning @literarymachine to verify in his client.

fsteeg commented 5 years ago

@acka47 I can't assign @literarymachine – should we add the skohub team to lobid-gnd? https://github.com/hbz/lobid-gnd/settings/collaboration

acka47 commented 5 years ago

Done that & assigned @literarymachine.

acka47 commented 4 years ago

Closing this as we are through with testing this, see https://github.com/hbz/lobid-resources/issues/986.