DSpace 7.6 query for item or handle given a resourcepolicy policy_id

95 views
Skip to first unread message

amtuan...@gmail.com

unread,
Aug 23, 2023, 8:26:37 AM8/23/23
to DSpace Technical Support
Hi 

I need to run a query to get the item id or handle given a resourcepolicy policy_id. 

The resourcepolicy table has a dspace_object column, but it apparently identifies the resource policy itself.

Thanks,
Tuan

Jose Blanco

unread,
Aug 23, 2023, 10:11:47 AM8/23/23
to amtuan...@gmail.com, DSpace Technical Support
Hi Tuan,

In this table: resourcepolicy

dspace_object can be the id to the item or the collection or the
bitstream or the community, maybe I'm missing something else. For
items, rerource_type_id is 2.

So you could do this:

select dspace_object from resourcepolicy where resource_type_id = 2;

If you want the handles:

select handle from handle where resource_id in (select dspace_object
from resourcepolicy where resource_type_id = 2);

Hope this helps.
-Jose
> --
> All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
> ---
> 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 dspace-tech...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/062c2829-a4d6-4ef7-b3a3-eea0af738a48n%40googlegroups.com.

amtuan...@gmail.com

unread,
Aug 23, 2023, 11:34:08 AM8/23/23
to DSpace Technical Support
Thanks for the hint. It turns out the dspace_object is the id of the bitstream. I am able to complete the query. Many thanks!
Reply all
Reply to author
Forward
0 new messages