Interface QueryFactory


public interface QueryFactory

Interface for creating queries

Since:
1.0
Version:
1.0
Author:
Michael Grove
Implementation Notes:
The factory is _not required_ to parse the query when creating it. That can be deferred until execution. All of the methods can potentially throw a parse error but the exception is only thrown when queries are parse at creation time. Parsing could be done lazily prior to execution in which case the creation error would be reported as part of the execution process
  • Method Details

    • select

      @Nonnull default SelectQuery select(@Nonnull String theQuery)
      Create the select query with the default base ("http://api.stardog.com/") for parsing.
      Parameters:
      theQuery - the query
      Returns:
      the query
      Throws:
      MalformedQuery - if this query is not syntactically valid
    • select

      @Nonnull SelectQuery select(@Nonnull String theQuery, @Nonnull String theBase)
      Create a new select query.
      Parameters:
      theQuery - the query
      theBase - the base IRI for parsing
      Returns:
      the query
      Throws:
      MalformedQuery - if this query is not syntactically valid
    • graph

      @Nonnull default GraphQuery graph(@Nonnull String theQuery)
      Create the graph query with the default base ("http://api.stardog.com/") for parsing.
      Parameters:
      theQuery - the query
      Returns:
      the query
      Throws:
      MalformedQuery - if this query is not syntactically valid
    • graph

      @Nonnull GraphQuery graph(@Nonnull String theQuery, @Nonnull String theBase)
      Create a new graph query.
      Parameters:
      theQuery - the query
      theBase - the base IRI for parsing
      Returns:
      the query
      Throws:
      MalformedQuery - if this query is not syntactically valid
    • ask

      @Nonnull default BooleanQuery ask(@Nonnull String theQuery)
      Create the boolean query with the default base ("http://api.stardog.com/") for parsing.
      Parameters:
      theQuery - the query
      Returns:
      the query
      Throws:
      MalformedQuery - if this query is not syntactically valid
    • ask

      @Nonnull BooleanQuery ask(@Nonnull String theQuery, @Nonnull String theBase)
      Create a new boolean query.
      Parameters:
      theQuery - the query
      theBase - the base IRI for parsing
      Returns:
      the query
      Throws:
      MalformedQuery - if this query is not syntactically valid
    • update

      @Nonnull default UpdateQuery update(@Nonnull String theQuery)
      Create the update query with the default base ("http://api.stardog.com/") for parsing.
      Parameters:
      theQuery - the query
      Returns:
      the query
      Throws:
      MalformedQuery - if this query is not syntactically valid
    • update

      @Nonnull UpdateQuery update(@Nonnull String theQuery, @Nonnull String theBase)
      Create a new update query.
      Parameters:
      theQuery - the query
      theBase - the base IRI for parsing
      Returns:
      the query
      Throws:
      MalformedQuery - if this query is not syntactically valid