public class SPARQLParser
extends java.lang.Object
| Constructor and Description |
|---|
SPARQLParser(java.lang.String prefix)
Create a new SPARQLParser.
|
SPARQLParser(java.lang.String prefix,
boolean parsePrefix)
Create a new SPARQLParser.
|
SPARQLParser(java.lang.String prefix,
boolean parsePrefix,
boolean parseComments)
Create a new SPARQLParser.
|
SPARQLParser(java.lang.String prefix,
SparqlPrefixDeclarations prefixDecl)
Create a new SPARQLParser.
|
SPARQLParser(java.lang.String prefix,
SparqlPrefixDeclarations prefixDecl,
boolean parseComments)
Create a new SPARQLParser.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSparqlParserListener(SparqlParserListener listener)
Add a parser listener.
|
SparqlPrefixDeclarations |
getPrefixDeclarations()
Return the prefix declarations.
|
java.util.List<SparqlParserListener> |
getSparqlParserListeners()
Return the parser listeners.
|
boolean |
isParsingComments()
Return true if the parser parse comments
|
SparqlRequest |
parseQuery(java.lang.String queryStr)
Parse a query.
|
SparqlRequest |
parseQuery(java.net.URL queryURL)
Parse a query, for the UTF-8 charset.
|
SparqlRequest |
parseQuery(java.net.URL queryURL,
java.lang.String charset)
Parse a query.
|
void |
setParseComments(boolean parseComments)
Set if the parser parse comments
|
void |
setPrefixDeclarations(SparqlPrefixDeclarations prefixDecl)
Set the prefix declarations.
|
public SPARQLParser(java.lang.String prefix)
prefix - the prefixpublic SPARQLParser(java.lang.String prefix,
boolean parsePrefix)
prefix - the prefixparsePrefix - true if the prefixes found in the SPARQL content must be keptpublic SPARQLParser(java.lang.String prefix,
boolean parsePrefix,
boolean parseComments)
prefix - the prefixparsePrefix - true if the prefixes found in the SPARQL content must be keptparseComments - true if the comments are parsedpublic SPARQLParser(java.lang.String prefix,
SparqlPrefixDeclarations prefixDecl)
prefix - the prefixprefixDecl - the prefix declarationspublic SPARQLParser(java.lang.String prefix,
SparqlPrefixDeclarations prefixDecl,
boolean parseComments)
prefix - the prefixprefixDecl - the prefix declarationsparseComments - true if the comments are parsedpublic void setPrefixDeclarations(SparqlPrefixDeclarations prefixDecl)
prefixDecl - the prefix declarationspublic SparqlPrefixDeclarations getPrefixDeclarations()
public void addSparqlParserListener(SparqlParserListener listener)
listener - the listenerpublic java.util.List<SparqlParserListener> getSparqlParserListeners()
public void setParseComments(boolean parseComments)
parseComments - true if the parser parse commentspublic boolean isParsingComments()
public SparqlRequest parseQuery(java.lang.String queryStr) throws MalformedQueryException
SparqlHelperConfig.getErrorsHandlingType()
is set to ErrorsHandlingType.EXCEPTION, else an empty query with no matches will be created, and the
getSparqlParserListeners() will be fired.queryStr - the query as a StringMalformedQueryException - the exceptionpublic SparqlRequest parseQuery(java.net.URL queryURL, java.lang.String charset) throws MalformedQueryException
queryURL - the URL containing the querycharset - the charsetMalformedQueryExceptionpublic SparqlRequest parseQuery(java.net.URL queryURL) throws MalformedQueryException
queryURL - the URL containing the queryMalformedQueryExceptionCopyright © 2025, 2026 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence