Class QueryExecutionFactory

java.lang.Object
org.apache.jena.query.QueryExecutionFactory

public class QueryExecutionFactory extends Object
QueryExecutionFactory provides some convenience operations for making QueryExecution objects. It is not comprehensive and only covers common, simple cases.

For more control of building a local or remote QueryExecution object see the builder patterns such as:

  • QueryExecution.create(). ... .build() for querying local data.
  • QueryExecution.service(url). ... .build() for querying a remote store using HTTP.

See also RDFConnection for working with SPARQL Query, SPARQL Update and SPARQL Graph Store Protocol together.

See Also:
  • Method Details

    • create

      public static QueryExecution create(Query query)
      Create a QueryExecution
      Parameters:
      query - Query
      Returns:
      QueryExecution
    • create

      public static QueryExecution create(String queryStr)
      Create a QueryExecution
      Parameters:
      queryStr - Query string
      Returns:
      QueryExecution
    • create

      public static QueryExecution create(String queryStr, Syntax syntax)
      Create a QueryExecution
      Parameters:
      queryStr - Query string
      syntax - Query syntax
      Returns:
      QueryExecution
    • create

      public static QueryExecution create(Query query, Dataset dataset)
      Create a QueryExecution to execute over the Dataset.
      Parameters:
      query - Query
      dataset - Target of the query
      Returns:
      QueryExecution
    • create

      public static QueryExecution create(Query query, DatasetGraph datasetGraph)
      Create a QueryExecution to execute over the DatasetGraph.
      Parameters:
      query - Query
      datasetGraph - Target of the query
      Returns:
      QueryExecution
    • create

      public static QueryExecution create(String queryStr, Dataset dataset)
      Create a QueryExecution to execute over the Dataset.
      Parameters:
      queryStr - Query string
      dataset - Target of the query
      Returns:
      QueryExecution
    • create

      public static QueryExecution create(String queryStr, Syntax syntax, Dataset dataset)
      Create a QueryExecution to execute over the Dataset.
      Parameters:
      queryStr - Query string
      syntax - Query language
      dataset - Target of the query
      Returns:
      QueryExecution
    • create

      public static QueryExecution create(Query query, org.apache.jena.rdf.model.Model model)
      Create a QueryExecution to execute over the Model.
      Parameters:
      query - Query
      model - Target of the query
      Returns:
      QueryExecution
    • create

      public static QueryExecution create(String queryStr, org.apache.jena.rdf.model.Model model)
      Create a QueryExecution to execute over the Model.
      Parameters:
      queryStr - Query string
      model - Target of the query
      Returns:
      QueryExecution
    • create

      public static QueryExecution create(String queryStr, Syntax lang, org.apache.jena.rdf.model.Model model)
      Create a QueryExecution to execute over the Model.
      Parameters:
      queryStr - Query string
      lang - Query language
      model - Target of the query
      Returns:
      QueryExecution
    • create

      @Deprecated public static QueryExecution create(Query query, Dataset dataset, QuerySolution querySolution)
      Deprecated.
      Use QueryExecution.dataset(dataset).query(query).substitution(querySolution).build().
      Create a QueryExecution over a Dataset given some initial values of variables.
      Parameters:
      query - Query
      dataset - Target of the query
      querySolution - Any initial binding of variables
      Returns:
      QueryExecution
    • create

      @Deprecated public static QueryExecution create(Query query, org.apache.jena.rdf.model.Model model, QuerySolution querySolution)
      Deprecated.
      Use QueryExecution#model(model).query(query).substitution(querySolution).build().
      Create a QueryExecution over a Model given some initial values of variables.
      Parameters:
      query - Query
      model - Target of the query
      querySolution - Any initial binding of variables
      Returns:
      QueryExecution