edu.unika.aifb.owltools
Class api

java.lang.Object
  extended by edu.unika.aifb.owltools.api

public class api
extends java.lang.Object

All functionality of the owl tools is bundled here for simple usage in own programs


Constructor Summary
api()
           
 
Method Summary
static int count(org.semanticweb.kaon2.api.Ontology ontology)
          Counts the number of axioms in an ontology
static int count(org.semanticweb.kaon2.api.Ontology ontology, java.lang.Class filter)
          Counts the number of axioms of a specific kind in an ontology
static int countEntities(org.semanticweb.kaon2.api.Ontology ontology)
          Counts the number of entities in an ontology
static int countEntities(org.semanticweb.kaon2.api.Ontology ontology, java.lang.Class filter)
          Counts the number of entities of a specific kind in an ontology
static void demeta(org.semanticweb.kaon2.api.Ontology metaontology, org.semanticweb.kaon2.api.Ontology ontology)
          Creates a concrete ontology from a metaontology
static void diff(org.semanticweb.kaon2.api.Ontology base, org.semanticweb.kaon2.api.Ontology diff, org.semanticweb.kaon2.api.Ontology result)
          Gets the difference between two ontologies.
static java.util.List<java.lang.String> dump(org.semanticweb.kaon2.api.Ontology ontology)
          Returns a list of all axioms in the ontology.
static java.util.List<java.lang.String> dump(org.semanticweb.kaon2.api.Ontology ontology, java.lang.Class filter)
          Returns a list of all axioms of a certain kind.
static java.util.List<java.lang.String> dumpEntities(org.semanticweb.kaon2.api.Ontology ontology)
          Returns a list of all entities mentioned in the ontology
static java.util.List<java.lang.String> dumpEntities(org.semanticweb.kaon2.api.Ontology ontology, java.lang.Class filter)
          List all entities of a specified type
static org.semanticweb.kaon2.api.Ontology filter(org.semanticweb.kaon2.api.Ontology ontology, java.lang.Class filter)
          Filters an ontology by only leaving axioms of a certain kind inside the ontology
static org.semanticweb.kaon2.api.Ontology filterOut(org.semanticweb.kaon2.api.Ontology ontology, java.lang.Class filter)
          Filters an ontology be removing all axioms of a certain kind from the ontology
static java.util.List<java.lang.String> latex(org.semanticweb.kaon2.api.Ontology ontology)
          Creates a latex serialization of an ontology.
static org.semanticweb.kaon2.api.Ontology luna(org.semanticweb.kaon2.api.Ontology ontology)
          Adds an axiom to an ontology that makes all the individuals in the ontology mutually different.
static void merge(org.semanticweb.kaon2.api.Ontology one, org.semanticweb.kaon2.api.Ontology two, org.semanticweb.kaon2.api.Ontology result)
          Merges two ontologies.
static void meta(org.semanticweb.kaon2.api.Ontology ontology, org.semanticweb.kaon2.api.Ontology metaontology)
          Creates a metaontology of an ontology based on the OWL Metamodel.
static org.semanticweb.kaon2.api.Ontology populate(org.semanticweb.kaon2.api.Ontology ontology, int instances)
          Populates an ontology with random instances
static boolean satisfiable(org.semanticweb.kaon2.api.Ontology ontology)
          Checks if an ontology is logically satisfiable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

api

public api()
Method Detail

count

public static int count(org.semanticweb.kaon2.api.Ontology ontology)
                 throws org.semanticweb.kaon2.api.KAON2Exception
Counts the number of axioms in an ontology

Parameters:
ontology - The ontology to be counted
Returns:
The number of axioms in the ontology
Throws:
org.semanticweb.kaon2.api.KAON2Exception

count

public static int count(org.semanticweb.kaon2.api.Ontology ontology,
                        java.lang.Class filter)
                 throws org.semanticweb.kaon2.api.KAON2Exception
Counts the number of axioms of a specific kind in an ontology

