xWCPS created to offer additional features to the WCPS service described in the previous tutorial. These features consist of:
One of the fundamental operations a query language must offer is that of querying for all data residing in the database without prior knowledge of their internal representation. WCPS requires the specification of coverage identifiers in selection queries. xWCPS is introduced to fill this gap offering a unified language by combining two already well known standards, WCPS and XPath 2.0, aiming at being rich, expressive and user friendly. In the following query all coverages from the "access.planetserver.eu" service will be encoded in 'png' format and returned as a result.
Example: *
for $c in /server[@endpoint='http://access.planetserver.eu:8080/rasdaman/ows']/coverage
return encode(\$c, "png")*
Coverage filtering based on the available metadata using XPath 2.0. For and where clauses can contain XPath 2.0 expressions in order to restrict results to specific metadata.
Example:
for $c in /server/coverage
metadata($c)$c//gml:cat_solar_longitude[text()>86.122]
return encode($c, "png")
xWCPS supports variable manipulation via 'let' clause, which allows assigning complex expressions to variables and using them for subsequent references, avoiding repetitiveness.
Example:
let $value = 85;
for $c in /server/coverage
where metadata($c)$c//gml:cat_solar_longitude[text()>$value]
return encode($c, "png")
An important feature of xWCPS is the ability to return the data accompanied with their metadata. This can be achieved using the 'mixed' clause of xWCPS.
Example:
for $c in /server/coverage
return mixed(encode($c, "png", metadata($c))
A xWCPS quer consists of three components:
Moreover may contain variable declaration (via let clause) anywhere in a query.
For expression may contain:
Examples:
Where expression may contain:
Example: where metadata(c)//gml:cat_solar_longitude[text()<86.0122]
Return expression may contain:
Examples:
The following examples show a variety of xWCPS queries that can be applied to the data of a WCS Server, when metadata are harvested and stored in database. Examples are based on the following services: http://access.planetserver.eu:8080/rasdaman/ows and https://rsg.pml.ac.uk/rasdaman/ows
All requests can be executed in http://earthserver-devel.vhosts.cite.gr/
for $c in ( CCI_V2_monthly_rrs_670 ) return metadata($c)
for $c in /server/coverage return metadata($c)
for $c in /server[@endpoint='https://rsg.pml.ac.uk/rasdaman/ows']/coverage return metadata($c)
for $c in /server[@endpoint='http://access.planetserver.eu:8080/rasdaman/ows']/coverage where metadata($c)//gml:cat_solar_longitude[text()<86.0122] return metadata($c)
for $c in /server[@endpoint='http://access.planetserver.eu:8080/rasdaman/ows']/coverage
where metadata($c)//gml:cat_solar_longitude[text()<86.0122] return metadata($c)//gml:cat_solar_longitude
for data in (frt0000cc22_07_if165l_trr3) return mixed(encode( { red: (int)(255 / (max((data.band_233 != 65535) * data.band_233) - min(data.band_233))) * (data.band_233 - min(data.band_233)); green: (int)(255 / (max((data.band_13 != 65535) * data.band_13) - min(data.band_13))) * (data.band_13 - min(data.band_13)); blue: (int)(255 / (max((data.band_78 != 65535) * data.band_78) - min(data.band_78))) * (data.band_78 - min(data.band_78)) ; alpha: (data.band_100 != 65535) * 255}, "png", "nodata=null"), metadata(data))