ch.uzh.ifi.attempto.acewiki.aceowl
Class ProperNameIndividual

java.lang.Object
  extended by ch.uzh.ifi.attempto.acewiki.core.AbstractOntologyElement
      extended by ch.uzh.ifi.attempto.acewiki.owl.AbstractOWLOntoElement
          extended by ch.uzh.ifi.attempto.acewiki.owl.OWLIndividual
              extended by ch.uzh.ifi.attempto.acewiki.aceowl.ProperNameIndividual
All Implemented Interfaces:
ACEOWLOntoElement, AnswerElement, Individual, OntologyElement, OWLOntoElement

public class ProperNameIndividual
extends OWLIndividual
implements ACEOWLOntoElement

This class stands for individuals that are represented by ACE proper names and OWL individuals. 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
ProperNameIndividual()
          Creates a new individual that has no name yet and is not registered to an ontology.
 
Method Summary
 void collectLexicalRules(java.lang.String catName, java.util.Collection<LexicalRule> lexRules)
          This method should collect the lexical rules of this ontology element for the given category name.
 java.lang.String getAbbreviation()
          Returns the abbreviation (without definite article) or null if there is no abbreviation.
 TextContainer getAnswerText()
          Returns the text to be shown when this ontology element is the answer to a question.
 java.lang.String[] getHeadwords()
          Returns the headwords that are used in the GUI (title, index, etc) to refer to this ontology element.
 java.lang.String getInternalType()
          Returns the word type as it is used internally.
 java.lang.String getIRISuffix()
          Returns the suffix of the OWL identifier of this ontology element.
 java.util.List<ch.uzh.ifi.attempto.ape.LexiconEntry> getLexiconEntries()
          Returns the lexicon entries (one for each word form).
 java.lang.String getType()
          Returns the word type as it is shown to the user.
 java.lang.String[] getWords()
          Returns an array of all 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".
 java.lang.String serializeWords()
          Returns the word forms of this ontology element in a serialized form.
 void setWords(java.lang.String serializedWords)
          Sets the word forms.
 
Methods inherited from class ch.uzh.ifi.attempto.acewiki.owl.OWLIndividual
getOWLRepresentation
 
Methods inherited from class ch.uzh.ifi.attempto.acewiki.owl.AbstractOWLOntoElement
getIRI, getOWLDataFactory, getOWLDeclaration
 
Methods inherited from class ch.uzh.ifi.attempto.acewiki.core.AbstractOntologyElement
getArticle, getId, getOntology, getWord, getWord, initArticle, initId, initOntology, log, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ch.uzh.ifi.attempto.acewiki.core.OntologyElement
getArticle, getId, getOntology, getWord, getWord, initArticle, initId, initOntology
 
Methods inherited from interface ch.uzh.ifi.attempto.acewiki.owl.OWLOntoElement
getIRI, getOWLDeclaration, getOWLRepresentation
 

Constructor Detail

ProperNameIndividual

public ProperNameIndividual()
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 interface: OntologyElement
Returns an array of all word forms.

Specified by:
getWords in interface OntologyElement
Returns:
An array containing all word forms.

getHeadwords

public java.lang.String[] getHeadwords()
Description copied from interface: OntologyElement
Returns the headwords that are used in the GUI (title, index, etc) to refer to this ontology element. At least one headword is required.

Specified by:
getHeadwords in interface OntologyElement
Overrides:
getHeadwords in class AbstractOntologyElement
Returns:
The headwords.

setWords

public void setWords(java.lang.String serializedWords)
Description copied from interface: OntologyElement
Sets the word forms.

Specified by:
setWords in interface OntologyElement
Parameters:
serializedWords - The serialized word forms to be set.

serializeWords

public java.lang.String serializeWords()
Description copied from interface: OntologyElement
Returns the word forms of this ontology element in a serialized form.

Specified by:
serializeWords in interface OntologyElement
Returns:
The serialized word forms.

getLexiconEntries

public java.util.List<ch.uzh.ifi.attempto.ape.LexiconEntry> getLexiconEntries()
Description copied from interface: ACEOWLOntoElement
Returns the lexicon entries (one for each word form).

Specified by:
getLexiconEntries in interface ACEOWLOntoElement
Returns:
The lexicon entries.

getType

public java.lang.String getType()
Description copied from interface: OntologyElement
Returns the word type as it is shown to the user.

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

getInternalType

public java.lang.String getInternalType()
Description copied from interface: OntologyElement
Returns the word type as it is used internally.

Specified by:
getInternalType in interface 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

getIRISuffix

public java.lang.String getIRISuffix()
Description copied from class: AbstractOWLOntoElement
Returns the suffix of the OWL identifier of this ontology element. Such identifiers are IRIs and the suffix is the part after the hash sign.

Specified by:
getIRISuffix in class AbstractOWLOntoElement
Returns:
The IRI suffix.

collectLexicalRules

public void collectLexicalRules(java.lang.String catName,
                                java.util.Collection<LexicalRule> lexRules)
Description copied from interface: ACEOWLOntoElement
This method should collect the lexical rules of this ontology element for the given category name.

Specified by:
collectLexicalRules in interface ACEOWLOntoElement
Parameters:
catName - The category name.
lexRules - The lexical rules should be added to this collection.

getAnswerText

public TextContainer getAnswerText()
Description copied from interface: AnswerElement
Returns the text to be shown when this ontology element is the answer to a question.

Specified by:
getAnswerText in interface AnswerElement
Returns:
The answer text.


Copyright 2008-2012, AceWiki developers