Pull community name and collection name from postgres DB

40 views
Skip to first unread message

Kim, Joshua

unread,
Apr 11, 2024, 5:45:03 PM4/11/24
to dspac...@googlegroups.com
Hello,

We have a long list of items which need to show a hierarchy (under which community name and collection name). How can I pull the data by using  Postgres DB? I am looking at the DB schema, but I am confused. Or the other way? Can anyone help me out with this?



University of Delaware

Joshua Kim

Library, Museums and Press

DSpace Technical Support

unread,
Apr 22, 2024, 6:31:53 PM4/22/24
to DSpace Technical Support
Hi Joshua,

Items can belong to several Collections, so there may not always be a single hierarchy.  But each Item will have an "owning collection".  If you are using DSpace 7, you can get this information from the REST API itself:


That's the easiest way to gather this information.  It's also possible to use the database, but it'd be a complex query.  You'd need to look closer at the "collection2item" (maps collections to items) and "community2collection" and "community2community" tables, as those contain the hierarchy between these objects.

Tim

Reply all
Reply to author
Forward
0 new messages