com.hp.hpl.jena.query
Class ResultSetFactory

java.lang.Object
  extended by com.hp.hpl.jena.query.ResultSetFactory

public class ResultSetFactory
extends java.lang.Object

ResultSetFactory - make result sets from places other than a query.

Version:
$Id: ResultSetFactory.java,v 1.14 2005/09/21 14:57:14 andy_seaborne Exp $
Author:
Andy Seaborne

Constructor Summary
ResultSetFactory()
           
 
Method Summary
static com.hp.hpl.jena.query.resultset.ResultSetRewindable copyResults(ResultSet results)
          Take a copy of a result set - the result set returns is an in-memory copy.
static ResultSet fromRDF(com.hp.hpl.jena.rdf.model.Model model)
          Turns an RDF model, with properties and classses from the result set vocabulary, into a SPARQL result set.
static ResultSet fromXML(java.io.InputStream in)
          Read XML which is the format of the SPARQL result set format.
static ResultSet load(java.lang.String filenameOrURI)
          Load a result set from file or URL into a result set (memory backed).
static ResultSet load(java.lang.String filenameOrURI, com.hp.hpl.jena.query.resultset.ResultSetFormat format)
          Load a result set from file or URL into a result set (memory backed).
static com.hp.hpl.jena.rdf.model.Model loadAsModel(java.lang.String filenameOrURI)
          Load a result set (or any other model) from file or URL
static com.hp.hpl.jena.rdf.model.Model loadAsModel(java.lang.String filenameOrURI, com.hp.hpl.jena.query.resultset.ResultSetFormat format)
          Load a result set (or any other model) from file or URL
static ResultSet makeResults(com.hp.hpl.jena.rdf.model.Model model)
          Turns an RDF model, with properties and classses from the result set vocabulary, into a SPARQL result set.
static com.hp.hpl.jena.query.resultset.ResultSetRewindable makeRewindable(com.hp.hpl.jena.rdf.model.Model model)
          Turns an RDF model, with properties and classses from the result set vocabulary, into a SPARQL result set which is rewindable (has a .reset()operation).
static com.hp.hpl.jena.query.resultset.ResultSetRewindable makeRewindable(ResultSet resultSet)
          Turn an existing result set into a rewindable one.
static ResultSet makeSorted(ResultSet resultSet, java.util.List conditions)
          Sort an existing result set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultSetFactory

public ResultSetFactory()
Method Detail

load

public static ResultSet load(java.lang.String filenameOrURI)
Load a result set from file or URL into a result set (memory backed).

Parameters:
filenameOrURI -
Returns:
ResultSet

load

public static ResultSet load(java.lang.String filenameOrURI,
                             com.hp.hpl.jena.query.resultset.ResultSetFormat format)
Load a result set from file or URL into a result set (memory backed).

Parameters:
filenameOrURI -
format -
Returns:
ResultSet

loadAsModel

public static com.hp.hpl.jena.rdf.model.Model loadAsModel(java.lang.String filenameOrURI)
Load a result set (or any other model) from file or URL

Parameters:
filenameOrURI -
Returns:
ResultSet

loadAsModel

public static com.hp.hpl.jena.rdf.model.Model loadAsModel(java.lang.String filenameOrURI,
                                                          com.hp.hpl.jena.query.resultset.ResultSetFormat format)
Load a result set (or any other model) from file or URL

Parameters:
filenameOrURI -
format -
Returns:
ResultSet

fromXML

public static ResultSet fromXML(java.io.InputStream in)
Read XML which is the format of the SPARQL result set format. The result set formed is a copy in memory.

Parameters:
in - InputStream
Returns:
ResultSet

fromRDF

public static ResultSet fromRDF(com.hp.hpl.jena.rdf.model.Model model)
Turns an RDF model, with properties and classses from the result set vocabulary, into a SPARQL result set. The result set formed is a copy in memory.

Parameters:
model -
Returns:
ResultSet

makeResults

public static ResultSet makeResults(com.hp.hpl.jena.rdf.model.Model model)
Turns an RDF model, with properties and classses from the result set vocabulary, into a SPARQL result set. The result set formed is a copy in memory.

Parameters:
model -
Returns:
ResultSet

makeRewindable

public static com.hp.hpl.jena.query.resultset.ResultSetRewindable makeRewindable(com.hp.hpl.jena.rdf.model.Model model)
Turns an RDF model, with properties and classses from the result set vocabulary, into a SPARQL result set which is rewindable (has a .reset()operation). The result set formed is a copy in memory.

Parameters:
model -
Returns:
ResultSetRewindable

makeRewindable

public static com.hp.hpl.jena.query.resultset.ResultSetRewindable makeRewindable(ResultSet resultSet)
Turn an existing result set into a rewindable one. May take a copy - uses up the resul set passed in.

Parameters:
resultSet -
Returns:
ResultSetRewindable

makeSorted

public static ResultSet makeSorted(ResultSet resultSet,
                                   java.util.List conditions)
Sort an existing result set. Experimental. The list of variables is a list of names (strings), with "x" for ascending in variable "x" and "-x" for descending in variable "x"

Parameters:
resultSet -
conditions -
Returns:
ResultSet

copyResults

public static com.hp.hpl.jena.query.resultset.ResultSetRewindable copyResults(ResultSet results)
Take a copy of a result set - the result set returns is an in-memory copy.

Parameters:
results -
Returns:
ResultSetRewindable


Copyright © 2004, 2005 Hewlett-Packard Development Company, LP