public class QueryParserUtil extends Object
Constructor and Description |
---|
QueryParserUtil() |
Modifier and Type | Method and Description |
---|---|
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 ParsedOperation |
parseOperation(QueryLanguage ql,
String operation,
String baseURI)
Parses the supplied operation 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.
|
static ParsedUpdate |
parseUpdate(QueryLanguage ql,
String update,
String baseURI)
Parses the supplied update operation into a query model.
|
static String |
removeSPARQLQueryProlog(String queryString)
Removes SPARQL prefix and base declarations, if any, from the supplied SPARQL query string.
|
public static QueryParser createParser(QueryLanguage ql) throws UnsupportedQueryLanguageException
public static ParsedOperation parseOperation(QueryLanguage ql, String operation, String baseURI) throws MalformedQueryException
ql
- The language in which the operation is formulated.operation
- The operation.baseURI
- The base URI to resolve any relative URIs that are in the operation against, can be
null if the operation does not contain any relative URIs.MalformedQueryException
- If the supplied operation was malformed.UnsupportedQueryLanguageException
- If the specified query language is not supported.public static ParsedUpdate parseUpdate(QueryLanguage ql, String update, String baseURI) throws MalformedQueryException, UnsupportedQueryLanguageException
ql
- The language in which the update operation is formulated.update
- The update operation.baseURI
- The base URI to resolve any relative URIs that are in the operation against, can be null
if the update operation does not contain any relative URIs.MalformedQueryException
- If the supplied update operation was malformed.UnsupportedQueryLanguageException
- If the specified query language is not supported.public static ParsedQuery parseQuery(QueryLanguage ql, String query, String baseURI) throws MalformedQueryException, UnsupportedQueryLanguageException
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.MalformedQueryException
- If the supplied query was malformed.UnsupportedQueryLanguageException
- If the specified query language is not supported.public static ParsedTupleQuery parseTupleQuery(QueryLanguage ql, String query, String baseURI) throws MalformedQueryException, UnsupportedQueryLanguageException
ql
- The language in which the query is formulated.query
- The query.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.public static ParsedGraphQuery parseGraphQuery(QueryLanguage ql, String query, String baseURI) throws MalformedQueryException, UnsupportedQueryLanguageException
ql
- The language in which the query is formulated.query
- The query.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.public static ParsedBooleanQuery parseBooleanQuery(QueryLanguage ql, String query, String baseURI) throws MalformedQueryException, UnsupportedQueryLanguageException
ql
- The language in which the query is formulated.query
- The query.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.public static String removeSPARQLQueryProlog(String queryString)
queryString
- a syntactically legal SPARQL query stringCopyright © 2015-2019 Eclipse Foundation. All Rights Reserved.