org.openrdf.query.parser
Class QueryParserUtil

java.lang.Object
  extended by org.openrdf.query.parser.QueryParserUtil

public class QueryParserUtil
extends Object

Utility class for creating query parsers and parsing queries in various query languages.


Constructor Summary
QueryParserUtil()
           
 
Method Summary
static QueryParser createParser(QueryLanguage ql)
           
static ParsedBooleanQuery parseBooleanQuery(QueryLanguage ql, String query, String baseURI)
          Parses the supplied query into a query model.
static ParsedGraphQuery parseGraphQuery(QueryLanguage ql, String query, String baseURI)
          Parses the supplied query into a query model.
static ParsedQuery parseQuery(QueryLanguage ql, String query, String baseURI)
          Parses the supplied query into a query model.
static ParsedTupleQuery parseTupleQuery(QueryLanguage ql, String query, String baseURI)
          Parses the supplied query into a query model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryParserUtil

public QueryParserUtil()
Method Detail

createParser

public static QueryParser createParser(QueryLanguage ql)
                                throws UnsupportedQueryLanguageException
Throws:
UnsupportedQueryLanguageException

parseQuery

public static ParsedQuery parseQuery(QueryLanguage ql,
                                     String query,
                                     String baseURI)
                              throws MalformedQueryException,
                                     UnsupportedQueryLanguageException
Parses the supplied query into a query model.

Parameters:
ql - The language in which the query is formulated.
query - The query.
baseURI - The base URI to resolve any relative URIs that are in the query against, can be null if the query does not contain any relative URIs.
Returns:
The query model for the parsed query.
Throws:
MalformedQueryException - If the supplied query was malformed.
UnsupportedQueryLanguageException - If the specified query language is not supported.

parseTupleQuery

public static ParsedTupleQuery parseTupleQuery(QueryLanguage ql,
                                               String query,
                                               String baseURI)
                                        throws MalformedQueryException,
                                               UnsupportedQueryLanguageException
Parses the supplied query into a query model.

Parameters:
ql - The language in which the query is formulated.
query - The query.
Returns:
The query model for the parsed query.
Throws:
IllegalArgumentException - If the supplied query is not a tuple query.
MalformedQueryException - If the supplied query was malformed.
UnsupportedQueryLanguageException - If the specified query language is not supported.

parseGraphQuery

public static ParsedGraphQuery parseGraphQuery(QueryLanguage ql,
                                               String query,
                                               String baseURI)
                                        throws MalformedQueryException,
                                               UnsupportedQueryLanguageException
Parses the supplied query into a query model.

Parameters:
ql - The language in which the query is formulated.
query - The query.
Returns:
The query model for the parsed query.
Throws:
IllegalArgumentException - If the supplied query is not a graph query.
MalformedQueryException - If the supplied query was malformed.
UnsupportedQueryLanguageException - If the specified query language is not supported.

parseBooleanQuery

public static ParsedBooleanQuery parseBooleanQuery(QueryLanguage ql,
                                                   String query,
                                                   String baseURI)
                                            throws MalformedQueryException,
                                                   UnsupportedQueryLanguageException
Parses the supplied query into a query model.

Parameters:
ql - The language in which the query is formulated.
query - The query.
Returns:
The query model for the parsed query.
Throws:
IllegalArgumentException - If the supplied query is not a graph query.
MalformedQueryException - If the supplied query was malformed.
UnsupportedQueryLanguageException - If the specified query language is not supported.


Copyright © 2001-2008 Aduna. All Rights Reserved.