ch.uzh.ifi.attempto.acewiki.core.ontology
Class Individual

java.lang.Object
  extended by ch.uzh.ifi.attempto.acewiki.core.ontology.OntologyElement
      extended by ch.uzh.ifi.attempto.acewiki.core.ontology.Individual
All Implemented Interfaces:
java.lang.Comparable<OntologyElement>

public class Individual
extends OntologyElement

This class represents an individual (in logic called "constant"). AceWiki supports only proper names to represent individuals (and no extensions are planned in this respect). For that reason, this class is proper name specific.

Proper names can be used either with a definite article (e.g. "the United Nations") or without (e.g. "Switzerland"). Furthermore, proper names can have an abbreviation that is a shorter name with exactly the same meaning. This abbreviation can aswell be used either with a definite article (e.g. "the UN") or without (e.g. "ACE").

Proper names have four word forms. The first one is the proper name with the definite article or just the proper name if no definite article is used for this proper name. The second one is in each case just the bare proper name. The third form is the abbreviation with the definite article if there is one. The fourth form, finally, is just the bare abbreviation. If there is no abbreviation then the third and fourth form are identical to the first and second form, respectively. For proper names that do not use a definite article and that have no abbreviation, all four forms are identical.

0: proper name, preceded by "the" if used with definite article. 1: bare proper name. 2: abbreviation, preceded by "the" if used with definite article; or the same as 0 if there is no abbreviation. 3: bare abbreviation; or the same as 1 if there is no abbreviation.

Examples: ["the United Nations", "United Nations", "the UN", "UN"]; ["the Nile", "Nile", "Nile", "Nile]; ["Switzerland", "Switzerland", "Switzerland", "Switzerland"]; ["Attempto Controlled English", "Attempto Controlled English", "ACE", "ACE"].

Author:
Tobias Kuhn

Constructor Summary
Individual()
          Creates a new individual that has no name yet and is not registered to an ontology.
 
Method Summary
 boolean areConceptsCached()
          Returns true if the concepts of this individual are cached and up-to-date and thus do not have to be recalculated.
protected  void changeWords(java.lang.String... words)
          Changes the word forms without updating the ontology indexes.
 java.lang.String getAbbreviation()
          Returns the abbreviation (without definite article) or null if there is no abbreviation.
 java.util.List<Concept> getCachedConcepts()
          Returns the cached concepts or null if there are no cached concepts.
 java.util.List<Concept> getConcepts()
          Calculates all concepts this individual belongs to.
 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.
 java.lang.String getInternalType()
          Returns the word type as it is used internally.
 java.lang.String getType()
          Returns the word type as it is shown to the user.
 java.lang.String getURISuffix()
          Returns the URI suffix of this ontology element.
 java.lang.String[] getWords()
          Returns the word forms.
 boolean hasDefiniteArticle()
          Returns true if the proper name has to be used with the definite article "the".
 boolean hasDefiniteArticle(int wordNumber)
          Returns true if the given word form uses the definite article "the".
 
Methods inherited from class ch.uzh.ifi.attempto.acewiki.core.ontology.OntologyElement
add, add, compareTo, edit, edit, getOntology, getPrettyWord, getSentences, getStatements, getURI, getWord, getWord, log, registerAt, remove, setWords, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Individual

public Individual()
Creates a new individual that has no name yet and is not registered to an ontology.

Method Detail

getWords

public java.lang.String[] getWords()
Description copied from class: OntologyElement
Returns the word forms. The position in the array corresponds to the word form id.

Specified by:
getWords in class OntologyElement
Returns:
An array containing the word forms.

getHeadword

public java.lang.String getHeadword()
Description copied from class: OntologyElement
Returns the headword that is used in the GUI to refer to this ontology element. For example, it is used for the title of the article. Unless overridden, it is the same as the pretty-printed word form with the id 0.

Overrides:
getHeadword in class OntologyElement
Returns:
The headword.

getIndexEntries

public java.lang.String[] getIndexEntries()
Description copied from class: OntologyElement
Returns a list of words that should be listed in the index to point to this ontology element.

Overrides:
getIndexEntries in class OntologyElement
Returns:
The index words.

changeWords

protected void changeWords(java.lang.String... words)
Description copied from class: OntologyElement
Changes the word forms without updating the ontology indexes. The order reflects the word form ids.

Specified by:
changeWords in class OntologyElement
Parameters:
words - The word forms.

getType

public java.lang.String getType()
Description copied from class: OntologyElement
Returns the word type as it is shown to the user. Newer versions of AceWiki can savely change this value.

Specified by:
getType in class OntologyElement
Returns:
The word type.

getInternalType

public java.lang.String getInternalType()
Description copied from class: OntologyElement
Returns the word type as it is used internally. Changing this value in newer versions of AceWiki breaks backwards compatibility for loading ontologies.

Specified by:
getInternalType in class OntologyElement
Returns:
The internal word type.

hasDefiniteArticle

public boolean hasDefiniteArticle()
Returns true if the proper name has to be used with the definite article "the".

Returns:
true if the definite article "the" has to be used.

hasDefiniteArticle

public boolean hasDefiniteArticle(int wordNumber)
Returns true if the given word form uses the definite article "the". This returns always false for 1 and 3.

Parameters:
wordNumber - the word number
Returns:
true if the definite article "the" is used for the word form of the given word number

getAbbreviation

public java.lang.String getAbbreviation()
Returns the abbreviation (without definite article) or null if there is no abbreviation.

Returns:
the abbreviation

getURISuffix

public java.lang.String getURISuffix()
Description copied from class: OntologyElement
Returns the URI suffix of this ontology element. For example "#country".

Overrides:
getURISuffix in class OntologyElement
Returns:
The URI suffix.
See Also:
OntologyElement.getURI()

getConcepts

public java.util.List<Concept> getConcepts()
Calculates all concepts this individual belongs to.

Returns:
A list of all concepts of this individual.
See Also:
Ontology.getConcepts(Individual)

getCachedConcepts

public java.util.List<Concept> getCachedConcepts()
Returns the cached concepts or null if there are no cached concepts. The returned concepts might not be up-to-date.

Returns:
A list of the cached concepts of this individual.

areConceptsCached

public boolean areConceptsCached()
Returns true if the concepts of this individual are cached and up-to-date and thus do not have to be recalculated.

Returns:
true if the concepts are cached.


Copyright 2008-2009, Attempto Group, University of Zurich (see http://attempto.ifi.uzh.ch)