|
|||||||||
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 statements.
Constructor Summary | |
---|---|
protected |
OntologyElement()
Initializes the ontology element. |
Method Summary | |
---|---|
int |
add(Statement followingStatement,
java.util.List<Statement> newStatements)
Adds one or more new statements to the article. |
int |
add(Statement followingStatement,
Statement newStatement)
Adds one new statement 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(Statement oldStatement,
java.util.List<Statement> newStatements)
Edits a statement of the article. |
int |
edit(Statement oldStatement,
Statement newStatement)
Edits a statement of the article. |
java.lang.String |
getHeadword()
Returns the headword that is used in the GUI to refer to this ontology element. |
java.lang.String[] |
getIndexEntries()
Returns a list of words that should be listed in the index to point 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 ACE sentences of the article text. |
java.util.List<Statement> |
getStatements()
Returns the article text as a list of statements. |
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(Statement statement)
Removes the given statement 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 java.lang.String[] getIndexEntries()
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<Statement> getStatements()
public java.util.List<Sentence> getSentences()
public int edit(Statement oldStatement, Statement newStatement)
oldStatement
- The statement that should be edited.newStatement
- The new statement.
Ontology.commitSentence(Sentence)
public int edit(Statement oldStatement, java.util.List<Statement> newStatements)
oldStatement
- The statement that should be edited.newStatements
- The new statements.
Ontology.commitSentence(Sentence)
public int add(Statement followingStatement, Statement newStatement)
followingStatement
- The statement in front of which the new statement should be added,
or null if the statement should be added to the end of the article.newStatement
- The new statement to be added.
Ontology.commitSentence(Sentence)
public int add(Statement followingStatement, java.util.List<Statement> newStatements)
followingStatement
- The statement in front of which the new statements should be added,
or null if the statements should be added to the end of the article.newStatements
- The new statements to be added.
Ontology.commitSentence(Sentence)
public void remove(Statement statement)
statement
- The statement 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 |