18 Catalog Services for the Web (CSW) Support

Oracle Spatial and Graph provides an implementation of the Open GIS Consortium specification for catalog services.

According to this specification: "Catalogue services support the ability to publish and search collections of descriptive information (metadata) for data, services, and related information objects. Metadata in catalogues represent resource characteristics that can be queried and presented for evaluation and further processing by both humans and software. Catalogue services are required to support the discovery and binding to registered information resources within an information community."

The Oracle Spatial and Graph implementation will be referred to as Catalog Services for the Web, or CSW.

Note:

This Oracle Spatial and Graph implementation of CSW support is new as of Release 12.2. The implementation for previous releases is deprecated and should not be used. If for any reason you need to use the deprecated implementation, its documentation is in the appendix Catalog Services for the Web (CSW) Support [deprecated implementation].

Before you use CSW, be sure that you understand the concepts described in Introduction to Spatial Web Services, and that you have performed any necessary configuration work as described in that chapter.

Topics:

18.1 CSW Engine and Architecture

This topic describes CSW, including its relationship to clients and to the database server.

CSW is implemented as a Java web application and can be deployed in WebLogic 12.1.3 or later. The required Java version is JDK 1.8 or later.

CSW has a metadata layer, which stores in the database the metadata needed to reply to catalog requests. The metadata includes spatial columns, which can be queried and processed using Oracle Spatial and Graph interfaces. The metadata also stores the association of nonspatial and spatial attributes of records, as well as the services that the catalog service provides to its clients.

Figure 18-1 shows the CSW architecture.

As shown in Figure 18-1:

  • CSW is part of a container in the middle tier.

  • CSW can communicate with a web service client using CSW requests and responses in SOAP/XML/KVP format.

  • CSW performs spatial data and metadata access through JDBC calls to the database.

  • The database includes Oracle Spatial and Graph with CSW metadata and data.

18.2 Database Schema and Objects for CSW

A CSW schema is any user schema that is used to store CSW records. In some examples used in this document, the schema of a database user named SCOTT or MDMETT is a CSW schema.

A CSW database instance stores CSW catalog records in a CSW schema. The CSW web service instance requires the CSW schema configured as a JDBC data source in the application container. Normally, only one CSW schema is configured for a specific database, but many CSW web services can be configured for use with the same database using different CSW schemas.

Oracle Spatial and Graph provides the view USER_SDO_CSW_SERVICE_INFO, which contains CSW metadata for the supported CSW recordType. The USER_SDO_CSW_SERVICE_INFO view contains the following columns:

CSW_VERSION     VARCHAR2(20),             
CSW_XSD_ID      NUMBER,              
CSW_TABLE_NAME  VARCHAR2(80)

You can query this view to find out the CSW recordType used by your CSW schema. Currently, only the DCMI recordType is supported, but that may change in future releases.

The SDO_CSW PL/SQL package enables you to perform CSW instance creation and other operations. It includes CSW initialization, and allows you to create and maintain Spatial and XQFT indexes. For reference information about the subprograms, see SDO_CSW Package (Catalog Services for the Web).

18.3 Configuring and Deploying the CSW Engine

This topic focuses on configuring and deploying Catalog Services for the Web, specifically CSW 2.0.2.

Be sure that you have previously performed any necessary operations described in Deploying and Configuring Spatial Web Services.

The CSW APIs enable you to perform operations that include:

  • Specifying information about record type domains and record view transformations

  • Populating the USER_SDO_CSW_SERVICE_INFO table for DCMI (Dublin Core Metadata Initiative)

  • Unpublishing record types by dropping them from the USER_SDO_CSW_SERVICE_INFO table

  • Granting to users and revoking from users privileges on CSW record types and on the XML query full text context index

Configuring the CSW engine involves the following:

  • Initializing CSW

  • Editing the CSWConfig.xml File

  • Setting Up CSW Data Sources

  • Loading Data for CSW

  • Testing the CSW Deployment

  • Creating and Maintaining Spatial and XQFT Indexes

Initializing CSW

Before initializing CSW, the following privileges should be granted to the CSW schema. Here, the schema of a database user named MDMETT is a CSW schema.

GRANT CONNECT, RESOURCE, UNLIMITED TABLESPACE, CTXAPP TO MDMETT;
GRANT EXECUTE ON CTXSYS.CTX_DDL TO MDMETT;
GRANT SELECT ON MDSYS.SDO_XSD_TABLE TO MDMETT;
GRANT SELECT,ALTER ON MDSYS.md_identifier_sq$ TO MDMETT;

To use Catalog Services for the Web in Oracle Spatial and Graph, you must call the SDO_CSW.INITIALIZE_CSW procedure to initialize the CSW 2.0.2 service. This procedure creates the user table if it does not already exist, and prepares the indexes.

DECLARE
BEGIN
sdo_csw.initialize_csw(
  'MDMETT',
  '2.0.2', -- must be 2.0.2
  1, -- must be 1 (for DCMI)
  'MY_CSW_CATALOG_TABLE',
  4326,
  1
  );
  END;
  /

If the CSW database instance is not instantiated, you can call the SDO_CSW.INITIALIZE_CSW procedure, which initializes a CSW schema and creates the CSW catalog table and appropriate indexes if they do not exist. For example, the preceding example will enable the MDMETT schema as the CSW schema, create the MY_CSW_CATALOG_TABLE table as the CSW catalog table, and create (spatial and XML Query Full Text) indexes on it.

The SDO_CSW.INITIALIZE_CSW procedure can also be used to just register the CSW schema and catalog table if the CSW catalog table and necessary indexes already exist. For details and examples, see the SDO_CSW.INITIALIZE_CSW reference topic.

Editing the CSWConfig.xml File

In the CSWConfig.xml configuration file, you may need to modify some or all of the following settings:

  • log_level, which accepts the following values (reflecting increasing amounts of information to be stored in the log file): OFF, SEVERE, WARNING, INFO (the default), CONFIG, FINE, FINER, FINEST, and ALL.

  • size_limit, an integer that specifies an approximate maximum amount of megabytes to write to any log file before creating a new file for log rotation. If size_limit is 0 (zero), there is no limit. The default value is 10.

  • file_count, which specifies how many output files to cycle through. Older log files will be deleted to limit the disk space taken by log files. The default value is 10.

  • ServiceIdentification and ServiceProvider, which provide appropriate content to deliver in CSW GetCapabilities responses. If these two values are required to be different than the default values provided by the Oracle Spatial and Graph CSW service, then they must be uncommented and edited as required in order to have the correct information returned in CSW GetCapabilities responses. If this section remains commented, default content will be delivered on the client side.

You can use the CSW Administration Console to edit the CSWConfig.xml configuration file.

Setting Up CSW Data Sources

After the CSW schema is created, set up a data source for the CSW engine in WebLogic Server, as follows.

  1. Log into the WebLogic Server console.

  2. In the left Pane; under Domain Structure, select Data Sources.

  3. Click New, then Generic Data Source.

  4. On Create a New JDBC Data Source page, specify:

    1. Name: CSW_ADMIN_CONN (or any name of your choice)

    2. JNDI Name: jdbc/csw_admin_ds

    3. Database Type: Oracle

  5. For Database Driver select Oracle Driver (Thin) for Instance Connections; Versions: Any.

  6. Skip Supports Global Transactions

  7. On the Connection Properties page, specify:

    1. Database Name

    2. Host Name

    3. Port

    4. Database User Name (that is, the CSW schema name)

    5. Password

  8. On the next page, test this connection.

  9. If the connection is successful, choose the appropriate server name for this deployment: either AdminServer or Your Managed Server name.

  10. Restart WLS, or at least restart the sdows application to recognize the data source that was created.

Loading Data for CSW

A client-side Java loader, provided by Oracle Spatial and Graph, is in the following .jar file (assuming the default Spatial and Graph installation directory of $ORACLE_HOME/md):

