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 intQueryTypeFunctionThe query type of SPARQL-Function queries.static intQueryTypeGenerateThe query type of SPARQL-Generate queries.static intQueryTypePerformThe query type of SPARQL-Perform queries.static intQueryTypeTemplateThe 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 voidaddGraphExpr(Expr expr)adds a FROM varOrIri clausevoidaddGraphQuery(SPARQLExtQuery generate)adds a FROM GENERATE clausevoidaddGraphURI(String s)Deprecated.voidaddNamedGraphExpr(Expr expr)adds a FROM NAMED varOrIri clausevoidaddNamedGraphQuery(Expr expr, SPARQLExtQuery generate)adds a FROM NAMED varOrIri clausevoidaddNamedGraphURI(String s)Deprecated.voidaddPostSelect(Var v, Expr expr)SPARQLExtQuerycloneQuery()booleanequals(Object other)List<Element>getBindingClauses()Gets the list ofSOURCEandITERATORclauses.ExprListgetCallParameters()Gets the call parameters of the query, or null.DatasetDescriptiongetDatasetDescription()Deprecated.List<FromClause>getFromClauses()Gets the list of FROM clausesExprgetFunctionExpression()Gets the function expression of the query, or null.List<Element>getGenerateClause()Gets theGENERATEform, or null if is is a URI.List<String>getGraphURIs()Deprecated.ExprgetName()Gets the name of the query, or null.List<String>getNamedGraphURIs()Deprecated.List<Element>getPerformClause()Get the elements in thePERFORMclause.VarExprListgetPostSelect()intgetQueryType()List<Var>getSignature()Gets the signature of the query, or null.List<Element>getTemplateClause()Gets the elements in theTEMPLATEclause.ExprgetTemplateClauseAfter()Returns the after expression in theTEMPLATEclause.ExprgetTemplateClauseBefore()Returns the before expression in theTEMPLATEclause.ExprgetTemplateClauseSeparator()Returns the separator expression in theTEMPLATEclause.booleanhasBindingClauses()Gets if the query has at least oneSOURCEorITERATORclause.booleanhasCallParameters()Gets if the query has call parameters.booleanhasDatasetDescription()Deprecated.booleanhasEmbeddedExpressions()Returns if the query contains expressions in literals, URIs, or in place of variables.voidhasEmbeddedExpressions(boolean hasEmbeddedExpressions)Sets if the query contains expressions in literals, URIs, or in place of variables.booleanhasFunctionExpression()Gets if the query has a function expression.booleanhasGenerateClause()Gets if the query has aGENERATEclauseinthashCode()booleanhasName()Gets if the query has a name.booleanhasPerformClause()Gets if the query has aPERFORMclause.booleanhasPostSelect()booleanhasSignature()Gets if the query has a signature.booleanhasTemplateClause()Gets if the query has aTEMPLATEclause.booleanhasTemplateClauseAfter()Returns if this query has a after expression in theTEMPLATEclause.booleanhasTemplateClauseBefore()Returns if this query has a before expression in theTEMPLATEclause.booleanhasTemplateClauseSeparator()Returns if this query has a separator expression in theTEMPLATEclause.booleanisAskType()booleanisConstructType()booleanisDescribeType()booleanisFunctionType()Gets if the Query is a SPARQL-Function query.booleanisGenerateType()Gets if the Query is a SPARQL-Generate query.booleanisPerformType()Gets if the Query is a SPARQL-Perform query.booleanisSelectType()booleanisSubQuery()Returns if the query is a sub query of another query.voidisSubQuery(boolean isSubQuery)Sets if the query is a sub query of another query.booleanisTemplateType()Gets if the Query is a SPARQL-Template query.booleanisUnknownType()voidnormalizeAggregates()Change this query to a semantically equivalent one, but with aggregates only in EXPRESSIONS clausevoidnormalizeBNode()Change this query to a semantically equivalent one, but with no BNode common to a query and a subquery.voidnormalizeXExpr()Change this query to a semantically equivalent one, but with no embedded expressions.voidsetBindingClauses(List<Element> list)Sets the list ofSOURCEandITERATORclauses.voidsetCallParameters(ExprList parameters)Sets the call parameters of the query.voidsetFromClauses(List<FromClause> fromClauses)Gets the list of FROM clausesvoidsetFunctionExpression(Expr functionExpression)Sets the function expression of the query.voidsetGenerateClause(List<Element> generateClause)Set the elements in theGENERATEclause.voidsetName(Expr name)Sets the name of the query.voidsetPerformClause(List<Element> performClause)Set the elements in thePERFORMclause.voidsetQueryAskType()voidsetQueryConstructType()voidsetQueryDescribeType()voidsetQueryFunctionType()Specifies that the Query is a SPARQL-Function query.voidsetQueryGenerateType()Specifies that the Query is a SPARQL-Generate query.voidsetQueryPerformType()Specifies that the Query is a SPARQL-Perform query.voidsetQuerySelectType()voidsetQueryTemplateType()Specifies that the Query is a SPARQL-Template query.voidsetSignature(List<Var> signature)Sets the signature of the query.voidsetTemplateClause(List<Element> templateClause)Set the elements in theTEMPLATEclause.voidsetTemplateClauseAfter(Expr templateClauseAfter)Set the after expression in theTEMPLATEclause.voidsetTemplateClauseBefore(Expr templateClauseBefore)Set the before expression in theTEMPLATEclause.voidsetTemplateClauseSeparator(Expr templateClauseSeparator)Set the separator expression in theTEMPLATEclause.booleanusesGraphURI(String uri)Deprecated.booleanusesNamedGraphURI(String uri)Deprecated.voidvisit(SPARQLExtQueryVisitor visitor)Visits the query by a SPARQLExt Query visitor.voidvisit(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:
setQuerySelectTypein classQuery
-
setQueryConstructType
public void setQueryConstructType()
- Overrides:
setQueryConstructTypein classQuery
-
setQueryDescribeType
public void setQueryDescribeType()
- Overrides:
setQueryDescribeTypein classQuery
-
setQueryAskType
public void setQueryAskType()
- Overrides:
setQueryAskTypein classQuery
-
getQueryType
public int getQueryType()
- Overrides:
getQueryTypein classQuery
-
isSelectType
public boolean isSelectType()
- Overrides:
isSelectTypein classQuery
-
isConstructType
public boolean isConstructType()
- Overrides:
isConstructTypein classQuery
-
isDescribeType
public boolean isDescribeType()
- Overrides:
isDescribeTypein classQuery
-
isUnknownType
public boolean isUnknownType()
- Overrides:
isUnknownTypein 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 aGENERATEclause- Returns:
- -
-
getGenerateClause
public final List<Element> getGenerateClause()
Gets theGENERATEform, or null if is is a URI.- Returns:
- -
-
setGenerateClause
public final void setGenerateClause(List<Element> generateClause)
Set the elements in theGENERATEclause.- Parameters:
generateClause- the template.
-
hasTemplateClause
public final boolean hasTemplateClause()
Gets if the query has aTEMPLATEclause.- Returns:
- -
-
getTemplateClause
public final List<Element> getTemplateClause()
Gets the elements in theTEMPLATEclause.- Returns:
- -
-
setTemplateClause
public final void setTemplateClause(List<Element> templateClause)
Set the elements in theTEMPLATEclause.- Parameters:
templateClause- the template.
-
hasTemplateClauseSeparator
public boolean hasTemplateClauseSeparator()
Returns if this query has a separator expression in theTEMPLATEclause.- Returns:
- if this query has a separator expression in the
TEMPLATEclause
-
getTemplateClauseSeparator
public Expr getTemplateClauseSeparator()
Returns the separator expression in theTEMPLATEclause.- Returns:
- the separator expression in the
TEMPLATEclause
-
setTemplateClauseSeparator
public void setTemplateClauseSeparator(Expr templateClauseSeparator)
Set the separator expression in theTEMPLATEclause.- Parameters:
templateClauseSeparator- the separator.
-
hasTemplateClauseBefore
public boolean hasTemplateClauseBefore()
Returns if this query has a before expression in theTEMPLATEclause.- Returns:
- if this query has a before expression in the
TEMPLATEclause
-
getTemplateClauseBefore
public Expr getTemplateClauseBefore()
Returns the before expression in theTEMPLATEclause.- Returns:
- the before expression in the
TEMPLATEclause
-
setTemplateClauseBefore
public void setTemplateClauseBefore(Expr templateClauseBefore)
Set the before expression in theTEMPLATEclause.- Parameters:
templateClauseBefore- the before string.
-
hasTemplateClauseAfter
public boolean hasTemplateClauseAfter()
Returns if this query has a after expression in theTEMPLATEclause.- Returns:
- if this query has a after expression in the
TEMPLATEclause
-
getTemplateClauseAfter
public Expr getTemplateClauseAfter()
Returns the after expression in theTEMPLATEclause.- Returns:
- the after expression in the
TEMPLATEclause
-
setTemplateClauseAfter
public void setTemplateClauseAfter(Expr templateClauseAfter)
Set the after expression in theTEMPLATEclause.- Parameters:
templateClauseAfter- the after string.
-
hasPerformClause
public final boolean hasPerformClause()
Gets if the query has aPERFORMclause.- Returns:
- -
-
getPerformClause
public final List<Element> getPerformClause()
Get the elements in thePERFORMclause.- Returns:
- the clause.
-
setPerformClause
public final void setPerformClause(List<Element> performClause)
Set the elements in thePERFORMclause.- 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:
getGraphURIsin classQuery
-
addGraphURI
@Deprecated public void addGraphURI(String s)
Deprecated.Throws UnsupportedOperationException- Overrides:
addGraphURIin classQuery
-
addNamedGraphURI
@Deprecated public void addNamedGraphURI(String s)
Deprecated.Throws UnsupportedOperationException- Overrides:
addNamedGraphURIin classQuery
-
usesGraphURI
@Deprecated public boolean usesGraphURI(String uri)
Deprecated.Throws UnsupportedOperationException- Overrides:
usesGraphURIin classQuery
-
getNamedGraphURIs
@Deprecated public List<String> getNamedGraphURIs()
Deprecated.Throws UnsupportedOperationException- Overrides:
getNamedGraphURIsin classQuery
-
usesNamedGraphURI
@Deprecated public boolean usesNamedGraphURI(String uri)
Deprecated.Throws UnsupportedOperationException- Overrides:
usesNamedGraphURIin classQuery
-
hasDatasetDescription
@Deprecated public boolean hasDatasetDescription()
Deprecated.Throws UnsupportedOperationException- Overrides:
hasDatasetDescriptionin classQuery
-
getDatasetDescription
@Deprecated public DatasetDescription getDatasetDescription()
Deprecated.Throws UnsupportedOperationException- Overrides:
getDatasetDescriptionin classQuery
-
hasBindingClauses
public final boolean hasBindingClauses()
Gets if the query has at least oneSOURCEorITERATORclause.- Returns:
- -
-
setBindingClauses
public final void setBindingClauses(List<Element> list)
Sets the list ofSOURCEandITERATORclauses.- Parameters:
list- -
-
getBindingClauses
public final List<Element> getBindingClauses()
Gets the list ofSOURCEandITERATORclauses.- 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:
visitin 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:
cloneQueryin classQuery
-
-