Class QueryExecUtils


  • public class QueryExecUtils
    extends java.lang.Object
    Some utilities for query processing.
    • Constructor Detail

      • QueryExecUtils

        public QueryExecUtils()
    • Method Detail

      • executeQuery

        public static void executeQuery​(QueryExecution queryExecution)
      • outputResultSet

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

        public static RDFNode getExactlyOne​(java.lang.String qs,
                                            Model model)
        Execute a query, expecting the result to be one row, one column. Return that one RDFNode
      • getExactlyOne

        public static RDFNode getExactlyOne​(java.lang.String qs,
                                            Dataset ds)
        Execute a query, expecting the result to be one row, one column. Return that one RDFNode
      • getExactlyOne

        public static RDFNode getExactlyOne​(QueryExecution qExec,
                                            java.lang.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 RDFNode getAtMostOne​(QueryExecution qExec,
                                           java.lang.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 java.util.List<RDFNode> getAll​(QueryExecution qExec,
                                                     java.lang.String varname)
        Execute, returning all matches, which may be zero.