|
|||||||||
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.Ontology
public class Ontology
This class represents an AceWiki ontology which consists of ontology element definitions and of ontological statements. Each ontology element has its own article that consists of ontological statements.
Method Summary | |
---|---|
protected int |
commitSentence(Sentence sentence)
Commits the sentence. |
boolean |
contains(OntologyElement ontologyElement)
Returns true if the given ontology element is contained by the ontology (identity check). |
OntologyElement |
get(java.lang.String name)
Returns the ontology element with the given name, or null if there is no such element. |
java.lang.String |
getACEText(boolean onlyConsistentSubset)
Returns the complete ontology as one ACE text. |
java.util.List<OntologyElement> |
getAnswer(Sentence questionSentence)
Returns a list of ontology elements that answer the given question. |
java.util.List<Concept> |
getConcepts(Individual ind)
Returns all concepts the given individual belongs to. |
java.util.List<Individual> |
getIndividuals(Concept concept)
Returns all individuals that belong to the given concept. |
java.lang.String |
getLexiconDef()
Returns the lexicon definition for all ontology elements in the ACE lexicon format. |
java.lang.String |
getName()
Returns the name of the ontology. |
java.util.Collection<OntologyElement> |
getOntologyElements()
Returns all ontology elements. |
org.semanticweb.owl.model.OWLOntology |
getOWLOntology(boolean onlyConsistentSubset)
Returns an OWL ontology object that contains the complete ontology. |
java.lang.String |
getOWLOntologyAsXML(boolean onlyConsistentSubset)
Returns the complete ontology as an OWL/XML formatted string. |
java.util.List<Sentence> |
getReferences(OntologyElement element)
Returns all the sentences that use the given ontology element (no matter which word form is used). |
java.util.List<Sentence> |
getReferences(OntologyElement element,
int wordNumber)
Returns all the sentences that use the given word form (by word number) of the given ontology element. |
java.util.List<Concept> |
getSubConcepts(Concept concept)
Returns all the sub-concepts of the given concept. |
java.util.List<Concept> |
getSuperConcepts(Concept concept)
Returns all super-concepts of the given concept. |
java.lang.String |
getURI()
Returns the URI of the ontology (baseURI + name). |
boolean |
isConsistent()
Returns true if the ontology is consistent. |
boolean |
isSatisfiable(Concept concept)
Checks if the given concept is satisfiable. |
static Ontology |
loadOntology(java.lang.String name,
java.lang.String baseURI)
Loads an ontology (or creates an empty ontology if the ontology cannot be found). |
org.semanticweb.owl.model.OWLOntology |
readOWLOntology(java.lang.String owlxml)
Uses the ontology manager to read an OWL ontology from a string (that contains an ontology in OWL-XML format). |
void |
remove(OntologyElement element)
Removes the given ontology element from the ontology. |
protected void |
retractSentence(Sentence sentence)
Retracts the sentence. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Ontology loadOntology(java.lang.String name, java.lang.String baseURI)
name
- The name of the ontology.baseURI
- The base URI that is used to identify the ontology elements.
public void remove(OntologyElement element)
element
- The ontology element to be removed.public java.util.List<Sentence> getReferences(OntologyElement element, int wordNumber)
element
- The ontology element.wordNumber
- The word number.
public java.util.List<Sentence> getReferences(OntologyElement element)
element
- The ontology element.
public OntologyElement get(java.lang.String name)
name
- The name of the ontology element.
public java.util.Collection<OntologyElement> getOntologyElements()
public boolean contains(OntologyElement ontologyElement)
ontologyElement
- The ontology element.
public java.lang.String getName()
public java.lang.String getURI()
public java.lang.String getOWLOntologyAsXML(boolean onlyConsistentSubset)
onlyConsistentSubset
- If true then only the consistent part of the ontology is included.
public org.semanticweb.owl.model.OWLOntology getOWLOntology(boolean onlyConsistentSubset)
onlyConsistentSubset
- If true then only the consistent part of the ontology is included.
public java.lang.String getACEText(boolean onlyConsistentSubset)
onlyConsistentSubset
- If true then only the consistent part of the ontology is included.
public java.lang.String getLexiconDef()
public org.semanticweb.owl.model.OWLOntology readOWLOntology(java.lang.String owlxml) throws org.semanticweb.owl.model.OWLOntologyCreationException
owlxml
- The serialized OWL-XML ontology.
org.semanticweb.owl.model.OWLOntologyCreationException
- If the string cannot be parsed.protected int commitSentence(Sentence sentence)
sentence
- The sentence to be commited.
protected void retractSentence(Sentence sentence)
sentence
- The sentence to be retracted.public java.util.List<Concept> getConcepts(Individual ind)
ind
- The individual.
Individual.getConcepts()
public java.util.List<Individual> getIndividuals(Concept concept)
concept
- The concept.
Concept.getIndividuals()
public java.util.List<Concept> getSuperConcepts(Concept concept)
concept
- The concept for which all super-concepts should be returned.
Concept.getSuperConcepts()
public java.util.List<Concept> getSubConcepts(Concept concept)
concept
- The concept for which all sub-concepts should be returned.
Concept.getSubConcepts()
public java.util.List<OntologyElement> getAnswer(Sentence questionSentence)
questionSentence
- The question sentence that should be answered.
Sentence.getAnswer()
public boolean isConsistent()
public boolean isSatisfiable(Concept concept)
concept
- The concept.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |