API to get the host dataverse

11 views
Skip to first unread message

Remmy Zen

unread,
Sep 29, 2021, 11:53:11 AM9/29/21
to Dataverse Users Community
Hi,

We want to structure our dataverses and datasets in a tree structure (root as parent, several dataverses as child of the root, some of these dataverses can have other dataverse as well, and datasets and files as the leaves of the tree).

When creating or editing a dataverse, we can see the host of dataverse information which is the parent of this dataverse as shown below. Is it possible to get this information through API?
Screenshot from 2021-09-29 23-48-16.png

Alternatively, there is a subtree filter in the search API such that only the subtree of this dataverse collection and all its children will be searched. Is it possible to limit the level? For example, I only want to see only the direct child (level = 1) of this dataverse.

Thank you.

Regards,

Remmy

Philip Durbin

unread,
Sep 30, 2021, 2:39:32 PM9/30/21
to dataverse...@googlegroups.com
Hi Remmy,

Good questions. Yes, it's possible to get at least the id of the host dataverse collection via API.

If you go to https://dataverse.harvard.edu/api/dataverses/open-source-at-harvard for example ("open-source-at-harvard" is the "alias" of the dataverse collection), you'll see that the "ownerId" is 1.

Given the id of the owner/parent, we can go to https://dataverse.harvard.edu/api/dataverses/1 to find that the name is "Harvard Dataverse".

For the direct children question, you're probably best off searching by parentId like this https://dataverse.harvard.edu/api/search?q=parentId:3035123

I hope this helps. Please keep the questions coming. And please feel free to open GitHub issues if the APIs aren't giving you what you want easily enough.

Thanks,

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-commu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/c7e300e9-7f1a-4173-aa55-589392b36443n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages