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