How to retrieve collection name based on item?

ぐ巨炮叔叔 提交于 2019-12-12 01:24:25

问题


I am doing dspace search project. Here I have created seperate item page. Now I have one problem. I am not able to retrieve collection name in in which item appears. Collection2item displays only collection id.Please help.


回答1:


Savio, thank you for clarifying that you are in DSpace 5.

The following code appears to document the migration of community.name from DSpace 4 to DSpace 5.

https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V5.0_2014.09.26__DS-1582_Metadata_For_All_Objects.sql#L133-L141

DSpace 5 introduced "metadata for all objects" and collection.name appears to be stored as a metadatavalue of "title".




回答2:


The collection name is stored in the collection table. It is linked to the item table via item.owning_collection and collection2item.

select collection.name 
from collection 
inner join item on owning_collection=collection_id
where item_id=1


来源:https://stackoverflow.com/questions/31782971/how-to-retrieve-collection-name-based-on-item

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!