edu.unika.aifb.owltools.tools
Class DLPConvert

java.lang.Object
  extended by edu.unika.aifb.owltools.tools.KAON2Tool
      extended by edu.unika.aifb.owltools.tools.DLPConvert

public class DLPConvert
extends KAON2Tool

DLPconvert is a tool to transform different syntactical representations of a DLP program into each other (refer to Raphael Volz, 2004). This is the main class that calls the actual transformation algorithms provided in KAON2 and in the other classes of this package.


Nested Class Summary
static class DLPConvert.Format
          Specifies the different possible formats that dlpconvert is able to serialise set of rules in.
static class DLPConvert.IntegrityConstraintHandling
          Possibilities of how to handle integrity constraints.
 
Field Summary
 
Fields inherited from class edu.unika.aifb.owltools.tools.KAON2Tool
m_connection, printer
 
Constructor Summary
DLPConvert()
           
 
Method Summary
 java.util.Collection<org.semanticweb.kaon2.api.logic.Rule> addTransitivity(java.util.Collection<org.semanticweb.kaon2.api.logic.Rule> rules, org.semanticweb.kaon2.api.Ontology ontology)
           
 void compile()
           
static java.lang.String compileString(java.lang.String string, java.lang.String dir)
          Reads a string as an ontology and then converts this ontology.
static java.lang.String compileToFlogic(java.lang.String uri)
          Serializes the result in Flogic.
static java.lang.String compileUri(java.lang.String uri, java.lang.String dir)
          Creates a DLPConversion based on an URI.
 org.semanticweb.kaon2.api.Ontology dlpconvert(org.semanticweb.kaon2.api.Ontology ontology)
          Convenience interface, so you can easily work with ontologies without having to define a name for it.
 void dlpconvert(org.semanticweb.kaon2.api.Ontology in, org.semanticweb.kaon2.api.Ontology out)
          Creates an ontology consisting of the rules that KAON2's conversion to disjunctive datalog creates out of the given ontology.
 org.semanticweb.kaon2.api.Ontology dlpconvert(org.semanticweb.kaon2.api.Ontology ontology, java.lang.String uri, java.lang.String physicalUri)
          Convenience interface.
static void main(java.lang.String[] args)
          Allows to start dlpconvert from the command line as well.
 java.lang.String name()
          the name of the owl tool
static void printUsage()
          prints the command line parameters and a short info
 boolean processArguments(java.lang.String[] args)
          Processes the command line parameters and sets the appropriate flags instead.
 org.semanticweb.kaon2.api.Ontology screech(org.semanticweb.kaon2.api.Ontology ontology)
          Creates an ontology consisting of the rules that KAON2's converstion to disjunctive datalog creates.
 
Methods inherited from class edu.unika.aifb.owltools.tools.KAON2Tool
endConnection, loadOntology, printUsageError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DLPConvert

public DLPConvert()
Method Detail

name

public java.lang.String name()
the name of the owl tool

Specified by:
name in class KAON2Tool
Returns:
the name of the tool

main

public static void main(java.lang.String[] args)
Allows to start dlpconvert from the command line as well. Only used for a command line version.

Parameters:
args - command line parameters

processArguments

public boolean processArguments(java.lang.String[] args)
Processes the command line parameters and sets the appropriate flags instead. Only used for the command line version.

Specified by:
processArguments in class KAON2Tool
Parameters:
args - command line parameters

dlpconvert

public void dlpconvert(org.semanticweb.kaon2.api.Ontology in,
                       org.semanticweb.kaon2.api.Ontology out)
                throws org.semanticweb.kaon2.api.KAON2Exception,
                       java.lang.InterruptedException
Creates an ontology consisting of the rules that KAON2's conversion to disjunctive datalog creates out of the given ontology.

Parameters:
in - The ontology to be created.
out - The ontology that will hold the resulting rulebase.
Throws:
org.semanticweb.kaon2.api.KAON2Exception
java.lang.InterruptedException

dlpconvert

public org.semanticweb.kaon2.api.Ontology dlpconvert(org.semanticweb.kaon2.api.Ontology ontology,
                                                     java.lang.String uri,
                                                     java.lang.String physicalUri)
                                              throws org.semanticweb.kaon2.api.KAON2Exception,
                                                     java.lang.InterruptedException
Convenience interface. If you have a name for your result ontology, you can use this.

Parameters:
ontology - Ontology to be converted
uri - the URI of the ontology to be created
physicalUri - where is the ontology physically saved
Returns:
the converted ontology
Throws:
org.semanticweb.kaon2.api.KAON2Exception - from KAON2's reduction
java.lang.InterruptedException - from KAON2's reduction

dlpconvert

public org.semanticweb.kaon2.api.Ontology dlpconvert(org.semanticweb.kaon2.api.Ontology ontology)
                                              throws org.semanticweb.kaon2.api.KAON2Exception,
                                                     java.lang.InterruptedException
Convenience interface, so you can easily work with ontologies without having to define a name for it. Useful for testing or for temporary results.

Parameters:
ontology - Ontology to be converted
Returns:
Converted ontology
Throws:
org.semanticweb.kaon2.api.KAON2Exception - from KAON2's reduction
java.lang.InterruptedException - from KAON2's reduction

screech

public org.semanticweb.kaon2.api.Ontology screech(org.semanticweb.kaon2.api.Ontology ontology)
                                           throws org.semanticweb.kaon2.api.KAON2Exception,
                                                  java.lang.InterruptedException
Creates an ontology consisting of the rules that KAON2's converstion to disjunctive datalog creates. If there is a disjunction in the head, it is changed into a conjunction. The result may be applied for approximate reasoning.

Parameters:
ontology - the ontology to be converted
Returns:
the screech program, as an ontology
Throws:
org.semanticweb.kaon2.api.KAON2Exception - from KAON2
java.lang.InterruptedException - from KAON2

addTransitivity

public java.util.Collection<org.semanticweb.kaon2.api.logic.Rule> addTransitivity(java.util.Collection<org.semanticweb.kaon2.api.logic.Rule> rules,
                                                                                  org.semanticweb.kaon2.api.Ontology ontology)
                                                                           throws org.semanticweb.kaon2.api.KAON2Exception
Throws:
org.semanticweb.kaon2.api.KAON2Exception

compile

public void compile()

compileToFlogic

public static java.lang.String compileToFlogic(java.lang.String uri)
Serializes the result in Flogic. Only used by the Web Interface.

Parameters:
uri - input uri of the ontology to be converted
Returns:
the returnstring for the answer HTML-page

compileUri

public static java.lang.String compileUri(java.lang.String uri,
                                          java.lang.String dir)
Creates a DLPConversion based on an URI. Only used by the Web Interface.

Parameters:
uri - uri of the ontology to be converted
dir - where to archive the requeste
Returns:
the return string for the answering HTML-page

compileString

public static java.lang.String compileString(java.lang.String string,
                                             java.lang.String dir)
Reads a string as an ontology and then converts this ontology. Only used by the Web Interface

Parameters:
string - the ontology in string form
dir - the archive directory
Returns:
the resulting string for the answering HTML-page

printUsage

public static void printUsage()
prints the command line parameters and a short info