|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.uzh.ifi.attempto.acewiki.core.ontology.OntologyElement
public abstract class OntologyElement
This class represents an ontology element which can be an individual ("constant"), a concept ("unary relation", "class", "type"), or a role ("binary relation", "property"). See the respective sub-classes.
In AceWiki, each ontology element corresponds to a word which has one or more word forms. Word forms are identified by a number (the word form id).
Every ontology element has an article which consists of a list of sentences.
| Constructor Summary | |
|---|---|
protected |
OntologyElement()
Initializes the ontology element. |
| Method Summary | |
|---|---|
int |
add(Sentence followingSentence,
java.util.List<Sentence> newSentences)
Adds one or more new sentences to the article. |
protected abstract void |
changeWords(java.lang.String... words)
Changes the word forms without updating the ontology indexes. |
int |
compareTo(OntologyElement e)
|
int |
edit(Sentence oldSentence,
java.util.List<Sentence> newSentences)
Edits a sentence of the article. |
java.lang.String |
getHeadword()
Returns the headword that is used in the GUI to refer to this ontology element. |
abstract java.lang.String |
getInternalType()
Returns the word type as it is used internally. |
Ontology |
getOntology()
Returns the ontology this ontology element is registered at. |
java.lang.String |
getPrettyWord(int n)
Returns the pretty-printed word form for the given word form id. |
java.util.List<Sentence> |
getSentences()
Returns the article text as a list of sentences. |
abstract java.lang.String |
getType()
Returns the word type as it is shown to the user. |
java.net.URI |
getURI()
Returns the URI of the ontology element. |
java.lang.String |
getURISuffix()
Returns the URI suffix of this ontology element. |
java.lang.String |
getWord()
Returns the word form with the id 0 (the default word form). |
java.lang.String |
getWord(int n)
Returns the word form for the given word form id. |
abstract java.lang.String[] |
getWords()
Returns the word forms. |
protected void |
log(java.lang.String text)
Writes the text to the log file. |
void |
registerAt(Ontology ontology)
Registers this ontology element at the given ontology. |
void |
remove(Sentence sentence)
Removes the given sentence from the article. |
void |
setWords(java.lang.String... words)
Sets the word forms. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected OntologyElement()
| Method Detail |
|---|
public abstract java.lang.String[] getWords()
public java.lang.String getWord(int n)
n - The word form id.
public java.lang.String getWord()
public java.lang.String getPrettyWord(int n)
n - The word form id.
public final void setWords(java.lang.String... words)
words - The word forms.protected abstract void changeWords(java.lang.String... words)
words - The word forms.public java.lang.String getHeadword()
public abstract java.lang.String getType()
public abstract java.lang.String getInternalType()
public Ontology getOntology()
public void registerAt(Ontology ontology)
ontology - public java.util.List<Sentence> getSentences()
public int edit(Sentence oldSentence,
java.util.List<Sentence> newSentences)
oldSentence - The sentence that should be edited.newSentences - The new sentences.
Ontology.commitSentence(Sentence)
public int add(Sentence followingSentence,
java.util.List<Sentence> newSentences)
followingSentence - The sentence in front of which the new sentences should be added,
or null if the sentences should be added to the end of the article.newSentences - The new sentences to be added.
Ontology.commitSentence(Sentence)public void remove(Sentence sentence)
sentence - The sentence to be removed.public final java.net.URI getURI()
getURISuffix()public java.lang.String getURISuffix()
getURI()protected void log(java.lang.String text)
text - The text to be written to the log file.public int compareTo(OntologyElement e)
compareTo in interface java.lang.Comparable<OntologyElement>public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||