Since DSpace 5, all DSpace objects (bitstream, bundle, item, collection, community, site, group, eperson) can have metadata (in DSpace 4 and earlier, this applied only to items). The advantage is that such metadata can have a flexible schema, which can be changed dynamically (e.g. from the administration web interface), without altering the underlying database schema (DDL). This will allow an easy implementation of future changes like:

All metadata has the following form: namespace.element.qualifier = value

This page outlines the changes to the database schema between DSpace 4 and DSpace 5 that reflect this change. The terms object, resource and entity are used interchangeably.

Changes

A consequence of the implementation of Metadata on all DSpace objects is that most entity (e.g. bitstream, eperson, ...) attributes (e.g. ) moved into the metadatavalue table.
e.g.:

SELECT lastname FROM eperson;

is now:

SELECT text_value FROM metadatavalue
WHERE metadata_field_id = (
  SELECT metadata_field_id
  FROM metadatafieldregistry mfr, metadataschemaregistry msr
  WHERE mfr.metadata_schema_id = msr.metadata_schema_id
  AND short_id = 'eperson'
  AND element = 'lastname'
  AND qualifier IS NULL
);

Column names like item_id or community_id have been mostly replaced with the tuple (resource_idresource_type_id) where resource_type_id is a constant specifying object type:

constantobject type
0bitstream
1bundle
2item
3collection
4community
5site
6group
7eperson

 

 

SELECT text_value FROM metadatavalue
JOIN handle as h ON h.resource_id = metadatavalue.dspace_object_id
WHERE metadata_field_id = (
  SELECT metadata_field_id
  FROM metadatafieldregistry mfr, metadataschemaregistry msr
  WHERE mfr.metadata_schema_id = msr.metadata_schema_id
  AND short_id = 'dc'
  AND element = 'title'
  AND qualifier IS NULL
)
AND resource_type_id=2;

 

Example change

Example eperson table in DSpace 4 (simplified to show only relevant parts):

eperson_idfirstnamelastname
1001JohnSmith
1002JaneDoe

 

Example eperson and metadatavalue tables in DSpace 5 (simplified to show only relevant parts):

eperson:

eperson_id
1001
1002

metadatavalue:

resource_type_idresource_idmetadata_field_idtext_value
71001123John
71001124Smith
71002123Jane
71002124Doe

See also

Relevant DB schema changes: V5.0_2014.09.26__DS-1582_Metadata_For_All_Objects.sql

DSpace 5 DB schema: Storage Layer#RDBMS/DatabaseStructure