On Wed, Mar 23, 2011 at 21:22, Jimmy Ghaphery <[email protected]> wrote:
> Currently I'm going through 4 tables
> (resourcepolicy->bundle2bitstream->item2bundle->handle/metadatavalue)

Yes, from my own experience, direct queries can get very complex.
This is a price we pay for the great flexibility. Especially the
metadatavalue table stores a lot of useful stuff that requires complex
queries to get to. OTOH. if DSpace had a fixed schema for metadata,
you'd be restricted to just one schema.

> resource_id.resourcepolicy = bitstream_id.bundle2bitstream
> bundle_id.bundle2bitstream = bundle_id.item2bundle
> item_id.item2bundle = item_id.metadatavalue = resource_id.handle

For some reason, you have it reversed. Correct SQL would be something like
... WHERE resourcepolicy.resource_id = bundle2bitstream.bitstream_id AND ...

There was a great graphics of the dspace database schema on the old
wiki but it seems lost now (not even at archive.org). Here's the
useless low-resolution version:
https://wiki.duraspace.org/display/DSPACE/DSpace+2.0+Requirements+and+Issues
Now you have to do with this one:
https://wiki.duraspace.org/display/DSDOC/Storage+Layer#StorageLayer-RDBMS%2FDatabaseStructure
I have printed the former and use it - the great thing about it is
that it displays logical grouping of tables.

Does anyone have a link to the SVG?

> Is there an easier way? Any handy sql to pull up handle from resource_id
> field in the resourcepolicy table would get me a good part of the way
> there......

I don't have the printed schema at hand, otherwise I would check it for you.
Even if it seems complex, you're probably doing it right :(

Regards,
~~helix84

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to