Datamodel for the SCAPE platform
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 |
+-------------+
It's a the datamodel for the SCAPE platform
A list of benefits X brings to the end user:
- The user can handle SCAPE Objects
- Developers implementing SCAPE features
- Java objects fro SCAPE
- Serialization/Deserialization for SCAPE objects
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();
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);
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);
Since the file paths at the austrian national library are created using a provided Pairtree parser two additional properties are exposed for parsing files from the ONB:
- scape.onb.pairtree.basepath The base path where the files at ONB are located
JAVA_OPTS="$JAVA_OPTS -Dscape.onb.pairtree.basepath=/tmp/scape/onb"
- scape.onb.pairtree.encapsulated The encapsulated directory of the path
JAVA_OPTS="$JAVA_OPTS -Dscape.onb.pairtree.encapsulated=onb"
- finished
SCAPE Platform Datamodel is released under Apache version 2.0 license.
Part of this work was supported by the European Union in the 7th Framework Program, IST, through the SCAPE project, Contract 270137.
This tool is supported by the Open Planets Foundation. Commercial support is provided by company X.
To build you require:
- Git client
- Apache Maven
- Java Developers Kit (e.g. OpenJDK 6)
- Dependency to paitree
Updating the ONB converter introduced a dependency to gov.loc.pairtree:1.1.1 This is not available on maven central! So you will have to install it manually in your local maven repository:
wget http://downloads.sourceforge.net/project/loc-xferutils/loc-pairtree-java-library/pairtree-1.1.1.jar?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Floc-xferutils%2Ffiles%2Floc-pairtree-java-library%2F&ts=1384173580&use_mirror=heanet
mvn install:install-file -Dfile=/path/to/pairtree-1.1.1.jar -DartifactId=pairtree -Dversion=1.1.1 -DgroupId=gov.loc -Dpackaging=jar
To compile go to the sources folder and execute the command:
$ mvn clean install
- Fork the GitHub project
- Change the code and push into the forked project
- Submit a pull request
To increase the changes of you code being accepted and merged into the official source here's a checklist of things to go over before submitting a contribution. For example:
- Has unit tests (that covers at least 80% of the code)
- Has documentation (at least 80% of public API)
- Agrees to contributor license agreement, certifying that any contributed code is original work and that the copyright is turned over to the project