Skip to content

meganap/nexml.java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<h3 class="headerstyle">Java source code</h3>
<p>
	This subdirectory contains java code for NeXML processing.
	Specifically, the directory structure is as follows:
	<ul>
        <li class="folder"><a href="src/">src/</a>* contains source code for the following 
            subprojects:<br/><br/>
            <ul>
                <li class="folder">
                    <a href="src/org/">src/org/</a>* contains the DOM-based core java 5 NeXML 
                    reading/writing API developed by a 
                    <a href="https://www.nescent.org/wg_evoinfo/Java_API_Library_to_NeXML_Subgroup">
                    subgroup</a> of the 
                    <a href="https://www.nescent.org/wg_evoinfo/Database_Interop_Hackathon">
                    database interoperability hackathon</a> held at 
                    <a href="http://www.nescent.org">NESCent</a> March 8-13 2009. The API contains
                    interfaces in the <code>org.nexml.model</code> package and their implementations 
                    in the <code>org.nexml.model.impl</code> package.
                </li>
                <li class="folder">
                    <a href="src/mesquite">src/mesquite/</a>* contains classes for 
                    <a href="http://mesquiteproject.org">mesquite</a>. 
                    These classes use the <code>org.nexml.model.*</code> 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.
                </li>
		        <li class="folder">
		            <a href="src/validator/">src/validator/</a>* contains a 
		            <a href="http://xerces.apache.org/xerces-j/">Xerces-J</a>-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.
		        </li>                
		        <li class="folder">
		            <a href="src/transformer/">src/transformer/</a>* contains a 
					class that transforms NeXML documents into CDAO documents using
					the xslt stylesheets found in $NEXML_ROOT/xslt.
		        </li>                
            </ul>
        </li>
        <li class="folder">
            <a href="test/">test/</a>* contains 
            <a href="http://www.junit.org/">JUnit4</a> tests for the <code>org.nexml.model.*</code>
            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.
        </li>        
        <li class="folder">
            <a href="jars/">jars/</a>* 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).
        </li>
        <li class="folder">
            <a href="resources/">resources/</a>* contains an example classpaths.xml file for 
            mesquite's <a href="http://mesquiteproject.org/mesquite/download/source.html#classPaths">
		system for loading other projects</a>.
        </li>        
        <li class="rss">
            <a href="build.sh">build.sh</a> this is a simple shell script that 
            invokes ant, using the <a href="build.xml">build.xml</a> to build and 
            install the NeXML/Java deliverables on the NeXML website (i.e. you probably
            don't need to run this yourself, ever).
        </li>        
	</ul>
</p>
<h3 class="headerstyle">Building and installing</h3>
<p>
	The java libraries use ant for building and testing. The following targets are available:
</p>
<ul>
	<li class="rss">
		<strong>validator</strong> - this builds a jar that contains <code>validator.ValidateNeXML</code>
		which validates XML documents against the NeXML schema, <code>validator.XmlValidator</code> which validates
		XML documents against any command-line specified XML schema and <code>transformer.NeXML2CDAO</code>, 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  <a href="jars/">jars/</a> folder. To run <code>transformer.NeXML2CDAO</code>, 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/
	</li>
	<li class="rss">
		<strong>mesquite</strong> - this builds a zip file with classes for NeXML I/O in 
		<a href="http://mesquiteproject.org">Mesquite</a>. The following caveats apply here:
		<ol>
			<li>You will need Mesquite version 2.74 or higher. This is because the NeXML I/O requires a recent version of 
			<a href="http://svn.mesquiteproject.org:8080/repository/mesquite/trunk/Mesquite%20Project/Source/mesquite/lib/NameReference.java">NameReference.java</a>,
			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.)</li>
			<li>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.</li>
			<li>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.</li>
		</ol>
		To install the extension, you can either use mesquite's <a href="http://mesquiteproject.org/mesquite/download/source.html#classPaths">
		system for loading other projects</a> to point to the unzipped contents of the mesquite-nexml.zip file this target produces
		(also available from http://nexml.org/nexml/downloads/), or, easier, use the <strong>mesquite-install</strong> target.
	</li>
	<li class="rss">
		<strong>mesquite-install</strong> - this target first builds the mesquite extension, then merges it into the 
		mesquite project specified by the MESQUITE_ROOT environment variable.
	</li>
	<li class="rss">
		<strong>jar</strong> - 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:
		<pre>
		&lt;repository>
			&lt;id>m2.nexml.repos&lt;/id>
			&lt;name>NeXML Remote Repository&lt;/name>
			&lt;url>http://nexml-dev.nescent.org/.m2/repository&lt;/url>
		&lt;/repository>		
		
		&lt;!-- .... and further down.... --->
		
		&lt;dependency>
			&lt;groupId>org.nexml.model&lt;/groupId>
			&lt;artifactId>nexml&lt;/artifactId>
			&lt;version>1.5-SNAPSHOT&lt;/version>
		&lt;/dependency>
		</pre>
	</li>
	<li class="rss">
		<strong>test</strong> - 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. 
	</li>
</ul>

About

Java API for NeXML.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published