hbz / lobid

Linking Open Bibliographic Data
https://lobid.org/
Eclipse Public License 2.0
15 stars 4 forks source link

Support content negotiation for /team profiles #359

Closed acka47 closed 4 years ago

acka47 commented 6 years ago

We already support it for /resources and /organisations see e.g. curl -i -H "Accept: Application/ld+json" http://lobid.org/organisations/DE-605. It doens't work for our foaf profiles, though see e.g. curl -i -H "Accept: Application/ld+json" http://lobid.org/team/ap#!

dr0i commented 6 years ago

Maybe these are even not valid foaf:profile because they use mostly schema.org?

dr0i commented 4 years ago

Did this:

RewriteCond %{HTTP_ACCEPT} application/ld+json RewriteCond %{REQUEST_URI} !(.json) RewriteRule ^/team/(.)(?!json) /team/$1.json [L,P] RewriteRule ^/team$ /team.json [L,P]

Have a look @acka47 @fsteeg.

acka47 commented 4 years ago

Doesn't work for me. $ curl -i -H "Accept: Application/ld+json" http://lobid.org/team/ap#! still gives back HTML only.

fsteeg commented 4 years ago

With a lowercase application it works:

$ curl -i -H "Accept: application/ld+json" http://lobid.org/team/ap#!

But:

"All media type values, subtype values, and parameter names as defined are case-insensitive." (https://tools.ietf.org/html/rfc2045)

dr0i commented 4 years ago

Right! Added an [NC] to the end of the rewriteCond to make it case insensitive. Please check agian.

acka47 commented 4 years ago

+1