$ORACLE_HOME/md/jlib/sdocswloader.jar

After the CSW schema is initialized, you can use the sdocswloader.jar Java package to load CSW 2.0.2 data. This package takes a large file containing CSW XML records and loads them into the user CSW table. For information about how to use this package, see Loading CSW 2.0.2 Data.

Testing the CSW Deployment

After the CSW engine is deployed and the data source is created, you can test the deployment with a set of CSW engine test queries. The following example is a GetCapabilities query for CSW 2.0.2:

http://machine-name:port/oraclespatial/csw?request=GetCapabilities&service=CSW&version=2.0.2

Creating and Maintaining Spatial and XQFT Indexes

In some cases yo may need to manually create or maintain spatial and XML Query Full Text (XQFT) indexes. These indexes are created automatically (if they do not already exist) by the first format of the SDO_CSW.INITIALIZE_CSW procedure, in which you do not need to create them. However, in some scenarios you may need to drop and re-create the index, and/or to synchronize the index, such as the following:

  • Scenario 1: The spatial index creation did not complete successfully when you used the SDO_CSW.INITIALIZE_CSW procedure.

  • Scenario 2: The spatial index creation did not complete successfully when you called the SDO_CSW.CREATE_SPATIAL_IDX procedure.

  • Scenario 3: The spatial index becomes invalid for any reason, such as .mentioned in Exchanging Partitions Including Indexes

  • Scenario 4: There have been significant insert, update, or delete operations on the CSW user data table.

If you need to re-create or rebuild the spatial index due to scenario 1, 2, or 3, then you must drop the spatial index first (by using SQL statement DROP INDEX <index_name> [FORCE]), and then re-create the spatial index using the SDO_CSW.CREATE_SPATIAL_IDX procedure.

For scenario 4, it is faster to call SDO_CSW.SYNC_INDEX for the XQFT index, in which case the existing XQFT index is automatically updated. However, if you need to re-create the XQFT index, then you can call the SDO_CSW.CREATE_XQFT_IDX procedure to drop the existing XQFT index and then create a new one.

18.4 Loading CSW 2.0.2 Data

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 and Graph provides a client-side loader for this purpose: $ORACLE_HOME/md/jlib/sdocswloader.jar (assuming the default Spatial and Graph 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.

  1. 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_NAME" path="/root/csw:Record” type="xml"/>
            <Column name="METADATA_ID_COLUMN_NAME" 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 first Column name is the column where you have the records to be stored as Oracle XMLType objects in the CSW table, and the second Column 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):

    1. 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;

    2. Create a directory named log where the csw_records.log file will be created.

  2. Create a runXMLLoader.sh (for Linux) or runXMLLoader.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.

18.5 Capabilities Documents (CSW)

A client can get information about the server’s capabilities.

A capabilities document is generated by the CSW server in response to a GetCapabilities request. The capabilities document contains information extracted from CSW metadata stored in an Oracle database, including a record type and the type of operations supported.

The client can use HTTP GET, POST, and SOAP protocols to access this capabilities document. The following example uses the HTTP protocol:

http:///<machine-name:port>/oraclespatial/csw?request=GetCapabilities&service=CSW&acceptversion=2.0.0&outputFormat=text/xml

In the preceding formats:

  • machine-name is the name of the system where the application server is running.

  • port is the port number where the application server is running.

  • oraclespatial is the default root where the Oracle Spatial and Graph web services application is mounted.

18.6 CSW Administration Console

The Oracle Spatial Web Services Administration Console includes a CSW administration screen.

You can access the CSW administration console by going to a URL in the following format:

http://<system-name>:<port>/oraclespatial/

The CSW administration console provides screens to configure, test, and diagnose problems. It has the following tabs:

  • Configuration File

    The Configuration File tab lets you edit and update the CSWConfig.xml file.

  • Test

    The Test tab enables you quickly generate and invoke getCapabilities, describeRecord, getRecords, and getRecordByID operations to test and query the CSW service and catalog data. You can edit the query statements based on spatial and nonspatial constraints.

  • Log

    The Log tab shows any errors generated during CSW operations processing, which can help you diagnose any possible problems.

