com.hp.hpl.jena.ontology.tidy
Class Checker

java.lang.Object
  extended by com.hp.hpl.jena.ontology.tidy.impl.CheckerImpl
      extended by com.hp.hpl.jena.ontology.tidy.Checker
All Implemented Interfaces:
CheckerResults, com.hp.hpl.jena.ontology.tidy.impl.Constants

public class Checker
extends com.hp.hpl.jena.ontology.tidy.impl.CheckerImpl
implements CheckerResults

This class implements the OWL Syntax Checker, and is integrated with Jena Models, OntModels, and Graphs. The basic mode of use, is to create a Checker and to add one or more Models, OntModels or Graphs. It tries to do the right thing, vis-a-vis imports, without duplicating imports processing already performed by an OntModel; in particular, to use a specific OntDocumentManager create an OntModel using that document manager. Any imports that are processed by this class, a private document manager is used, constructed from the default profile (with imports processing explicitly on). The three methods CheckerImpl.getProblems() CheckerImpl.getErrors() and CheckerImpl.getSubLanguage() can all be used repeatedly and at any point. They report on what has been added so far. When constructing a checker, you must choose whether to record errors and problems concerning non-OWL Lite constructs, or only concerning non-OWL DL constructs. For either choice CheckerImpl.getSubLanguage() functions correctly (i.e. the grammar used is identical). However, if the Checker has been constructed with the liteflag as false, it is not possible to access a rationale for an ontology being in OWL DL rather than OWL Lite.

Author:
Jeremy Carroll

Field Summary
 
Fields inherited from interface com.hp.hpl.jena.ontology.tidy.impl.Constants
BadOWL, BadRDF, BadXSD, DL, Failure, FirstOfOne, FirstOfTwo, ObjectAction, RemoveTriple, SecondOfTwo, SubjectAction
 
Constructor Summary
Checker(boolean liteFlag)
          Create a new checker - indicate whether error reports are wanted for non-OWL Lite constructions or only non-OWL DL constructions.
 
Method Summary
 void add(Graph g)
          Adds the graph to the syntax check.
 void add(Model m)
          Adds the model to the syntax check.
 void addGraphAndImports(Graph g)
          Adds the graph, and definitely its imports, to the syntax check.
 void addRaw(Graph g)
          Adds the graph, and definitely not its imports, to the syntax check.
 int getHighTide()
           
 void load(String url)
          Include an ontology and its imports in the check.
 void load(String url, String lang)
          Include an ontology and its imports in the check.
 void noremove()
           
 void setOptimizeMemory(boolean big)
           
 
Methods inherited from class com.hp.hpl.jena.ontology.tidy.impl.CheckerImpl
getErrors, getProblems, getSubLanguage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.hp.hpl.jena.ontology.tidy.CheckerResults
getErrors, getProblems, getSubLanguage, setOptimizeMemory
 

Constructor Detail

Checker

public Checker(boolean liteFlag)
Create a new checker - indicate whether error reports are wanted for non-OWL Lite constructions or only non-OWL DL constructions.

Parameters:
liteFlag - If true CheckerImpl.getErrors() and CheckerImpl.getProblems() will indicate any OWL DL or OWL Full construction.
Method Detail

addRaw

public void addRaw(Graph g)
Adds the graph, and definitely not its imports, to the syntax check. Many graphs can be checked together. Does not process imports, and does not attempt to be clever at all (e.g. no special treatment for inferred graphs, it just processes the inferred triples as normal).

Overrides:
addRaw in class com.hp.hpl.jena.ontology.tidy.impl.CheckerImpl
Parameters:
g - The graph to be added.

load

public void load(String url)
Include an ontology and its imports in the check.

Overrides:
load in class com.hp.hpl.jena.ontology.tidy.impl.CheckerImpl
Parameters:
url - Load the ontology from this URL.

load

public void load(String url,
                 String lang)
Include an ontology and its imports in the check.

Overrides:
load in class com.hp.hpl.jena.ontology.tidy.impl.CheckerImpl
Parameters:
url - Load the ontology from this URL.
lang - The language (RDF/XML, N3 or N-TRIPLE) in which the ontology is written.

add

public void add(Graph g)
Adds the graph to the syntax check. Only considers the base triples of an inferred graph (if recognised as such), processes imports (guessing that any MultiUnion has in fact been created by OntModel and contains the imports closure).

Parameters:
g - The Graph to be added.

addGraphAndImports

public void addGraphAndImports(Graph g)
Adds the graph, and definitely its imports, to the syntax check. If g is an inferred graph, the inferred triples are added (which is probably not what was desired).

Parameters:
g - The Graph to be added.

add

public void add(Model m)
Adds the model to the syntax check. Only considers the base triples of an inferred model (if recognised as such), along with any imports.

If the Model is an OntModel created with the ModelFactory then the base graph with its imports (which have already been collected) are added. Import processing is not redone at this stage.

The behaviour is identical to that of add(Graph); better control,if needed, is achieved through the use of addGraphAndImports(com.hp.hpl.jena.graph.Graph) and addRaw(com.hp.hpl.jena.graph.Graph).

Parameters:
m - The Model to be added.

getHighTide

public int getHighTide()

noremove

public void noremove()

setOptimizeMemory

public void setOptimizeMemory(boolean big)


Copyright © 2000, 2001, 2002, 2003, 2004 Hewlett-Packard Development Company, LP