org.openrdf.elmo.codegen
Class OntologyConverter

java.lang.Object
  extended by org.openrdf.elmo.codegen.OntologyConverter

public class OntologyConverter
extends Object

A Facade to CodeGenerator and OwlGenerator classes. This class provides a simpler interface to create concept packages and build ontologies. Unlike the composed classes, this class reads and creates jar packages.

Author:
James Leigh

Constructor Summary
OntologyConverter()
           
 
Method Summary
 void addJar(URL url)
          Add a jar of classes to include in the class-path.
 void addOntology(URI ontology, String pkgName)
          Binds this ontology with the package name.
 void addRdfSource(URL url)
          Adds an RDF file to the local repository.
 void createClasses(File jarOutputFile)
          Generate Elmo concept Java classes from the ontology in the local repository.
 void createOntology(File rdfOutputFile)
          Generate an OWL ontology from the JavaBeans in the included jars.
protected  Repository createRepository()
           
 String[] getBaseClasses()
          Array of Java Class names that all concepts will extend.
 String getPropertyNamesPrefix()
          The property names prefix or null for default prefix.
 void init()
          Create the local repository and load the RDF files.
 boolean isImportJarOntologies()
          If the ontologies bundled with the included jars should be imported.
static void main(String[] args)
           
 void setBaseClasses(String[] strings)
          Array of Java Class names that all concepts will extend.
 void setImportJarOntologies(boolean importJarOntologies)
          If the ontologies bundled with the included jars should be imported.
 void setNamespace(String prefix, String namespace)
          Set the prefix that should be used for this ontology namespace.
 void setPropertyNamesPrefix(String propertyNamesPrefix)
          The property names prefix or null for default prefix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OntologyConverter

public OntologyConverter()
Method Detail

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

isImportJarOntologies

public boolean isImportJarOntologies()
If the ontologies bundled with the included jars should be imported.

Returns:
true if the ontology will be imported.

setImportJarOntologies

public void setImportJarOntologies(boolean importJarOntologies)
If the ontologies bundled with the included jars should be imported.

Parameters:
importJarOntologies - true if the ontology will be imported.

getPropertyNamesPrefix

public String getPropertyNamesPrefix()
The property names prefix or null for default prefix.


setPropertyNamesPrefix

public void setPropertyNamesPrefix(String propertyNamesPrefix)
The property names prefix or null for default prefix.


getBaseClasses

public String[] getBaseClasses()
Array of Java Class names that all concepts will extend.

Returns:
Array of Java Class names that all concepts will extend.

setBaseClasses

public void setBaseClasses(String[] strings)
Array of Java Class names that all concepts will extend.

Parameters:
strings -

addJar

public void addJar(URL url)
Add a jar of classes to include in the class-path.

Parameters:
url -

addRdfSource

public void addRdfSource(URL url)
Adds an RDF file to the local repository.

Parameters:
url -

setNamespace

public void setNamespace(String prefix,
                         String namespace)
Set the prefix that should be used for this ontology namespace.

Parameters:
prefix -
namespace -

addOntology

public void addOntology(URI ontology,
                        String pkgName)
Binds this ontology with the package name.

Parameters:
ontology -
pkgName -

init

public void init()
          throws Exception
Create the local repository and load the RDF files.

Throws:
Exception

createOntology

public void createOntology(File rdfOutputFile)
                    throws Exception
Generate an OWL ontology from the JavaBeans in the included jars.

Parameters:
rdfOutputFile -
Throws:
Exception
See Also:
#addOntology(URI, String)}, #addJar(URL)}

createClasses

public void createClasses(File jarOutputFile)
                   throws Exception
Generate Elmo concept Java classes from the ontology in the local repository.

Parameters:
jarOutputFile -
Throws:
Exception
See Also:
#addOntology(URI, String)}, #addRdfSource(URL)}

createRepository

protected Repository createRepository()
                               throws RepositoryException
Throws:
RepositoryException


Copyright © 2004-2008 Aduna. All Rights Reserved.