org.gcube.resources.discovery.client.queries.impl
Class XQuery

java.lang.Object
  extended by org.gcube.resources.discovery.client.queries.impl.QueryBox
      extended by org.gcube.resources.discovery.client.queries.impl.QueryTemplate
          extended by org.gcube.resources.discovery.client.queries.impl.XQuery
All Implemented Interfaces:
Query, SimpleQuery

public class XQuery
extends QueryTemplate
implements 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:

Author:
Fabio Simeoni

Field Summary
static String cond
           
static String ns
           
static String range
           
static String result
           
static String template
           
static String vars
           
 
Fields inherited from class org.gcube.resources.discovery.client.queries.impl.QueryTemplate
DEFAULT
 
Constructor Summary
XQuery(Map<String,String> parameters)
           
 
Method Summary
 XQuery addCondition(String condition)
          Adds a free-form condition on query results.
 XQuery addNamespace(String prefix, URI uri)
          Adds a namespace to the query.
 XQuery addVariable(String variable, String range)
          Adds a variable to the query.
 XQuery setResult(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
Constructor Detail

XQuery

public XQuery(Map<String,String> parameters)
Method Detail

addCondition

public XQuery addCondition(String condition)
Adds a free-form condition on query results.

In the condition, $resource ranges over resources.

Specified by:
addCondition in interface SimpleQuery
Parameters:
condition - the condition
Returns:
the query

addNamespace

public XQuery addNamespace(String prefix,
                           URI uri)
Description copied from interface: SimpleQuery
Adds a namespace to the query.

Specified by:
addNamespace in interface SimpleQuery
Parameters:
prefix - the namespace prefix
uri - the namespace URI
Returns:
the query

addVariable

public XQuery addVariable(String variable,
                          String range)
Description copied from interface: SimpleQuery
Adds a variable to the query.

Specified by:
addVariable in interface SimpleQuery
Parameters:
variable - the name of the variable
range - the range of the variable
Returns:
the query

setResult

public XQuery setResult(String expression)
Adds a result expression to the query.

In the expression, $resource ranges over resources.

Specified by:
setResult in interface SimpleQuery
Parameters:
expression - the result expression
Returns:
the query


Copyright © 2013. All Rights Reserved.