CSWQuery | R Documentation |
CSWQuery
CSWQuery
R6Class
object.
Object of R6Class
for modelling an CSW Query
ows4R::OGCAbstractObject
-> CSWQuery
ElementSetName
element set name property for request XML encoding
constraint
property for request XML encoding
ows4R::OGCAbstractObject$ERROR()
ows4R::OGCAbstractObject$INFO()
ows4R::OGCAbstractObject$WARN()
ows4R::OGCAbstractObject$encode()
ows4R::OGCAbstractObject$getClass()
ows4R::OGCAbstractObject$getClassName()
ows4R::OGCAbstractObject$getNamespaceDefinition()
ows4R::OGCAbstractObject$isFieldInheritedFrom()
ows4R::OGCAbstractObject$logger()
ows4R::OGCAbstractObject$print()
new()
This method is used to instantiate an CSWQUery object. The elementSetName
can be
either "full" (default), "brief" or "summary". A constraint CSWConstraint
can be
defined for the query. The typeNames
indicates to query (default "csw:Record").
The serviceVersion
gives the CSW service version (default "2.0.2")
CSWQuery$new( elementSetName = "full", constraint = NULL, typeNames = "csw:Record", serviceVersion = "2.0.2" )
elementSetName
element set name. Default is "full"
constraint
object of class CSWConstraint
typeNames
type names
serviceVersion
CSW service version
setServiceVersion()
Set service version. The methods ensures propery naming of typeNames depending on the service version
CSWQuery$setServiceVersion(serviceVersion)
serviceVersion
service version
clone()
The objects of this class are cloneable with this method.
CSWQuery$clone(deep = FALSE)
deep
Whether to make a deep clone.
Emmanuel Blondel <emmanuel.blondel1@gmail.com>
#CSWQuery - elementSetName
query_full <- CSWQuery$new()
query_brief <- CSWQuery$new(elementSetName = "brief")
query_summary <- CSWQuery$new(elementSetName = "summary")
#CSWQuery - cqlText with title
cons <- CSWConstraint$new(cqlText = "dc:title like '%ips%'")
query <- CSWQuery$new(constraint = cons)
#CSW 2.0.2 - Query - Filter / AnyText
filter <- OGCFilter$new( PropertyIsLike$new("csw:AnyText", "%Physio%"))
cons <- CSWConstraint$new(filter = filter)
query <- CSWQuery$new(constraint = cons)
#CSW 2.0.2 - Query - Filter / AnyText Equal
filter <- OGCFilter$new( PropertyIsEqualTo$new("csw:AnyText", "species"))
cons <- CSWConstraint$new(filter = filter)
query <- CSWQuery$new(constraint = cons)
#CSW 2.0.2 - Query - Filter / AnyText And Not
filter <- OGCFilter$new(And$new(
PropertyIsLike$new("csw:AnyText", "%lorem%"),
PropertyIsLike$new("csw:AnyText", "%ipsum%"),
Not$new(
PropertyIsLike$new("csw:AnyText", "%dolor%")
)
))
cons <- CSWConstraint$new(filter = filter)
query <- CSWQuery$new(constraint = cons)
#CSW 2.0.2 - Query - Filter / AnyText And nested Or
filter <- OGCFilter$new(And$new(
PropertyIsEqualTo$new("dc:title", "Aliquam fermentum purus quis arcu"),
PropertyIsEqualTo$new("dc:format", "application/pdf"),
Or$new(
PropertyIsEqualTo$new("dc:type", "http://purl.org/dc/dcmitype/Dataset"),
PropertyIsEqualTo$new("dc:type", "http://purl.org/dc/dcmitype/Service"),
PropertyIsEqualTo$new("dc:type", "http://purl.org/dc/dcmitype/Image"),
PropertyIsEqualTo$new("dc:type", "http://purl.org/dc/dcmitype/Text")
)
))
cons <- CSWConstraint$new(filter = filter)
query <- CSWQuery$new(elementSetName = "brief", constraint = cons)
#CSW 2.0.2 - Query - Filter / BBOX
bbox <- matrix(c(-180,180,-90,90), nrow = 2, ncol = 2, byrow = TRUE,
dimnames = list(c("x", "y"), c("min","max")))
filter <- OGCFilter$new( BBOX$new(bbox = bbox) )
cons <- CSWConstraint$new(filter = filter)
query <- CSWQuery$new(elementSetName = "brief", constraint = cons)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.