Jena Schema Generator (Schemagen)
CraigTrim 110000G799 Visits (10113)
Jena Schema Generator
There is a useful script that comes bundled with Jena.
On Windows, this is
On Linux this is
The Schema Generator can be used to generate a Java class file with all the Ontology classes and properies defined within the Ontology model. A complete HOWTO can be found on the Jena site.
Usage is simple:
schemagen -i MyOntology.owl -o MyJavaFile.java
All the Ontology Class types are defined as Jena Resource object instances, and all the Ontology Predicate types are defined as Jena Property object instances.
If you get an error that says “JENAROOT not set”, go to Environment Variables and set the JENAROOT property to the appropriate location: