Class Sparql11QueryParser

java.lang.Object
cz.cvut.kbss.jopa.query.sparql.Sparql11QueryParser
All Implemented Interfaces:
QueryParser

public class Sparql11QueryParser extends Object implements QueryParser
Grammar-based SPARQL 1.1 query parser.

Follows more strictly the standard SPARQL 1.1 grammar with one exception - it allows using variable in property paths, so that they can be set on the query. If they are not set, an exception will be thrown when the query is executed.

  • Constructor Details

  • Method Details

    • parseQuery

      public TokenStreamSparqlQueryHolder parseQuery(String query)
      Description copied from interface: QueryParser
      Parses the specified query string and returns a query holder instance containing the parsed query.
      Specified by:
      parseQuery in interface QueryParser
      Parameters:
      query - The query to parse
      Returns:
      Query holder with the parsed query
    • parseQuery

      public TokenStreamSparqlQueryHolder parseQuery(String query, Class<?> resultClass)
      Description copied from interface: QueryParser
      Parses the specified query string and returns a query holder instance containing the parsed query.

      The provided result class can be used when processing the query to make adjustments.

      Specified by:
      parseQuery in interface QueryParser
      Parameters:
      query - Query to parse
      resultClass - Result class provided by the client
      Returns:
      Query holder with the parsed query