Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.hp.hpl.jena.query
Class ResultSetFormatter

    java.lang.Object
      com.hp.hpl.jena.query.ResultSetFormatter

    public class ResultSetFormatter

extends java.lang.Object

ResultSetFormatter - Convenience ways to call the various output formatters. in various formats.

Author:
  Andy Seaborne

Constructor Summary
`ResultSetFormatter()`

Method Summary
`static com.hp.hpl.jena.rdf.model.Resource` | `asRDF(com.hp.hpl.jena.rdf.model.Model model, boolean booleanResult)` Encode the boolean as RDF in the model provided.
`static com.hp.hpl.jena.rdf.model.Resource` | `asRDF(com.hp.hpl.jena.rdf.model.Model model, ResultSet resultSet)` Encode the result set as RDF in the model provided.
`static java.lang.String` | `asXMLString(boolean booleanResult)` Return a string that has the result set serilized as XML (not RDF)
`static java.lang.String` | `asXMLString(boolean booleanResult, java.lang.String stylesheet)` Return a string that has the result set serilized as XML (not RDF)
`static java.lang.String` | `asXMLString(ResultSet qresults)` Return a string that has the result set serilized as XML (not RDF)
`static java.lang.String` | `asXMLString(ResultSet qresults, java.lang.String stylesheet)` Return a string that has the result set serilized as XML (not RDF) with a style sheet directive inserted into the XML.
`static int` | `consume(ResultSet resultSet)` This operation faithfully walks the results but does nothing with them.
`static void` | `out(boolean answer)` Output an ASK answer
`static void` | `out(java.io.OutputStream out, boolean answer)` Output an ASK answer
`static void` | `out(java.io.OutputStream out, ResultSet qresults)` Output a result set in a text format.
`static void` | `out(java.io.OutputStream out, ResultSet qresults, com.hp.hpl.jena.shared.PrefixMapping pmap)` Output a result set in a text format.
`static void` | `out(java.io.OutputStream out, ResultSet qresults, com.hp.hpl.jena.sparql.core.Prologue prologue)` Output a result set in a text format.
`static void` | `out(ResultSet qresults)` Output a result set in a text format.
`static void` | `out(ResultSet qresults, com.hp.hpl.jena.shared.PrefixMapping pmap)` Output a result set in a text format.
`static void` | `out(ResultSet qresults, com.hp.hpl.jena.sparql.core.Prologue prologue)` Output a result set in a text format.
`static void` | `out(ResultSet qresults, Query query)` Output a result set in a text format.
`static void` | `output(java.io.OutputStream outStream, ResultSet resultSet, com.hp.hpl.jena.sparql.resultset.ResultSetFormat rFmt)` Output a ResultSetin some format.
`static void` | `output(ResultSet resultSet, com.hp.hpl.jena.sparql.resultset.ResultSetFormat rFmt)` Output a ResultSetin some format.
`static void` | `outputAsJSON(boolean booleanResult)` Output a result set in the JSON format Format: Serializing SPARQL Query Results in JSON JSON: http://json.org/
`static void` | `outputAsJSON(java.io.OutputStream outStream, boolean booleanResult)` Output a result set in the JSON format Format: Serializing SPARQL Query Results in JSON JSON: http://json.org/
`static void` | `outputAsJSON(java.io.OutputStream outStream, ResultSet resultSet)` Output a result set in the JSON format Format: Serializing SPARQL Query Results in JSON JSON: http://json.org/
`static void` | `outputAsJSON(ResultSet resultSet)` Output a result set in the JSON format Format: Serializing SPARQL Query Results in JSON JSON: http://json.org/
`static void` | `outputAsRDF(java.io.OutputStream outStream, java.lang.String format, boolean booleanResult)` Write out an RDF model that encodes a boolean result
`static void` | `outputAsRDF(java.io.OutputStream outStream, java.lang.String format, ResultSet resultSet)` Write out an RDF model that encodes the result set
`static void` | `outputAsRDF(java.lang.String format, boolean booleanResult)` Write out an RDF model that encodes a boolean result
`static void` | `outputAsRDF(java.lang.String format, ResultSet resultSet)` Write out an RDF model that encodes the result set
`static void` | `outputAsSSE(boolean booleanResult)` Output a boolean result in the SSE format Format: SSE
`static void` | `outputAsSSE(java.io.OutputStream outStream, boolean booleanResult)` Output a boolean result in the SSE format Format: SSE
`static void` | `outputAsSSE(java.io.OutputStream outStream, ResultSet resultSet)` Output a result set in the SSE format Format: SSE
`static void` | `outputAsSSE(java.io.OutputStream outStream, ResultSet resultSet, com.hp.hpl.jena.sparql.core.Prologue prologue)` Output a result set in the SSE format Format: SSE
`static void` | `outputAsSSE(ResultSet resultSet)` Output a result set in the SSE format Format: SSE
`static void` | `outputAsSSE(ResultSet resultSet, com.hp.hpl.jena.sparql.core.Prologue prologue)` Output a result set in the SSE format Format: SSE
`static void` | `outputAsXML(boolean booleanResult)` Output a boolean result in the XML format
`static void` | `outputAsXML(boolean booleanResult, java.lang.String stylesheet)` Output a boolean result in the XML format
`static void` | `outputAsXML(java.io.OutputStream outStream, boolean booleanResult)` Output a boolean result in the XML format
`static void` | `outputAsXML(java.io.OutputStream outStream, boolean booleanResult, java.lang.String stylesheet)` Output a boolean result in the XML format
`static void` | `outputAsXML(java.io.OutputStream outStream, ResultSet qresults)` Output a result set in the XML format
`static void` | `outputAsXML(java.io.OutputStream outStream, ResultSet qresults, java.lang.String stylesheet)` Output a result set in the XML format, inserting a style sheet in the XMl output
`static void` | `outputAsXML(ResultSet qresults)` Output a result set in the XML format
`static void` | `outputAsXML(ResultSet qresults, java.lang.String stylesheet)` Output a result set in the XML format, inserting a style sheet in the XMl output
`static java.util.List` | `toList(ResultSet resultSet)` Turn the result set into a java.util.List
`static com.hp.hpl.jena.rdf.model.Model` | `toModel(boolean booleanResult)` Encode a boolean result set as RDF.
`static com.hp.hpl.jena.rdf.model.Model` | `toModel(ResultSet resultSet)` Encode the result set as RDF.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ResultSetFormatter

    public ResultSetFormatter()

Method Detail

### out

    public static void out(ResultSet qresults)

  Output a result set in a text format.

  Parameters:
    `qresults` - result set

### out

    public static void out(java.io.OutputStream out,
                           ResultSet qresults)

  Output a result set in a text format.

  Parameters:
    `out` - OutputStream
    `qresults` - result set

### out

    public static void out(ResultSet qresults,
                           Query query)

  Output a result set in a text format.

  Parameters:
    `qresults` - result set
    `query` - May be used to abbreviate URIs

### out

    public static void out(ResultSet qresults,
                           com.hp.hpl.jena.sparql.core.Prologue prologue)

  Output a result set in a text format.

  Parameters:
    `qresults` - result set
    `prologue` - May be used to abbreviate URIs

### out

    public static void out(ResultSet qresults,
                           com.hp.hpl.jena.shared.PrefixMapping pmap)

  Output a result set in a text format.

  Parameters:
    `qresults` - result set
    `pmap` - Prefix mapping for abbreviating URIs.

### out

    public static void out(java.io.OutputStream out,
                           ResultSet qresults,
                           com.hp.hpl.jena.shared.PrefixMapping pmap)

  Output a result set in a text format.

  Parameters:
    `out` - OutputStream
    `qresults` - result set
    `pmap` - Prefix mapping for abbreviating URIs.

### out

    public static void out(java.io.OutputStream out,
                           ResultSet qresults,
                           com.hp.hpl.jena.sparql.core.Prologue prologue)

  Output a result set in a text format.

  Parameters:
    `out` - OutputStream
    `qresults` - result set
    `prologue` - Prologue, used to abbreviate IRIs

### out

    public static void out(boolean answer)

  Output an ASK answer

  Parameters:
    `answer` - The boolean answer

### out

    public static void out(java.io.OutputStream out,
                           boolean answer)

  Output an ASK answer

  Parameters:
    `out` - OutputStream
    `answer` - The boolean answer

### consume

    public static int consume(ResultSet resultSet)

  This operation faithfully walks the results but does nothing with them.

  Returns:
    The count of the number of solutions.

### toList

    public static java.util.List toList(ResultSet resultSet)

  Turn the result set into a java.util.List

  Parameters:
    `resultSet` - The result set
  Returns:
    List of QuerySolutions

### toModel

    public static com.hp.hpl.jena.rdf.model.Model toModel(ResultSet resultSet)

  Encode the result set as RDF.

  Parameters:
    `resultSet` -
  Returns:
    Model Model contains the results

### toModel

    public static com.hp.hpl.jena.rdf.model.Model toModel(boolean booleanResult)

  Encode a boolean result set as RDF.

  Parameters:
    `booleanResult` -
  Returns:
    Model Model contains the results

### asRDF

    public static com.hp.hpl.jena.rdf.model.Resource asRDF(com.hp.hpl.jena.rdf.model.Model model,
                                                           ResultSet resultSet)

  Encode the result set as RDF in the model provided.

  Parameters:
    `model` - The place where to put the RDF.
    `resultSet` -
  Returns:
    Resource The resource for the result set.

### asRDF

    public static com.hp.hpl.jena.rdf.model.Resource asRDF(com.hp.hpl.jena.rdf.model.Model model,
                                                           boolean booleanResult)

  Encode the boolean as RDF in the model provided.

  Parameters:
    `model` - The place where to put the RDF.
    `booleanResult` -
  Returns:
    Resource The resource for the result set.

### output

    public static void output(ResultSet resultSet,
                              com.hp.hpl.jena.sparql.resultset.ResultSetFormat rFmt)

  Output a ResultSetin some format.

  Parameters:
    `resultSet` - Result set
    `rFmt` - A format to encode the result set in

### output

    public static void output(java.io.OutputStream outStream,
                              ResultSet resultSet,
                              com.hp.hpl.jena.sparql.resultset.ResultSetFormat rFmt)

  Output a ResultSetin some format. To get detailed control over each format, call the appropropiate operation directly.

  Parameters:
    `outStream` - Output
    `resultSet` - Result set
    `rFmt` - A format to encode the result set in

### outputAsRDF

    public static void outputAsRDF(java.lang.String format,
                                   ResultSet resultSet)

  Write out an RDF model that encodes the result set

  Parameters:
    `format` - Name of RDF format (names as Jena writers)
    `resultSet` - The result set to encode in RDF

### outputAsRDF

    public static void outputAsRDF(java.io.OutputStream outStream,
                                   java.lang.String format,
                                   ResultSet resultSet)

  Write out an RDF model that encodes the result set

  Parameters:
    `outStream` - Output
    `format` - Name of RDF format (names as Jena writers)
    `resultSet` - The result set to encode in RDF

### outputAsRDF

    public static void outputAsRDF(java.lang.String format,
                                   boolean booleanResult)

  Write out an RDF model that encodes a boolean result

  Parameters:
    `format` - Name of RDF format (names as Jena writers)
    `booleanResult` - The boolean result to encode in RDF

### outputAsRDF

    public static void outputAsRDF(java.io.OutputStream outStream,
                                   java.lang.String format,
                                   boolean booleanResult)

  Write out an RDF model that encodes a boolean result

  Parameters:
    `outStream` - Output
    `format` - Name of RDF format (names as Jena writers)
    `booleanResult` - The boolean result to encode in RDF

### outputAsXML

    public static void outputAsXML(ResultSet qresults)

  Output a result set in the XML format

  Parameters:
    `qresults` - result set

### outputAsXML

    public static void outputAsXML(java.io.OutputStream outStream,
                                   ResultSet qresults)

  Output a result set in the XML format

  Parameters:
    `outStream` - output stream
    `qresults` - result set

### outputAsXML

    public static void outputAsXML(ResultSet qresults,
                                   java.lang.String stylesheet)

  Output a result set in the XML format, inserting a style sheet in the XMl output

  Parameters:
    `qresults` - result set
    `stylesheet` - The URL of the stylsheet

### outputAsXML

    public static void outputAsXML(java.io.OutputStream outStream,
                                   ResultSet qresults,
                                   java.lang.String stylesheet)

  Output a result set in the XML format, inserting a style sheet in the XMl output

  Parameters:
    `outStream` - output stream
    `qresults` - result set
    `stylesheet` - The URL of the stylsheet

### outputAsXML

    public static void outputAsXML(boolean booleanResult)

  Output a boolean result in the XML format

  Parameters:
    `booleanResult` - The boolean result to encode

### outputAsXML

    public static void outputAsXML(java.io.OutputStream outStream,
                                   boolean booleanResult)

  Output a boolean result in the XML format

  Parameters:
    `outStream` - output stream
    `booleanResult` - The boolean result to encode

### outputAsXML

    public static void outputAsXML(boolean booleanResult,
                                   java.lang.String stylesheet)

  Output a boolean result in the XML format

  Parameters:
    `booleanResult` -
    `stylesheet` - The URL of the stylesheet

### outputAsXML

    public static void outputAsXML(java.io.OutputStream outStream,
                                   boolean booleanResult,
                                   java.lang.String stylesheet)

  Output a boolean result in the XML format

  Parameters:
    `outStream` - output stream
    `booleanResult` -
    `stylesheet` - The URL of the stylesheet

### asXMLString

    public static java.lang.String asXMLString(ResultSet qresults)

  Return a string that has the result set serilized as XML (not RDF)

  Parameters:
    `qresults` - result set
  Returns:
    string

### asXMLString

    public static java.lang.String asXMLString(ResultSet qresults,
                                               java.lang.String stylesheet)

  Return a string that has the result set serilized as XML (not RDF) with a style sheet directive inserted into the XML.

  Parameters:
    `qresults` - result set
    `stylesheet` -
  Returns:
    string

### asXMLString

    public static java.lang.String asXMLString(boolean booleanResult)

  Return a string that has the result set serilized as XML (not RDF)

  Parameters:
    `booleanResult` - The boolean result to encode
  Returns:
    string

### asXMLString

    public static java.lang.String asXMLString(boolean booleanResult,
                                               java.lang.String stylesheet)

  Return a string that has the result set serilized as XML (not RDF)

  Parameters:
    `booleanResult` - The boolean result to encode
    `stylesheet` -
  Returns:
    string

### outputAsJSON

    public static void outputAsJSON(ResultSet resultSet)

  Output a result set in the JSON format Format: Serializing SPARQL Query Results in JSON JSON: http://json.org/

  Parameters:
    `resultSet` - result set

### outputAsJSON

    public static void outputAsJSON(java.io.OutputStream outStream,
                                    ResultSet resultSet)

  Output a result set in the JSON format Format: Serializing SPARQL Query Results in JSON JSON: http://json.org/

  Parameters:
    `outStream` - output stream
    `resultSet` - result set

### outputAsJSON

    public static void outputAsJSON(boolean booleanResult)

  Output a result set in the JSON format Format: Serializing SPARQL Query Results in JSON JSON: http://json.org/

  Parameters:
    `booleanResult` - The boolean result to encode

### outputAsJSON

    public static void outputAsJSON(java.io.OutputStream outStream,
                                    boolean booleanResult)

  Output a result set in the JSON format Format: Serializing SPARQL Query Results in JSON JSON: http://json.org/

  Parameters:
    `outStream` - output stream
    `booleanResult` - The boolean result to encode

### outputAsSSE

    public static void outputAsSSE(boolean booleanResult)

  Output a boolean result in the SSE format Format: SSE

  Parameters:
    `booleanResult` - The boolean result to encode

### outputAsSSE

    public static void outputAsSSE(java.io.OutputStream outStream,
                                   boolean booleanResult)

  Output a boolean result in the SSE format Format: SSE

  Parameters:
    `outStream` - output stream
    `booleanResult` - The boolean result to encode

### outputAsSSE

    public static void outputAsSSE(ResultSet resultSet)

  Output a result set in the SSE format Format: SSE

  Parameters:
    `resultSet` - result set

### outputAsSSE

    public static void outputAsSSE(ResultSet resultSet,
                                   com.hp.hpl.jena.sparql.core.Prologue prologue)

  Output a result set in the SSE format Format: SSE

  Parameters:
    `resultSet` - result set

### outputAsSSE

    public static void outputAsSSE(java.io.OutputStream outStream,
                                   ResultSet resultSet)

  Output a result set in the SSE format Format: SSE

  Parameters:
    `outStream` - The output stream
    `resultSet` - The result set

### outputAsSSE

    public static void outputAsSSE(java.io.OutputStream outStream,
                                   ResultSet resultSet,
                                   com.hp.hpl.jena.sparql.core.Prologue prologue)

  Output a result set in the SSE format Format: SSE

  Parameters:
    `outStream` - output stream
    `resultSet` - result set
    `prologue` -

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP