[NeXML]
Rich phyloinformatic dataThe future data exchange standard is here!
NeXML is an exchange standard for representing phyloinformatic data — inspired by the commonly used NEXUS format, but more robust and easier to process.
Java
Java source code
This subdirectory contains java code for NeXML processing. Specifically, the directory structure is as follows:
- src/* contains source code for the following
subprojects:
-
src/org/* contains the DOM-based core java 5 NeXML
reading/writing API developed by a
subgroup of the
database interoperability hackathon held at
NESCent March 8-13 2009. The API contains
interfaces in the
org.nexml.modelpackage and their implementations in theorg.nexml.model.implpackage. -
src/mesquite/* contains classes for
mesquite.
These classes use the
org.nexml.model.*architecture, and so function to illustrate how to use it in an application. Written and maintained by Rutger Vos with some help from Wayne Maddison. - src/validator/* contains a Xerces-J-based XML validator (written by Terri Liebowitz of the San Diego Supercomputing Center, with modifications by Mark Holder) and a ValidateNeXML class that does essentially the same thing, but more tailored to NeXML specifically.
- src/transformer/* contains a class that transforms NeXML documents into CDAO documents using the xslt stylesheets found in $NEXML_ROOT/xslt.
-
src/org/* contains the DOM-based core java 5 NeXML
reading/writing API developed by a
subgroup of the
database interoperability hackathon held at
NESCent March 8-13 2009. The API contains
interfaces in the
-
test/* contains
JUnit4 tests for the
org.nexml.model.*API. Some of the tests attempt to parse files from the nexml/examples folder. The tests try to find these files by building a path relative to the NEXML_ROOT environment variable, which should point to nexml/trunk/nexml/, i.e. inside it should be the examples folder. If you are building and running inside eclipse, you might create a run configuration for all the junit tests (Test runner JUnit 4) and add NEXML_ROOT and its values to the environment tab. - jars/* contains dependencies for the code in the src/ and test/ folders. As of 1 Sept 2010, all seemingly extraneous jars have been removed, leaving only the JUnit jar (for testing), the Xerces jar (for the validator), and the saxon jar (for the transformer).
- resources/* contains an example classpaths.xml file for mesquite's system for loading other projects.
- build.sh this is a simple shell script that invokes ant, using the build.xml to build and install the NeXML/Java deliverables on the NeXML website (i.e. you probably don't need to run this yourself, ever).
Building and installing
The java libraries use ant for building and testing. The following targets are available:
-
validator - this builds a jar that contains
validator.ValidateNeXMLwhich validates XML documents against the NeXML schema,validator.XmlValidatorwhich validates XML documents against any command-line specified XML schema andtransformer.NeXML2CDAO, which transforms a NeXML document into a CDAO document. The target also includes all prerequisites into the jar, i.e. saxon and xerces, which it finds in the jars/ folder. To runtransformer.NeXML2CDAO, the NEXML_ROOT environment variable needs to point at the folder which contains the xslt folder with the RDFa2RDFXML.xsl and nexml2cdao.xsl stylesheets. The jar that this target produces is also available from the downloads folder of the NeXML website: http://nexml.org/nexml/downloads/ -
mesquite - this builds a zip file with classes for NeXML I/O in
Mesquite. The following caveats apply here:
- You will need Mesquite version 2.74 or higher. This is because the NeXML I/O requires a recent version of NameReference.java, which is part of Mesquite's internal system for managing key/value annotations. (This new version has getters and setters to specify namespaces for the keys, which is what NeXML's semantic annotation system needs.)
- The NeXML extension uses java generics, so it requires java version 1.5 or higher. Mesquite itself is designed to be compatible with java 1.4 (or higher), but for the NeXML extension to work, you will need a more recent java vm.
- The ant target uses the MESQUITE_ROOT environment variable to construct the part of its class path that contains the mesquite classes against which the extension is compiled. This environment variable points to the root folder of mesquite, which is typically a folder called Mesquite_Folder.
- mesquite-install - this target first builds the mesquite extension, then merges it into the mesquite project specified by the MESQUITE_ROOT environment variable.
-
jar - this target builds the core nexml library (also available from http://nexml.org/nexml/downloads/).
This jar can also be installed from the maven repository on the nexml web server, i.e. in your pom.xml do something like this:
<repository> <id>m2.nexml.repos</id> <name>NeXML Remote Repository</name> <url>http://nexml-dev.nescent.org/.m2/repository</url> </repository> <!-- .... and further down.... ---> <dependency> <groupId>org.nexml.model</groupId> <artifactId>nexml</artifactId> <version>1.5-SNAPSHOT</version> </dependency>
- test - this target runs JUnit tests on the core nexml library. To run these, the NEXML_ROOT environment variable needs to point at the folder which contains the examples folder with NeXML example documents.
To download the contents of this folder using
svn:
svn co \
https://nexml.svn.sourceforge.net/svnroot/nexml/trunk/nexml/java/ \
java
https://nexml.svn.sourceforge.net/svnroot/nexml/trunk/nexml/java/ \
java
Name Last modified Size Description
Parent Directory - Folder
build.sh 17-Mar-2011 15:10 499 Unix shell script
build.xml 08-Nov-2010 07:16 4.8K XML instance document
jars/ 22-Oct-2010 12:52 - Folder
mesquite/ 05-Mar-2008 18:00 - Folder
org/ 07-Feb-2008 00:28 - Folder
resources/ 28-Sep-2010 10:47 - Folder
src/ 28-Oct-2010 13:19 - Folder
test/ 10-Mar-2009 10:43 - Folder
validator/ 26-Jun-2009 06:47 - Folder