18.5 CSW Major Operations (DCMI Profile)
This topic covers loading and querying CSW data, and provides examples of requests and responses for various operations. It applies to using CSW data using the DCMI record type.
If your CSW data uses the DCMI (Dublin Core Metadata Initiative) profile, the recordType
attribute for each record will contain the value 1
.
When you call the SDO_CSW.INITIALIZE_CSW procedure, you specify the record type for your CSW data in the csw_xsd_id
parameter value (1
for DCMI, 2
for ISO).
The view USER_SDO_CSW_SERVICE_INFO contains CSW metadata for the supported CSW recordType
, as explained in Database Schema and Objects for CSW.
- Loading CSW 2.0.2 Data (DCMI)
After the CSW table is created when you initialize the CSW schema, you can start loading your CSW 2.0.2 data (DCMI records) into this table. - Querying CSW 2.0.2 Data (DCMI)
For querying CSW data, the GetCapabilities, DescribeRercord, and GetRecords CSW requests are supported, using the queryable elements described in this topic. - CSW Operations: Requests and Responses with XML Examples (DCMI)
This topic presents some requests to the CSW engine, and usually the responses to requests, for the following operations.
Parent topic: Catalog Services for the Web (CSW) Support
18.5.1 Loading CSW 2.0.2 Data (DCMI)
After the CSW table is created when you initialize the CSW schema, you can start loading your CSW 2.0.2 data (DCMI records) into this table.
Oracle Spatial provides a client-side loader for this purpose: $ORACLE_HOME/md/jlib/sdocswloader.jar
(assuming the default Spatial installation directory of $ORACLE_HOME/md
):
The sdocswloader.jar
package can take large files containing CSW XML records and load them into the CSW table. For example, assume that you have three XML files, csw_records1.txt, csw_records2.txt, and csw_records3.txt, which contain many DCMI records. Follow these steps to load them into the CSW table.
-
Create an XML configuration file named
sdo_csw_demo.xml
(or any other name as you wish), as in in the following example.<?xml version='1.0' encoding='windows-1252'?> <Connection> <Driver>Thin</Driver> <Hostname>localhost</Hostname> <Port>52504</Port> <ServiceName>SERVICENAME </ServiceName> <ServerMode>DEDICATED</ServerMode> <Schema>MDMETT</Schema> <Password>MDMETT</Password> <!-- Requires access to V$MYSTAT and V$SESS_TIME_MODEL --> <logServerStats>true</logServerStats> <clientSideEncoding>true</clientSideEncoding> <!-- SAX : for Splitting Large XML Files into smaller Files --> <!-- FOLDER : for walking a client side directory tree loading Files --> <mode>SAX</mode> <Pool>false</Pool> <Namespaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/> <!-- List of Files to be processed --> <FileList> <!-- replace the following with full file path names for the records --> <File>csw_records1.txt</File> <File>csw_records2.txt</File> <File>csw_records3.txt</File> </FileList> <Tables> <Table name=”CSW CATALOG TABLE_NAME” path="/root/csw:Record"> <Column name="XML_COLUMN" path="/root/csw:Record” type="xml"/> <Column name="METADATA_ID" path="/root/csw:Record/dc:identifier" type="string"/> </Table> </Tables> <!-- Each Writer process will commit its workload after this number of inserts --> <CommitCharge>100</CommitCharge> <!-- Number of Concurrent Writer Threads --> <ThreadCount>10</ThreadCount> <!—replace the following with full file path name for the logger --> <LogFileName>csw_records.log</LogFileName> <ErrorTable>CSW_ERROR_TABLE_NAME</ErrorTable> <schemaInstancePrefix>xsi</schemaInstancePrefix> <schemaLocation/> <noNamespaceSchemaLocation/> </Connection>
This configuration file allows the loader to process the DCMI records with DCMI namespaces.
The
username
parameter in this file refers to the CSW schema name.The
Table
name is the CSW table that you would like to populate; the firstColumn
name is the column where you have the records to be stored as Oracle XMLType objects in the CSW table, and the secondColumn
name is the column where you want the record ID values to be stored in the CSW table.Note:
If the table and the log directory do not exist, do the following before running XMLLoader (in the next major step):
-
Create a CSW_ERROR_TABLE_NAME in the CSW schema, to contain a log of errors. For example:
CREATE TABLE CSW_ERROR_TABLE of XMLTYPE;
-
Create a directory named
log
where thecsw_records.log
file will be created.
-
-
Create a
runXMLLoader.sh
(for Linux) orrunXMLLoader.bat
(for Windows) file, as shown in the following examples:-
Linux:
runXMLLoader.sh
PATH=$ORACLE_HOME/jdk/bin:$PATH java -Xmx2048M -classpath "$ORACLE_HOME/md/jlib/sdocswloader.jar:$ORACLE_HOME/lib/xmlparserv2.jar:$ORACLE_HOME/jdbc/lib/ojdbc8.jar:$ORACLE_HOME/rdbms/jlib/xdb8.jar" -Doracle.spatial.xmlloader.ConnectionParameters= /mydir/sdo_csw_demo.xml oracle.spatial.xmlloader.saxLoader.XMLLoader
-
Windows:
runXMLLoader.bat
set ORACLE_HOME=e:\app\oracle\product\12.2.0\dbhome_1 set PATH=%ORACLE_HOME%\jdk\bin;%PATH% java -cp %CD%\XMLLoader.jar;%ORACLE_HOME%\lib\xmlparserv2.jar;%ORACLE_HOME%\jdbc\lib\ojdbc8.jar;%ORACLE_HOME%\jdbc\lib\ojdbc8dms.jar;%ORACLE_HOME%\rdbms\jlib\xdb8.jar -Doracle.spatial.xmlloader.ConnectionParameters=%1 oracle.spatial.xmlloader.saxLoader.XMLLoader
These files use the
sdo_csw_demo.xml
file, and they assume JDK 1.8. You may need to modify the files if you have another Java environment, and you may need to make other changes to the configuration file and related script files for your system environment. -
In this example scenario, the CSW table is populated with the records in the three CSW 2.0.2 data files when runXMLLoader.sh
or runXMLLoader.bat
is run.
Parent topic: CSW Major Operations (DCMI Profile)
18.5.2 Querying CSW 2.0.2 Data (DCMI)
For querying CSW data, the GetCapabilities, DescribeRercord, and GetRecords CSW requests are supported, using the queryable elements described in this topic.
The following table lists the queryable elements for querying CSW data that is in DCMI format. For each query element, the DCMI name of the element it listed along with a brief description.
Table 18-1 Queryable Elements for DCMI
DCMI Name | Description |
---|---|
csw:AnyText |
A target for full-text search of character data types in a catalogue |
dc:contributor |
An entity responsible for making contributions to the content of the resource. |
dc:coverage |
The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant. |
dc:creator |
An entity primarily responsible for making the content of the resource. |
dc:date |
A date of a creation or update event of the metadata resource. |
dc:description |
An account of the resource. |
dc:format |
The physical or digital manifestation of the resource. |
dc:identifier |
An unambiguous reference to the resource within a given context. |
dc:language |
A language of the intellectual content of the resource. |
dc:publisher |
An entity responsible for making the resource available. This would equate to the Distributor in ISO and FGDC metadata. |
dc:relation |
A reference to a related resource. |
dc:rights |
Information about rights held in and over the resource |
dc:source |
A reference to a resource from which the present resource is derived. |
dc:subject |
A topic of the content of the resource. This is a place where a Topic Category or other taxonomy could be applied. |
dc:title |
A name given to the resource. Also known as “Name”. |
dc:type |
The nature or genre of the content of the resource. |
dct:abstract |
An account of the content of the resource. This is also known as the “Abstract” in other aspects of OGC, FGDC, and ISO metadata. |
dct:modified |
Date on which the resource was last changed |
dct:spatial |
The spatial extent or scope of the content of the resource. |
ows:BoundingBox |
Bounding Box |
The queryable elements that can be used in a csw:Constraint element with a cws:ElementName or csw:ElementSetName element can be grouped into the following modes:
-
Brief (Brief mode as specified in the OGC CSW 2.0.2 specification)
-
Summary (Summary mode as specified in the OGC CSW 2.0.2 specification)
-
Full (Always returns the full original DCMI record)
The csw:ElementySetName element specifies a mode (brief
, summary
, or full
); the csw:ElementName element does not specify a mode, but just the name of a queryable element.
The Brief mode queryable elements are the following:
dc:identifier dc:title dc:type ows:BoundingBox
The Summary mode queryable elements are the following:
dc:format dc:identifier dc:relation dc:subject dc:title dc:type dct:abstract dct:modified ows:BoundingBox
The Full mode queryable elements are any supported in the OGC specification and in the Brief and Summary modes. What distinguishes Full mode is that the query always returns the full original DCMI record, whereas the other modes return only the elements specified in the csw:Constraint element.
The Full mode queryable elements are the following:
csw:AnyText dc:contributor dc:coverage dc:creator dc:date dc:description dc:format dc:identifier dc:language dc:publisher dc:relation dc:rights dc:source dc:subject dc:title dc:type dct:abstract dct:modified dct:spatial ows:BoundingBox
Usage notes about ISO Queryables and some special cases:
-
gmd:date queryable is the same as gmd:modified queryable. Use either one in CSW request. gmd:date.
-
gmd:format and gmd:formatVersion: ElementName mode considers the path with distributionFormat node. Summary, Comprehensive, and Full ElementSetName mode considers also the distributorFormat node. Brief mode does not have these queryables.
-
gmd:hasSecurityConstraints queryable can only have the following values (it is also strongly recommended to use these values because data is not supposed to have values other than these): unclassified, restricted, confidential, secret, topSecret.
-
gmd:keywordType queryable can only have the following values (it is also strongly recommended to use these values because data is not supposed to have values other than these): discipline, place, stratum, temporal, theme.
-
gmd:referenceSystem: This is a union set queryable with referenceSystem, code, codeSpace, and version queryables. Use one of referenceSystem (also alias for code queryable), code, codeSpace, or version queryable in the csw:ElementName element of the CSW request, then all of these will appear in the response if they exist in the result set of ISO records (thus, the “related to” explanations). The csw:Constraint element can have any of these queryables.
-
gmd:spatialResolution: This is also a union set queryable with spatialResolution, denominator, distance, and distanceUOM queryables. Use one of spatialResolution (also alias for denominator queryable), denominator, distance, or distanceUOM in the csw:ElementName element of the CSW request, then all of these will appear in the response if they exist in the results of ISO records (thus, the “related to” explanations). The csw:Constraint element can have any of these queryables.
-
gmd:topicCategory queryable can only have the following values (it is also strongly recommended to use these values because data is not supposed to have values other than these): farming, biota, boundaries, climatologyMeteorologyAtmosphere, economy, elevation, environment, geoscientificInformation, health, imageryBaseMapsEarthCover, intelligenceMilitary, inlandWaters, location, oceans, planningCadastre, society, structure, transportation, and utilitiesCommunication.
-
ogc:Not logic is only supported for csw:Constraint/ogc:Filter/ogc:Not/ogc:PropertyIsLike.
-
PropertyIsNull is not supported for revisionDate, publicationDate, creationDate, contributor, creator, or publisher queryables.
-
srv:operatesOnData: This is also union set queryable with operatesOn, operatesOnIdentifier, operatesOnName queryables. This is a bit different than the above union sets described: operatesOn is processed different and independent than operatesOnIdentifier and operatesOnName queryables. When operatesOnIndetifier is in csw:ElementSet element of CSW request, then the operatesOnName will appear in the response if it exists in the results of ISO records. Similar argument for operatesOnIdentifier queryable but not operatesOn queryable. Thus, Table 1 shows “related to” explanation. The csw:Constraint can have any of these queryables.
-
srv:serviceOperation: This is also a union set queryable with serviceOperation, operation, DCP, and linkage queryables. Use one of serviceOperation (also alias for operation queryable), operation, DCP, linkage in the csw:ElementName element of the CSW request, then all of these will appear in the response if they exist in the result set of ISO records (thus, the “related to” explanations). The csw:Constraint element can have any of these queryables.
Parent topic: CSW Major Operations (DCMI Profile)
18.5.3 CSW Operations: Requests and Responses with XML Examples (DCMI)
This topic presents some requests to the CSW engine, and usually the responses to requests, for the following operations.
- GetCapabilities Operation (CSW, DCMI)
- DescribeRecord Operation (CSW, DCMI)
- GetRecords Operation (CSW, DCMI)
- GetRecordById Operation (CSW, DCMI)
Parent topic: CSW Major Operations (DCMI Profile)
18.5.3.1 GetCapabilities Operation (CSW, DCMI)
The GetCapabilities operation allows CSW clients to retrieve Catalog service metadata from the CSW engine (server). The response to a GetCapabilities request is an XML document containing Catalog service metadata document about the server. This operation specifies the XML document that a CSW instance will return to describe its capabilities.
The CSW server accepts the service, Sections, AcceptVersions, and AcceptFormats request parameters, and may implement the updateSequenceparameter. All CSW servers must implement the HTTP GET (that is, GET KVP) protocol for GetCapabilities operation. This service also supports POST XML and SOAP protocols.
The service metadata document (the CSW GetCapabilities response) contains the following sections:
-
Service Identification: Metadata about a specified CSW implementation.
-
Service Provider: Metadata about the organization offering the CSW service.
-
Operations Metadata: Metadata about the CSW operations offered by a specific CSW implementation, including the URLs for operation requests. This section also lists which record types are allowed for each operation supported.
-
Filter_Capabilities: Metadata about the filter capabilities of the server if the server implements the Filter predicate encoding as defined in [OGC 04-095].
Depending on the values in the Sections parameter of the GetCapabilities operation request, any combination of these sections can be requested to reduce response size. If the Sections parameter is not specified, then all sections will be returned
Example 18-1 GetCapabilities Request
The following is a request to get the capabilities of the CSW server named CSW at a specified namespace URL. This request will return a capabilities document, as explained in Capabilities Documents (CSW).
<csw:GetCapabilities service="CSW" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:ows="http://www.opengis.net/ows/2.0"> <ows:AcceptVersions> <ows:Version>2.0.2</ows:Version> <ows:Version>0.7.2</ows:Version> </ows:AcceptVersions> <ows:AcceptFormats> <ows:OutputFormat>text/xml</ows:OutputFormat> </ows:AcceptFormats> </csw:GetCapabilities>
18.5.3.2 DescribeRecord Operation (CSW, DCMI)
The DescribeRecord operation allows a client to discover elements of the information model supported by the catalog service. The operation allows some or all of the information model to be described. The Oracle Spatial catalog service supports HTTP GET, POST XML and SOAP protocols.
For XML encoded DescribeRecord requests, the namespace declarations are specified using standard XML conventions (xmlns
attributes) and described in the document "Namespaces in XML" [https://www.w3.org/TR/1999/REC-xml-names-19990114/].
For KVP encoding, namespace declarations are specified using the NAMESPACE
parameter, which is a comma-separated list of namespace declarations of the form xmlns([prefix=]namespace-url).
The TypeName
parameter specifies a list of type names that are to be described by the catalog service. A type name is the name of a queryable entity from the information model of the catalog. The Oracle Spatial catalog service allows only csw:Record
for the TypeName
parameter.
The outputFormat
parameter specifies the MIME type of the response document. The default output format attribute is the MIME type application/xml. All supported output formats should be declared in the Capabilities document. The Oracle Spatial catalog service supports by default application/xml
.
The schemaLanguage
parameter is used to specify the schema language that should be used to describe the specified types. The default value is XMLSCHEMA
, which indicates that the XML-Schema schema description language should be used. The Oracle Spatial catalog service supports XMLSCHEMA
for this parameter if it is present in the request.
An example HTTP GET request is:
http://<host:port>/oraclespatial/csw/<data source name>?service=CSW&request=DescribeRecord&version=2.0.2&outputFormat=application/xml&schemaLanguage=XMLSCHEMA&typeName=csw:Record&namespace=xmlns(csw=http://www.opengis.org/cat/csw)
The DescribeRecord operation response is an XML document with a DescribeRecordResponse
element that includes zero or more SchemaComponent
subelements, each of which contains the description of one or more type names in the requested schema language. The Oracle Spatial catalog service DescribeRecord response for the DCMI profile has only one SchemaComponent
because the TypeName
value is csw:Record
.
Example 18-2 DescribeRecord Request
The following is a request to describe the record with the type name Record
for a specified namespace..
<csw:DescribeRecord xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsd:schemaLanguage="http://www.w3.org/XML/Schema" service="CSW" version="2.0.2"> <csw:TypeName>csw:Record</csw:TypeName> </csw:DescribeRecord>
Example 18-3 DescribeRecord Response
The following is the response from the preceding request. The response is an XML schema definition (XSD). See the <xsd:documentation>
elements in the response for explanatory comments.
<csw:DescribeRecordResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd"> <csw:SchemaComponent schemaLanguage="http://www.w3.org/XML/Schema" targetNamespace="http://www.opengis.net/cat/csw/2.0.2"> <xsd:schema id="csw-record" targetNamespace="http://www.opengis.net/cat/csw/2.0.2" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:ows="http://www.opengis.net/ows" elementFormDefault="qualified" version="2.0.2.2"> <xsd:annotation> <xsd:appinfo> <dc:identifier xmlns:dc="http://purl.org/dc/elements/1.1/">http://schemas.opengis.net/csw/2.0.2/record.xsd</dc:identifier> </xsd:appinfo> <xsd:documentation xml:lang="en"> This schema defines the basic record types that must be supported by all CSW implementations. These correspond to full, summary, and brief views based on DCMI metadata terms. CSW is an OGC Standard. Copyright (c) 2004,2010 Open Geospatial Consortium. To obtain additional rights of use, visit http://www.opengeospatial.org/legal/ . </xsd:documentation> </xsd:annotation> <xsd:include schemaLocation="csw.xsd"/> <xsd:import namespace="http://purl.org/dc/terms/" schemaLocation="http://schemas.opengis.net/csw/2.0.2/rec-dcterms.xsd"/> <xsd:import namespace="http://purl.org/dc/elements/1.1/" schemaLocation="http://schemas.opengis.net/csw/2.0.2/rec-dcmes.xsd"/> <xsd:import namespace="http://www.opengis.net/ows" schemaLocation="http://schemas.opengis.net/ows/1.0.0/owsAll.xsd"/> <xsd:element name="AbstractRecord" id="AbstractRecord" type="csw:AbstractRecordType" abstract="true" /> <xsd:complexType name="AbstractRecordType" id="AbstractRecordType" abstract="true"/> <xsd:element name="DCMIRecord" type="csw:DCMIRecordType" substitutionGroup="csw:AbstractRecord"/> <xsd:complexType name="DCMIRecordType"> <xsd:annotation> <xsd:documentation xml:lang="en"> This type encapsulates all of the standard DCMI metadata terms, including the Dublin Core refinements; these terms may be mapped to the profile-specific information model. </xsd:documentation> </xsd:annotation> <xsd:complexContent> <xsd:extension base="csw:AbstractRecordType"> <xsd:sequence> <xsd:group ref="dct:DCMI-terms"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:element name="BriefRecord" type="csw:BriefRecordType" substitutionGroup="csw:AbstractRecord"/> <xsd:complexType name="BriefRecordType" final="#all"> <xsd:annotation> <xsd:documentation xml:lang="en"> This type defines a brief representation of the common record format. It extends AbstractRecordType to include only the dc:identifier and dc:type properties. </xsd:documentation> </xsd:annotation> <xsd:complexContent> <xsd:extension base="csw:AbstractRecordType"> <xsd:sequence> <xsd:element ref="dc:identifier" minOccurs="1" maxOccurs="unbounded"/> <xsd:element ref="dc:title" minOccurs="1" maxOccurs="unbounded"/> <xsd:element ref="dc:type" minOccurs="0"/> <xsd:element ref="ows:BoundingBox" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:element name="SummaryRecord" type="csw:SummaryRecordType" substitutionGroup="csw:AbstractRecord"/> <xsd:complexType name="SummaryRecordType" final="#all"> <xsd:annotation> <xsd:documentation xml:lang="en"> This type defines a summary representation of the common record format. It extends AbstractRecordType to include the core properties. </xsd:documentation> </xsd:annotation> <xsd:complexContent> <xsd:extension base="csw:AbstractRecordType"> <xsd:sequence> <xsd:element ref="dc:identifier" minOccurs="1" maxOccurs="unbounded"/> <xsd:element ref="dc:title" minOccurs="1" maxOccurs="unbounded"/> <xsd:element ref="dc:type" minOccurs="0"/> <xsd:element ref="dc:subject" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="dc:format" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="dc:relation" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="dct:modified" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="dct:abstract" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="dct:spatial" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="ows:BoundingBox" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:element name="Record" type="csw:RecordType" substitutionGroup="csw:AbstractRecord"/> <xsd:complexType name="RecordType" final="#all"> <xsd:annotation> <xsd:documentation xml:lang="en"> This type extends DCMIRecordType to add ows:BoundingBox; it may be used to specify a spatial envelope for the catalogued resource. </xsd:documentation> </xsd:annotation> <xsd:complexContent> <xsd:extension base="csw:DCMIRecordType"> <xsd:sequence> <xsd:element name="AnyText" type="csw:EmptyType" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="ows:BoundingBox" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="EmptyType" /> </xsd:schema> </csw:SchemaComponent> </csw:DescribeRecordResponse>
18.5.3.3 GetRecords Operation (CSW, DCMI)
The primary tools for resource discovery in CSW are the two operations: search and present. In the HTTP protocol binding these are combined in the form of the GetRecords operation, which performs a search and present.
The “search” portion of the GetRecords operation is encoded using the Query
element, which includes the parameters parameters typeName
and Constraint
.
-
The
typeName
parameter is used to specify which entities (record Types) of the catalog service will be queried. -
The Constraint parameter is used to specify which query constraints will be applied to identify the request set.
The “present” portion of the GetRecords operation is encoded using the outputSchema
parameter and the ElementName
/ElementSetName
parameter(s).
-
The
outputSchema
parameter indicates which XSD schema (that is,http://www.opengis.net/cat/csw/2.0.2
) will be used to generate the response to the GetRecords operation. -
The
ElementName
orElementSetName
parameter is used to specify which properties of theoutputSchema
to include in each record in the GetRecords response.
(The following description does not repeat some parameters also used with DescribeRecord, such as namespace
and outputFormat
.)
The resultType
parameter may have the value hits
, results
, or validate
. The value determines whether the catalog service returns just a summary of the result set (hits
), includes one or more records from the result set (results
), or validates the request message (validate
).
The startPosition
parameter is used to indicate at which record position the catalog should start generating output. The default value is 1, meaning that it starts at the first record in the result set.
The maxRecords
parameter is used to define the maximum number of records that should be returned from the result set of a query. If it is not specified, then 10 records will be returned. If its value is set to zero, then the behavior is identical to setting resultType
to hits
.
The typeNames
parameter is a list of one or more names of queryable entities in the catalog's information model that may be constrained in the predicate of the query. (csw:Record
indicates the DCMI profile.)
The ElementName
parameter is used to specify one or more metadata record elements, from the output schema specified using the outputSchema
parameter, so that the query will present in the response to the a GetRecords operation.
The ElementSetName
parameter can be brief, summary or full, to indicate which named set the service will present to the client.
The ElementName
and ElementSetName
parameters are mutually exclusive. Either an ElementSetName
parameter or one or more ElementSetName
parameters should be specified in a query.
The ConstraintLanguage
parameter must be Filter
for the Oracle Spatial CSW service. CQL
is not supported.
The constraint
parameter specifies which filtering capabilities are used to get certain records. The following filtering capabilities are supported by the Oracle Spatial CSW service:
-
Logical operators: And, Or, Not
-
Comparison operators: PropertyIsEqualTo, PropertyIsNotEqualTo, PropertyIsLessThan, PropertyIsGreaterThan, PropertyIsLessThanOrEqualTo, PropertyIsGreaterThanOrEqualTo, PropertyIsLike, PropertyIsNull, csw:AnyText
-
Spatial operators: BBOX
-
Simple arithmetic: add, sub, div, mul, function
The GetRecordsResponse
element is a container for the response to the GetRecords request.
The SearchStatus
element indicates the status of the response. The search status consists of a timestamp attribute indicating when the result set was created.
The SearchResults
element contains the SearchResults
element, which is the set of records returned by the GetRecords operation. The following attributes can be used with the SearchResults
element: ElementSet(brief/summary/full)
, numberOfRecordaMatched
, numberOfRecordsReturned
, nextRecord
.
Oracle Spatial Catalog Service supports HTTP GET, POST XML and SOAP protocols for the GetRecords operation.
Example 18-4 GetRecords Request with PropertyIsEqualTo and PropertyIsLike
The following is a request to GetRecords with PropertyIsEqualTo
and PropertyIsLike
specified. It finds the result set of records where the type is equal to the URL http://purl.org/dc/dcmitype/Image
or where the format is a String value containing anything between and including “application/” and “xml” tokens. (The following characters are flexible: escapeChar
, singleChar
, and wildcard
.)
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" resultType="results" service="CSW" version="2.0.2"> <csw:Query typeNames="csw:Record"> <csw:ElementSetName>summary</csw:ElementSetName> <csw:Constraint version="1.1.0"> <ogc:Filter> <ogc:Or> <ogc:PropertyIsLike escapeChar="\" singleChar="?" wildCard="*"> <ogc:PropertyName>dc:format</ogc:PropertyName> <ogc:Literal>application/*xml</ogc:Literal> </ogc:PropertyIsLike> <ogc:PropertyIsEqualTo> <ogc:PropertyName>dc:type</ogc:PropertyName> <ogc:Literal>http://purl.org/dc/dcmitype/Image</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Or> </ogc:Filter> </csw:Constraint> </csw:Query> </csw:GetRecords>
For GetRecords Requests, ElementSetName
can be summary
, full
, or brief
.
The CSW 2.0.2 specification allows either ElementSetName
(only 1) or ElementName
(can be more than 1) in the GetRecords Request.
The Spatial catalog service supports only synchronous processing of GetRecords requests.
Example 18-5 GetRecords Response with PropertyIsEqualTo and PropertyIsLike
The following is the response from the preceding request.
<csw:GetRecordsResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns9="http://www.opengis.net/ows" xmlns:ns8="http://purl.org/dc/terms/" xmlns:ns7="http://purl.org/dc/elements/1.1/" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:ows="http://www.opengis.net/ows/2.0" xmlns:ogc="http://www.opengis.net/ogc" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:swe="http://www.opengis.net/swe/2.0" version="2.0.2" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 ../../cswAll.xsd"> <csw:SearchStatus timestamp="2016-06-09T02:16:36Z"></csw:SearchStatus> <csw:SearchResults elementSet="summary" recordSchema="http://www.opengis.net/cat/csw/2.0.2" numberOfRecordsMatched="4" numberOfRecordsReturned="4" nextRecord="0"> <csw:SummaryRecord> <ns7:identifier>urn:uuid:19887a8a-f6b0-4a63-ae56-7fba0e17801f</ns7:identifier> <ns7:title>Lorem ipsum</ns7:title> <ns7:type>http://purl.org/dc/dcmitype/Image</ns7:type> <ns7:subject>Tourism--Greece</ns7:subject> <ns7:format>image/svg+xml</ns7:format> <ns8:abstract>Quisque lacus diam, placerat mollis, pharetra in, commodo sed, augue. Duis iaculis arcu vel arcu.</ns8:abstract> <ns9:BoundingBox></ns9:BoundingBox> </csw:SummaryRecord> <csw:SummaryRecord> <ns7:identifier>urn:uuid:66ae76b7-54ba-489b-a582-0f0633d96493</ns7:identifier> <ns7:title>Maecenas enim</ns7:title> <ns7:type>http://purl.org/dc/dcmitype/Text</ns7:type> <ns7:subject>Marine sediments</ns7:subject> <ns7:format>application/xhtml+xml</ns7:format> <ns8:abstract>Pellentesque tempus magna non sapien fringilla blandit.</ns8:abstract> <ns9:BoundingBox></ns9:BoundingBox> </csw:SummaryRecord> <csw:SummaryRecord> <ns7:identifier>urn:uuid:829babb0-b2f1-49e1-8cd5-7b489fe71a1e</ns7:identifier> <ns7:title>Vestibulum massa purus</ns7:title> <ns7:type>http://purl.org/dc/dcmitype/Image</ns7:type> <ns7:format>image/jp2</ns7:format> <ns7:relation>urn:uuid:9a669547-b69b-469f-a11f-2d875366bbdc</ns7:relation> <ns9:BoundingBox></ns9:BoundingBox> </csw:SummaryRecord> <csw:SummaryRecord> <ns7:identifier>urn:uuid:a06af396-3105-442d-8b40-22b57a90d2f2</ns7:identifier> <ns7:title>Lorem ipsum dolor sit amet</ns7:title> <ns7:type>http://purl.org/dc/dcmitype/Image</ns7:type> <ns7:format>image/jpeg</ns7:format> <ns9:BoundingBox></ns9:BoundingBox> </csw:SummaryRecord> </csw:SearchResults> </csw:GetRecordsResponse>
Example 18-6 GetRecords Request with PropertyIsLike
The following is a request to GetRecords with PropertyIsLike
where the client wants to fetch records whose property title is like “Lorem ipsum*”. (The following characters are flexible: escapeChar
, singleChar
, and wildcard
.)
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" maxRecords="20" resultType="results" service="CSW" version="2.0.2"> <csw:Query typeNames="csw:Record"> <csw:ElementSetName>summary</csw:ElementSetName> <csw:Constraint version="1.1.0"> <ogc:Filter> <ogc:PropertyIsLike escapeChar="\" singleChar="?" wildCard="*"> <ogc:PropertyName>dc:title</ogc:PropertyName> <ogc:Literal>Lorem ipsum*</ogc:Literal> </ogc:PropertyIsLike> </ogc:Filter> </csw:Constraint> </csw:Query> </csw:GetRecords>
Example 18-7 GetRecords Response with PropertyIsLike
The following is the response from the preceding request.
<csw:GetRecordsResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns9="http://www.opengis.net/ows" xmlns:ns8="http://purl.org/dc/terms/" xmlns:ns7="http://purl.org/dc/elements/1.1/" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:ows="http://www.opengis.net/ows/2.0" xmlns:ogc="http://www.opengis.net/ogc" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:swe="http://www.opengis.net/swe/2.0" version="2.0.2" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 ../../cswAll.xsd"> <csw:SearchStatus timestamp="2016-06-10T01:38:22Z"></csw:SearchStatus> <csw:SearchResults elementSet="summary" recordSchema="http://www.opengis.net/cat/csw/2.0.2" numberOfRecordsMatched="2" numberOfRecordsReturned="2" nextRecord="0"> <csw:SummaryRecord> <ns7:identifier>urn:uuid:19887a8a-f6b0-4a63-ae56-7fba0e17801f</ns7:identifier> <ns7:title>Lorem ipsum</ns7:title> <ns7:type>http://purl.org/dc/dcmitype/Image</ns7:type> <ns7:subject>Tourism--Greece</ns7:subject> <ns7:format>image/svg+xml</ns7:format> <ns8:abstract>Quisque lacus diam, placerat mollis, pharetra in, commodo sed, augue. Duis iaculis arcu vel arcu.</ns8:abstract> <ns9:BoundingBox></ns9:BoundingBox> </csw:SummaryRecord> <csw:SummaryRecord> <ns7:identifier>urn:uuid:a06af396-3105-442d-8b40-22b57a90d2f2</ns7:identifier> <ns7:title>Lorem ipsum dolor sit amet</ns7:title> <ns7:type>http://purl.org/dc/dcmitype/Image</ns7:type> <ns7:format>image/jpeg</ns7:format> <ns9:BoundingBox></ns9:BoundingBox> </csw:SummaryRecord> </csw:SearchResults> </csw:GetRecordsResponse>
Example 18-8 GetRecords Request with PropertyIsGreaterThan
The following is a request to GetRecords with PropertyIsGreaterThan where the client would like to fetch records where their dates are later than the date value 2004-01-01.
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" resultType="results" service="CSW" version="2.0.2"> <csw:Query typeNames="csw:Record"> <csw:ElementName>dc:identifier</csw:ElementName> <csw:ElementName>dc:type</csw:ElementName> <csw:ElementName>dc:date</csw:ElementName> <csw:Constraint version="1.1.0"> <ogc:Filter> <ogc:PropertyIsGreaterThan> <ogc:PropertyName>dc:date</ogc:PropertyName> <ogc:Literal>2004-01-01Z</ogc:Literal> </ogc:PropertyIsGreaterThan> </ogc:Filter> </csw:Constraint> </csw:Query> </csw:GetRecords>
Example 18-9 GetRecords Response with PropertyIsGreaterThan
The following is the response from the preceding request.
<csw:GetRecordsResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns9="http://www.opengis.net/ows" xmlns:ns8="http://purl.org/dc/terms/" xmlns:ns7="http://purl.org/dc/elements/1.1/" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:ows="http://www.opengis.net/ows/2.0" xmlns:ogc="http://www.opengis.net/ogc" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:swe="http://www.opengis.net/swe/2.0" version="2.0.2" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 ../../cswAll.xsd"> <csw:SearchStatus timestamp="2015-06-29T05:50:16Z"></csw:SearchStatus> <csw:SearchResults elementSet="" recordSchema="http://www.opengis.net/cat/csw/2.0.2" numberOfRecordsMatched="3" numberOfRecordsReturned="3" nextRecord="0"> <csw:Record> <ns7:identifier>urn:uuid:784e2afd-a9fd-44a6-9a92-a3848371c8ec</ns7:identifier> <ns7:type>http://purl.org/dc/dcmitype/Text</ns7:type> <ns7:date>2006-05-12Z</ns7:date> </csw:Record> <csw:Record> <ns7:identifier>urn:uuid:94bc9c83-97f6-4b40-9eb8-a8e8787a5c63</ns7:identifier> <ns7:type>http://purl.org/dc/dcmitype/Dataset</ns7:type> <ns7:date>2006-03-26Z</ns7:date> </csw:Record> <csw:Record> <ns7:identifier>urn:uuid:9a669547-b69b-469f-a11f-2d875366bbdc</ns7:identifier> <ns7:type>http://purl.org/dc/dcmitype/Dataset</ns7:type> <ns7:date>2005-10-24Z</ns7:date> </csw:Record> </csw:SearchResults> </csw:GetRecordsResponse>
Example 18-10 GetRecords Request with BoundingBox (BBOX)
The following is a request to GetRecords with BoundingBox
(BBOX) where the client wants to fetch records whose geometry does not fall into the Bounding Box of (40,-9;50, -5) and where the type is equal to the case-insensitive String URL value HTTP://purl.org/dc/dcmitype/dataset
. This means that type could be http://purl.org/dc/dcmitype/dataset
or anything starting with that. This request benefits from both spatial and XQFT indexes.
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" resultType="results" service="CSW" version="2.0.2"> <csw:Query typeNames="csw:Record"> <csw:ElementName>dc:identifier</csw:ElementName> <csw:ElementName>dc:type</csw:ElementName> <csw:ElementName>ows:BoundingBox</csw:ElementName> <csw:Constraint version="1.1.0"> <ogc:Filter> <ogc:And> <ogc:Not> <ogc:BBOX> <ogc:PropertyName>ows:BoundingBox</ogc:PropertyName> <gml:Envelope srsName="urn:x-ogc:def:crs:EPSG:6.11:4326"> <gml:lowerCorner>40.0 -9.0</gml:lowerCorner> <gml:upperCorner>50.0 -5.0</gml:upperCorner> </gml:Envelope> </ogc:BBOX> </ogc:Not> <ogc:PropertyIsEqualTo matchCase="false"> <ogc:PropertyName>dc:type</ogc:PropertyName> <ogc:Literal>HTTP://purl.org/dc/dcmitype/dataset</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:And> </ogc:Filter> </csw:Constraint> </csw:Query> </csw:GetRecords>
Example 18-11 GetRecords Response with BoundingBox (BBOX)
The following is the response from the preceding request.
<csw:GetRecordsResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns9="http://www.opengis.net/ows" xmlns:ns8="http://purl.org/dc/terms/" xmlns:ns7="http://purl.org/dc/elements/1.1/" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:ows="http://www.opengis.net/ows/2.0" xmlns:ogc="http://www.opengis.net/ogc" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:swe="http://www.opengis.net/swe/2.0" version="2.0.2" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 ../../cswAll.xsd"> <csw:SearchStatus timestamp="2015-06-29T05:50:16Z"></csw:SearchStatus> <csw:SearchResults elementSet="" recordSchema="http://www.opengis.net/cat/csw/2.0.2" numberOfRecordsMatched="2" numberOfRecordsReturned="2" nextRecord="0"> <csw:Record> <ns7:identifier>urn:uuid:88247b56-4cbc-4df9-9860-db3f8042e357</ns7:identifier> <ns7:type>http://purl.org/dc/dcmitype/Dataset</ns7:type> <ns9:BoundingBox></ns9:BoundingBox> </csw:Record> <csw:Record> <ns7:identifier>urn:uuid:94bc9c83-97f6-4b40-9eb8-a8e8787a5c63</ns7:identifier> <ns7:type>http://purl.org/dc/dcmitype/Dataset</ns7:type> <ns9:BoundingBox crs="urn:x-ogc:def:crs:EPSG:6.11:4326" dimensions="2"> <ns9:LowerCorner>47.595 -4.097</ns9:LowerCorner> <ns9:UpperCorner>51.217 0.889</ns9:UpperCorner> </ns9:BoundingBox> </csw:Record> </csw:SearchResults> </csw:GetRecordsResponse>
18.5.3.4 GetRecordById Operation (CSW, DCMI)
The GetRecordById operation is a subset of the GetRecords operation, and is included as a convenient short form for retrieving and linking to records in the CSW service. The GetRecordById request retrieves catalog records using their identifier.
The GetRecordById operation is an implementation of the "present" operation as described in GetRecords Operation (CSW, DCMI). The parameters are ElementSetName
, outputFormat
, outputSchema
, and Id
.
The GetRecordById response is the list of requested records with matched Id
values.
Oracle Spatial CSW supports HTTP GET, POST XML, and SOAP protocols for this request.
Example 18-12 GetRecordById Request
The following is a request to get the records with the record ID values urn:uuid:a06af396-3105-442d-8b40-22b57a90d2f2
, urn:uuid:19887a8a-f6b0-4a63-ae56-7fba0e17801f
, and urn:uuid:ab42a8c4-95e8-4630-bf79-33e59241605a
.
<csw:GetRecordById xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" outputFormat="application/xml" service="CSW" version="2.0.2"> <csw:Id>urn:uuid:a06af396-3105-442d-8b40-22b57a90d2f2</csw:Id> <csw:Id>urn:uuid:19887a8a-f6b0-4a63-ae56-7fba0e17801f</csw:Id> <csw:Id>urn:uuid:ab42a8c4-95e8-4630-bf79-33e59241605a</csw:Id> <csw:ElementSetName>brief</csw:ElementSetName> </csw:GetRecordById>
Example 18-13 GetRecordById Response
The following is the response from the preceding request.
<csw:GetRecordByIdResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns9="http://www.opengis.net/ows" xmlns:ns8="http://purl.org/dc/terms/" xmlns:ns7="http://purl.org/dc/elements/1.1/" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:ows="http://www.opengis.net/ows/2.0" xmlns:ogc="http://www.opengis.net/ogc" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:swe="http://www.opengis.net/swe/2.0" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 ../../cswAll.xsd"> <BriefRecord> <ns7:identifier>urn:uuid:19887a8a-f6b0-4a63-ae56-7fba0e17801f</ns7:identifier> <ns7:type>http://purl.org/dc/dcmitype/Image</ns7:type> <ns7:title>Lorem ipsum</ns7:title> <ns9:BoundingBox></ns9:BoundingBox> </BriefRecord> <BriefRecord> <ns7:identifier>urn:uuid:a06af396-3105-442d-8b40-22b57a90d2f2</ns7:identifier> <ns7:type>http://purl.org/dc/dcmitype/Image</ns7:type> <ns7:title>Lorem ipsum dolor sit amet</ns7:title> <ns9:BoundingBox></ns9:BoundingBox> </BriefRecord> <BriefRecord> <ns7:identifier>urn:uuid:ab42a8c4-95e8-4630-bf79-33e59241605a</ns7:identifier> <ns7:type>http://purl.org/dc/dcmitype/Service</ns7:type> <ns9:BoundingBox></ns9:BoundingBox> </BriefRecord> </csw:GetRecordByIdResponse>