com.att.gs.codip.ograph
Class OGUtility

java.lang.Object
  |
  +--com.att.gs.codip.ograph.OGUtility

public class OGUtility
extends java.lang.Object

A colleciton static of utility methods.


Constructor Summary
OGUtility()
           
 
Method Summary
static void addJessClass(jess.Rete rete, jess.Context context, OGClass theClass)
          Adds a class to the provided Jess Rete Object.
static void addJessDatatype(jess.Rete rete, jess.Context context, OGDatatype theDatatype)
          Adds a datatype to the provided Jess Rete Object.
static void addJessInstance(jess.Rete rete, jess.Context context, OGPropInstance theProperty)
          Adds an instance to the provided Jess Rete Object.
static void addJessInstances(jess.Rete rete, OGOntology theOnto)
          Adds the instances in an ontology to the provided Jess Rete Object.
static void addJessInstances(jess.Rete rete, OGOntology theOnto, boolean forceReload)
          Adds the instances in an ontology to the provided Jess Rete Object.
static void addJessLiteral(jess.Rete rete, jess.Context context, OGLiteral theLiteral)
          Adds a literal to the provided Jess Rete Object.
static void addJessOntotology(jess.Rete rete, OGOntology theOnto)
          Adds an ontology, and all its compoents, to the provided Jess Rete Object.
static void addJessOntotology(jess.Rete rete, OGOntology theOnto, boolean forceReload)
          Adds an ontology, and all its compoents, to the provided Jess Rete Object.
static void addJessProperty(jess.Rete rete, jess.Context context, OGProperty theProperty)
          Adds a property to the provided Jess Rete Object.
static void fullGC()
          Perform a full garbage collection.
static void main(java.lang.String[] args)
          Main added for basic testing.
static void printClass(java.io.PrintStream outStream, OGClass theClass)
          Prints a class to the provided PrintStream.
static void printDatatype(java.io.PrintStream outStream, OGDatatype theDatatype)
          Prints a datatype to the provided PrintStream.
static void printLiteral(java.io.PrintStream outStream, OGLiteral theLiteral)
          Prints a literal to the provided PrintStream.
static void printOntotology(java.io.PrintStream outStream, OGOntology theOnto)
          Prints an ontology, and all its components, to the provided PrintStream.
static void printProperty(java.io.PrintStream outStream, OGProperty theProperty)
          Prints a property to the provided PrintStream.
static void removeJessInstances(jess.Rete rete, OGOntology theOnto)
           
static void removeJessOntotology(jess.Rete rete, OGOntology theOnto)
          Removes an ontology, and all its compoents, from the provided Jess Rete Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OGUtility

public OGUtility()
Method Detail

fullGC

public static void fullGC()
Perform a full garbage collection. Repeatedly call the system garbage collection funciton until free memory stops increasing. This ensures that all available heap space is reclaimed. When working with large ontologies, this method may be useful after parsing or building the model to reclaim heap space.


printOntotology

public static void printOntotology(java.io.PrintStream outStream,
                                   OGOntology theOnto)
                            throws java.lang.Exception
Prints an ontology, and all its components, to the provided PrintStream.

Parameters:
outStream - The PrintStream to use.
theOnto - The ontology to print.
java.lang.Exception

printClass

public static void printClass(java.io.PrintStream outStream,
                              OGClass theClass)
                       throws java.lang.Exception
Prints a class to the provided PrintStream.

Parameters:
outStream - The PrintStream to use.
theClass - The class to print.
java.lang.Exception

printProperty

public static void printProperty(java.io.PrintStream outStream,
                                 OGProperty theProperty)
                          throws java.lang.Exception
Prints a property to the provided PrintStream.

Parameters:
outStream - The PrintStream to use.
theProperty - The property to print.
java.lang.Exception

printLiteral

public static void printLiteral(java.io.PrintStream outStream,
                                OGLiteral theLiteral)
                         throws java.lang.Exception
Prints a literal to the provided PrintStream.

Parameters:
outStream - The PrintStream to use.
theLiteral - The literal to print.
java.lang.Exception

printDatatype

public static void printDatatype(java.io.PrintStream outStream,
                                 OGDatatype theDatatype)
                          throws java.lang.Exception
Prints a datatype to the provided PrintStream.

Parameters:
outStream - The PrintStream to use.
theDatatype - The datatype to print.
java.lang.Exception

addJessOntotology

public static void addJessOntotology(jess.Rete rete,
                                     OGOntology theOnto)
                              throws java.lang.Exception
