« Example of a dspace item with more than 1 asset | Main | sql to pull relation metadata »

Pulling handles and bitstreams from dspace & Handles with no bitstreams

I used the sql below to pull pull the bitstream data

[silvi003@strip3 ~]$ cat asset_dump.sql
 select handle.handle, bitstream.name,  bitstream.sequence_id , bitstream.internal_id 
    from handle,item2bundle,bitstream,bundle2bitstream, item where
    handle.resource_id = item2bundle.item_id AND  handle.resource_type_id=2 AND item2bundle.bundle_id=bundle2bitstream.bundle_id AND
    bundle2bitstream.bitstream_id = bitstream.bitstream_id AND bitstream.deleted='f'  AND handle.resource_id=item.item_id AND 
    item.withdrawn='f' order by handle::text::integer;

I then filtered the license.txt bitstreams with:

psql -U dspace_sr dspace_sr < asset_dump.sql | grep -v license.txt > bitstreams.dump

To pull all the live the handles of live items

select handle from handle, item where handle.resource_type_id=2 AND handle.resource_id=item.item_id AND item.withdrawn='f'  order by 
handle::text::integer;

Some items do not have assets

I found 24 of the 44257 handles that have no asset associated with it. These handles are:
7816
7841
9351
9370
9682
9823
9920
10059
10353
19505
20042
21179
21327
21471
25360
25800
28566
44158
44165
44795
44822
48905
51903
61520

If you look in AgEcon:

http://ageconsearch.umn.edu/handle/61520

You find the message:

Files in This Item:

There are no files associated with this item.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)