Interface QueryEngine

  • All Known Implementing Classes:
    QueryEngineImpl

    @ProviderType
    public interface QueryEngine
    The query engine allows to parse and execute queries.

    What query languages are supported depends on the registered query parsers.

    • Method Detail

      • getSupportedQueryLanguages

        Set<String> getSupportedQueryLanguages()
        Get the set of supported query languages.
        Returns:
        the supported query languages
      • getBindVariableNames

        List<String> getBindVariableNames​(String statement,
                                          String language,
                                          Map<String,​String> mappings)
                                   throws ParseException
        Parse the query (check if it's valid) and get the list of bind variable names.
        Parameters:
        statement - query statement
        language - query language
        mappings - namespace prefix mappings
        Returns:
        the list of bind variable names
        Throws:
        ParseException
      • executeQuery

        Result executeQuery​(String statement,
                            String language,
                            long limit,
                            long offset,
                            Map<String,​? extends PropertyValue> bindings,
                            Map<String,​String> mappings)
                     throws ParseException
        Execute a query and get the result.
        Parameters:
        statement - the query statement
        language - the language
        limit - the maximum result set size (may not be negative)
        offset - the number of rows to skip (may not be negative)
        bindings - the bind variable value bindings
        mappings - namespace prefix mappings
        Returns:
        the result
        Throws:
        ParseException - if the statement could not be parsed
        IllegalArgumentException - if there was an error executing the query
      • executeQuery

        Result executeQuery​(String statement,
                            String language,
                            Optional<Long> limit,
                            Optional<Long> offset,
                            Map<String,​? extends PropertyValue> bindings,
                            Map<String,​String> mappings)
                     throws ParseException
        Execute a query and get the result.
        Parameters:
        statement - the query statement
        language - the language
        limit - the maximum result set size (may not be negative but may be empty)
        offset - the number of rows to skip (may not be negative but may be empty)
        bindings - the bind variable value bindings
        mappings - namespace prefix mappings
        Returns:
        the result
        Throws:
        ParseException - if the statement could not be parsed
        IllegalArgumentException - if there was an error executing the query
      • executeQuery

        Result executeQuery​(String statement,
                            String language,
                            Map<String,​? extends PropertyValue> bindings,
                            Map<String,​String> mappings)
                     throws ParseException
        Execute a query and get the result. This is a convenience method: no limit, and offset 0.
        Parameters:
        statement - the query statement
        language - the language
        bindings - the bind variable value bindings
        mappings - namespace prefix mappings
        Returns:
        the result
        Throws:
        ParseException - if the statement could not be parsed
        IllegalArgumentException - if there was an error executing the query