|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinf.compilers.XmlAdaptor<Sentence>
ai.krr.fol.XfolSentenceAdaptor
public class XfolSentenceAdaptor
This class is an adaptor between the ai.krr.propositions.Sentence class that can be used as an internal representation for reasoning and its external form in an XML Syntax. The XMLSchema defining the XFOL format ....
property | possible values | default |
---|---|---|
case-sensitive | true, false | true |
Field Summary |
---|
Fields inherited from class inf.compilers.XmlAdaptor |
---|
indentStr, props |
Constructor Summary | |
---|---|
XfolSentenceAdaptor()
This constructor creates a SyntaxAdaptor that can be used to read statements in an XML syntax for propositional logic (XFOL) and create a propositional Sentence for it, or it can be used to write out a propositional Sentence in XFOL syntax. |
Method Summary | |
---|---|
protected XfolSentenceAdaptor |
clone()
This function returns a copy of this SyntaxAdaptor that contains a (shallow) copy of the properties. |
protected org.w3c.dom.Element |
generateAtomNode(org.w3c.dom.Document doc,
Atom atom,
java.util.Set<NameSpace> nss)
|
protected org.w3c.dom.Element |
generateCharacterNode(org.w3c.dom.Document doc,
CharacterSymbol charSy)
|
protected org.w3c.dom.Element |
generateConnectedSentenceNode(org.w3c.dom.Document doc,
ConnectedSentence stmt,
java.util.Set<NameSpace> nss)
|
protected org.w3c.dom.Element |
generateConstantTermNode(org.w3c.dom.Document doc,
Constant cTerm)
|
protected org.w3c.dom.Element |
generateFunctionTermNode(org.w3c.dom.Document doc,
FunctionTerm fTerm)
|
protected org.w3c.dom.Element |
generateIntegerNode(org.w3c.dom.Document doc,
IntegerSymbol intSy)
|
protected org.w3c.dom.Element |
generateLiteralNode(org.w3c.dom.Document doc,
Literal lit,
java.util.Set<NameSpace> nss)
|
protected org.w3c.dom.Element |
generateNegatedSentenceNode(org.w3c.dom.Document doc,
NegatedSentence stmt,
java.util.Set<NameSpace> nss)
|
org.w3c.dom.Element |
generateNodeTree(org.w3c.dom.Document doc,
Sentence content)
This function generates an Element Node that is the root for the given content. |
protected org.w3c.dom.Element |
generatePrefixNode(org.w3c.dom.Document doc,
QuantifiedSentence stmt)
|
protected org.w3c.dom.Element |
generateQuantifiedSentenceNode(org.w3c.dom.Document doc,
QuantifiedSentence stmt,
java.util.Set<NameSpace> nss)
|
protected org.w3c.dom.Element |
generateRealNumberNode(org.w3c.dom.Document doc,
RealNumberSymbol realSy)
|
org.w3c.dom.Element |
generateSentenceNode(org.w3c.dom.Document doc,
Sentence content,
java.util.Set<NameSpace> nss)
This function generates an Element Node that is the root for the given content. |
protected org.w3c.dom.Element |
generateStringNode(org.w3c.dom.Document doc,
StringSymbol strSy)
|
protected org.w3c.dom.Element |
generateSymbolNode(org.w3c.dom.Document doc,
java.lang.String tag,
NamedSymbol nSy)
|
protected org.w3c.dom.Element |
generateTermNode(org.w3c.dom.Document doc,
Term term)
|
protected org.w3c.dom.Element |
generateTruthValueNode(org.w3c.dom.Document doc,
TruthValue tValue,
java.util.Set<NameSpace> nss)
|
protected org.w3c.dom.Element |
generateVariableNode(org.w3c.dom.Document doc,
Variable var)
|
java.lang.Class<Sentence> |
getInternalClass()
This function returns the Class that holds the internal representation this adaptor translates to and from. |
java.lang.String |
getSyntaxName()
This function returns the name that should identify the syntactical language that this adaptor translates to and from. |
protected Atom |
parseAtom(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected Constant |
parseCharacter(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected ConnectedSentence |
parseConnectedSentence(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected Constant |
parseConstant(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected FunctionTerm |
parseFunctionTerm(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected Constant |
parseInteger(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected Literal |
parseLiteral(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected NegatedSentence |
parseNegatedSentence(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
Sentence |
parseNodeTree(org.w3c.dom.Element root)
This function takes a DOM Document and generates an internal representation of the statement in the representation R that represents the content of the given Document. |
protected QuantifiedSentence |
parseQuantifiedSentence(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected Constant |
parseRealNumber(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected Sentence |
parseSentence(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected Constant |
parseString(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected Term |
parseTerm(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected TruthValue |
parseTruthValue(org.w3c.dom.Element node)
|
protected Variable |
parseVariable(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
Methods inherited from class inf.compilers.XmlAdaptor |
---|
addContentText, generateContentNodeTree, generateDocument, getContentText, getProperty, parseContentNodeTree, parseDocument, prettyPrint, read, setProperty, setSyntaxAdaptors, write |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XfolSentenceAdaptor()
This constructor creates a SyntaxAdaptor that can be used to read statements in an XML syntax for propositional logic (XFOL) and create a propositional Sentence for it, or it can be used to write out a propositional Sentence in XFOL syntax. The given properties must not be null.
props
- the Properties that determine how to perform the reading and
writingMethod Detail |
---|
protected XfolSentenceAdaptor clone()
This function returns a copy of this SyntaxAdaptor that contains a (shallow) copy of the properties.
clone
in class java.lang.Object
public java.lang.Class<Sentence> getInternalClass()
This function returns the Class that holds the internal representation this adaptor translates to and from.
public java.lang.String getSyntaxName()
This function returns the name that should identify the syntactical language that this adaptor translates to and from.
public Sentence parseNodeTree(org.w3c.dom.Element root) throws inf.compilers.ExpressivenessException, java.text.ParseException
This function takes a DOM Document and generates an internal representation of the statement in the representation R that represents the content of the given Document. No validation will be performed here.
parseNodeTree
in class inf.compilers.XmlAdaptor<Sentence>
doc
- the Document to be transformed here
inf.compilers.ExpressivenessException
java.text.ParseException
public org.w3c.dom.Element generateNodeTree(org.w3c.dom.Document doc, Sentence content) throws inf.compilers.ExpressivenessException
This function generates an Element Node that is the root for the given content. The way it is generated depends on the type of sentence this is.
generateNodeTree
in class inf.compilers.XmlAdaptor<Sentence>
doc
- the Document to which the Node will belongcontent
- a statement in the internal representation language
inf.compilers.ExpressivenessException
- if the XML cannot represent the given
statementpublic org.w3c.dom.Element generateSentenceNode(org.w3c.dom.Document doc, Sentence content, java.util.Set<NameSpace> nss) throws inf.compilers.ExpressivenessException
This function generates an Element Node that is the root for the given content. The way it is generated depends on the type of sentence this is.
doc
- the Document to which the Node will belongcontent
- a statement in the internal representation languagenss
- the set of all NameSpaces used in the given Sentence
inf.compilers.ExpressivenessException
- if any contained NamedSymbol is internalprotected org.w3c.dom.Element generateQuantifiedSentenceNode(org.w3c.dom.Document doc, QuantifiedSentence stmt, java.util.Set<NameSpace> nss) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generatePrefixNode(org.w3c.dom.Document doc, QuantifiedSentence stmt) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateConnectedSentenceNode(org.w3c.dom.Document doc, ConnectedSentence stmt, java.util.Set<NameSpace> nss) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateNegatedSentenceNode(org.w3c.dom.Document doc, NegatedSentence stmt, java.util.Set<NameSpace> nss) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateLiteralNode(org.w3c.dom.Document doc, Literal lit, java.util.Set<NameSpace> nss) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateAtomNode(org.w3c.dom.Document doc, Atom atom, java.util.Set<NameSpace> nss) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateTruthValueNode(org.w3c.dom.Document doc, TruthValue tValue, java.util.Set<NameSpace> nss) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateTermNode(org.w3c.dom.Document doc, Term term) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateFunctionTermNode(org.w3c.dom.Document doc, FunctionTerm fTerm) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateVariableNode(org.w3c.dom.Document doc, Variable var) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateConstantTermNode(org.w3c.dom.Document doc, Constant cTerm) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateSymbolNode(org.w3c.dom.Document doc, java.lang.String tag, NamedSymbol nSy) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateStringNode(org.w3c.dom.Document doc, StringSymbol strSy) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateCharacterNode(org.w3c.dom.Document doc, CharacterSymbol charSy) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateRealNumberNode(org.w3c.dom.Document doc, RealNumberSymbol realSy) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateIntegerNode(org.w3c.dom.Document doc, IntegerSymbol intSy) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected Sentence parseSentence(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected QuantifiedSentence parseQuantifiedSentence(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected ConnectedSentence parseConnectedSentence(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected NegatedSentence parseNegatedSentence(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected Literal parseLiteral(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected Atom parseAtom(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected TruthValue parseTruthValue(org.w3c.dom.Element node)
protected Term parseTerm(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected FunctionTerm parseFunctionTerm(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected Variable parseVariable(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected Constant parseConstant(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected Constant parseString(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected Constant parseCharacter(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected Constant parseRealNumber(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected Constant parseInteger(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |