|
|||||||||
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.Statement
ch.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.
ACE sentences can either have an ontology element as owner (in the case of asserted sentences) or it can be an independent statement that has no owner (in the case of inferred sentences).
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.
Field Summary | |
---|---|
static ContextChecker |
contextChecker
The context checker used for AceWiki. |
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<OntologyElement> |
getAnswer()
Returns all ontology elements that answer this question. |
java.util.List<OntologyElement> |
getCachedAnswer()
Returns the cached answer if the sentence is a 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. |
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 up-to-date and thus 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 ch.uzh.ifi.attempto.acewiki.core.ontology.Statement |
---|
getOntology, getOwner |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ContextChecker contextChecker
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 java.lang.String getText()
getText
in class Statement
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()
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<OntologyElement> getAnswer()
Ontology.getAnswer(Sentence)
public java.util.List<OntologyElement> getCachedAnswer()
public boolean isAnswerCached()
public java.lang.String toString()
toString
in class Statement
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |