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    import java.util.List;
018    
019    /**
020     * This is the main interface for the AceWiki behavior.
021     * 
022     * @author Tobias Kuhn
023     */
024    public interface AceWikiEngine {
025            
026            /**
027             * This is the first method to be called and provides the ontology object.
028             * 
029             * @param ontology The ontology object.
030             */
031            public void init(Ontology ontology);
032            
033            /**
034             * Returns the language handler for the given language.
035             * 
036             * @param language The name of the language.
037             * @return The language handler for the given language.
038             */
039            public LanguageHandler getLanguageHandler(String language);
040            
041            /**
042             * Returns the available languages. The first language is considered the default one, which
043             * means that at least one language must be returned.
044             * 
045             * @return An array of language names.
046             */
047            public String[] getLanguages();
048            
049            /**
050             * Returns the lexical types, as defined by the respective ontology element types.
051             * 
052             * @return The lexical types.
053             */
054            public String[] getLexicalTypes();
055            
056            /**
057             * Returns the reasoner.
058             * 
059             * @return The reasoner.
060             */
061            public AceWikiReasoner getReasoner();
062            
063            /**
064             * Returns the word index.
065             * 
066             * @return The word index.
067             */
068            public WordIndex getWordIndex();
069            
070            /**
071             * Returns a list of exporters to export the wiki content in different formats.
072             * 
073             * @return A list of ontology exporters.
074             */
075            public List<OntologyExporter> getExporters();
076            
077            /**
078             * Creates a new ontology element for the given lexical type.
079             * 
080             * @param type The lexical type.
081             * @return A new ontology element.
082             */
083            public OntologyElement createOntologyElement(String type);
084            
085            /**
086             * Creates a new sentence object based on the given serialization.
087             * 
088             * @param serialized The serialized representation of the sentence.
089             * @return A new sentence object.
090             */
091            public Sentence createSentence(String serialized);
092            
093            /**
094             * Creates a new assignement sentence that assigns a given individual to a given concept.
095             * 
096             * @param ind The individual.
097             * @param concept The concept.
098             * @return A new sentence representing the assignment.
099             */
100            public Sentence createAssignmentSentence(Individual ind, Concept concept);
101    
102            /**
103             * Creates a new hierarchy sentence that states that a certain concept is a sub-concept of
104             * another concept.
105             * 
106             * @param subConcept The sub-concept.
107             * @param superConcept The super-concept.
108             * @return A new sentence representing the assignment.
109             */
110            public Sentence createHierarchySentence(Concept subConcept, Concept superConcept);
111    
112    }