Do you have the REST API enabled? The following endpoint will provide a dump of the hierarchy that is easy to parse.
https://demo.dspace.org/rest/hierarchy If that does not help, here are some SQL that might help. with recursive r_comm2coll as ( select community_id, collection_id from community2collection union select cm2cm.parent_comm_id as community_id, r.collection_id from r_comm2coll r inner join community2community cm2cm on cm2cm.child_comm_id = r.community_id ) select distinct commh.handle as CommHandle, collh.handle as CollHandle, ( select text_value from metadatavalue mv where mv.resource_id=commh.resource_id and mv.resource_type_id=4 and metadata_field_id = ( select metadata_field_id from metadatafieldregistry where element='title' and qualifier is null ) ) as CommName, ( select text_value from metadatavalue mv where mv.resource_id=collh.resource_id and mv.resource_type_id=3 and metadata_field_id = ( select metadata_field_id from metadatafieldregistry where element='title' and qualifier is null ) ) as CollName from handle commh inner join r_comm2coll on r_comm2coll.community_id=commh.resource_id and commh.resource_type_id=4 inner join handle collh on r_comm2coll.collection_id=collh.resource_id and collh.resource_type_id=3 order by CommHandle,CollHandle On Thu, Nov 16, 2017 at 12:03 PM, Stacy Pennington <[email protected]> wrote: > Does anyone out there have some useful PostgreSQL queries already written > for DSpace 6.2? > > I've found several sets of PostgreSQL queries that were useful for earlier > versions of DSpace, but most of them appear to be written between the > versions 1.8 and 4.x, and the database changes from the past few years, > particularly the UUID use, make many of them not work today. My attempts to > repair them and make them work for 6.2 haven't gone well. > > What I'm actually looking for is a query that would provide a hierarchical > list of communities, sub-communities, and collections in simple list, > probably with just 2-space character indention at each successive > sub-level, include the number of items at each level. Basically, think of > something like what you get when you click Browse > Communities & > Collections in the JSPUI interface but without the images and intro text of > each community/collection and with the number of items for each level. > > (Basically, we need this because we are trying to flatten and uncomplicate > our current DSpace topology, and we have over 500 collections, so getting > an overview or monitoring our progress is really difficult.) > > Before I dive into this and try to create one of these SQL queries on my > own, it seems like a good idea to see if anyone has already done it. > > Thanks. > > Stacy > > -- > You received this message because you are subscribed to the Google Groups > "DSpace Technical Support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/dspace-tech. > For more options, visit https://groups.google.com/d/optout. > -- Terry Brady Applications Programmer Analyst Georgetown University Library Information Technology https://github.com/terrywbrady/info 425-298-5498 (Seattle, WA) -- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/dspace-tech. For more options, visit https://groups.google.com/d/optout.
