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

Content negotiation is not enabled for the profiles #72

Closed
dgarijo opened this issue May 6, 2024 · 11 comments
Closed

Content negotiation is not enabled for the profiles #72

dgarijo opened this issue May 6, 2024 · 11 comments

Comments

@dgarijo
Copy link
Contributor

dgarijo commented May 6, 2024

All profiles should resolve, at least to their context file:

curl -sH "Accept:application/ld+json" -L https://w3id.org/ro/wfrun/provenance

returns just HTML, which is not ideal

@jmfernandez
Copy link
Contributor

I guess it is partially mimicking what it is done with RO-Crate . Both for RO-Crate 1.1 and any of the profiles, their permalinks (https://w3id.org/ro/crate/1.1 and for example https://w3id.org/ro/wfrun/provenance/0.4 ) are resolving to the human readable documentation and they have to be used in conformsTo.

But for JSON-LD context matters RO-Crate 1.1 has https://w3id.org/ro/crate/1.1/context , meanwhile WorkflowRun profiles have a complementary context https://w3id.org/ro/terms/workflow-run (which is only needed for very few terms which do not appear in RO-Crate 1.1 context)

@dgarijo
Copy link
Contributor Author

dgarijo commented May 6, 2024 via email

@jmfernandez
Copy link
Contributor

As w3id.org relies on an Apache reverse proxy being set up for each one of the cases, it might be technically feasible to perform it just tweaking https://github.com/perma-id/w3id.org/blob/master/ro/.htaccess inspired in this StackOverflow example https://superuser.com/a/858867

@simleo
Copy link
Collaborator

simleo commented May 7, 2024

We should make it resolvable with content negotiation. It's not hard to do.

Can you please take care of this, @dgarijo? Then it would be great if you explained what you have done, for the benefit of everyone else.

@dgarijo
Copy link
Contributor Author

dgarijo commented May 7, 2024 via email

@simleo
Copy link
Collaborator

simleo commented May 7, 2024

The context is the same for all three profiles, it's at https://w3id.org/ro/terms/workflow-run.

$ curl -sH "accept:application/ld+json" -L https://w3id.org/ro/terms/workflow-run
{
    "@context": [
        "https://w3id.org/ro/crate/1.1/context",
        {
            "ParameterConnection": "https://w3id.org/ro/terms/workflow-run#ParameterConnection",
            "ContainerImage": "https://w3id.org/ro/terms/workflow-run#ContainerImage",
            "DockerImage": "https://w3id.org/ro/terms/workflow-run#DockerImage",
            "SIFImage": "https://w3id.org/ro/terms/workflow-run#SIFImage",
            "connection": "https://w3id.org/ro/terms/workflow-run#connection",
            "sourceParameter": "https://w3id.org/ro/terms/workflow-run#sourceParameter",
            "targetParameter": "https://w3id.org/ro/terms/workflow-run#targetParameter",
            "md5": "https://w3id.org/ro/terms/workflow-run#md5",
            "sha1": "https://w3id.org/ro/terms/workflow-run#sha1",
            "sha256": "https://w3id.org/ro/terms/workflow-run#sha256",
            "sha512": "https://w3id.org/ro/terms/workflow-run#sha512",
            "environment": "https://w3id.org/ro/terms/workflow-run#environment",
            "registry": "https://w3id.org/ro/terms/workflow-run#registry",
            "tag": "https://w3id.org/ro/terms/workflow-run#tag",
            "containerImage": "https://w3id.org/ro/terms/workflow-run#containerImage"
        }
    ]
}

@elichad
Copy link
Contributor

elichad commented May 23, 2024

(from WRROC meeting) @dgarijo you can work on this now that #73 is merged

@dgarijo
Copy link
Contributor Author

dgarijo commented May 23, 2024

All right, I will try to push this ASAP (I am still running late on urgent tasks, sorry)

@dgarijo
Copy link
Contributor Author

dgarijo commented May 29, 2024

This is now done

@dgarijo dgarijo closed this as completed May 29, 2024
@dgarijo
Copy link
Contributor Author

dgarijo commented May 29, 2024

Enabled in the latest version only:

curl -sH "Accept:application/ld+json" -L https://w3id.org/ro/wfrun/provenance/0.5-DRAFT

@stain
Copy link
Contributor

stain commented Jun 25, 2024

See also perma-id/w3id.org#4215 adding latest version, e.g.

curl -sH "Accept:application/ld+json" -L https://w3id.org/ro/wfrun/provenance

This now redirects to https://www.researchobject.org/workflow-run-crate/profiles/provenance_run_crate/ro-crate-metadata.jsonld which comes back with content-type: application/ld+json -- it's a double symlink:

So on a release of 0.6 we only need to update those 3 symlinks (and of course version number etc. within the JSON-LD)

btw,
Within the JSON-LD of the profile crate itself I added to the @context:

"@base"	"https://www.researchobject.org/workflow-run-crate/profiles/0.5/process_run_crate/"

This mean that its hasPart e.g. about example1/ would resolve to the versioned https://www.researchobject.org/workflow-run-crate/profiles/0.5/process_run_crate/example1/ and perhaps more crucially so that the version-less profile crate is, triple by triple, the same crate as the versioned crate.

Alternatively we could make it into a Detached Crate and use absolute URIs throughout. It would just mean a bigger search-replace on update. (I use sed -i s/0.5-DRAFT/0.5/g)

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

5 participants