Skip to content

myrho/scape-platform-datamodel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

SCAPE Data transfer objects
===========================
This is the implementation of the Scape Digital Object Model, for exchanging data in the SCAPE platform. It is built on top of various metadata standards like textmd, NISO/MIX and PREMIS.

                +-----------------------+
                |  Intellectual Entity  |
                +-----------------------+
                1/                    \1
                /                      \
              1/                        \*
     +--------------+            +------------------+
     |   Desc. MD   |            |  Representation  |
     +--------------+            +------------------+
                                 1/                \1
                                 /                  \
                               1/                    \*
                       +-----------------+      +----------+
                       |  Adm. Metadata  |      |   File   |
                       +-----------------+      +----------+
                                                          \1
                                                           \
                                                            \*
                                                       +-------------+
                                                       |  Bitstream  |
                                                       +-------------+


Immutability & Builders
=======================
All objects are immutable and are constructed using their respective inner Builder classes, and allow for method chaining.

    	IntellectualEntity entity = new IntellectualEntity.Builder()
    		.identifier(new Identifier("minimal-1"))
    		.descriptive(TestUtil.createMinimalDC())
    		.build();

Deep Copying
============
All copies should be deep copy for thread safety issues.

In order to get a copy of an Object you can either create a new Builder from it's respective outer class,
or employ the Utility class CopyUtil to get a plain deep copy without the Builder:

    	IntellectualEntity orig = new IntellectualEntity.Builder()
    		.identifier(new Identifier("minimal-1"))
    		.descriptive(TestUtil.createMinimalDC())
    		.build();

		IntellectualEntity copy1=new IntellectualEntity.Builder(orig)
			.identifier(new Identifier("copy-1"))
			.build();

		IntellectualEntity copy2 = CopyUtil.deepCopy(IntellectualEntity.class, orig);			

Serialization/Deserialization
=============================
An example for serialization of an Intellectual Entity into it's METS representation looks like this:

        IntellectualEntity entity = TestUtil.createRandomEntity();
        SCAPEMarshaller.getInstance().serialize(entity, System.out);
        

An example for deseriialization looks like this:

		InputStream in = new FileInputStream("entity-1.xml");
		IntellectualEntity deserialized=SCAPEMarshaller.getInstance().deserialize(IntellectualEntity.class, in);        

                                              

About

Data transfer objects for the SCAPE platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages