Quick Introduction to Jastor

  • Unzip the distribution
  • Start the server openanzo-3.1.0\startAnzo.bat
  • 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(...);