Dataverse file id, retrieving the JSON-LD citation via API

瀏覽次數:36 次
跳到第一則未讀訊息

Raman Prasad

未讀,
2018年4月25日 上午11:56:402018/4/25
收件者:Dataverse Users Community
Hi,

If I have a Dataverse file ID, what's the best way to determine the DOI via API?

My goal is to retrieve the JSON-LD metadata for a file's dataset--but I may not know the DOI to start.

Thanks,

Raman

Philip Durbin

未讀,
2018年4月25日 中午12:50:012018/4/25
收件者:dataverse...@googlegroups.com
Hi Raman!

Huh, the awful hack I originally posted to https://groups.google.com/d/msg/dataverse-community/VG6gTMEd_Ps/-Ot6cWBnAwAJ isn't working anymore.

I wrote that on April 9th and I'm not sure if Harvard Dataverse was running 4.8.5 or if we had upgraded to 4.8.6 already. I'm not sure what changed.

Can you please open a GitHub issue about wanting to derive the DOI (or Handle) from a dataset based on a file id? It's in the citation from the Search API but as a URL and it sounds like you just want the DOI.

Here's an even worse hack that prints "The DOI for file id 3040230 is doi:10.7910/DVN/TJCLKP"

#!/bin/sh
# https://dataverse.harvard.edu/file.xhtml?fileId=3040230
FILEID=3040230
FILE_SEARCH=`curl -s https://dataverse.harvard.edu/api/search?q=entityId:$FILEID | jq .`
DOI_URL=`echo $FILE_SEARCH | jq '.data.items[0].dataset_citation' | grep -o 'https://doi.*' | cut -d, -f1`
DOI=`echo $DOI_URL | sed 's/https:\/\/doi/doi:/' | sed 's/\.org\///'`
echo "The DOI for file id $FILEID is $DOI"

I hope this helps,

Phil

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/557877ac-d997-4f62-9de9-c5d954d63235%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Heppler, Michael

未讀,
2018年4月25日 下午1:15:112018/4/25
收件者:dataverse...@googlegroups.com
FYI, it looks like 4.8.6 went up to production and demo on April 4.

Hey, Raman!


On Wed, Apr 25, 2018 at 12:49 PM, Philip Durbin <philip...@harvard.edu> wrote:
Hi Raman!

Huh, the awful hack I originally posted to https://groups.google.com/d/msg/dataverse-community/VG6gTMEd_Ps/-Ot6cWBnAwAJ isn't working anymore.

I wrote that on April 9th and I'm not sure if Harvard Dataverse was running 4.8.5 or if we had upgraded to 4.8.6 already. I'm not sure what changed.

Can you please open a GitHub issue about wanting to derive the DOI (or Handle) from a dataset based on a file id? It's in the citation from the Search API but as a URL and it sounds like you just want the DOI.

Here's an even worse hack that prints "The DOI for file id 3040230 is doi:10.7910/DVN/TJCLKP"

#!/bin/sh
# https://dataverse.harvard.edu/file.xhtml?fileId=3040230
FILEID=3040230
FILE_SEARCH=`curl -s https://dataverse.harvard.edu/api/search?q=entityId:$FILEID | jq .`
DOI_URL=`echo $FILE_SEARCH | jq '.data.items[0].dataset_citation' | grep -o 'https://doi.*' | cut -d, -f1`
DOI=`echo $DOI_URL | sed 's/https:\/\/doi/doi:/' | sed 's/\.org\///'`
echo "The DOI for file id $FILEID is $DOI"

I hope this helps,

Phil
On Wed, Apr 25, 2018 at 11:56 AM, Raman Prasad <pra...@g.harvard.edu> wrote:
Hi,

If I have a Dataverse file ID, what's the best way to determine the DOI via API?

My goal is to retrieve the JSON-LD metadata for a file's dataset--but I may not know the DOI to start.

Thanks,

Raman

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.

Raman Prasad

未讀,
2018年4月25日 下午1:18:432018/4/25
收件者:Dataverse Users Community
Thanks, Phil!  The "worse" hack will definitely work.

I'll also open an issue.


On Wednesday, April 25, 2018 at 12:50:01 PM UTC-4, Philip Durbin wrote:
Hi Raman!

Huh, the awful hack I originally posted to https://groups.google.com/d/msg/dataverse-community/VG6gTMEd_Ps/-Ot6cWBnAwAJ isn't working anymore.

I wrote that on April 9th and I'm not sure if Harvard Dataverse was running 4.8.5 or if we had upgraded to 4.8.6 already. I'm not sure what changed.

Can you please open a GitHub issue about wanting to derive the DOI (or Handle) from a dataset based on a file id? It's in the citation from the Search API but as a URL and it sounds like you just want the DOI.

Here's an even worse hack that prints "The DOI for file id 3040230 is doi:10.7910/DVN/TJCLKP"

#!/bin/sh
# https://dataverse.harvard.edu/file.xhtml?fileId=3040230
FILEID=3040230
FILE_SEARCH=`curl -s https://dataverse.harvard.edu/api/search?q=entityId:$FILEID | jq .`
DOI_URL=`echo $FILE_SEARCH | jq '.data.items[0].dataset_citation' | grep -o 'https://doi.*' | cut -d, -f1`
DOI=`echo $DOI_URL | sed 's/https:\/\/doi/doi:/' | sed 's/\.org\///'`
echo "The DOI for file id $FILEID is $DOI"

I hope this helps,

Phil
On Wed, Apr 25, 2018 at 11:56 AM, Raman Prasad <pra...@g.harvard.edu> wrote:
Hi,

If I have a Dataverse file ID, what's the best way to determine the DOI via API?

My goal is to retrieve the JSON-LD metadata for a file's dataset--but I may not know the DOI to start.

Thanks,

Raman

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse...@googlegroups.com.

Philip Durbin

未讀,
2018年4月25日 下午1:22:442018/4/25
收件者:dataverse...@googlegroups.com

To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
回覆所有人
回覆作者
轉寄
0 則新訊息