Adds an ontology, and all its compoents, to the provided Jess Rete Object. Duplicate instances of the ontolgoy will not be added.

Note that a suitable jess defclass calss must have be executed before using this method. A Jess script with appropriate calls is in OGRTemplates.clp

Parameters:
rete - The Jess Rete object to add facts to.
theOnto - The ontology to print.
java.lang.Exception

addJessOntotology

public static void addJessOntotology(jess.Rete rete,
                                     OGOntology theOnto,
                                     boolean forceReload)
                              throws java.lang.Exception
Adds an ontology, and all its compoents, to the provided Jess Rete Object. Duplicate instances of the ontolgoy will only be added if force is true.

Note that a suitable jess defclass calss must have be executed before using this method. A Jess script with appropriate calls is in OGRTemplates.clp

Parameters:
rete - The Jess Rete object to add facts to.
theOnto - The ontology to print.
forceReload - A flag force reloading a previously loaded ontology.
java.lang.Exception

addJessClass

public static void addJessClass(jess.Rete rete,
                                jess.Context context,
                                OGClass theClass)
                         throws java.lang.Exception
Adds a class to the provided Jess Rete Object.

Note that a suitable jess defclass must have be executed before using this method.

Parameters:
rete - The Jess Rete object to add facts to.
theClass - The class to print.
java.lang.Exception

addJessProperty

public static void addJessProperty(jess.Rete rete,
                                   jess.Context context,
                                   OGProperty theProperty)
                            throws java.lang.Exception
Adds a property to the provided Jess Rete Object.

Note that a suitable jess defclass must have be executed before using this method.

Parameters:
rete - The Jess Rete object to add facts to.
theProperty - The property to print.
java.lang.Exception

addJessLiteral

public static void addJessLiteral(jess.Rete rete,
                                  jess.Context context,
                                  OGLiteral theLiteral)
                           throws java.lang.Exception
Adds a literal to the provided Jess Rete Object.

Note that a suitable ess defclass must have be executed before using this method.

Parameters:
rete - The Jess Rete object to add facts to.
theLiteral - The literal to add.
java.lang.Exception

addJessDatatype

public static void addJessDatatype(jess.Rete rete,
                                   jess.Context context,
                                   OGDatatype theDatatype)
                            throws java.lang.Exception
Adds a datatype to the provided Jess Rete Object.

Note that a suitable jess defclass must have be executed before using this method.

Parameters:
rete - The Jess Rete object to add facts to.
theDatatype - The Datatype to add.
java.lang.Exception

addJessInstances

public static void addJessInstances(jess.Rete rete,
                                    OGOntology theOnto)
                             throws java.lang.Exception
Adds the instances in an ontology to the provided Jess Rete Object. Instances from duplicates of the ontology will not be added.

Note that a suitable jess defclass must have be executed before using this method.

Parameters:
rete - The Jess Rete object to add facts to.
theOnto - The ontology to print.
java.lang.Exception

addJessInstances

public static void addJessInstances(jess.Rete rete,
                                    OGOntology theOnto,
                                    boolean forceReload)
                             throws java.lang.Exception
Adds the instances in an ontology to the provided Jess Rete Object. Instances from duplicates of the ontology will not be added unless forceReload is true.

Note that a suitable jess defclass must have be executed before using this method.

Parameters:
rete - The Jess Rete object to add facts to.
theOnto - The ontology to print.
forceReload - A flag force reloading a previously loaded ontology.
java.lang.Exception

addJessInstance

public static void addJessInstance(jess.Rete rete,
                                   jess.Context context,
                                   OGPropInstance theProperty)
                            throws java.lang.Exception
Adds an instance to the provided Jess Rete Object.

Note that a suitable jess defclass must have be executed before using this method.

Parameters:
rete - The Jess Rete object to add facts to.
theProperty - The property instance to add.
java.lang.Exception

removeJessOntotology

public static void removeJessOntotology(jess.Rete rete,
                                        OGOntology theOnto)
                                 throws java.lang.Exception
Removes an ontology, and all its compoents, from the provided Jess Rete Object.

Parameters:
rete - The Jess Rete object to add facts to.
theOnto - The ontology to print.
java.lang.Exception

removeJessInstances

public static void removeJessInstances(jess.Rete rete,
                                       OGOntology theOnto)
                                throws java.lang.Exception
java.lang.Exception

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Main added for basic testing.

java.lang.Exception


CODIP AT&T Government Solutions, Inc.