ResearchObject / workflow-run-crate

Workflow Run RO-Crate profile
https://www.researchobject.org/workflow-run-crate/
Apache License 2.0
8 stars 9 forks source link

Content negotiation is not enabled for the profiles #72

Closed dgarijo closed 4 months ago

dgarijo commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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

El lun., 6 may. 2024 8:11 p. m., José María Fernández < @.***> escribió:

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)

— Reply to this email directly, view it on GitHub https://github.com/ResearchObject/workflow-run-crate/issues/72#issuecomment-2096626786, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALTIGSC6QJDRHUTLWPAOJ3ZA7BTJAVCNFSM6AAAAABHJMABAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJWGYZDMNZYGY . You are receiving this because you authored the thread.Message ID: @.***>

jmfernandez commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

Are there any machine readable context files associated with the profiles? If so I can do the content negotiation

El mar., 7 may. 2024 9:20 a. m., Simone Leo @.***> escribió:

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

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

— Reply to this email directly, view it on GitHub https://github.com/ResearchObject/workflow-run-crate/issues/72#issuecomment-2097618429, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALTIGSTSYDS7OPGZSZWRZDZBB6EHAVCNFSM6AAAAABHJMABAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJXGYYTQNBSHE . You are receiving this because you were mentioned.Message ID: @.***>

simleo commented 4 months ago

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 commented 4 months ago

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

dgarijo commented 4 months ago

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

dgarijo commented 4 months ago

This is now done

dgarijo commented 4 months ago

Enabled in the latest version only:

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

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)