18.7 CSW Operations: Requests and Responses with XML Examples

This topic presents some requests to the CSW engine, and usually the responses to requests, for the following operations.

Topics:

18.7.1 GetCapabilities Operation (CSW)

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.7.2 DescribeRecord Operation (CSW)

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 and Graph 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 and Graph 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 and Graph 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 and Graph 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?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 and Graph catalog service DescribeRecord response has only one SchemaComponent because it currently supports only the TypeName value 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.7.3 GetRecords Operation (CSW)

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 or ElementSetName parameter is used to specify which properties of the outputSchema 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. (Currently only csw:Record can be specified.)

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 and Graph 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 and Graph 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 and Graph 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 and Graph 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.7.4 GetRecordById Operation (CSW)

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). The parameters are ElementSetName, outputFormat, outputSchema, and Id.

The GetRecordById response is the list of requested records with matched Id values.

Oracle Spatial and Graph 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>

18.8 Diagnosing CSW Issues

The CSW log files provide diagnostic information.

These log files are located inside the sdows.ear/WEB-INF/log directory. In the WFS Administration Console, you can use the Log tab for WFS to see and download the WFS log files.

This topic explains some types of log messages and how to deal with them.

“DataSource jdbc/csw_admin_ds not found” — GetCapabilities response error message

The response may be similar to the following (reformatted for readability):

<?xml version='1.0' encoding='UTF-8'?>
<ows:ExceptionReport
  xmlns:ows="http://www.opengis.net/ows/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://www.opengis.net/ows/2.0 http://schemas.opengis.net/ows/2.0/owsExceptionReport.xsd" version="2.0.1">
  <ows:Exception exceptionCode="NoApplicableCode" locator="DataSource jdbc/csw_admin_ds not found"/>
</ows:ExceptionReport>

This means that a CSW data source is not configured or that WebLogic Server cannot connect to the database. See Setting Up CSW Data Sources in Configuring and Deploying the CSW Engine for information about configuring CSW data sources.

MDSYS.SDO_XSD_TABLE does not exist or the specified XSD ID is incorrect

This means that the XML schema could not be found. Ensure that Oracle Spatial is installed properly, and check the XSD_ID column of the SDO_XSD_TABLE table and the USER_SDO_CSW_SERVICE_INFO view.

CSW catalog table issues

Ensure that the Catalog Services for the Web catalog table, the SRID parameter, the metadata ID, and the XML schema definition (XSD) type are correctly specified.

The XQFT index cannot be dropped or created for the CSW catalog table

The XQuery Full Text (XQFT) index could not be dropped or created for the Catalog Services for the Web catalog table. Ensure that the CSW catalog table is ready for dropping or building an XQFT index.

A Catalog Services for the Web (CSW) server-side error occurred

Ensure that the CSW metadata is correct and the CSW catalog table is properly defined.

A Catalog Services for the Web (CSW) client-side error occurred

Ensure that the CSW record types are properly published, and that the sdows.ear file and WebLogic Server (WLS) are properly configured.

Database connection error

The following message in the CSW log means that the database is not running:

SEVERE: Error discovering coverages 
java.sql.SQLRecoverableException: No more data to read from socket

“Error reading log file” message on CSW administration console Log tab

If an authenticated user does not interact with the CSW server administration console for a given period of time, the user session in the browser might have timed out. In this case, refresh the browser display, and re-authenticate to get a new session.

Document received does not conform with protocol syntax

An error message like the following indicates that the request contains XML elements or character elements that are not defined in any OGC specification:

<?xml version='1.0' encoding='UTF-8'?>
<ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows/2.0" version="2.0.2" language="">
  <ows:Exception exceptionCode="InvalidEncodingSyntax" locator="request">
    <ows:ExceptionText>Document received does not conform with protocol syntax.</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>