seek4science / seek

For finding, sharing and exchanging Data, Models, Simulations and Processes in Science.
http://www.seek4science.org
BSD 3-Clause "New" or "Revised" License
75 stars 52 forks source link

descriptor_type empty for Scipion workflow type. #1955

Open pconesa opened 2 months ago

pconesa commented 2 months ago

Hi, I'm trying to use the API to get the files described by entry 599 or other similar ones.

When requesting https://workflowhub.eu/ga4gh/trs/v2/tools/599/versions

I'm not getting the type:

[
    {
        "id": "1",
        "url": "https://workflowhub.eu/workflows/599?version=1",
        "name": "Version 1",
        "author": [],
        "descriptor_type": []
    },
    {
        "id": "2",
        "url": "https://workflowhub.eu/workflows/599?version=2",
        "name": "Version 2",
        "author": [],
        "descriptor_type": []
    }
]

Which is needed by the API to get the files later as described in the documentation:

/tools/{id}/versions/{version_id}/{type}/files

Is this the way to get the files when workflow type is Scipion or other than : GALAXY CWL ... (seems to be a short list of valid ones?)

fbacall commented 2 months ago

Yeah, TRS currently has a hard-coded enum of acceptable workflow types: https://github.com/ga4gh/tool-registry-service-schemas/blob/develop/openapi/openapi.yaml#L730-L740

Although there is an open issue about how to extend this: https://github.com/ga4gh/tool-registry-service-schemas/issues/215

You might be able to do what you want with the regular Git API: https://workflowhub.eu/workflows/599/git/2/download/workflow_ceitec_layer1.json.template

where 599 is your workflow ID, 2 is the version number, and workflow_ceitec_layer1.json.template is the file path to download.

pconesa commented 2 months ago

Thanks, how can I get the list of files for 599 entry without knowing them?

fbacall commented 2 months ago

There's a "tree" endpoint also:

curl -H "Accept: application/json" https://workflowhub.eu/workflows/599/git/2/tree

(documentation for these endpoints coming soon™️)

pconesa commented 2 months ago

Thanks, got it! I think I can reach the files this way. Justfor you yo know.... our plan is for Scipion "python workflow engine" list workflows from workflowhub of type Scipion.

Currently, I think it is not possible to filter by Type "Scipion"?

I managed to filter by organization. So far if fine, we will use :

https://workflowhub.eu/ga4gh/trs/v2/tools?organization=Scipion CNB

Then we'll use the git endpoint to get the file we want

fbacall commented 2 months ago

You can get a JSON response from the regular index page (with any filters etc. applied):

curl -H "Accept: application/json" https://workflowhub.eu/workflows?filter%5Bworkflow_type%5D=scipion