001    // This file is part of AceWiki.
002    // Copyright 2008-2012, AceWiki developers.
003    // 
004    // AceWiki is free software: you can redistribute it and/or modify it under the terms of the GNU
005    // Lesser General Public License as published by the Free Software Foundation, either version 3 of
006    // the License, or (at your option) any later version.
007    // 
008    // AceWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
009    // even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
010    // Lesser General Public License for more details.
011    // 
012    // You should have received a copy of the GNU Lesser General Public License along with AceWiki. If
013    // not, see http://www.gnu.org/licenses/.
014    
015    package ch.uzh.ifi.attempto.acewiki.core;
016    
017    /**
018     * This class represents an ontology element. Such ontology elements include individuals, concepts
019     * and relations. Each ontology element corresponds to a word which has one or more word forms.
020     * Word forms are identified by a number (the word form id).
021     * 
022     * @author Tobias Kuhn
023     */
024    public interface OntologyElement {
025            
026            /**
027             * Initializes the id of this ontology element.
028             * 
029             * @param id The id.
030             */
031            public void initId(long id);
032            
033            /**
034             * Initializes the ontology of this ontology element.
035             * 
036             * @param ontology The ontology.
037             */
038            public void initOntology(Ontology ontology);
039            
040            /**
041             * Initializes the article of this ontology element.
042             * 
043             * @param article The article.
044             */
045            public void initArticle(Article article);
046            
047            /**
048             * Returns the numerical id of this ontology element.
049             * 
050             * @return The id.
051             */
052            public long getId();
053            
054            /**
055             * Returns the ontology of this ontology element.
056             * 
057             * @return The ontology.
058             */
059            public Ontology getOntology();
060            
061            /**
062             * Returns the article of this ontology element.
063             * 
064             * @return The article.
065             */
066            public Article getArticle();
067            
068            /**
069             * Returns an array of all word forms.
070             * 
071             * @return An array containing all word forms.
072             */
073            public String[] getWords();
074    
075            /**
076             * Returns the word form for the given word form id.
077             * 
078             * @param wordFormID The word form id.
079             * @return The word form.
080             */
081            public String getWord(int wordFormID);
082            
083            /**
084             * Returns the main word form.
085             * 
086             * @return The word form.
087             */
088            public String getWord();
089            
090            /**
091             * Returns the headwords that are used in the GUI (title, index, etc) to refer to this ontology
092             * element. At least one headword is required.
093             * 
094             * @return The headwords.
095             */
096            public String[] getHeadwords();
097            
098            /**
099             * Returns the word type as it is used internally.
100             * 
101             * @return The internal word type.
102             */
103            public String getInternalType();
104            
105            /**
106             * Sets the word forms.
107             * 
108             * @param serializedWords The serialized word forms to be set.
109             */
110            public void setWords(String serializedWords);
111            
112            /**
113             * Returns the word forms of this ontology element in a serialized form.
114             * 
115             * @return The serialized word forms.
116             */
117            public String serializeWords();
118            
119            /**
120             * Returns the word type as it is shown to the user.
121             * 
122             * @return The word type.
123             */
124            public String getType();
125    
126    }