|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openrdf.query.parser.QueryParserUtil
public class QueryParserUtil
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 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public QueryParserUtil()
| Method Detail |
|---|
public static QueryParser createParser(QueryLanguage ql)
throws UnsupportedQueryLanguageException
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 SPARQL query string
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||