Class SPARQLExtQuery
- java.lang.Object
-
- org.apache.jena.sparql.core.Prologue
-
- org.apache.jena.query.Query
-
- fr.mines_stetienne.ci.sparql_generate.query.SPARQLExtQuery
-
-
Field Summary
Fields Modifier and Type Field Description static int
QueryTypeFunction
The query type of SPARQL-Function queries.static int
QueryTypeGenerate
The query type of SPARQL-Generate queries.static int
QueryTypePerform
The query type of SPARQL-Perform queries.static int
QueryTypeTemplate
The query type of SPARQL-Template queries.-
Fields inherited from class org.apache.jena.query.Query
constructTemplate, distinct, groupVars, havingExprs, NOLIMIT, ORDER_ASCENDING, ORDER_DEFAULT, ORDER_DESCENDING, ORDER_UNKNOW, projectVars, queryResultStar, QueryTypeAsk, QueryTypeConstruct, QueryTypeDescribe, QueryTypeJson, QueryTypeSelect, QueryTypeUnknown, reduced, resultNodes, strictQuery, valuesDataBlock
-
Fields inherited from class org.apache.jena.sparql.core.Prologue
prefixMap, resolver, seenBaseURI
-
-
Constructor Summary
Constructors Constructor Description SPARQLExtQuery()
Creates a new empty query.SPARQLExtQuery(Prologue prologue)
Creates a new empty query with the given prologue.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addGraphExpr(Expr expr)
adds a FROM varOrIri clausevoid
addGraphQuery(SPARQLExtQuery generate)
adds a FROM GENERATE clausevoid
addGraphURI(String s)
Deprecated.void
addNamedGraphExpr(Expr expr)
adds a FROM NAMED varOrIri clausevoid
addNamedGraphQuery(Expr expr, SPARQLExtQuery generate)
adds a FROM NAMED varOrIri clausevoid
addNamedGraphURI(String s)
Deprecated.void
addPostSelect(Var v, Expr expr)
SPARQLExtQuery
cloneQuery()
boolean
equals(Object other)
List<Element>
getBindingClauses()
Gets the list ofSOURCE
andITERATOR
clauses.ExprList
getCallParameters()
Gets the call parameters of the query, or null.DatasetDescription
getDatasetDescription()
Deprecated.List<FromClause>
getFromClauses()
Gets the list of FROM clausesExpr
getFunctionExpression()
Gets the function expression of the query, or null.List<Element>
getGenerateClause()
Gets theGENERATE
form, or null if is is a URI.List<String>
getGraphURIs()
Deprecated.Expr
getName()
Gets the name of the query, or null.List<String>
getNamedGraphURIs()
Deprecated.List<Element>
getPerformClause()
Get the elements in thePERFORM
clause.VarExprList
getPostSelect()
int
getQueryType()
List<Var>
getSignature()
Gets the signature of the query, or null.List<Element>
getTemplateClause()
Gets the elements in theTEMPLATE
clause.Expr
getTemplateClauseAfter()
Returns the after expression in theTEMPLATE
clause.Expr
getTemplateClauseBefore()
Returns the before expression in theTEMPLATE
clause.Expr
getTemplateClauseSeparator()
Returns the separator expression in theTEMPLATE
clause.boolean
hasBindingClauses()
Gets if the query has at least oneSOURCE
orITERATOR
clause.boolean
hasCallParameters()
Gets if the query has call parameters.boolean
hasDatasetDescription()
Deprecated.boolean
hasEmbeddedExpressions()
Returns if the query contains expressions in literals, URIs, or in place of variables.void
hasEmbeddedExpressions(boolean hasEmbeddedExpressions)
Sets if the query contains expressions in literals, URIs, or in place of variables.boolean
hasFunctionExpression()
Gets if the query has a function expression.boolean
hasGenerateClause()
Gets if the query has aGENERATE
clauseint
hashCode()
boolean
hasName()
Gets if the query has a name.boolean
hasPerformClause()
Gets if the query has aPERFORM
clause.boolean
hasPostSelect()
boolean
hasSignature()
Gets if the query has a signature.boolean
hasTemplateClause()
Gets if the query has aTEMPLATE
clause.boolean
hasTemplateClauseAfter()
Returns if this query has a after expression in theTEMPLATE
clause.boolean
hasTemplateClauseBefore()
Returns if this query has a before expression in theTEMPLATE
clause.boolean
hasTemplateClauseSeparator()
Returns if this query has a separator expression in theTEMPLATE
clause.boolean
isAskType()
boolean
isConstructType()
boolean
isDescribeType()
boolean
isFunctionType()
Gets if the Query is a SPARQL-Function query.boolean
isGenerateType()
Gets if the Query is a SPARQL-Generate query.boolean
isPerformType()
Gets if the Query is a SPARQL-Perform query.boolean
isSelectType()
boolean
isSubQuery()
Returns if the query is a sub query of another query.void
isSubQuery(boolean isSubQuery)
Sets if the query is a sub query of another query.boolean
isTemplateType()
Gets if the Query is a SPARQL-Template query.boolean
isUnknownType()
void
normalizeAggregates()
Change this query to a semantically equivalent one, but with aggregates only in EXPRESSIONS clausevoid
normalizeBNode()
Change this query to a semantically equivalent one, but with no BNode common to a query and a subquery.void
normalizeXExpr()
Change this query to a semantically equivalent one, but with no embedded expressions.void
setBindingClauses(List<Element> list)
Sets the list ofSOURCE
andITERATOR
clauses.void
setCallParameters(ExprList parameters)
Sets the call parameters of the query.void
setFromClauses(List<FromClause> fromClauses)
Gets the list of FROM clausesvoid
setFunctionExpression(Expr functionExpression)
Sets the function expression of the query.void
setGenerateClause(List<Element> generateClause)
Set the elements in theGENERATE
clause.void
setName(Expr name)
Sets the name of the query.void
setPerformClause(List<Element> performClause)
Set the elements in thePERFORM
clause.void
setQueryAskType()
void
setQueryConstructType()
void
setQueryDescribeType()
void
setQueryFunctionType()
Specifies that the Query is a SPARQL-Function query.void
setQueryGenerateType()
Specifies that the Query is a SPARQL-Generate query.void
setQueryPerformType()
Specifies that the Query is a SPARQL-Perform query.void
setQuerySelectType()
void
setQueryTemplateType()
Specifies that the Query is a SPARQL-Template query.void
setSignature(List<Var> signature)
Sets the signature of the query.void
setTemplateClause(List<Element> templateClause)
Set the elements in theTEMPLATE
clause.void
setTemplateClauseAfter(Expr templateClauseAfter)
Set the after expression in theTEMPLATE
clause.void
setTemplateClauseBefore(Expr templateClauseBefore)
Set the before expression in theTEMPLATE
clause.void
setTemplateClauseSeparator(Expr templateClauseSeparator)
Set the separator expression in theTEMPLATE
clause.boolean
usesGraphURI(String uri)
Deprecated.boolean
usesNamedGraphURI(String uri)
Deprecated.void
visit(SPARQLExtQueryVisitor visitor)
Visits the query by a SPARQLExt Query visitor.void
visit(QueryVisitor visitor)
Visits the query by a SPARQLExt Query visitor, or throw an exception.-
Methods inherited from class org.apache.jena.query.Query
addDescribeNode, addGroupBy, addGroupBy, addGroupBy, addGroupBy, addHavingCondition, addJsonMapping, addOrderBy, addOrderBy, addOrderBy, addOrderBy, addProjectVars, addResultVar, addResultVar, addResultVar, addResultVar, addResultVar, allocAggregate, clone, getAggregators, getConstructTemplate, getGroupBy, getHavingExprs, getJsonMapping, getLimit, getOffset, getOrderBy, getProject, getProjectVars, getPrologue, getQueryPattern, getResultURIs, getResultVars, getSyntax, getValuesData, getValuesVariables, hasAggregators, hasGroupBy, hasHaving, hasLimit, hasOffset, hasOrderBy, hasValues, isConstructQuad, isDistinct, isJsonType, isOrdered, isQueryResultStar, isReduced, isStrict, output, queryType, resetResultVars, serialize, serialize, serialize, serialize, serialize, serialize, setConstructTemplate, setDistinct, setLimit, setOffset, setQueryJsonType, setQueryPattern, setQueryResultStar, setReduced, setResultVars, setStrict, setSyntax, setValuesDataBlock, toString, toString
-
Methods inherited from class org.apache.jena.sparql.core.Prologue
copy, expandPrefixedName, explicitlySetBaseURI, getBase, getBaseURI, getPrefix, getPrefixMapping, getResolver, hash, samePrologue, setBase, setBaseURI, setPrefix, setPrefixMapping, shortForm
-
-
-
-
Field Detail
-
QueryTypeGenerate
public static final int QueryTypeGenerate
The query type of SPARQL-Generate queries.- See Also:
- Constant Field Values
-
QueryTypeTemplate
public static final int QueryTypeTemplate
The query type of SPARQL-Template queries.- See Also:
- Constant Field Values
-
QueryTypePerform
public static final int QueryTypePerform
The query type of SPARQL-Perform queries.- See Also:
- Constant Field Values
-
QueryTypeFunction
public static final int QueryTypeFunction
The query type of SPARQL-Function queries.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SPARQLExtQuery
public SPARQLExtQuery()
Creates a new empty query.
-
SPARQLExtQuery
public SPARQLExtQuery(Prologue prologue)
Creates a new empty query with the given prologue.
-
-
Method Detail
-
setQueryGenerateType
public void setQueryGenerateType()
Specifies that the Query is a SPARQL-Generate query.
-
setQueryTemplateType
public void setQueryTemplateType()
Specifies that the Query is a SPARQL-Template query.
-
setQueryPerformType
public void setQueryPerformType()
Specifies that the Query is a SPARQL-Perform query.
-
setQueryFunctionType
public void setQueryFunctionType()
Specifies that the Query is a SPARQL-Function query.
-
setQuerySelectType
public void setQuerySelectType()
- Overrides:
setQuerySelectType
in classQuery
-
setQueryConstructType
public void setQueryConstructType()
- Overrides:
setQueryConstructType
in classQuery
-
setQueryDescribeType
public void setQueryDescribeType()
- Overrides:
setQueryDescribeType
in classQuery
-
setQueryAskType
public void setQueryAskType()
- Overrides:
setQueryAskType
in classQuery
-
getQueryType
public int getQueryType()
- Overrides:
getQueryType
in classQuery
-
isSelectType
public boolean isSelectType()
- Overrides:
isSelectType
in classQuery
-
isConstructType
public boolean isConstructType()
- Overrides:
isConstructType
in classQuery
-
isDescribeType
public boolean isDescribeType()
- Overrides:
isDescribeType
in classQuery
-
isUnknownType
public boolean isUnknownType()
- Overrides:
isUnknownType
in classQuery
-
isGenerateType
public boolean isGenerateType()
Gets if the Query is a SPARQL-Generate query.
-
isTemplateType
public boolean isTemplateType()
Gets if the Query is a SPARQL-Template query.
-
isPerformType
public boolean isPerformType()
Gets if the Query is a SPARQL-Perform query.
-
isFunctionType
public boolean isFunctionType()
Gets if the Query is a SPARQL-Function query.
-
hasEmbeddedExpressions
public void hasEmbeddedExpressions(boolean hasEmbeddedExpressions)
Sets if the query contains expressions in literals, URIs, or in place of variables.- Parameters:
hasEmbeddedExpressions
-
-
hasEmbeddedExpressions
public boolean hasEmbeddedExpressions()
Returns if the query contains expressions in literals, URIs, or in place of variables.
-
hasPostSelect
public boolean hasPostSelect()
-
getPostSelect
public VarExprList getPostSelect()
-
isSubQuery
public boolean isSubQuery()
Returns if the query is a sub query of another query.
-
isSubQuery
public void isSubQuery(boolean isSubQuery)
Sets if the query is a sub query of another query.- Parameters:
isSubQuery
-
-
hasName
public final boolean hasName()
Gets if the query has a name.- Returns:
- -
-
getName
public final Expr getName()
Gets the name of the query, or null.- Returns:
- the name node.
-
setName
public final void setName(Expr name)
Sets the name of the query.- Parameters:
name
- the name of the query
-
hasSignature
public final boolean hasSignature()
Gets if the query has a signature.- Returns:
- -
-
getSignature
public final List<Var> getSignature()
Gets the signature of the query, or null.- Returns:
- the signature of the query.
-
setSignature
public final void setSignature(List<Var> signature)
Sets the signature of the query.- Parameters:
signature
- the signature of the query
-
hasCallParameters
public final boolean hasCallParameters()
Gets if the query has call parameters.- Returns:
- -
-
getCallParameters
public final ExprList getCallParameters()
Gets the call parameters of the query, or null.- Returns:
- call parameters.
-
setCallParameters
public final void setCallParameters(ExprList parameters)
Sets the call parameters of the query.- Parameters:
parameters
- the call parameters of the query
-
hasGenerateClause
public final boolean hasGenerateClause()
Gets if the query has aGENERATE
clause- Returns:
- -
-
getGenerateClause
public final List<Element> getGenerateClause()
Gets theGENERATE
form, or null if is is a URI.- Returns:
- -
-
setGenerateClause
public final void setGenerateClause(List<Element> generateClause)
Set the elements in theGENERATE
clause.- Parameters:
generateClause
- the template.
-
hasTemplateClause
public final boolean hasTemplateClause()
Gets if the query has aTEMPLATE
clause.- Returns:
- -
-
getTemplateClause
public final List<Element> getTemplateClause()
Gets the elements in theTEMPLATE
clause.- Returns:
- -
-
setTemplateClause
public final void setTemplateClause(List<Element> templateClause)
Set the elements in theTEMPLATE
clause.- Parameters:
templateClause
- the template.
-
hasTemplateClauseSeparator
public boolean hasTemplateClauseSeparator()
Returns if this query has a separator expression in theTEMPLATE
clause.- Returns:
- if this query has a separator expression in the
TEMPLATE
clause
-
getTemplateClauseSeparator
public Expr getTemplateClauseSeparator()
Returns the separator expression in theTEMPLATE
clause.- Returns:
- the separator expression in the
TEMPLATE
clause
-
setTemplateClauseSeparator
public void setTemplateClauseSeparator(Expr templateClauseSeparator)
Set the separator expression in theTEMPLATE
clause.- Parameters:
templateClauseSeparator
- the separator.
-
hasTemplateClauseBefore
public boolean hasTemplateClauseBefore()
Returns if this query has a before expression in theTEMPLATE
clause.- Returns:
- if this query has a before expression in the
TEMPLATE
clause
-
getTemplateClauseBefore
public Expr getTemplateClauseBefore()
Returns the before expression in theTEMPLATE
clause.- Returns:
- the before expression in the
TEMPLATE
clause
-
setTemplateClauseBefore
public void setTemplateClauseBefore(Expr templateClauseBefore)
Set the before expression in theTEMPLATE
clause.- Parameters:
templateClauseBefore
- the before string.
-
hasTemplateClauseAfter
public boolean hasTemplateClauseAfter()
Returns if this query has a after expression in theTEMPLATE
clause.- Returns:
- if this query has a after expression in the
TEMPLATE
clause
-
getTemplateClauseAfter
public Expr getTemplateClauseAfter()
Returns the after expression in theTEMPLATE
clause.- Returns:
- the after expression in the
TEMPLATE
clause
-
setTemplateClauseAfter
public void setTemplateClauseAfter(Expr templateClauseAfter)
Set the after expression in theTEMPLATE
clause.- Parameters:
templateClauseAfter
- the after string.
-
hasPerformClause
public final boolean hasPerformClause()
Gets if the query has aPERFORM
clause.- Returns:
- -
-
getPerformClause
public final List<Element> getPerformClause()
Get the elements in thePERFORM
clause.- Returns:
- the clause.
-
setPerformClause
public final void setPerformClause(List<Element> performClause)
Set the elements in thePERFORM
clause.- Parameters:
performClause
- the template.
-
hasFunctionExpression
public final boolean hasFunctionExpression()
Gets if the query has a function expression.- Returns:
- -
-
getFunctionExpression
public final Expr getFunctionExpression()
Gets the function expression of the query, or null.- Returns:
- the function expression.
-
setFunctionExpression
public final void setFunctionExpression(Expr functionExpression)
Sets the function expression of the query.- Parameters:
functionExpression
- the function expression
-
getFromClauses
public List<FromClause> getFromClauses()
Gets the list of FROM clauses- Returns:
-
setFromClauses
public void setFromClauses(List<FromClause> fromClauses)
Gets the list of FROM clauses
-
addGraphExpr
public void addGraphExpr(Expr expr)
adds a FROM varOrIri clause- Parameters:
expr
-
-
addNamedGraphExpr
public void addNamedGraphExpr(Expr expr)
adds a FROM NAMED varOrIri clause- Parameters:
expr
-
-
addNamedGraphQuery
public void addNamedGraphQuery(Expr expr, SPARQLExtQuery generate)
adds a FROM NAMED varOrIri clause- Parameters:
expr
-
-
addGraphQuery
public void addGraphQuery(SPARQLExtQuery generate)
adds a FROM GENERATE clause- Parameters:
q
-
-
getGraphURIs
@Deprecated public List<String> getGraphURIs()
Deprecated.- Overrides:
getGraphURIs
in classQuery
-
addGraphURI
@Deprecated public void addGraphURI(String s)
Deprecated.Throws UnsupportedOperationException- Overrides:
addGraphURI
in classQuery
-
addNamedGraphURI
@Deprecated public void addNamedGraphURI(String s)
Deprecated.Throws UnsupportedOperationException- Overrides:
addNamedGraphURI
in classQuery
-
usesGraphURI
@Deprecated public boolean usesGraphURI(String uri)
Deprecated.Throws UnsupportedOperationException- Overrides:
usesGraphURI
in classQuery
-
getNamedGraphURIs
@Deprecated public List<String> getNamedGraphURIs()
Deprecated.Throws UnsupportedOperationException- Overrides:
getNamedGraphURIs
in classQuery
-
usesNamedGraphURI
@Deprecated public boolean usesNamedGraphURI(String uri)
Deprecated.Throws UnsupportedOperationException- Overrides:
usesNamedGraphURI
in classQuery
-
hasDatasetDescription
@Deprecated public boolean hasDatasetDescription()
Deprecated.Throws UnsupportedOperationException- Overrides:
hasDatasetDescription
in classQuery
-
getDatasetDescription
@Deprecated public DatasetDescription getDatasetDescription()
Deprecated.Throws UnsupportedOperationException- Overrides:
getDatasetDescription
in classQuery
-
hasBindingClauses
public final boolean hasBindingClauses()
Gets if the query has at least oneSOURCE
orITERATOR
clause.- Returns:
- -
-
setBindingClauses
public final void setBindingClauses(List<Element> list)
Sets the list ofSOURCE
andITERATOR
clauses.- Parameters:
list
- -
-
getBindingClauses
public final List<Element> getBindingClauses()
Gets the list ofSOURCE
andITERATOR
clauses.- Returns:
- -
-
normalizeXExpr
public void normalizeXExpr()
Change this query to a semantically equivalent one, but with no embedded expressions.
-
normalizeBNode
public void normalizeBNode()
Change this query to a semantically equivalent one, but with no BNode common to a query and a subquery.
-
normalizeAggregates
public void normalizeAggregates()
Change this query to a semantically equivalent one, but with aggregates only in EXPRESSIONS clause
-
visit
public void visit(QueryVisitor visitor)
Visits the query by a SPARQLExt Query visitor, or throw an exception.- Overrides:
visit
in classQuery
- Parameters:
visitor
- must be a SPARQLExt Query visitor.- Throws:
IllegalArgumentException
- if the query is not a SPARQLExtQuery Query.
-
visit
public void visit(SPARQLExtQueryVisitor visitor)
Visits the query by a SPARQLExt Query visitor.- Parameters:
visitor
- the SPARQLExt Query visitor.
-
cloneQuery
public SPARQLExtQuery cloneQuery()
- Overrides:
cloneQuery
in classQuery
-
-