Class XQuery
java.lang.Object
org.gcube.resources.discovery.client.queries.impl.QueryBox
org.gcube.resources.discovery.client.queries.impl.QueryTemplate
org.gcube.resources.discovery.client.queries.impl.XQuery
- All Implemented Interfaces:
Query,SimpleQuery
A
SimpleQuery over an XQuery template.
The template is defined as follows (cf. template):
<ns/> for $resource in <range/><vars/> where <cond def="$result"/> return <result def="$result"/>
where:
-
rangestands for the path to the data ranged over by the$resultvariable. This parameter is typically bound at query-creation time (cf.XQuery(Map). -
ns,vars,condandresultstand for, respectively, the declarations of namespace prefixes, the declarations of auxiliary variables, the conditions, and the result expression of the query. These parameters should be bound through theSimpleQueryAPI.
- Author:
- Fabio Simeoni
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.gcube.resources.discovery.client.queries.impl.QueryTemplate
DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCondition(String condition) Adds a free-form condition on query results.addNamespace(String prefix, URI uri) Adds a namespace to the query.addVariable(String variable, String range) Adds a variable to the query.Adds a result expression to the query.Methods inherited from class org.gcube.resources.discovery.client.queries.impl.QueryTemplate
addParameter, appendParameter, expression, hasParameter, parameterMethods inherited from class org.gcube.resources.discovery.client.queries.impl.QueryBox
equals, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.gcube.resources.discovery.client.queries.api.Query
expression
-
Field Details
-
ns
- See Also:
-
vars
- See Also:
-
range
- See Also:
-
cond
- See Also:
-
result
- See Also:
-
template
- See Also:
-
-
Constructor Details
-
XQuery
-
-
Method Details
-
addCondition
Adds a free-form condition on query results.In the condition,
$resourceranges over resources.- Specified by:
addConditionin interfaceSimpleQuery- Parameters:
condition- the condition- Returns:
- the query
-
addNamespace
Description copied from interface:SimpleQueryAdds a namespace to the query.- Specified by:
addNamespacein interfaceSimpleQuery- Parameters:
prefix- the namespace prefixuri- the namespace URI- Returns:
- the query
-
addVariable
Description copied from interface:SimpleQueryAdds a variable to the query.- Specified by:
addVariablein interfaceSimpleQuery- Parameters:
variable- the name of the variablerange- the range of the variable- Returns:
- the query
-
setResult
Adds a result expression to the query.In the expression,
$resourceranges over resources.- Specified by:
setResultin interfaceSimpleQuery- Parameters:
expression- the result expression- Returns:
- the query
-