CSW_GetRecords: Get catalog info for records satisfying constraint

Description Usage Arguments Value Remarks Examples

View source: R/get_cat_data.R

Description

The CSW_GetRecords function retrieves catalog entries from the CSW server (unless resultType='validate' is specified). The default output format is a data.frame with as alternatives an xml_document or list (see output). The fields of the data.frame are determined by the ElementSetName argument that results in few (brief), more (summary) and most (full) fields. The relation between typeNames, outputSchema and namespace is not clear to me, but it seems that the argument values must correspond: taking the first option for typeNames one should also take the first one for outputSchema and namespace. Also see remarks.
The default constraint language and its version are CQL_TEXT and 1.1.0 but can be overwritten by arguments of this function. See the vignette for examples and references for the query language.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
CSW_GetRecords(constraint = "", constraintLanguage = "CQL_TEXT",
  constraint_language_version = "1.1.0", resultType = c("results",
  "validate"), typeNames = c("csw:Record", "gmd:MD_Metadata",
  "gfc:FC_FeatureCatalogue", "dcat"),
  outputSchema = c("http://www.opengis.net/cat/csw/2.0.2",
  "http://www.isotc211.org/2005/gmd", "http://www.isotc211.org/2005/gfc",
  "http://www.w3.org/ns/dcat#"), ElementSetName = c("summary", "full",
  "brief"), namespace = c("csw:http://www.opengis.net/cat/csw/2.0.2",
  "gmd:http://www.isotc211.org/2005/gmd"), maxRecords = "",
  startPosition = "", output = c("table", "list", "xml"),
  version = CSW_get_version(), baseurl = CSW_get_url(),
  verbose = c("N", "F", "Y"))

Arguments

constraint

Character vector with a constraint written with constraintLanguage=CQL_TEXT and constraint_language_version==1.1.0.

constraintLanguage

Character vector indicating in which language the constraint is written. Default CQL_TEXT.

constraint_language_version

Character vector indicating the version of the constraint language. Default 1.1.0.

resultType

Character vector with one of results and validate. With results actual search results will be returned. With validate a Boolean will be returned indicating if the constraint is valid.

typeNames

Character vector with one (or both?) of csw:Record and gmd:MD_Metadata. Also gfc:FC_FeatureCatalogue and dcat can be used.

outputSchema

Character vector with one (or more?) of http://www.opengis.net/cat/csw/2.0.2 , http://www.isotc211.org/2005/gmd, http://www.isotc211.org/2005/gfc and http://www.w3.org/ns/dcat#. The first two work and the first of them give a more table like presentation.

ElementSetName

Character vector with one of summary, full and brief indicating how much data is presented. Default summary.

namespace

Character vector with one or both of csw:http://www.opengis.net/cat/csw/2.0.2 and gmd:http://www.isotc211.org/2005/gmd. See Remarks for the relation between typeName and namespace.

maxRecords

Integer indicating the number of records that will be read from the server. Default is determined by the CSW server (for the default baseurl the default maxRecords is 10 but values in the order of 100 are accepted )

startPosition

Integer indicating the number of the first record that will be returned. The default is 1. To read e.g. the records of a constraint with 150 hits one can issue two requests: the first one with maxRecords = 100 and startPosition = 1 (returning 100 records) and the second with maxRecords = 100 and startPosition = 101 (that will return the last 50 records)

output

Character vector with one of table, list and xml. With table (the default) the results will be put in a data.frame. With list this table is placed in a list with the number of retrieved and total number of records satisfying the constraint. With xml the retrieved xml_document is passed through without conversion.

version

Character vector with CSW version. Default is 2.0.2 but this can be changed for the remainder of the session with CSW_set_version .

baseurl

Character vector with base url of the CSW server. Default is http://nationaalgeoregister.nl/geonetwork/srv/dut/csw? but this can be changed for the remainder of the session with CSW_set_url .

verbose

Character N, F or Y. When F the full generated and encoded url will be displayed, when Y the variable part of the url (without baseurl, service indication CSW and version) will be displayed in decoded form and when N (default) nothing of the generated url will be displayed.

Value

An xml document with the record description in the indicated layout.

Remarks

We have tried various combinations of typeNames (first two only), outputSchema (same) and namespace. These have only two possible outcomes and depend only on outputSchema: the csw output is more table like and the gmd output is more verbose (?)

Examples

1
2
3
4
## Not run: 
 exp1 = CSW_GetRecords(constraint="AnyText LIKE 'duin%'" )

## End(Not run)

HanOostdijk/CSW documentation built on May 29, 2019, 1:39 p.m.