|
|||||||||
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.Sentence
public class Sentence
This class represents an ACE sentence which is either a declarative statement or a question. Some declarative sentences can be translated into OWL and can participate in reasoning. Other sentences have no OWL representation and do not participate in reasoning.
Each sentence belongs to exactly one article of an ontology element (the owner).
Parsing of the sentence is done lasily, i.e. at the first time when a parsing result is required. Parsing fails silently. No exceptions are thrown if a sentence is not ACE compliant.
Constructor Summary | |
---|---|
Sentence(java.lang.String text,
Ontology ontology)
Creates a new inferred sentence. |
|
Sentence(java.lang.String text,
OntologyElement owner)
Creates a new asserted sentence. |
Method Summary | |
---|---|
boolean |
contains(OntologyElement e)
Checks whether the sentence contains the given ontology element (no matter which word form). |
boolean |
contains(OntologyElement e,
int wordNumber)
Checks whether the sentence contains the given word form (by word number) of the given ontology element. |
static java.util.List<Sentence> |
generateSentences(TextContainer textContainer,
OntologyElement owner)
Generates sentence objects out of a text container. |
java.util.List<Individual> |
getAnswer()
Returns all individuals that answer this question. |
org.semanticweb.owl.model.OWLOntology |
getOWLOntology()
Returns the OWL ontology object that contains the OWL representation of this sentence. |
java.lang.String |
getOWLXML()
Returns the OWL/XML representation of this sentence as a string. |
OntologyElement |
getOwner()
Returns the owner ontology element of this sentence. |
ACEParserResult |
getParserResult()
Returns the parser result object. |
java.lang.String |
getPrettyText()
Returns the sentence text as a string with underscores displayed as blanks. |
java.lang.String |
getText()
Returns the sentence text as a string. |
java.util.List<TextElement> |
getTextElements()
Returns a list of text elements that represent the tokens of this sentence. |
boolean |
isAnswerCached()
Returns true if the sentence is a question and the answer to the question is cached and does not have to be recalculated. |
boolean |
isInferred()
Checks if the sentence is inferred or asserted. |
boolean |
isIntegrated()
Returns true if the sentence is integrated into the ontology. |
boolean |
isOWL()
Returns true if this sentence has an OWL representation. |
boolean |
isOWLSWRL()
Returns true if this sentence has an OWL or SWRL representation. |
boolean |
isQuestion()
Returns true if the sentence is a question. |
boolean |
isReasonerParticipant()
Returns true if this sentence participates in reasoning. |
int |
reassert()
This method tries to reassert a sentence that is not yet integrated. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Sentence(java.lang.String text, OntologyElement owner)
text
- The sentence text.owner
- The owner ontology element.public Sentence(java.lang.String text, Ontology ontology)
text
- The sentence text.ontology
- The ontology.Method Detail |
---|
public static java.util.List<Sentence> generateSentences(TextContainer textContainer, OntologyElement owner)
textContainer
- The text container.owner
- The owner ontology element of the sentences.
public java.util.List<TextElement> getTextElements()
public OntologyElement getOwner()
public java.lang.String getText()
public java.lang.String getPrettyText()
public ACEParserResult getParserResult()
public java.lang.String getOWLXML()
public boolean isReasonerParticipant()
public boolean isOWL()
public boolean isOWLSWRL()
public org.semanticweb.owl.model.OWLOntology getOWLOntology() throws org.semanticweb.owl.model.OWLOntologyCreationException
org.semanticweb.owl.model.OWLOntologyCreationException
- If the OWL ontology object creation failed.public int reassert()
Ontology.commitSentence(Sentence)
public boolean isIntegrated()
public boolean isQuestion()
public boolean isInferred()
public boolean contains(OntologyElement e, int wordNumber)
e
- The ontology element.wordNumber
- The word number.
public boolean contains(OntologyElement e)
e
- The ontology element.
public java.util.List<Individual> getAnswer()
Ontology.getAnswer(Sentence)
public boolean isAnswerCached()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |