Class ResultSetMgr

java.lang.Object
org.apache.jena.riot.ResultSetMgr

public class ResultSetMgr extends Object
Reading and writing of Result Sets. ResultSetFormatter provides output to text.
See Also:
  • Constructor Details

    • ResultSetMgr

      public ResultSetMgr()
  • Method Details

    • read

      public static ResultSet read(String urlOrFilename)
      Read from a URL (including filenames) and produce a ResultSet. Note that returned result set may stream and so the input stream be read while the ResultSet is used.

      See ResultSetFactory.copyResults(ResultSet) for a ResultSet that is detached from the InputStream.

      Parameters:
      urlOrFilename -
      Returns:
      ResultSet
    • read

      public static ResultSet read(String urlOrFilename, Lang lang)
      Read from a URL (including filenames) and produce a ResultSet; the stream is expect to use syntax lang. Note that returned result set may stream and so the input stream be read while the ResultSet is used. See ResultSetFactory.copyResults(ResultSet) for a ResultSet that is detached from the InputStream.
      Parameters:
      urlOrFilename -
      lang -
      Returns:
      ResultSet
    • read

      public static ResultSet read(InputStream input)
      Read from a URL (including filenames) and produce a ResultSet. Note that returned result set may stream and so the input stream be read while the ResultSet is used.

      See ResultSetFactory.copyResults(ResultSet) for a ResultSet that is detached from the InputStream.

      Parameters:
      input -
      Returns:
      ResultSet
    • read

      public static ResultSet read(InputStream input, Lang lang)
      Read from an InputStream and produce a ResultSet; the stream is expect to use syntax lang. Note that returned result set may stream and so the input stream be read while the ResultSet is used. See ResultSetFactory.copyResults(ResultSet) for a ResultSet that is detached from the InputStream.
      Parameters:
      input -
      lang -
      Returns:
      ResultSet
    • readBoolean

      public static boolean readBoolean(String urlOrFilename)
      Read a boolean result from the URI
      Parameters:
      urlOrFilename -
      Returns:
      boolean
    • readBoolean

      public static boolean readBoolean(String urlOrFilename, Lang lang)
      Read a boolean result from the URI; the input is expect to use syntax lang
      Parameters:
      urlOrFilename -
      lang -
      Returns:
      boolean
    • readBoolean

      public static boolean readBoolean(InputStream input)
      Read a boolean result from the URI
      Parameters:
      input -
      Returns:
      boolean
    • readBoolean

      public static boolean readBoolean(InputStream input, Lang lang)
      Read a boolean result from the URI; the input is expect to use syntax lang
      Parameters:
      input -
      lang -
      Returns:
      boolean
    • parse

      public static ResultSet parse(String uri, Lang hintLang, Context context)
      Read ResultSet.
      Parameters:
      uri - URI to read from (includes file: and a plain file name).
      hintLang - Hint for the syntax
      context - Content object to control reading process.
    • write

      public static void write(OutputStream output, ResultSet resultSet, Lang lang)
      Write a SPARQL result set to the output stream in the specified language/syntax.
      Parameters:
      output -
      resultSet -
      lang -
    • write

      public static void write(OutputStream output, boolean result, Lang lang)
      Write a SPARQL boolean result to the output stream in the specified language/syntax.
      Parameters:
      output -
      result -
      lang -
    • asString

      public static String asString(ResultSet resultSet, Lang lang)
      Generate a string in the specified language/syntax for a SPARQL result set.
      Parameters:
      resultSet -
      lang -
    • asString

      public static String asString(boolean result, Lang lang)
      Generate a string in the specified language/syntax for a SPARQL boolean result.
      Parameters:
      result -
      lang -