Parameters:
ontology - The ontology to be counted
filter - The kind of axioms to be counted. Must be one of org.semanticweb.kaon2.api.owl.axioms
Returns:
The number of axioms of the kind
Throws:
org.semanticweb.kaon2.api.KAON2Exception

countEntities

public static int countEntities(org.semanticweb.kaon2.api.Ontology ontology)
                         throws org.semanticweb.kaon2.api.KAON2Exception
Counts the number of entities in an ontology

Parameters:
ontology - The ontology to be counted
Returns:
The number of entities in the ontology
Throws:
org.semanticweb.kaon2.api.KAON2Exception

countEntities

public static int countEntities(org.semanticweb.kaon2.api.Ontology ontology,
                                java.lang.Class filter)
                         throws org.semanticweb.kaon2.api.KAON2Exception
Counts the number of entities of a specific kind in an ontology

Parameters:
ontology - The ontology to be counted
filter - The kind of entities to be counted. Must be one of org.semanticweb.kaon2.api.owl.elements
Returns:
The number of entities of that kind
Throws:
org.semanticweb.kaon2.api.KAON2Exception

dump

public static java.util.List<java.lang.String> dump(org.semanticweb.kaon2.api.Ontology ontology)
                                             throws org.semanticweb.kaon2.api.KAON2Exception
Returns a list of all axioms in the ontology. The syntax is KAON2's own axiom syntax

Parameters:
ontology - The ontology to be listed
Returns:
A list of strings, each one representing one axiom
Throws:
org.semanticweb.kaon2.api.KAON2Exception

dump

public static java.util.List<java.lang.String> dump(org.semanticweb.kaon2.api.Ontology ontology,
                                                    java.lang.Class filter)
                                             throws org.semanticweb.kaon2.api.KAON2Exception
Returns a list of all axioms of a certain kind. The syntax is KAON2's own axiom syntax

Parameters:
ontology - The ontology to be listed from
filter - The kind of axioms to be listed. Must be one of org.semanticweb.kaon2.api.owl.axioms
Returns:
A list of strings, each one representing one axiom of the specified kind
Throws:
org.semanticweb.kaon2.api.KAON2Exception

dumpEntities

public static java.util.List<java.lang.String> dumpEntities(org.semanticweb.kaon2.api.Ontology ontology)
                                                     throws org.semanticweb.kaon2.api.KAON2Exception
Returns a list of all entities mentioned in the ontology

Parameters:
ontology - The ontology to be listed from
Returns:
A list of strings, with the URIs of all entities in the ontology
Throws:
org.semanticweb.kaon2.api.KAON2Exception

dumpEntities

public static java.util.List<java.lang.String> dumpEntities(org.semanticweb.kaon2.api.Ontology ontology,
                                                            java.lang.Class filter)
                                                     throws org.semanticweb.kaon2.api.KAON2Exception
List all entities of a specified type

Parameters:
ontology - The ontology to be listed from
filter - The kind of entities to be counted. Must be one of org.semanticweb.kaon2.api.owl.elements
Returns:
A list of strings, each one an URI of an entity of the specified kind
Throws:
org.semanticweb.kaon2.api.KAON2Exception

filter

public static org.semanticweb.kaon2.api.Ontology filter(org.semanticweb.kaon2.api.Ontology ontology,
                                                        java.lang.Class filter)
                                                 throws org.semanticweb.kaon2.api.KAON2Exception
Filters an ontology by only leaving axioms of a certain kind inside the ontology

Parameters:
ontology - The ontology to be filtered
filter - The axiomtype to remain in the ontology
Returns:
An ontology with only the axioms of the specified kind
Throws:
org.semanticweb.kaon2.api.KAON2Exception

filterOut

public static org.semanticweb.kaon2.api.Ontology filterOut(org.semanticweb.kaon2.api.Ontology ontology,
                                                           java.lang.Class filter)
                                                    throws org.semanticweb.kaon2.api.KAON2Exception
Filters an ontology be removing all axioms of a certain kind from the ontology

Parameters:
ontology - The ontology to be filtered
filter - The axiomtype to be removed from the ontology
Returns:
An ontology with all axioms of the specified kind removed
Throws:
org.semanticweb.kaon2.api.KAON2Exception

diff

public static void diff(org.semanticweb.kaon2.api.Ontology base,
                        org.semanticweb.kaon2.api.Ontology diff,
                        org.semanticweb.kaon2.api.Ontology result)
                 throws org.semanticweb.kaon2.api.KAON2Exception
Gets the difference between two ontologies. It returns all the axioms that are part of the diff ontology but not the base ontology.

Parameters:
base - The ontology to compare to
diff - The ontology with the extra axioms
result - The ontology that holds all the extra axioms in diff but not in base
Throws:
org.semanticweb.kaon2.api.KAON2Exception

latex

public static java.util.List<java.lang.String> latex(org.semanticweb.kaon2.api.Ontology ontology)
                                              throws org.semanticweb.kaon2.api.KAON2Exception
Creates a latex serialization of an ontology. By using the latex class itself you have much more possibilities to customize the output

Parameters:
ontology - The ontology to be tex'ed
Returns:
The result, being a list of strings that represent lines of a latex program
Throws:
org.semanticweb.kaon2.api.KAON2Exception

luna

public static org.semanticweb.kaon2.api.Ontology luna(org.semanticweb.kaon2.api.Ontology ontology)
                                               throws org.semanticweb.kaon2.api.KAON2Exception
Adds an axiom to an ontology that makes all the individuals in the ontology mutually different.

Parameters:
ontology - Ontology to be locally una'd.
Returns:
The ontology with the local una axiom
Throws:
org.semanticweb.kaon2.api.KAON2Exception

merge

public static void merge(org.semanticweb.kaon2.api.Ontology one,
                         org.semanticweb.kaon2.api.Ontology two,
                         org.semanticweb.kaon2.api.Ontology result)
                  throws org.semanticweb.kaon2.api.KAON2Exception
Merges two ontologies. It adds up the axioms from both input ontologies

Parameters:
one - One of the ontologies
two - The other ontology
result - The merged ontology
Throws:
org.semanticweb.kaon2.api.KAON2Exception

meta

public static void meta(org.semanticweb.kaon2.api.Ontology ontology,
                        org.semanticweb.kaon2.api.Ontology metaontology)
                 throws org.semanticweb.kaon2.api.KAON2Exception
Creates a metaontology of an ontology based on the OWL Metamodel. By using the Meta class directly much more options are available.

Parameters:
ontology - The ontology to be meta'd
metaontology - The returned metaontology of the given ontology
Throws:
org.semanticweb.kaon2.api.KAON2Exception

demeta

public static void demeta(org.semanticweb.kaon2.api.Ontology metaontology,
                          org.semanticweb.kaon2.api.Ontology ontology)
                   throws org.semanticweb.kaon2.api.KAON2Exception,
                          java.lang.InterruptedException
Creates a concrete ontology from a metaontology

Parameters:
metaontology - The metaontology that holds the concrete ontology
ontology - The returned concrete ontology
Throws:
org.semanticweb.kaon2.api.KAON2Exception
java.lang.InterruptedException

populate

public static org.semanticweb.kaon2.api.Ontology populate(org.semanticweb.kaon2.api.Ontology ontology,
                                                          int instances)
                                                   throws org.semanticweb.kaon2.api.KAON2Exception
Populates an ontology with random instances

Parameters:
ontology - The ontology to be populated
instances - The number of instances to be added
Returns:
The populated ontology
Throws:
org.semanticweb.kaon2.api.KAON2Exception

satisfiable

public static boolean satisfiable(org.semanticweb.kaon2.api.Ontology ontology)
                           throws org.semanticweb.kaon2.api.KAON2Exception,
                                  java.lang.InterruptedException
Checks if an ontology is logically satisfiable

Parameters:
ontology - The ontology to be checked
Returns:
true if the ontology is satisfiable, else false
Throws:
org.semanticweb.kaon2.api.KAON2Exception
java.lang.InterruptedException