Quick Introduction to Jastor
- Download the full distribution of Open Anzo from http://www.openanzo.org/downloads.html. These are built on a nightly basis.
- Unzip the distribution
- Start the server openanzo-3.1.0\startAnzo.bat
- Jastor generation is available from Anzo Command Line interface, for which we do have documentation. Follow the instructions "Installing The CLI from Distribution" at http://www.openanzo.org/projects/openanzo/wiki/CommandLineInterface. This will help you get a good idea of what Open Anzo is all about.
- Once you have that ready you should be ready to generate the Jastor classes. There are a number of ways to do so (multiple ontologies/packages, extra options), but I will explain the simplest one to get you started.
anzo gen --destdir c:/code/myont --package org.openanzo.ski.ontology ski.owl http://jastor.openanzo.org/testonts/Ski
- To compile and use the code, you will need to add all the jar files openanzo-3.1.0\plugins\dependencies and openanzo-3.1.0\plugins\openanzo to your classpath. You can find a more consolidated list by downloading the openanzo client distribution and including the jars in the lib directory
javac c:/code/myont/org/openanzo/ski/ontology/*.java
If you have a favorite IDE (we use Eclipse), this will all be a lot easier.
- The basic usage of the generated code is to use the generated factory:
INamedGraph graph = new NamedGraph("http://openanzo.org/skis/volkl/bridge"); Ski ski = SkiFactory.createSki(graph, graph.getNamedGraphURI()); ski.setModel(...); ski.addAvailableLength(...);
