How to generate DRS URLs

29 views
Skip to first unread message

Padmini Chilappagari

unread,
Apr 8, 2021, 8:31:21 AM4/8/21
to ga4gh...@ga4gh.org
Hello there,

My name is Padmini Chilappagari and I am a Software Developer at ESAC,Inc. Our team develops web applications such as PDC (Proteomic Data Commons). 

We are working on generating DRS URLs for our data using the following API listed in the DRS Github Repo:

https://petstore.swagger.io/?url=https://raw.githubusercontent.com/uc-cdis/Indexd/master/openapis/swagger.yaml#/index/addEntry

Do you have any other information on how to generate DRS URLs?

For example, we have a manifest file: file.tsv and we would like to create a DRS entry and ultimately generate a DRS URL for it, could you please let us know how it's possible?


Thanks and regards,

Padmini Chilappagari,

Senior Software Developer,

ESAC Inc

Justin Clark-Casey

unread,
Apr 9, 2021, 1:24:35 PM4/9/21
to ga4gh...@ga4gh.org
Hi Padmini. I'm going to respond as no-one else has. However, I'm far from an expert - this may draw someone from the woodwork to correct/elaborate.

I'm unsure what you're trying to do in this API example but I'm going to presume you ultimately want to create DRS URIs, for example of the form
drs://drs.example.org/314159 where 314159 is an example DRS object ID.

You need to generate the DRS object IDs yourself. My assumption is that it's up to you how you do it - I've never seen any guidance for this.

For example, you could use could simply have an incrementing counter. Or you could create a random UUID. Or you could use a hash of the file content - for
example the SHA1 of your file.tsv. You might also have an an accession/ID from elsewhere that you could reuse if it conforms to the characters allowed in a DRS
object ID. I'd be quite interested to know what people out there do for this.

One you have your object ID you append it to your host (above drs.example.org) and hey presto, there's your DRS ID.

Best,

--
Justin Clark-Casey
EOSC Programme Manager
EMBL-EBI, TSI
> --
> You received this message because you are subscribed to the Google Groups "Cloud Work Stream" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ga4gh-cloud...@ga4gh.org <mailto:ga4gh-cloud...@ga4gh.org>.
> To view this discussion on the web visit
> https://groups.google.com/a/ga4gh.org/d/msgid/ga4gh-cloud/CAHkB%3DuexDr9TpKsj%3DjOXMsWTLANoLM99UVtxwAaXxvEPKvhjdg%40mail.gmail.com
> <https://groups.google.com/a/ga4gh.org/d/msgid/ga4gh-cloud/CAHkB%3DuexDr9TpKsj%3DjOXMsWTLANoLM99UVtxwAaXxvEPKvhjdg%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Justin Clark-Casey

unread,
Apr 9, 2021, 1:25:34 PM4/9/21
to ga4gh...@ga4gh.org
On 09/04/2021 18:24, Justin Clark-Casey wrote:
> Hi Padmini. I'm going to respond as no-one else has. However, I'm far from an expert - this may draw someone from the woodwork to correct/elaborate.
>
> I'm unsure what you're trying to do in this API example but I'm going to presume you ultimately want to create DRS URIs, for example of the form
> drs://drs.example.org/314159 where 314159 is an example DRS object ID.
>
> You need to generate the DRS object IDs yourself. My assumption is that it's up to you how you do it - I've never seen any guidance for this.
>
> For example, you could use could simply have an incrementing counter. Or you could create a random UUID. Or you could use a hash of the file content - for
> example the SHA1 of your file.tsv. You might also have an an accession/ID from elsewhere that you could reuse if it conforms to the characters allowed in a DRS
> object ID. I'd be quite interested to know what people out there do for this.
>
> One you have your object ID you append it to your host (above drs.example.org) and hey presto, there's your DRS ID.

DRS URL, I meant :)

Fore, Ian (NIH/NCI) [E]

unread,
Apr 9, 2021, 3:20:08 PM4/9/21
to Cloud Work Stream, Padmini Chilappagari
Hi Padmini,

Wondering exactly what you're trying to fix,  as DRS is already up and working on PDC in some fashion at least.  

Here's what I just found as I was working with DRS ids for PDC files as part of the Cancer Data Aggregator (CDA) testing. 
This Jupyter notebook shows some example of DRS ids for PDC files coming back from CDA.

We can take one of those ids and pass it to the Cancer Research Data Commons (CRDC) DRS API as follows
That will give you the json DRS response to where the file is.
To get a URL to download the file you would call the CRDC DRS API as follows. You will have to include your CRDC Access token in the HTTP header. 
The DRS clients in fasp-scripts would make all that easier. I'll look into adding a PDC example.

So - if your question was 'how do I get the URL once I have the DRS id" then what I've described above covers it.

But, if you want to do what Justin was describing below, create DRS URIs, then in your case it's already been done.  DRS URIs get created automatically when the PDC files are indexed by indexd.

I would suggest we follow up within CRDC between the PDC and Gen3 on this, to make sure you can do what you need for PDC purposes.

Cheers
Ian
Reply all
Reply to author
Forward
0 new messages