ro-crate
ro-crate copied to clipboard
Content negotiation for RO-Crate identifier
Describe the bug Doing:
curl -sH "Accept:application/ld+json" -L https://w3id.org/ro/crate/1.1
Returns HTML instead of the contents of https://www.researchobject.org/ro-crate/1.1/ro-crate-metadata.json , which should be the right response in this case.
Also, I think that
curl -sH "Accept:application/ld+json" -L https://w3id.org/ro/crate
Should resolve to the latest official version of the RO-Crate spec
Suggested fix Fix the content negotiation in w3id.org.
Maybe related to #228
@stain says that https://github.com/perma-id/w3id.org/blob/master/ro/crate/.htaccess does not have content negotiation enabled
Now that we have Profile Crates in 1.2-DRAFT and also a historical 1.1 RO-Crate we should add this to the w3id so we comply with our own #296 on retrieval!
Note that 1.0 does not have an RO-Crate representation of itself and neither do we have a https://www.researchobject.org/ro-crate/ro-crate-metadata.json so this would for now only be on the versioned URIs. Not sure how to do the latest one for https://w3id.org/ro/crate -- by symlink perhaps? For 1.2-DRAFT (1.2 when released) it's a Detached Crate so it does not matter where it's served from.
@dgarijo Would you be able to add this content negotiation to w3id?
@stain I have noticed that the jsonld files are inconsistent:
- Version 1.0 has a file
https://www.researchobject.org/ro-crate/1.0/ro-crate-metadata.jsonld - Version 1.1 and onward have
https://www.researchobject.org/ro-crate/1.1/ro-crate-metadata.json(theldversion gives an error, it's an empty file, maybe some sort of symlink, but does not work for content negotiation).
Can this be made consistent? I will point for now to the json representation. But I believe it should probably be jsonld
Also, version 0.2 and 0.1.0 (why is it not 0.1?) do not have a jsonld file.
Now curl -sH "Accept:application/ld+json" -L https://w3id.org/ro/crate/1.1 works as intended. With the caveats stated above (it does not work for 1.0 and before)
the
jsonldfiles are inconsistent
This is because the spec changed between 1.0 and 1.1 about the naming of the metadata file. 1.0 requires ro-crate-metadata.jsonld, 1.1+ requires ro-crate-metadata.json - so I think choosing json will be more forward-compatible.
Is it possible to add a special line directing requests for 1.0 to the jsonld instead?
it is possible, but maybe to make it cleaner we can just add a json file in the 1.0 spec mirroring the jsonld file. That makes maintenance easier in my opinion.
I think the redirect should go to the jsonld file so it has the correct content-type: application/ld+json from Github pages - there should be symlinks for 1.1 and 1.2, but the reverse symlink is not needed for 1.0, as it does not have the ro-crate-metadata.json specified.
Also, version 0.2 and 0.1.0 (why is it not 0.1?) do not have a jsonld file.
These are 0.x so can remain broken in that respect :) It was not 0.1 as we used semantic versioning on the first one, but then realised we don't want to update permalinks for every typo or small JSON-LD bug.
Ok, I will wait until @elichad makes the JSON-LD available in 1.1+ (https://www.researchobject.org/ro-crate/1.1/ro-crate-metadata.jsonld does not return the right json-ld file). Please ping me and I will do the change
@dgarijo would adding Options +FollowSymLinks to the .htaccess resolve the problem? Like in https://github.com/perma-id/w3id.org/blob/master/.htaccess
Actually, I think this is a problem with the ro-crate-metadata.json symlink in 1.1 - neither GitHub nor my file system recognises it as a symlink. The one in 1.2-DRAFT seems to work:
$ curl -sH "Accept:application/ld+json" -L https://w3id.org/ro/crate/1.1/crate
ro-crate-metadata.json
$ curl -sH "Accept:application/ld+json" -L https://w3id.org/ro/crate/1.2-DRAFT/crate
{
"@context": "https://w3id.org/ro/crate/1.2-DRAFT/context",
"@graph": [...
(tested with /crate as this works with the -DRAFT suffix on the version)
I will fix this symlink and see if that resolves the issue
All right, I will wait then
El mar., 17 sept. 2024 7:09 p. m., Eli Chadwick @.***> escribió:
Actually, I think this is a problem with the ro-crate-metadata.json symlink in 1.1 - neither GitHub nor my file system recognises it as a symlink. The one in 1.2-DRAFT seems to work:
$ curl -sH "Accept:application/ld+json" -L https://w3id.org/ro/crate/1.1/crate ro-crate-metadata.json https://w3id.org/ro/crate/1.1/cratero-crate-metadata.json
$ curl -sH "Accept:application/ld+json" -L https://w3id.org/ro/crate/1.2-DRAFT/crate { @.": "https://w3id.org/ro/crate/1.2-DRAFT/context", @.": [...
(tested with /crate as this works with the -DRAFT suffix on the version)
I will fix this symlink and see if that resolves the issue
— Reply to this email directly, view it on GitHub https://github.com/ResearchObject/ro-crate/issues/297#issuecomment-2356469638, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALTIGSLB2YQ2XPI3PNZKZTZXBO3RAVCNFSM6AAAAABHONRND6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJWGQ3DSNRTHA . You are receiving this because you were mentioned.Message ID: @.***>
#361 should fix it on the website side.
@dgarijo when you update the .htaccess can you ensure it goes to
https://www.researchobject.org/ro-crate/specification/$1/ro-crate-metadata.jsonld
not
https://www.researchobject.org/ro-crate/$1/ro-crate-metadata.jsonld
for forward compatibility
@stain @elichad: I have done this change: https://github.com/perma-id/w3id.org/pull/4434/files per your request.
I checked and curl -sH "Accept:application/ld+json" -L https://w3id.org/ro/crate/1.1 provides the right serialization