--
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.
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.
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.
--Philip Durbin
Software Developer for http://dataverse.org
http://www.iq.harvard.edu/people/philip-durbin
--
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/CABbxx8GEU99%3DOSF4EFpP1TUYyPx7Msk_T-0YePiCux0mYztfzw%40mail.gmail.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
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.
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.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsubscribe...@googlegroups.com.
To post to this group, send email to dataverse...@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.
--Philip Durbin
Software Developer for http://dataverse.org
http://www.iq.harvard.edu/people/philip-durbin
--
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/c08a6101-4738-47a7-bf6c-ae93b43efac0%40googlegroups.com.