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
public class XQuery extends QueryTemplate implements SimpleQuery
ASimpleQueryover 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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XQueryaddCondition(String condition)Adds a free-form condition on query results.XQueryaddNamespace(String prefix, URI uri)Adds a namespace to the query.XQueryaddVariable(String variable, String range)Adds a variable to the query.XQuerysetResult(String expression)Adds a result expression to the query.-
Methods inherited from class org.gcube.resources.discovery.client.queries.impl.QueryTemplate
addParameter, appendParameter, expression, hasParameter, parameter
-
Methods inherited from class org.gcube.resources.discovery.client.queries.impl.QueryBox
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.gcube.resources.discovery.client.queries.api.Query
expression
-
-
-
-
Field Detail
-
ns
public static final String ns
- See Also:
- Constant Field Values
-
vars
public static final String vars
- See Also:
- Constant Field Values
-
range
public static final String range
- See Also:
- Constant Field Values
-
cond
public static final String cond
- See Also:
- Constant Field Values
-
result
public static final String result
- See Also:
- Constant Field Values
-
template
public static final String template
- See Also:
- Constant Field Values
-
-
Method Detail
-
addCondition
public XQuery addCondition(String condition)
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
public XQuery addNamespace(String prefix, URI uri)
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
public XQuery addVariable(String variable, String range)
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
public XQuery setResult(String expression)
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
-
-