Class SPARQLExtQuery
java.lang.Object
org.apache.jena.sparql.core.Prologue
org.apache.jena.query.Query
fr.mines_stetienne.ci.sparql_generate.query.SPARQLExtQuery
- All Implemented Interfaces:
Cloneable,org.apache.jena.atlas.io.Printable
public class SPARQLExtQuery
extends org.apache.jena.query.Query
Represents a SPARQL-Generate or SPARQL-Template query.
- Author:
- Maxime Lefrançois
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe query type of SPARQL-Function queries.static final intThe query type of SPARQL-Generate queries.static final intThe query type of SPARQL-Perform queries.static final intThe 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, valuesDataBlockFields inherited from class org.apache.jena.sparql.core.Prologue
prefixMap, resolver, seenBaseURI -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty query.SPARQLExtQuery(org.apache.jena.sparql.core.Prologue prologue) Creates a new empty query with the given prologue. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGraphExpr(org.apache.jena.sparql.expr.Expr expr) adds a FROM varOrIri clausevoidaddGraphQuery(SPARQLExtQuery generate) adds a FROM GENERATE clausevoidDeprecated.voidaddNamedGraphExpr(org.apache.jena.sparql.expr.Expr expr) adds a FROM NAMED varOrIri clausevoidaddNamedGraphQuery(org.apache.jena.sparql.expr.Expr expr, SPARQLExtQuery generate) adds a FROM NAMED varOrIri clausevoidDeprecated.voidaddPostSelect(org.apache.jena.sparql.core.Var v, org.apache.jena.sparql.expr.Expr expr) voidGENERATE, TEMPLATE and SELECT queries of SPARQL-Generate may have no WHERE clause: Jena would warn "No query pattern in non-DESCRIBE query" for each of them.booleanfinal List<org.apache.jena.sparql.syntax.Element> Gets the list ofSOURCEandITERATORclauses.final org.apache.jena.sparql.expr.ExprListGets the call parameters of the query, or null.org.apache.jena.sparql.core.DatasetDescriptionDeprecated.Gets the list of FROM clausesfinal org.apache.jena.sparql.expr.ExprGets the function expression of the query, or null.final List<org.apache.jena.sparql.syntax.Element> Gets theGENERATEform, or null if is is a URI.Deprecated.final org.apache.jena.sparql.expr.ExprgetName()Gets the name of the query, or null.Deprecated.final List<org.apache.jena.sparql.syntax.Element> Get the elements in thePERFORMclause.org.apache.jena.sparql.core.VarExprListintfinal List<org.apache.jena.sparql.core.Var> Gets the signature of the query, or null.final List<org.apache.jena.sparql.syntax.Element> Gets the elements in theTEMPLATEclause.org.apache.jena.sparql.expr.ExprReturns the after expression in theTEMPLATEclause.org.apache.jena.sparql.expr.ExprReturns the before expression in theTEMPLATEclause.org.apache.jena.sparql.expr.ExprReturns the separator expression in theTEMPLATEclause.final booleanGets if the query has at least oneSOURCEorITERATORclause.final booleanGets if the query has call parameters.booleanDeprecated.booleanReturns 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.final booleanGets if the query has a function expression.final booleanGets if the query has aGENERATEclauseinthashCode()final booleanhasName()Gets if the query has a name.final booleanGets if the query has aPERFORMclause.booleanfinal booleanGets if the query has a signature.final booleanGets if the query has aTEMPLATEclause.booleanReturns if this query has a after expression in theTEMPLATEclause.booleanReturns if this query has a before expression in theTEMPLATEclause.booleanReturns if this query has a separator expression in theTEMPLATEclause.booleanbooleanbooleanbooleanGets if the Query is a SPARQL-Function query.booleanGets if the Query is a SPARQL-Generate query.booleanGets if the Query is a SPARQL-Perform query.booleanbooleanReturns if the query is a sub query of another query.voidisSubQuery(boolean isSubQuery) Sets if the query is a sub query of another query.booleanGets if the Query is a SPARQL-Template query.booleanvoidChange this query to a semantically equivalent one, but with aggregates only in EXPRESSIONS clausevoidChange this query to a semantically equivalent one, but with no BNode common to a query and a subquery.voidChange this query to a semantically equivalent one, but with no embedded expressions.voidfinal voidsetBindingClauses(List<org.apache.jena.sparql.syntax.Element> list) Sets the list ofSOURCEandITERATORclauses.final voidsetCallParameters(org.apache.jena.sparql.expr.ExprList parameters) Sets the call parameters of the query.voidsetFromClauses(List<FromClause> fromClauses) Gets the list of FROM clausesfinal voidsetFunctionExpression(org.apache.jena.sparql.expr.Expr functionExpression) Sets the function expression of the query.final voidsetGenerateClause(List<org.apache.jena.sparql.syntax.Element> generateClause) Set the elements in theGENERATEclause.final voidsetName(org.apache.jena.sparql.expr.Expr name) Sets the name of the query.final voidsetPerformClause(List<org.apache.jena.sparql.syntax.Element> performClause) Set the elements in thePERFORMclause.voidvoidvoidvoidSpecifies that the Query is a SPARQL-Function query.voidSpecifies that the Query is a SPARQL-Generate query.voidSpecifies that the Query is a SPARQL-Perform query.voidvoidSpecifies that the Query is a SPARQL-Template query.final voidsetSignature(List<org.apache.jena.sparql.core.Var> signature) Sets the signature of the query.final voidsetTemplateClause(List<org.apache.jena.sparql.syntax.Element> templateClause) Set the elements in theTEMPLATEclause.voidsetTemplateClauseAfter(org.apache.jena.sparql.expr.Expr templateClauseAfter) Set the after expression in theTEMPLATEclause.voidsetTemplateClauseBefore(org.apache.jena.sparql.expr.Expr templateClauseBefore) Set the before expression in theTEMPLATEclause.voidsetTemplateClauseSeparator(org.apache.jena.sparql.expr.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(org.apache.jena.query.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, serialize, serialize, serialize, serialize, serialize, serialize, setConstructTemplate, setDistinct, setJsonMapping, setLimit, setOffset, setQueryJsonType, setQueryPattern, setQueryResultStar, setReduced, setResultVars, setStrict, setSyntax, setValuesDataBlock, toString, toStringMethods inherited from class org.apache.jena.sparql.core.Prologue
copy, expandPrefixedName, explicitlySetBaseURI, getBase, getBaseURI, getPrefix, getPrefixMapping, getResolver, getVersion, hash, samePrologue, setBase, setBaseURI, setPrefix, setPrefixMapping, setVersion, shortForm
-
Field Details
-
QueryTypeGenerate
public static final int QueryTypeGenerateThe query type of SPARQL-Generate queries.- See Also:
-
QueryTypeTemplate
public static final int QueryTypeTemplateThe query type of SPARQL-Template queries.- See Also:
-
QueryTypePerform
public static final int QueryTypePerformThe query type of SPARQL-Perform queries.- See Also:
-
QueryTypeFunction
public static final int QueryTypeFunctionThe query type of SPARQL-Function queries.- See Also:
-
-
Constructor Details
-
SPARQLExtQuery
public SPARQLExtQuery()Creates a new empty query. -
SPARQLExtQuery
public SPARQLExtQuery(org.apache.jena.sparql.core.Prologue prologue) Creates a new empty query with the given prologue.
-
-
Method Details
-
ensureResultVars
public void ensureResultVars()GENERATE, TEMPLATE and SELECT queries of SPARQL-Generate may have no WHERE clause: Jena would warn "No query pattern in non-DESCRIBE query" for each of them.- Overrides:
ensureResultVarsin classorg.apache.jena.query.Query
-
resetResultVars
public void resetResultVars()- Overrides:
resetResultVarsin classorg.apache.jena.query.Query
-
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 classorg.apache.jena.query.Query
-
setQueryConstructType
public void setQueryConstructType()- Overrides:
setQueryConstructTypein classorg.apache.jena.query.Query
-
setQueryDescribeType
public void setQueryDescribeType()- Overrides:
setQueryDescribeTypein classorg.apache.jena.query.Query
-
setQueryAskType
public void setQueryAskType()- Overrides:
setQueryAskTypein classorg.apache.jena.query.Query
-
getQueryType
public int getQueryType() -
isSelectType
public boolean isSelectType()- Overrides:
isSelectTypein classorg.apache.jena.query.Query
-
isConstructType
public boolean isConstructType()- Overrides:
isConstructTypein classorg.apache.jena.query.Query
-
isDescribeType
public boolean isDescribeType()- Overrides:
isDescribeTypein classorg.apache.jena.query.Query
-
isAskType
public boolean isAskType()- Overrides:
isAskTypein classorg.apache.jena.query.Query
-
isUnknownType
public boolean isUnknownType()- Overrides:
isUnknownTypein classorg.apache.jena.query.Query
-
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() -
addPostSelect
public void addPostSelect(org.apache.jena.sparql.core.Var v, org.apache.jena.sparql.expr.Expr expr) -
getPostSelect
public org.apache.jena.sparql.core.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 org.apache.jena.sparql.expr.Expr getName()Gets the name of the query, or null.- Returns:
- the name node.
-
setName
public final void setName(org.apache.jena.sparql.expr.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
Gets the signature of the query, or null.- Returns:
- the signature of the query.
-
setSignature
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 org.apache.jena.sparql.expr.ExprList getCallParameters()Gets the call parameters of the query, or null.- Returns:
- call parameters.
-
setCallParameters
public final void setCallParameters(org.apache.jena.sparql.expr.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
Gets theGENERATEform, or null if is is a URI.- Returns:
- -
-
setGenerateClause
Set the elements in theGENERATEclause.- Parameters:
generateClause- the template.
-
hasTemplateClause
public final boolean hasTemplateClause()Gets if the query has aTEMPLATEclause.- Returns:
- -
-
getTemplateClause
Gets the elements in theTEMPLATEclause.- Returns:
- -
-
setTemplateClause
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 org.apache.jena.sparql.expr.Expr getTemplateClauseSeparator()Returns the separator expression in theTEMPLATEclause.- Returns:
- the separator expression in the
TEMPLATEclause
-
setTemplateClauseSeparator
public void setTemplateClauseSeparator(org.apache.jena.sparql.expr.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 org.apache.jena.sparql.expr.Expr getTemplateClauseBefore()Returns the before expression in theTEMPLATEclause.- Returns:
- the before expression in the
TEMPLATEclause
-
setTemplateClauseBefore
public void setTemplateClauseBefore(org.apache.jena.sparql.expr.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 org.apache.jena.sparql.expr.Expr getTemplateClauseAfter()Returns the after expression in theTEMPLATEclause.- Returns:
- the after expression in the
TEMPLATEclause
-
setTemplateClauseAfter
public void setTemplateClauseAfter(org.apache.jena.sparql.expr.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
Get the elements in thePERFORMclause.- Returns:
- the clause.
-
setPerformClause
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 org.apache.jena.sparql.expr.Expr getFunctionExpression()Gets the function expression of the query, or null.- Returns:
- the function expression.
-
setFunctionExpression
public final void setFunctionExpression(org.apache.jena.sparql.expr.Expr functionExpression) Sets the function expression of the query.- Parameters:
functionExpression- the function expression
-
getFromClauses
Gets the list of FROM clauses- Returns:
-
setFromClauses
Gets the list of FROM clauses -
addGraphExpr
public void addGraphExpr(org.apache.jena.sparql.expr.Expr expr) adds a FROM varOrIri clause- Parameters:
expr-
-
addNamedGraphExpr
public void addNamedGraphExpr(org.apache.jena.sparql.expr.Expr expr) adds a FROM NAMED varOrIri clause- Parameters:
expr-
-
addNamedGraphQuery
adds a FROM NAMED varOrIri clause- Parameters:
expr-
-
addGraphQuery
adds a FROM GENERATE clause- Parameters:
q-
-
getGraphURIs
Deprecated.- Overrides:
getGraphURIsin classorg.apache.jena.query.Query
-
addGraphURI
Deprecated.Throws UnsupportedOperationException- Overrides:
addGraphURIin classorg.apache.jena.query.Query
-
addNamedGraphURI
Deprecated.Throws UnsupportedOperationException- Overrides:
addNamedGraphURIin classorg.apache.jena.query.Query
-
usesGraphURI
Deprecated.Throws UnsupportedOperationException- Overrides:
usesGraphURIin classorg.apache.jena.query.Query
-
getNamedGraphURIs
Deprecated.Throws UnsupportedOperationException- Overrides:
getNamedGraphURIsin classorg.apache.jena.query.Query
-
usesNamedGraphURI
Deprecated.Throws UnsupportedOperationException- Overrides:
usesNamedGraphURIin classorg.apache.jena.query.Query
-
hasDatasetDescription
Deprecated.Throws UnsupportedOperationException- Overrides:
hasDatasetDescriptionin classorg.apache.jena.query.Query
-
getDatasetDescription
Deprecated.Throws UnsupportedOperationException- Overrides:
getDatasetDescriptionin classorg.apache.jena.query.Query
-
hasBindingClauses
public final boolean hasBindingClauses()Gets if the query has at least oneSOURCEorITERATORclause.- Returns:
- -
-
setBindingClauses
Sets the list ofSOURCEandITERATORclauses.- Parameters:
list- -
-
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(org.apache.jena.query.QueryVisitor visitor) Visits the query by a SPARQLExt Query visitor, or throw an exception.- Overrides:
visitin classorg.apache.jena.query.Query- Parameters:
visitor- must be a SPARQLExt Query visitor.- Throws:
IllegalArgumentException- if the query is not a SPARQLExtQuery Query.
-
visit
Visits the query by a SPARQLExt Query visitor.- Parameters:
visitor- the SPARQLExt Query visitor.
-
equals
- Overrides:
equalsin classorg.apache.jena.query.Query
-
cloneQuery
- Overrides:
cloneQueryin classorg.apache.jena.query.Query
-
hashCode
public int hashCode()- Overrides:
hashCodein classorg.apache.jena.query.Query
-