Class QueryFactory

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

public class QueryFactory extends Object
  • Constructor Details

    • QueryFactory

      public QueryFactory()
  • Method Details

    • create

      public static Query create(String queryString)
      Create a SPARQL query from the given string.
      Parameters:
      queryString - The query string
      Throws:
      QueryException - Thrown when a parse error occurs
    • create

      public static Query create(String queryString, Syntax syntax)
      Create a query from the given string with the
      Parameters:
      queryString - The query string
      syntax - Syntax
      Throws:
      QueryException - Thrown when a parse error occurs
    • create

      public static Query create(String queryString, String baseURI)
      Create a query from the given string by calling the parser.
      Parameters:
      queryString - The query string
      baseURI - Base URI
      Throws:
      QueryException - Thrown when a parse error occurs
    • create

      public static Query create(String queryString, String baseURI, Syntax syntax)
      Create a query from the given string by calling the parser.
      Parameters:
      queryString - The query string
      baseURI - Base URI
      syntax - Syntax
      Throws:
      QueryException - Thrown when a parse error occurs
    • create

      public static Query create()
      Make a query - no parsing done
    • make

      public static Query make()
      Make a query - no parsing done - old name: create() preferred.
    • create

      public static Query create(Query originalQuery)
      Make a query from another one by deep copy (a clone). The returned query will be .equals to the original. The returned query can be mutated without changing the original (at which point it will stop being .equals)
      Parameters:
      originalQuery - The query to clone.
    • parse

      public static Query parse(Query query, String queryString, String baseURI, Syntax syntaxURI)
      Parse a query from the given string by calling the parser.
      Parameters:
      query - Existing, uninitialized query
      queryString - The query string
      baseURI - URI for relative URI expansion
      syntaxURI - URI for the syntax
      Throws:
      QueryException - Thrown when a parse error occurs
    • read

      public static Query read(String url)
      Read a SPARQL query from a file.
      Parameters:
      url - URL (file: or http: or anything a FileManager can handle)
      Returns:
      A new query object
    • read

      public static Query read(String url, String baseURI)
      Read a SPARQL query from a file.
      Parameters:
      url - URL (file: or http: or anything a FileManager can handle)
      baseURI - BaseURI for the query
      Returns:
      A new query object
    • read

      public static Query read(String url, Syntax langURI)
      Read a query from a file.
      Parameters:
      url - URL (file: or http: or anything a FileManager can handle)
      langURI - Query syntax
      Returns:
      A new query object
    • read

      public static Query read(String url, String baseURI, Syntax langURI)
      Read a query from a file.
      Parameters:
      url - URL (file: or http: or anything a FileManager can handle)
      baseURI - BaseURI for the query
      langURI - Query syntax
      Returns:
      A new query object
    • read

      public static Query read(String url, StreamManager streamManager, String baseURI, Syntax langURI)
      Read a query from a file.
      Parameters:
      url - URL (file: or http: or anything a FileManager can handle)
      streamManager - Optional StreamManager
      baseURI - BaseURI for the query
      langURI - Query syntax
      Returns:
      A new query object
    • createElement

      public static Element createElement(String elementString)
    • createTemplate

      public static Template createTemplate(String templateString)