Class QueryExecUtils

java.lang.Object
org.apache.jena.sparql.util.QueryExecUtils

public class QueryExecUtils extends Object
Some utilities for query processing.
  • Constructor Details

    • QueryExecUtils

      public QueryExecUtils()
  • Method Details

    • exec

      public static void exec(Query query, DatasetGraph dsg)
    • exec

      public static void exec(QueryExec queryExec)
    • exec

      public static void exec(Prologue prologue, QueryExec queryExec)
    • exec

      public static void exec(Prologue prologue, QueryExec queryExec, ResultsFormat outputFormat)
    • exec

      public static void exec(Prologue prologue, QueryExec queryExec, ResultsFormat outputFormat, PrintStream output)
    • executeQuery

      public static void executeQuery(QueryExecution queryExecution)
    • executeQuery

      public static void executeQuery(Prologue prologue, QueryExecution queryExecution)
    • executeQuery

      public static void executeQuery(Prologue prologue, QueryExecution queryExecution, ResultsFormat outputFormat)
    • executeQuery

      public static void executeQuery(Prologue prologue, QueryExecution queryExecution, ResultsFormat outputFormat, PrintStream output)
    • execute

      public static void execute(Op op, DatasetGraph dsg)
    • execute

      public static void execute(Op op, DatasetGraph dsg, ResultsFormat outputFormat)
    • execute

      public static void execute(Op op, DatasetGraph dsg, ResultsFormat outputFormat, PrintStream output)
    • outputResultSet

      public static void outputResultSet(ResultSet results, Prologue prologue, ResultsFormat outputFormat, PrintStream output)
    • getExactlyOne

      public static org.apache.jena.rdf.model.RDFNode getExactlyOne(String qs, org.apache.jena.rdf.model.Model model)
      Execute a query, expecting the result to be one row, one column. Return that one RDFNode
    • getExactlyOne

      public static org.apache.jena.rdf.model.RDFNode getExactlyOne(String qs, Dataset ds)
      Execute a query, expecting the result to be one row, one column. Return that one RDFNode
    • getExactlyOne

      public static org.apache.jena.rdf.model.RDFNode getExactlyOne(QueryExecution qExec, String varname)
      Execute, expecting the result to be one row, one column. Return that one. RDFNode or throw an exception. Use with try ( QueryExecution qExec = ....).
    • getAtMostOne

      public static org.apache.jena.rdf.model.RDFNode getAtMostOne(QueryExecution qExec, String varname)
      Execute, expecting the result to be one row, one column. Return that one RDFNode or null. Throw exception if more than one. Use with try ( QueryExecution qExec = ....).
    • getAll

      public static List<org.apache.jena.rdf.model.RDFNode> getAll(QueryExecution qExec, String varname)
      Execute, returning all matches, which may be zero.