ch.uzh.ifi.attempto.acewiki.core
Class Ontology

java.lang.Object
  extended by ch.uzh.ifi.attempto.acewiki.core.Ontology

public class Ontology
extends java.lang.Object

This class represents an AceWiki ontology which consists of ontology element definitions and of ontological statements. Each ontology element has its own article that consists of ontological statements.

Author:
Tobias Kuhn

Method Summary
 void change(OntologyElement element, java.lang.String serializedWords)
          Changes the word forms of the given ontology element.
protected  void commitSentence(Sentence sentence)
          Commits the sentence.
 boolean contains(OntologyElement ontologyElement)
          Returns true if the given ontology element is contained by the ontology (identity check).
 OntologyElement get(long id)
          Returns the ontology element with the given id, or null if there is no such element.
 OntologyElement getElement(java.lang.String name)
          Returns the ontology element with the given name, or null if there is no such element.
 AceWikiEngine getEngine()
          Returns the AceWiki engine.
 java.lang.String getName()
          Returns the name of the ontology.
 java.util.List<OntologyElement> getOntologyElements()
          Returns all ontology elements.
 java.lang.String getParameter(java.lang.String name)
          Returns a parameter value.
 CachingReasoner getReasoner()
          Returns the reasoner object in the form of a caching reasoner.
 java.util.List<Sentence> getReferences(OntologyElement element)
          Returns all the sentences that use the given ontology element.
 long getStateID()
          Returns the state id of the ontology.
 StatementFactory getStatementFactory()
          Returns the statement factory.
 AceWikiStorage getStorage()
          Returns the storage object.
 java.lang.String getURI()
          Returns the URI of the ontology (baseURI + name).
 void log(java.lang.String text)
          Writes a log entry.
 void reassert(Sentence sentence)
          This method tries to reassert a sentence that is not yet integrated.
 void register(OntologyElement element)
          Registers the given ontology element.
 void remove(OntologyElement element)
          Removes the given ontology element from the ontology.
 void retract(Sentence sentence)
          This method retracts an integrated sentence so that it is still part of the wiki article but does not participate in reasoning anymore.
protected  void retractSentence(Sentence sentence)
          Retracts the sentence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getEngine

public AceWikiEngine getEngine()
Returns the AceWiki engine.

Returns:
The AceWiki engine.

getReasoner

public CachingReasoner getReasoner()
Returns the reasoner object in the form of a caching reasoner.

Returns:
The reasoner.

getStatementFactory

public StatementFactory getStatementFactory()
Returns the statement factory.

Returns:
The statement factory.

getStorage

public AceWikiStorage getStorage()
Returns the storage object.

Returns:
The storage object.

register

public void register(OntologyElement element)
Registers the given ontology element.

Parameters:
element - The ontology element to register.

remove

public void remove(OntologyElement element)
Removes the given ontology element from the ontology.

Parameters:
element - The ontology element to be removed.

change

public void change(OntologyElement element,
                   java.lang.String serializedWords)
Changes the word forms of the given ontology element.

Parameters:
element - The ontology element to be changed.
serializedWords - The serialized word forms.

getReferences

public java.util.List<Sentence> getReferences(OntologyElement element)
Returns all the sentences that use the given ontology element.

Parameters:
element - The ontology element.
Returns:
A list of all sentence that contain the ontology element.

getElement

public OntologyElement getElement(java.lang.String name)
Returns the ontology element with the given name, or null if there is no such element.

Parameters:
name - The name of the ontology element.
Returns:
The ontology element.

get

public OntologyElement get(long id)
Returns the ontology element with the given id, or null if there is no such element.

Parameters:
id - The id of the ontology element.
Returns:
The ontology element.

getOntologyElements

public java.util.List<OntologyElement> getOntologyElements()
Returns all ontology elements. The list is a copy of the internal list.

Returns:
A list of all ontology elements.

contains

public boolean contains(OntologyElement ontologyElement)
Returns true if the given ontology element is contained by the ontology (identity check).

Parameters:
ontologyElement - The ontology element.
Returns:
true if the ontology element is contained by the ontology.

getName

public java.lang.String getName()
Returns the name of the ontology.

Returns:
The name of the ontology.

getURI

public java.lang.String getURI()
Returns the URI of the ontology (baseURI + name).

Returns:
The URI of the ontology.

commitSentence

protected void commitSentence(Sentence sentence)
                       throws InconsistencyException
Commits the sentence. This means that it is added to the reasoner.

Parameters:
sentence - The sentence to be commited.
Throws:
InconsistencyException - if the sentence is inconsistent with the existing sentences.

reassert

public void reassert(Sentence sentence)
              throws InconsistencyException
This method tries to reassert a sentence that is not yet integrated.

Parameters:
sentence - The sentence to be reasserted.
Throws:
InconsistencyException - if the sentence is inconsistent with the existing sentences.

retractSentence

protected void retractSentence(Sentence sentence)
Retracts the sentence. This means that the sentence is removed from the reasoner.

Parameters:
sentence - The sentence to be retracted.

retract

public void retract(Sentence sentence)
This method retracts an integrated sentence so that it is still part of the wiki article but does not participate in reasoning anymore.

Parameters:
sentence - The sentence to be retracted.

log

public void log(java.lang.String text)
Writes a log entry.

Parameters:
text - Log text.

getStateID

public long getStateID()
Returns the state id of the ontology. This id increases each time the ontology changes (more precisely: each time the part of the ontology that participates in reasoning changes). This id is used to find out whether cached information is still valid or has to be recalculated.

Returns:
The state id of the ontology.

getParameter

public java.lang.String getParameter(java.lang.String name)
Returns a parameter value.

Parameters:
name - The parameter name.
Returns:
The parameter value.


Copyright 2008-2012, AceWiki developers