|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.openrdf.sesame.query.XmlQueryResultWriter
A TableQueryResultListener that converts query results into an XML document. The resulting XML document for a successful query has the following form:
<xml version="1.0" encoding="UTF-8"?>
<tableQueryResult>
<header>
<columnName>X</columnName>
<columnName>Y</columnName>
</header>
<tuple>
<uri>http://foo.com/bar</uri>
<literal>some text</literal>
</tuple>
<tuple>
<bNode>node1234</bNode>
<literal xml:lang="en">foobar</literal>
</tuple>
<tuple>
<bNode>node5678</bNode>
<literal datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"><foo>bar</foo></literal>
</tuple>
</tableQueryResult>
In case of an error, the error will be reported in the query result
itself, e.g.:
<?xml version="1.0" encoding="UTF-8"?>
<tableQueryResult>
<error type="MalformedQueryError">Expected '>', found ' '</error>
</tableQueryResult>
or:
<?xml version="1.0" encoding="UTF-8"?>
<tableQueryResult>
<header>
<columnName>X</columnName>
<columnName>Y</columnName>
</header>
<tuple>
<uri>http://foo.com/bar</uri>
<literal>some text</literal>
</tuple>
<error type="QueryEvaluationError">bladibla</error>
</tableQueryResult>
| Constructor Summary | |
XmlQueryResultWriter(OutputStream out)
Creates a new XmlQueryResultWriter (with plainXMLLiterals=false). |
|
XmlQueryResultWriter(OutputStream out,
boolean plainXMLLiterals)
|
|
XmlQueryResultWriter(Writer writer)
|
|
XmlQueryResultWriter(Writer writer,
boolean plainXMLLiterals)
|
|
| Method Summary | |
void |
endTableQueryResult()
Indicates the end of a table-like query result. |
void |
endTuple()
Indicates the end of a tuple/row. |
void |
error(QueryErrorType errType,
String msg)
Reports an error that has occurred during the query evaluation. |
void |
setPrettyPrint(boolean prettyPrint)
Enables/disables addition of indentation characters and newlines in the XML document. |
void |
startTableQueryResult()
Indicates the start of a table-like query result. |
void |
startTableQueryResult(String[] columnHeaders)
Indicates the start of a table-like query result. |
void |
startTuple()
Indicates the start of a tuple/row. |
void |
tupleValue(Value value)
Delivers the next value in the current tuple/row. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XmlQueryResultWriter(OutputStream out)
public XmlQueryResultWriter(OutputStream out,
boolean plainXMLLiterals)
public XmlQueryResultWriter(Writer writer)
public XmlQueryResultWriter(Writer writer,
boolean plainXMLLiterals)
| Method Detail |
public void setPrettyPrint(boolean prettyPrint)
public void startTableQueryResult()
throws IOException
TableQueryResultListener
startTableQueryResult in interface TableQueryResultListenerIOException
public void startTableQueryResult(String[] columnHeaders)
throws IOException
TableQueryResultListener
startTableQueryResult in interface TableQueryResultListenerIOException
public void endTableQueryResult()
throws IOException
TableQueryResultListener
endTableQueryResult in interface TableQueryResultListenerIOException
public void startTuple()
throws IOException
TableQueryResultListener
startTuple in interface TableQueryResultListenerIOException
public void endTuple()
throws IOException
TableQueryResultListener
endTuple in interface TableQueryResultListenerIOException
public void tupleValue(Value value)
throws IOException
TableQueryResultListener
tupleValue in interface TableQueryResultListenervalue - The next value in the current tuple/row.
IOException
public void error(QueryErrorType errType,
String msg)
throws IOException
TableQueryResultListener
error in interface TableQueryResultListenererrType - The type of error.msg - A message describing the error.
IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||