edu.unika.aifb.owltools.tools
Class KAON2Tool

java.lang.Object
  extended by edu.unika.aifb.owltools.tools.KAON2Tool
Direct Known Subclasses:
Ded, Deo, Diff, DLPConvert, Dump, Evaluate, Filter, Latex, Luna, Merge, Meta, Metrics, Populate, Satisfiable, Script, Server, Shell, Syntax

public abstract class KAON2Tool
extends java.lang.Object

Common code for all the owl tools


Field Summary
protected  org.semanticweb.kaon2.api.KAON2Connection m_connection
          The KAON2Connection for the tool
 Printer printer
          The printer for the different kinds of output.
 
Constructor Summary
KAON2Tool()
          Constructor.
 
Method Summary
protected  void endConnection()
          closes an existing KAON2Connection
protected  org.semanticweb.kaon2.api.Ontology loadOntology(java.lang.String name)
          loads an ontology.
abstract  java.lang.String name()
          the name of the specified tool.
 void printUsageError()
          prints a short excuse after not understandable input
abstract  boolean processArguments(java.lang.String[] args)
          needs to be implemented by all tools: processArgument to process all the given command line arguments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_connection

protected org.semanticweb.kaon2.api.KAON2Connection m_connection
The KAON2Connection for the tool


printer

public Printer printer
The printer for the different kinds of output. This is public so when used in own code the printer can be redirected in any way

Constructor Detail

KAON2Tool

public KAON2Tool()
Constructor. Basically creates a new printer. Most of the actual constructing happens when processing the command line arguments later.

Method Detail

name

public abstract java.lang.String name()
the name of the specified tool. Needs to be implemented by all tools

Returns:
the name of the tool

processArguments

public abstract boolean processArguments(java.lang.String[] args)
needs to be implemented by all tools: processArgument to process all the given command line arguments


endConnection

protected void endConnection()
                      throws org.semanticweb.kaon2.api.KAON2Exception
closes an existing KAON2Connection

Throws:
org.semanticweb.kaon2.api.KAON2Exception

loadOntology

protected org.semanticweb.kaon2.api.Ontology loadOntology(java.lang.String name)
                                                   throws org.semanticweb.kaon2.api.KAON2Exception,
                                                          java.lang.InterruptedException
loads an ontology. If there is no open connection, a new one is created

Parameters:
name - Name of the ontology to be loaded. Either starts with http, https or ftp, or it will be loaded from a local file with the given name
Returns:
The loaded ontology
Throws:
org.semanticweb.kaon2.api.KAON2Exception
java.lang.InterruptedException

printUsageError

public void printUsageError()
prints a short excuse after not understandable input