Warning
|
If integrating with a Highly Available Cluster of DDF, see High Availability Guidance. |
DDF is structured to enable flexible integration with external clients and into larger component systems.
If integrating with an existing installation of DDF, continue to the following sections on endpoints and data/metadata management.
If a new installation of DDF is required, first see the Managing section for installation and configuration instructions, then return to this section for guidance on connecting external clients.
If you would like to set up a test or demo installation to use while developing an external client, see the Quick Start Tutorial for demo instructions.
For troubleshooting and known issues, see the Release Notes .
1. Endpoints
Federation with DDF is primarily accomplished through Endpoints accessible through http(s) requests and responses.
Note
|
Not all installations will expose all available endpoints. Check with DDF administrator to confirm availability of these endpoints. |
1.1. Ingest Endpoints
Ingest is the process of getting data and/or metadata into the DDF catalog framework.
These endpoints are provided by DDF to be used by integrators to ingest content or metadata.
- Catalog REST Endpoint
-
Uses REST to interact with the catalog.
- CSW Endpoint
-
Searches collections of descriptive information (metadata) about geospatial data and services.
1.2. CRUD Endpoints
To perform CRUD (Create, Read, Update, Delete) operations on data or metadata in the catalog, work with one of these endpoints.
- Catalog REST Endpoint
-
Uses REST to interact with the catalog.
- CSW Endpoint
-
Searches collections of descriptive information (metadata) about geospatial data and services.
1.3. Query Endpoints
Query data or metadata stored within an instance of DDF using one of these endpoints.
- CSW Endpoint
-
Searches collections of descriptive information (metadata) about geospatial data and services.
- OpenSearch Endpoint
-
Sends query parameters and receives search results.
- Queries Endpoint
-
To perform CRUD (Create, Read, Update, Delete) operations on query metacards in the catalog, work with one of these endpoints.
1.4. Content Retrieval Endpoints
To retrieve content from an instance of DDF, use one of these endpoints.
- Catalog REST Endpoint
-
Uses REST to interact with the catalog.
1.5. Pub-Sub Endpoints
These endpoints provide publication and subscription services to allow notifications when certain events happen within DDF.
- CSW Endpoint
-
Searches collections of descriptive information (metadata) about geospatial data and services.
1.6. Endpoint Details
1.6.1. Catalog REST Endpoint
The Catalog REST Endpoint allows clients to perform operations on the Catalog using REST, a simple architectural style that performs communication using HTTP.
Bulk operations are not supported: for all RESTful CRUD commands, only one metacard ID is supported in the URL.
The Catalog REST Endpoint can be used for one or more of these operations on an instance of DDF:
This example metacard can be used to test the integration with DDF.
1
2
3
4
5
6
7
8
9
10
<?xml version="1.0" encoding="UTF-8"?>
<metacard xmlns="urn:catalog:metacard" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:smillang="http://www.w3.org/2001/SMIL20/Language" gml:id="3a59483ba44e403a9f0044580343007e">
<type>ddf.metacard</type>
<string name="title">
<value>Test REST Metacard</value>
</string>
<string name="description">
<value>Vestibulum quis ipsum sit amet metus imperdiet vehicula. Nulla scelerisque cursus mi.</value>
</string>
</metacard>
1.6.1.1. Catalog REST Create Operation Examples
The REST endpoint can be used to upload resources as attachments.
Send a POST
request with the input to be ingested contained in the HTTP request body to the endpoint.
https://<FQDN>:<PORT>/services/catalog/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
POST /services/catalog?transform=xml HTTP/1.1
Host: <FQDN>:<PORT>
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Cache-Control: no-cache
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="parse.resource"; filename=""
Content-Type:
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="parse.metadata"; filename=""
Content-Type:
------WebKitFormBoundary7MA4YWxkTrZu0gW--
The create
and update
methods both support the multipart mime format.
If only a single attachment exists, it will be interpreted as a resource to be parsed, which will result in a metacard and resource being stored in the system.
If multiple attachments exist, then the REST endpoint will assume that one attachment is the actual resource (attachment should be named parse.resource
) and the other attachments are overrides of metacard attributes (attachment names should follow metacard attribute names).
In the case of the metadata attribute, it is possible to also have the system transform that metadata and use the results of that to override the metacard that would be generated from the resource (attachment should be named parse.metadata
).
If the ingest is successful, a status of 201 Created
will be returned, along with the Metacard ID in the header of the response.
Note
|
Request with Non-XML Data
If a request with non-XML data is sent to the Catalog REST endpoint,
the metacard will be created but the resource will be stored in the |
If content or metadata is not ingested successfully, check for these error messages.
Status Code | Error Message | Possible Causes |
---|---|---|
|
|
Malformed XML Response: If the XML being ingested has formatting errors. |
Request with Unknown Schema: If ingest is attempted with a schema that is unknown, unsupported, or not configured by the endpoint, DDF creates a generic resource metacard with the provided XML as content for the |
1.6.1.2. Catalog REST Read Operation Examples
The read
operation can be used to retrieve metadata in different formats.
-
Send a
GET
request to the endpoint. -
Optionally add a
transform
query parameter to the end of the URL with the transformer to be used (such astransform=kml
). By default, the response body will include the XML representation of the Metacard.
https://<FQDN>:<PORT>/services/catalog/<metacardId>
If successful, a status of 200 OK
will be returned, along with the content of the metacard requested.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<metacard xmlns="urn:catalog:metacard" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:smillang="http://www.w3.org/2001/SMIL20/Language" gml:id="<METACARD_ID>">
<type>ddf.metacard</type>
<source>ddf.distribution</source>
<string name="title">
<value>Test REST Metacard</value>
</string>
<string name="point-of-contact">
<value>email@example.com</value>
</string>
<dateTime name="metacard.created">
<value>2021-09-22</value>
</dateTime>
<dateTime name="effective">
<value>2021-09-22</value>
</dateTime>
<dateTime name="modified">
<value>2021-09-22</value>
</dateTime>
<dateTime name="created">
<value>2021-09-22</value>
</dateTime>
<string name="description">
<value>Vestibulum quis ipsum sit amet metus imperdiet vehicula. Nulla scelerisque cursus mi.</value>
</string>
<string name="metacard-tags">
<value>resource</value>
<value>VALID</value>
</string>
<dateTime name="metacard.modified">
<value>2021-09-22</value>
</dateTime>
</metacard>
-
To receive metadata in an alternate format, add a transformer to the request URL.
https://<FQDN>:<PORT>/services/catalog/<metacardId>?transform=<TRANSFORMER_ID>
transform=geojson
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"geometry": null,
"type": "Feature",
"properties": {
"effective": "2021-09-22",
"point-of-contact": "email@example.com",
"created": "2021-09-22",
"metacard.modified": "2021-09-22",
"metacard-tags": [
"resource",
"VALID"
],
"modified": "2021-09-22",
"description": "Vestibulum quis ipsum sit amet metus imperdiet vehicula. Nulla scelerisque cursus mi.",
"id": "3a59483ba44e403a9f0044580343007e",
"metacard-type": "ddf.metacard",
"title": "Test REST Metacard",
"source-id": "ddf.distribution",
"metacard.created": "2021-09-22"
}
}
To retrieve a metacard from a specific federated source, add sources/<SOURCE_ID>
to the URL.
https://<FQDN>:<PORT>/services/catalog/sources/<sourceId>/<metacardId>?transform=<TRANSFORMER_ID>
To retrieve the resource associated with a metacard, use the resource
transformer with the GET
request.
https://<FQDN>:<PORT>/services/catalog/<metacardId>?transform=resource
See Metacard Transformers for details on metacard transformers.
If the metacard or resource is not returned successfully, check for these errors.
Status Code | Error Message | Possible Causes |
---|---|---|
|
|
Invalid Metacard ID |
|
|
Transformer is invalid, unsupported, or not configured. |
|
Metacard does not have an associated resource (is metadata only). |
|
|
Invalid source ID, or source unavailable. |
1.6.1.3. Catalog Rest Update Operation Examples
To update the metadata for a metacard, send a PUT
request with the ID of the Metacard to be updated appended to the end of the URL
and the updated metadata is contained in the HTTP body.
Optionally, specify the transformer to use when parsing an override of a metadata attribute.
https://<FQDN>:<PORT>/services/catalog/<metacardId>?transform=<input transformer>
Status Code | Error Message | Possible Causes |
---|---|---|
|
|
Invalid metacard ID. |
|
|
Invalid transformer ID. |
1.6.1.4. Catalog REST Delete Operation Examples
To delete a metacard, send a DELETE
request with the metacard ID to be deleted appended
to the end of the URL.
Delete Request URL
https://<FQDN>:<PORT>/services/catalog/<metacardId>
Status Code | Error Message | Possible Causes |
---|---|---|
|
|
Invalid metacard ID. |
1.6.1.5. Catalog REST Sources Operation Examples
To retrieve information about federated sources, including sourceId
,
availability
, contentTypes
,and version
,
send a GET
request to the endpoint.
https://<FQDN>:<PORT>//sources/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[
{
"id" : "DDF-OS",
"available" : true,
"contentTypes" :
[
],
"version" : "2.26.17"
},
{
"id" : "ddf.distribution",
"available" : true,
"contentTypes" :
[
],
"version" : "2.26.17"
}
]
Status Code | Error Message | Possible Causes |
---|---|---|
403 |
<p>Problem accessing /ErrorServlet. Reason: <pre>Forbidden</pre></p> |
Connection error or service unavailable. |
1.6.2. CSW Endpoint
The CSW endpoint enables a client to search collections of descriptive information (metadata) about geospatial data and services.
The CSW endpoint supports metadata operations only.
For more information about the Catalogue Services for Web (CSW) standard .
The CSW Endpoint can be used for one or more of these operations on an instance of DDF:
Note
|
Sample Responses May Not Match Actual Responses
Actual responses may vary from these samples, depending on your configuration. Send a GET or POST request to obtain an accurate response. |
1.6.2.1. CSW Endpoint Create Examples
Metacards are ingested into the catalog via the Insert
sub-operation.
The schema of the record needs to conform to a schema of the information model that the catalog supports.
Send a POST
request to the CSW endpoint URL.
https://<FQDN>:<PORT>/services/csw
Include the metadata to ingest within a csw:Insert
block in the body of the request.
Insert
Request<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<csw:Transaction
service="CSW"
version="2.0.2"
verboseResponse="true"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2">
<csw:Insert typeName="csw:Record">
<csw:Record
xmlns:ows="http://www.opengis.net/ows"
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:xsd="http://www.w3.org/2001/XMLSchema">
<dc:identifier></dc:identifier>
<dc:title>Aliquam fermentum purus quis arcu</dc:title>
<dc:type>http://purl.org/dc/dcmitype/Text</dc:type>
<dc:subject>Hydrography--Dictionaries</dc:subject>
<dc:format>application/pdf</dc:format>
<dc:date>2021-09-22</dc:date>
<dct:abstract>Vestibulum quis ipsum sit amet metus imperdiet vehicula. Nulla scelerisque cursus mi.</dct:abstract>
<ows:BoundingBox crs="urn:x-ogc:def:crs:EPSG:6.11:4326">
<ows:LowerCorner>44.792 -6.171</ows:LowerCorner>
<ows:UpperCorner>51.126 -2.228</ows:UpperCorner>
</ows:BoundingBox>
</csw:Record>
</csw:Insert>
</csw:Transaction>
To specify the document type being ingested and select the appropriate input transformer,
use the typeName
attribute in the csw:Insert
element
<csw:Insert typeName="xml">
To receive a copy of the metacard in the response, specify verboseResponse="true"
in the csw:Transaction
.
The InsertResult
element of the response will hold the metacard information added to the catalog.
<csw:Transaction service="CSW" version="2.0.2" verboseResponse="true" [...]
1
2
3
4
5
6
7
8
9
10
11
12
<csw:Transaction service="CSW" version="2.0.2" verboseResponse="true" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2">
<csw:Insert typeName="xml">
<metacard xmlns="urn:catalog:metacard" xmlns:ns2="http://www.opengis.net/gml"
xmlns:ns3="http://www.w3.org/1999/xlink" xmlns:ns4="http://www.w3.org/2001/SMIL20/"
xmlns:ns5="http://www.w3.org/2001/SMIL20/Language">
<type>ddf.metacard</type>
<string name="title">
<value>PlainXml near</value>
</string>
</metacard>
</csw:Insert>
</csw:Transaction>
A successful ingest will return a status of 200 OK
and csw:TransactionResponse
.
Insert
Response<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<csw:TransactionResponse xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ns3="http://www.w3.org/1999/xlink"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ns5="http://www.w3.org/2001/SMIL20/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:ows="http://www.opengis.net/ows"
xmlns:dct="http://purl.org/dc/terms/"
xmlns:ns9="http://www.w3.org/2001/SMIL20/Language"
xmlns:ns10="http://www.w3.org/2001/XMLSchema-instance"
version="2.0.2"
ns10:schemaLocation="http://www.opengis.net/csw /ogc/csw/2.0.2/CSW-publication.xsd">
<csw:TransactionSummary>
<csw:totalInserted>1</csw:totalInserted>
<csw:totalUpdated>0</csw:totalUpdated>
<csw:totalDeleted>0</csw:totalDeleted>
</csw:TransactionSummary>
<csw:InsertResult>
<csw:BriefRecord>
<dc:identifier><METACARD ID</dc:identifier>
<dc:title>Aliquam fermentum purus quis arcu</dc:title>
<dc:type>http://purl.org/dc/dcmitype/Text</dc:type>
<ows:BoundingBox crs="EPSG:4326">
<ows:LowerCorner>-6.171 44.792</ows:LowerCorner>
<ows:UpperCorner>-2.228 51.126</ows:UpperCorner>
</ows:BoundingBox>
</csw:BriefRecord>
</csw:InsertResult>
</csw:TransactionResponse>
Status Code | Error Message | Possible Causes |
---|---|---|
400 Bad Request |
|
XML error. Check for formatting errors in record. |
Schema error. Verify metadata is compliant with defined schema. |
1.6.2.2. CSW Endpoint Query Examples
To query through the CSW Endpoint, send a POST
request to the CSW endpoint.
https://<FQDN>:<PORT>/services/csw
Within the body of the request, include a GetRecords
operation to define the query.
Define the service and version to use (CSW, 2.0.2).
The output format must be application/xml
.
Specify the output schema.
(To get a list of supported schemas, send a Get Capabilities request to the CSW endpoint.)
1
2
3
4
5
6
7
8
9
10
11
<GetRecords xmlns="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
service="CSW"
version="2.0.2"
maxRecords="4"
startPosition="1"
resultType="results"
outputFormat="application/xml"
outputSchema="http://www.opengis.net/cat/csw/2.0.2"
xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 ../../../csw/2.0.2/CSW-discovery.xsd">
Include the query within the GetRecords
request.
Optionally, set the ElementSetName
to determine how much detail to return.
-
Brief: the least possible detail.
-
Summary: (Default)
-
Full: All metadata elements for the record(s).
Within the Constraint
element, define the query as an OSG or CQL filter.
1
2
3
4
5
6
7
8
9
10
11
<Query typeNames="Record">
<ElementSetName>summary</ElementSetName>
<Constraint version="1.1.0">
<ogc:Filter>
<ogc:PropertyIsLike wildCard="%" singleChar="_" escapeChar="\">
<ogc:PropertyName>AnyText</ogc:PropertyName>
<ogc:Literal>%</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
</Constraint>
</Query>
1
2
3
4
5
6
7
8
<Query typeNames="Record">
<ElementSetName>summary</ElementSetName>
<Constraint version="2.0.0">
<ogc:CqlText>
"AnyText" = '%'
</ogc:CqlText>
</csw:Constraint>
</Query>
GetRecords
XML Request Example<?xml version="1.0" ?>
<GetRecords xmlns="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
service="CSW"
version="2.0.2"
maxRecords="4"
startPosition="1"
resultType="results"
outputFormat="application/xml"
outputSchema="http://www.opengis.net/cat/csw/2.0.2"
xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 ../../../csw/2.0.2/CSW-discovery.xsd">
<Query typeNames="Record">
<ElementSetName>summary</ElementSetName>
<Constraint version="1.1.0">
<ogc:Filter>
<ogc:PropertyIsLike wildCard="%" singleChar="_" escapeChar="\">
<ogc:PropertyName>AnyText</ogc:PropertyName>
<ogc:Literal>%</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
</Constraint>
</Query>
</GetRecords>
GetRecords
Sample Response (application/xml
)<?xml version='1.0' encoding='UTF-8'?>
<csw:GetRecordsResponse xmlns:dct="http://purl.org/dc/terms/"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
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:dc="http://purl.org/dc/elements/1.1/" version="2.0.2">
<csw:SearchStatus timestamp="2021-09-22"/>
<csw:SearchResults numberOfRecordsMatched="1" numberOfRecordsReturned="1" nextRecord="0" recordSchema="http://www.opengis.net/cat/csw/2.0.2" elementSet="summary">
<csw:Record xmlns:ows="http://www.opengis.net/ows"
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:xsd="http://www.w3.org/2001/XMLSchema">
<dc:identifier/>
<dc:title>Aliquam fermentum purus quis arcu</dc:title>
<dc:type>http://purl.org/dc/dcmitype/Text</dc:type>
<dc:subject>Hydrography--Dictionaries</dc:subject>
<dc:format>application/pdf</dc:format>
<dc:date>2021-09-22</dc:date>
<dct:abstract>Vestibulum quis ipsum sit amet metus imperdiet vehicula. Nulla scelerisque cursus mi.</dct:abstract>
<ows:BoundingBox crs="urn:x-ogc:def:crs:EPSG:6.11:4326">
<ows:LowerCorner>44.792 -6.171</ows:LowerCorner>
<ows:UpperCorner>51.126 -2.228</ows:UpperCorner>
</ows:BoundingBox>
</csw:Record>
</csw:SearchResults>
</csw:GetRecordsResponse>
To query a Specific Source
, specify a query for a source-id
.
To find a valid source-id
, send a Get Capabilities request.
Configured sources will be listed in the FederatedCatalogs
section of the response.
Note
|
The |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?xml version="1.0" ?>
<csw:GetRecords resultType="results"
outputFormat="application/xml"
outputSchema="urn:catalog:metacard"
startPosition="1"
maxRecords="10"
service="CSW"
version="2.0.2"
xmlns:ns2="http://www.opengis.net/ogc" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:ns4="http://www.w3.org/1999/xlink" xmlns:ns3="http://www.opengis.net/gml" xmlns:ns9="http://www.w3.org/2001/SMIL20/Language" xmlns:ns5="http://www.opengis.net/ows" xmlns:ns6="http://purl.org/dc/elements/1.1/" xmlns:ns7="http://purl.org/dc/terms/" xmlns:ns8="http://www.w3.org/2001/SMIL20/">
<csw:DistributedSearch hopCount="2" />
<ns10:Query typeNames="csw:Record" xmlns="" xmlns:ns10="http://www.opengis.net/cat/csw/2.0.2">
<ns10:ElementSetName>full</ns10:ElementSetName>
<ns10:Constraint version="1.1.0">
<ns2:Filter>
<ns2:And>
<ns2:PropertyIsEqualTo wildCard="*" singleChar="#" escapeChar="!">
<ns2:PropertyName>source-id</ns2:PropertyName>
<ns2:Literal>Source1</ns2:Literal>
</ns2:PropertyIsEqualTo>_
<ns2:PropertyIsLike wildCard="*" singleChar="#" escapeChar="!">
<ns2:PropertyName>title</ns2:PropertyName>
<ns2:Literal>*</ns2:Literal>
</ns2:PropertyIsLike>
</ns2:And>
</ns2:Filter>
</ns10:Constraint>
</ns10:Query>
</csw:GetRecords>
To receive a response to a GetRecords
query that conforms to the GMD specification, set the Namespace(xmlns),outputschema
, and typeName
elements for GML schema.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?xml version="1.0" ?>
<GetRecords xmlns="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gml="http://www.opengis.net/gml"
service="CSW"
version="2.0.2"
maxRecords="8"
startPosition="1"
resultType="results"
outputFormat="application/xml"
outputSchema="http://www.isotc211.org/2005/gmd"
xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 ../../../csw/2.0.2/CSW-discovery.xsd">
<Query typeNames="gmd:MD_Metadata">
<ElementSetName>summary</ElementSetName>
<Constraint version="1.1.0">
<ogc:Filter>
<ogc:PropertyIsLike wildCard="%" singleChar="_" escapeChar="\">
<ogc:PropertyName>apiso:Title</ogc:PropertyName>
<ogc:Literal>%</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
</Constraint>
</Query>
</GetRecords>
UTM coordinates can be used when making a CSW GetRecords request using an ogc:Filter
.
UTM coordinates should use EPSG:326XX
as the srsName
where XX
is the zone within the northern hemisphere.
UTM coordinates should use EPSG:327XX
as the srsName
where XX
is the zone within the southern hemisphere.
Note
|
UTM coordinates are only supported with requests providing an |
<GetRecords xmlns="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gml="http://www.opengis.net/gml"
service="CSW"
version="2.0.2"
maxRecords="4"
startPosition="1"
resultType="results"
outputFormat="application/xml"
outputSchema="http://www.opengis.net/cat/csw/2.0.2"
xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 ../../../csw/2.0.2/CSW-discovery.xsd">
<Query typeNames="Record">
<ElementSetName>summary</ElementSetName>
<Constraint version="1.1.0">
<ogc:Filter>
<ogc:Intersects>
<ogc:PropertyName>ows:BoundingBox</ogc:PropertyName>
<gml:Envelope srsName="EPSG:32636">
<gml:lowerCorner>171070 1106907</gml:lowerCorner>
<gml:upperCorner>225928 1106910</gml:upperCorner>
</gml:Envelope>
</ogc:Intersects>
</ogc:Filter>
</Constraint>
</Query>
</GetRecords>
To locate a record by Metacard ID, send a POST
request with a GetRecordById
element specifying the ID.
GetRecordById
Request Example
1
2
3
4
5
6
7
8
9
10
11
12
<GetRecordById xmlns="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
service="CSW"
version="2.0.2"
outputFormat="application/xml"
outputSchema="http://www.opengis.net/cat/csw/2.0.2"
xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2
../../../csw/2.0.2/CSW-discovery.xsd">
<ElementSetName>full</ElementSetName>
<Id><METACARD-ID></Id>
</GetRecordById>
CSW Record Field | Metacard Field | Brief Record | Summary Record | Record |
---|---|---|---|---|
|
|
1-n |
1-n |
0-n |
|
0-n |
|||
|
0-n |
0-n |
||
|
0-n |
|||
|
0-n  |
|||
|
0-n |
|||
|
|
0-n |
||
|
|
0-1 |
0-1 |
0-n |
|
0-n |
0-n |
||
|
|
1-n |
1-n |
0-n |
|
|
0-n |
||
|
0-n |
|||
|
0-n |
0-n |
||
|
0-n |
|||
|
0-n |
|||
|
|
0-n |
0-n |
|
|
0-n |
|||
|
|
0-n |
||
|
0-n |
|||
|
0-n |
|||
|
|
0-n |
||
|
0-n |
|||
|
|
0-n |
||
|
|
0-n |
||
|
|
0-n |
||
|
|
0-n  |
||
|
0-n  |
|||
|
0-n |
|||
|
0-n |
|||
|
0-n |
|||
|
0-n  |
|||
|
0-n  |
|||
|
0-n |
|||
|
0-n |
|||
|
0-n |
|||
|
0-n  |
|||
|
|
0-n  |
||
|
0-n |
|||
|
0-n |
|||
|
0-n |
|||
|
0-n |
|||
|
|
0-n |
0-n |
|
|
0-n |
|||
|
0-n |
|||
|
0-n |
|||
|
0-n |
|||
|
0-n |
|||
|
|
0-n |
0-n  |
|
|
0-n |
|||
|
|
0-n |
||
|
|
0-n  |
||
|
0-n |
0-n |
0-n |
Status Code | Error Message | Possible Causes |
---|---|---|
|
|
A query to a specific source has specified a source that is unavailable. |
200 OK |
|
No results found for query. Verify input. |
1.6.2.3. CSW Endpoint Update Examples
The CSW Endpoint can edit the metadata attributes of a metacard.
Send a POST
request to the CSW Endpoint URL:
https://<FDQN>:<PORT>/services/csw
Replace the <METACARD-ID>
value with the metacard id being updated, and edit any properties within the csw:Record
.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<csw:Transaction
service="CSW"
version="2.0.2"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2">
<csw:Update>
<csw:Record
xmlns:ows="http://www.opengis.net/ows"
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:xsd="http://www.w3.org/2001/XMLSchema">
<dc:identifier><METACARD-ID></dc:identifier>
<dc:title>Aliquam fermentum purus quis arcu</dc:title>
<dc:type>http://purl.org/dc/dcmitype/Text</dc:type>
<dc:subject>Hydrography--Dictionaries</dc:subject>
<dc:format>application/pdf</dc:format>
<dc:date>2021-09-22</dc:date>
<dct:abstract>Vestibulum quis ipsum sit amet metus imperdiet vehicula. Nulla scelerisque cursus mi.</dct:abstract>
<ows:BoundingBox crs="urn:x-ogc:def:crs:EPSG:6.11:4326">
<ows:LowerCorner>44.792 -6.171</ows:LowerCorner>
<ows:UpperCorner>51.126 -2.228</ows:UpperCorner>
</ows:BoundingBox>
</csw:Record>
</csw:Update>
</csw:Transaction>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<csw:TransactionResponse xmlns:ows="http://www.opengis.net/ows"
xmlns:ns2="http://www.w3.org/1999/xlink"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ns6="http://www.w3.org/2001/SMIL20/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dct="http://purl.org/dc/terms/"
xmlns:ns9="http://www.w3.org/2001/SMIL20/Language"
xmlns:ns10="http://www.w3.org/2001/XMLSchema-instance" version="2.0.2"
ns10:schemaLocation="http://www.opengis.net/csw /ogc/csw/2.0.2/CSW-publication.xsd">
<csw:TransactionSummary>
<csw:totalInserted>0</csw:totalInserted>
<csw:totalUpdated>1</csw:totalUpdated>
<csw:totalDeleted>0</csw:totalDeleted>
</csw:TransactionSummary>
</csw:TransactionResponse>
Within the csw:Transaction
element, use the csw:RecordProperty
to update individual metacard attributes.
Use the Name
element to specify the name of the record property to be updated and set
the Value
element to the value to update in the record.
The values in the Update
will completely replace those that are already in the record.
1
2
3
4
<csw:RecordProperty>
<csw:Name>title</csw:Name>
<csw:Value>Updated Title</csw:Value>
</csw:RecordProperty>
To remove a non-required attribute, send the csw:Name
without a csw:Value
.
1
2
3
<csw:RecordProperty>
<csw:Name>title</csw:Name>
</csw:RecordProperty>
Required attributes are set to a default value if no Value
element is provided.
Property | Default Value |
---|---|
|
Resource |
|
current time |
|
current time |
|
current time |
|
myVersion |
|
current time |
|
current time |
|
resource, VALID |
|
system@localhost |
|
current time |
Use a csw:Constraint
to specify the metacard ID.
The constraint can be an OGC Filter or a CQL query.
1
2
3
4
5
6
7
8
<csw:Constraint version="2.0.0">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>id</ogc:PropertyName>
<ogc:Literal><METACARD-ID></ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</csw:Constraint>
1
2
3
4
5
<csw:Constraint version="2.0.0">
<ogc:CqlText>
"id" = '<METACARD-ID>'
</ogc:CqlText>
</csw:Constraint>
Warning
|
These filters can search on any arbitrary query criteria, but take care to only affect desired records. |
Update
Request with OGC filter constraint<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<csw:Transaction
service="CSW"
version="2.0.2"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ogc="http://www.opengis.net/ogc">
<csw:Update>
<csw:RecordProperty>
<csw:Name>title</csw:Name>
<csw:Value>Updated Title</csw:Value>
</csw:RecordProperty>
<csw:Constraint version="2.0.0">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>id</ogc:PropertyName>
<ogc:Literal><METACARD-ID></ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</csw:Constraint>
</csw:Update>
</csw:Transaction>
Update
Request with CQL filter constraint<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<csw:Transaction
service="CSW"
version="2.0.2"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ogc="http://www.opengis.net/ogc">
<csw:Update>
<csw:RecordProperty>
<csw:Name>title</csw:Name>
<csw:Value>Updated Title</csw:Value>
</csw:RecordProperty>
<csw:RecordProperty>
</csw:RecordProperty>
<csw:Constraint version="2.0.0">
<ogc:CqlText>
"id" = '<METACARD-ID>'
</ogc:CqlText>
</csw:Constraint>
</csw:Update>
</csw:Transaction>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<csw:TransactionResponse xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ns3="http://www.w3.org/1999/xlink"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ns5="http://www.w3.org/2001/SMIL20/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:ows="http://www.opengis.net/ows"
xmlns:dct="http://purl.org/dc/terms/"
xmlns:ns9="http://www.w3.org/2001/SMIL20/Language"
xmlns:ns10="http://www.w3.org/2001/XMLSchema-instance"
ns10:schemaLocation="http://www.opengis.net/csw /ogc/csw/2.0.2/CSW-publication.xsd"
version="2.0.2">
<csw:TransactionSummary>
<csw:totalInserted>0</csw:totalInserted>
<csw:totalUpdated>1</csw:totalUpdated>
<csw:totalDeleted>0</csw:totalDeleted>
</csw:TransactionSummary>
</csw:TransactionResponse>
Status Code | Error Message | Possible Causes |
---|---|---|
400 Bad Request |
|
XML or CSW schema error. Verify input. |
200 OK |
|
No records were updated. Verify metacard id or search parameters. |
1.6.2.4. CSW Endpoint Publication / Subscription Examples
The subscription GetRecords
operation is very similar to the GetRecords
operation used to search the catalog
but it subscribes to a search and sends events to a ResponseHandler
endpoint as metacards are ingested matching
the GetRecords
request used in the subscription.
The ResponseHandler
must use the https protocol and receive a HEAD request to poll for availability and
POST/PUT/DELETE requests for creation, updates, and deletions.
The response to a GetRecords
request on the subscription url will be an acknowledgement containing the original
GetRecords
request and a requestId
.
The client will be assigned a requestId
(URN).
A Subscription listens for events from federated sources if the DistributedSearch
element is present and the catalog is a member of a federation.
Send a POST
request to the CSW endpoint.
https://<FQDN>:<PORT>/services/csw/subscription
GetRecords
XML Request
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?xml version="1.0" ?>
<GetRecords xmlns="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
service="CSW"
version="2.0.2"
maxRecords="4"
startPosition="1"
resultType="results"
outputFormat="application/xml"
outputSchema="http://www.opengis.net/cat/csw/2.0.2"
xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 ../../../csw/2.0.2/CSW-discovery.xsd">
<ResponseHandler>https://some.ddf/services/csw/subscription/event</ResponseHandler>
<Query typeNames="Record">
<ElementSetName>summary</ElementSetName>
<Constraint version="1.1.0">
<ogc:Filter>
<ogc:PropertyIsLike wildCard="%" singleChar="_" escapeChar="\">
<ogc:PropertyName>xml</ogc:PropertyName>
<ogc:Literal>%</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
</Constraint>
</Query>
</GetRecords>
To update an existing subscription, send a PUT
request with the requestid
URN appended to the url.
CSW Endpoint Subscription Update URL
https://{FQDN}:{PORT}/services/csw/subscription/urn:uuid:4d5a5249-be03-4fe8-afea-6115021dd62f
GetRecords
XML Response<?xml version="1.0" ?>
<Acknowledgement timeStamp="2021-09-22T18:49:45" xmlns="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 ../../../csw/2.0.2/CSW-discovery.xsd">
<EchoedRequest>
<GetRecords
requestId="urn:uuid:4d5a5249-be03-4fe8-afea-6115021dd62f"
service="CSW"
version="2.0.2"
maxRecords="4"
startPosition="1"
resultType="results"
outputFormat="application/xml"
outputSchema="urn:catalog:metacard">
<ResponseHandler>https://some.ddf/services/csw/subscription/event</ResponseHandler>
<Query typeNames="Record">
<ElementSetName>summary</ElementSetName>
<Constraint version="1.1.0">
<ogc:Filter>
<ogc:PropertyIsLike wildCard="%" singleChar="_" escapeChar="\">
<ogc:PropertyName>xml</ogc:PropertyName>
<ogc:Literal>%</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
</Constraint>
</Query>
</GetRecords>
</EchoedRequest>
<RequestId>urn:uuid:4d5a5249-be03-4fe8-afea-6115021dd62f</ns:RequestId>
</Acknowledgement>
GetRecords
Event Sample Response<csw:GetRecordsResponse version="2.0.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:ows="http://www.opengis.net/ows" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<csw:SearchStatus timestamp="2014-02-19T15:33:44.602-05:00"/>
<csw:SearchResults numberOfRecordsMatched="1" numberOfRecordsReturned="1" nextRecord="5" recordSchema="http://www.opengis.net/cat/csw/2.0.2" elementSet="summary">
<csw:SummaryRecord>
<dc:identifier>f45415884c11409497e22db8303fe8c6</dc:identifier>
<dc:title>Product10</dc:title>
<dc:type>pdf</dc:type>
<dct:modified>2014-02-19T15:22:51.563-05:00</dct:modified>
<ows:BoundingBox crs="urn:x-ogc:def:crs:EPSG:6.11:4326">
<ows:LowerCorner>20.0 10.0</ows:LowerCorner>
<ows:UpperCorner>20.0 10.0</ows:UpperCorner>
</ows:BoundingBox>
</csw:SummaryRecord>
</csw:SearchResults>
</csw:GetRecordsResponse>
To retrieve an active subscription, send a GET
request with the requestid
URN appended to the url.
https://<FQDN>:<PORT>/services/csw/subscription/urn:uuid:4d5a5249-be03-4fe8-afea-6115021dd62f
HTTP GET
Sample Response<?xml version="1.0" ?>
<Acknowledgement timeStamp="2021-09-22T18:49:45" xmlns="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 ../../../csw/2.0.2/CSW-discovery.xsd">
<EchoedRequest>
<GetRecords
requestId="urn:uuid:4d5a5249-be03-4fe8-afea-6115021dd62f"
service="CSW"
version="2.0.2"
maxRecords="4"
startPosition="1"
resultType="results"
outputFormat="application/xml"
outputSchema="urn:catalog:metacard">
<ResponseHandler>https://some.ddf/services/csw/subscription/event</ResponseHandler>
<Query typeNames="Record">
<ElementSetName>summary</ElementSetName>
<Constraint version="1.1.0">
<ogc:Filter>
<ogc:PropertyIsLike wildCard="%" singleChar="_" escapeChar="\">
<ogc:PropertyName>xml</ogc:PropertyName>
<ogc:Literal>%</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
</Constraint>
</Query>
</GetRecords>
</EchoedRequest>
<RequestId>urn:uuid:4d5a5249-be03-4fe8-afea-6115021dd62f</ns:RequestId>
</Acknowledgement>
To delete a subscription, send a DELETE
request with the requestid
URN appended to the url.
https://<FQDN>:<PORT>/services/csw/subscription/urn:uuid:4d5a5249-be03-4fe8-afea-6115021dd62f
1.6.2.5. CSW Endpoint Delete Examples
To delete metacards via the CSW Endpoint, send a POST
request with a csw:Delete
to the CSW Endpoint URL.
https://<FQDN>:<PORT>/services/csw
Define the records to delete with the csw:Constraint
field.
The constraint can be either an OGC or CQL filter.
Delete
Request with OGC filter constraint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<csw:Transaction service="CSW" version="2.0.2"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc">
<csw:Delete typeName="csw:Record" handle="something">
<csw:Constraint version="2.0.0">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>id</ogc:PropertyName>
<ogc:Literal><METACARD-ID></ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</csw:Constraint>
</csw:Delete>
</csw:Transaction>
Delete
Request with CQL filter constraint
1
2
3
4
5
6
7
8
9
10
11
12
13
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<csw:Transaction service="CSW" version="2.0.2"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc">
<csw:Delete typeName="csw:Record" handle="something">
<csw:Constraint version="2.0.0">
<ogc:CqlText>
"id" = '<METACARD-ID>'
</ogc:CqlText>
</csw:Constraint>
</csw:Delete>
</csw:Transaction>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<csw:TransactionResponse xmlns:ows="http://www.opengis.net/ows"
xmlns:ns2="http://www.w3.org/1999/xlink"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dct="http://purl.org/dc/terms/"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ns8="http://www.w3.org/2001/SMIL20/"
xmlns:ns9="http://www.w3.org/2001/SMIL20/Language"
xmlns:ns10="http://www.w3.org/2001/XMLSchema-instance"
version="2.0.2" ns10:schemaLocation="http://www.opengis.net/csw /ogc/csw/2.0.2/CSW-publication.xsd">
<csw:TransactionSummary>
<csw:totalInserted>0</csw:totalInserted>
<csw:totalUpdated>0</csw:totalUpdated>
<csw:totalDeleted>1</csw:totalDeleted>
</csw:TransactionSummary>
</csw:TransactionResponse>
Status Code | Error Message | Possible Causes |
---|---|---|
|
|
No records matched filter criteria. Verify metacard ID. |
|
|
XML or CSW formatting error. Verify request. |
1.6.2.6. CSW Endpoint Get Capabilities Examples
The GetCapabilities
operation describes the operations the catalog supports and the URLs used to access those operations.
The CSW endpoint supports both HTTP GET
and HTTP POST
requests for the GetCapabilities
operation.
The response to either request will always be a csw:Capabilities
XML document.
This XML document is defined by the CSW-Discovery XML Schema .
GetCapabilities
URL for GET requesthttps://<FQDN>:<PORT>/services/csw?service=CSW&version=2.0.2&request=GetCapabilities
Alternatively, send a POST
request to the root CSW endpoint URL.
GetCapabilities
URL for GET request$https://<FQDN>:<PORT>/services/csw
Include an XML message body with a GetCapabilities
element.
GetCapabilities
Sample Request<?xml version="1.0" ?>
<csw:GetCapabilities
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
service="CSW"
version="2.0.2" >
</csw:GetCapabilities>
GetCapabilities
Sample Response (application/xml
)<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<csw:Capabilities xmlns:ows="http://www.opengis.net/ows" xmlns:ns2="http://www.w3.org/1999/xlink" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:ns6="http://www.w3.org/2001/SMIL20/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:ns9="http://www.w3.org/2001/SMIL20/Language" xmlns:ns10="http://www.w3.org/2001/XMLSchema-instance" version="2.0.2" ns10:schemaLocation="http://www.opengis.net/csw /ogc/csw/2.0.2/CSW-publication.xsd">
<ows:ServiceIdentification>
<ows:Title>Catalog Service for the Web</ows:Title>
<ows:Abstract>DDF CSW Endpoint</ows:Abstract>
<ows:ServiceType>CSW</ows:ServiceType>
<ows:ServiceTypeVersion>2.0.2</ows:ServiceTypeVersion>
</ows:ServiceIdentification>
<ows:ServiceProvider>
<ows:ProviderName>DDF</ows:ProviderName>
<ows:ProviderSite/>
<ows:ServiceContact/>
</ows:ServiceProvider>
<ows:OperationsMetadata>
<ows:Operation name="GetCapabilities">
<ows:DCP>
<ows:HTTP>
<ows:Get ns2:href="https://<FQDN>:<PORT>/services/csw"/>
<ows:Post ns2:href="https://<FQDN>:<PORT>/services/csw">
<ows:Constraint name="PostEncoding">
<ows:Value>XML</ows:Value>
</ows:Constraint>
</ows:Post>
</ows:HTTP>
</ows:DCP>
<ows:Parameter name="sections">
<ows:Value>ServiceIdentification</ows:Value>
<ows:Value>ServiceProvider</ows:Value>
<ows:Value>OperationsMetadata</ows:Value>
<ows:Value>Filter_Capabilities</ows:Value>
</ows:Parameter>
</ows:Operation>
<ows:Operation name="DescribeRecord">
<ows:DCP>
<ows:HTTP>
<ows:Get ns2:href="https://<FQDN>:<PORT>/services/csw"/>
<ows:Post ns2:href="https://<FQDN>:<PORT>/services/csw">
<ows:Constraint name="PostEncoding">
<ows:Value>XML</ows:Value>
</ows:Constraint>
</ows:Post>
</ows:HTTP>
</ows:DCP>
<ows:Parameter name="typeName">
<ows:Value>csw:Record</ows:Value>
<ows:Value>gmd:MD_Metadata</ows:Value>
</ows:Parameter>
<ows:Parameter name="OutputFormat">
<ows:Value>application/xml</ows:Value>
<ows:Value>application/json</ows:Value>
<ows:Value>application/atom+xml</ows:Value>
<ows:Value>text/xml</ows:Value>
</ows:Parameter>
<ows:Parameter name="schemaLanguage">
<ows:Value>http://www.w3.org/XMLSchema</ows:Value>
<ows:Value>http://www.w3.org/XML/Schema</ows:Value>
<ows:Value>http://www.w3.org/2001/XMLSchema</ows:Value>
<ows:Value>http://www.w3.org/TR/xmlschema-1/</ows:Value>
</ows:Parameter>
</ows:Operation>
<ows:Operation name="GetRecords">
<ows:DCP>
<ows:HTTP>
<ows:Get ns2:href="https://<FQDN>:<PORT>/services/csw"/>
<ows:Post ns2:href="https://<FQDN>:<PORT>/services/csw">
<ows:Constraint name="PostEncoding">
<ows:Value>XML</ows:Value>
</ows:Constraint>
</ows:Post>
</ows:HTTP>
</ows:DCP>
<ows:Parameter name="ResultType">
<ows:Value>hits</ows:Value>
<ows:Value>results</ows:Value>
<ows:Value>validate</ows:Value>
</ows:Parameter>
<ows:Parameter name="OutputFormat">
<ows:Value>application/xml</ows:Value>
<ows:Value>application/json</ows:Value>
<ows:Value>application/atom+xml</ows:Value>
<ows:Value>text/xml</ows:Value>
</ows:Parameter>
<ows:Parameter name="OutputSchema">
<ows:Value>urn:catalog:metacard</ows:Value>
<ows:Value>http://www.isotc211.org/2005/gmd</ows:Value>
<ows:Value>http://www.opengis.net/cat/csw/2.0.2</ows:Value>
</ows:Parameter>
<ows:Parameter name="typeNames">
<ows:Value>csw:Record</ows:Value>
<ows:Value>gmd:MD_Metadata</ows:Value>
</ows:Parameter>
<ows:Parameter name="ConstraintLanguage">
<ows:Value>Filter</ows:Value>
<ows:Value>CQL_Text</ows:Value>
</ows:Parameter>
<ows:Constraint name="FederatedCatalogs">
<ows:Value>Source1</ows:Value>
<ows:Value>Source2</ows:Value>
</ows:Constraint>
</ows:Operation>
<ows:Operation name="GetRecordById">
<ows:DCP>
<ows:HTTP>
<ows:Get ns2:href="https://<FQDN>:<PORT>/services/csw"/>
<ows:Post ns2:href="https://<FQDN>:<PORT>/services/csw">
<ows:Constraint name="PostEncoding">
<ows:Value>XML</ows:Value>
</ows:Constraint>
</ows:Post>
</ows:HTTP>
</ows:DCP>
<ows:Parameter name="OutputSchema">
<ows:Value>urn:catalog:metacard</ows:Value>
<ows:Value>http://www.isotc211.org/2005/gmd</ows:Value>
<ows:Value>http://www.opengis.net/cat/csw/2.0.2</ows:Value>
<ows:Value>http://www.iana.org/assignments/media-types/application/octet-stream</ows:Value>
</ows:Parameter>
<ows:Parameter name="OutputFormat">
<ows:Value>application/xml</ows:Value>
<ows:Value>application/json</ows:Value>
<ows:Value>application/atom+xml</ows:Value>
<ows:Value>text/xml</ows:Value>
<ows:Value>application/octet-stream</ows:Value>
</ows:Parameter>
<ows:Parameter name="ResultType">
<ows:Value>hits</ows:Value>
<ows:Value>results</ows:Value>
<ows:Value>validate</ows:Value>
</ows:Parameter>
<ows:Parameter name="ElementSetName">
<ows:Value>brief</ows:Value>
<ows:Value>summary</ows:Value>
<ows:Value>full</ows:Value>
</ows:Parameter>
</ows:Operation>
<ows:Operation name="Transaction">
<ows:DCP>
<ows:HTTP>
<ows:Post ns2:href="https://<FQDN>:<PORT>/services/csw">
<ows:Constraint name="PostEncoding">
<ows:Value>XML</ows:Value>
</ows:Constraint>
</ows:Post>
</ows:HTTP>
</ows:DCP>
<ows:Parameter name="typeNames">
<ows:Value>xml</ows:Value>
<ows:Value>appxml</ows:Value>
<ows:Value>csw:Record</ows:Value>
<ows:Value>gmd:MD_Metadata</ows:Value>
<ows:Value>tika</ows:Value>
</ows:Parameter>
<ows:Parameter name="ConstraintLanguage">
<ows:Value>Filter</ows:Value>
<ows:Value>CQL_Text</ows:Value>
</ows:Parameter>
</ows:Operation>
<ows:Parameter name="service">
<ows:Value>CSW</ows:Value>
</ows:Parameter>
<ows:Parameter name="version">
<ows:Value>2.0.2</ows:Value>
</ows:Parameter>
</ows:OperationsMetadata>
<ogc:Filter_Capabilities>
<ogc:Spatial_Capabilities>
<ogc:GeometryOperands>
<ogc:GeometryOperand>gml:Point</ogc:GeometryOperand>
<ogc:GeometryOperand>gml:LineString</ogc:GeometryOperand>
<ogc:GeometryOperand>gml:Polygon</ogc:GeometryOperand>
</ogc:GeometryOperands>
<ogc:SpatialOperators>
<ogc:SpatialOperator name="BBOX"/>
<ogc:SpatialOperator name="Beyond"/>
<ogc:SpatialOperator name="Contains"/>
<ogc:SpatialOperator name="Crosses"/>
<ogc:SpatialOperator name="Disjoint"/>
<ogc:SpatialOperator name="DWithin"/>
<ogc:SpatialOperator name="Intersects"/>
<ogc:SpatialOperator name="Overlaps"/>
<ogc:SpatialOperator name="Touches"/>
<ogc:SpatialOperator name="Within"/>
</ogc:SpatialOperators>
</ogc:Spatial_Capabilities>
<ogc:Scalar_Capabilities>
<ogc:LogicalOperators/>
<ogc:ComparisonOperators>
<ogc:ComparisonOperator>Between</ogc:ComparisonOperator>
<ogc:ComparisonOperator>NullCheck</ogc:ComparisonOperator>
<ogc:ComparisonOperator>Like</ogc:ComparisonOperator>
<ogc:ComparisonOperator>EqualTo</ogc:ComparisonOperator>
<ogc:ComparisonOperator>GreaterThan</ogc:ComparisonOperator>
<ogc:ComparisonOperator>GreaterThanEqualTo</ogc:ComparisonOperator>
<ogc:ComparisonOperator>LessThan</ogc:ComparisonOperator>
<ogc:ComparisonOperator>LessThanEqualTo</ogc:ComparisonOperator>
<ogc:ComparisonOperator>EqualTo</ogc:ComparisonOperator>
<ogc:ComparisonOperator>NotEqualTo</ogc:ComparisonOperator>
</ogc:ComparisonOperators>
</ogc:Scalar_Capabilities>
<ogc:Id_Capabilities>
<ogc:EID/>
</ogc:Id_Capabilities>
</ogc:Filter_Capabilities>
</csw:Capabilities>
1.6.3. OpenSearch Endpoint
The OpenSearch Endpoint enables a client to send query parameters and receive search results. This endpoint uses the input query parameters to create an OpenSearch query. The client does not need to specify all of the query parameters, only the query parameters of interest.
The OpenSearch specification defines a file format to describe an OpenSearch endpoint. This file is XML-based and is used to programatically retrieve a site’s endpoint, as well as the different parameter options a site holds. The parameters are defined via the OpenSearch and CDR IPT Specifications.
1.6.3.1. OpenSearch Contextual Queries
To use the OpenSearch endpoint for a query, send a GET
request with the query options as parameters
https://<FQDN>:<PORT>/services/catalog/query?<NAME>="<VALUE>"
OpenSearch Element | HTTPS Parameter | Possible Values | Comments |
---|---|---|---|
|
|
URL-encoded, space-delimited list of search terms |
Complex contextual search string. |
|
|
Integer >= 0 |
Maximum # of results to retrieve. default: |
|
|
integer > 0 |
Index of first result to return. This value uses a one-based index for the results. default: |
|
|
Requires a transformer shortname as a string, possible values include, when available, See Query Response transformers for more possible values. |
Defines the format that the return type should be in. default: |
https://<FQDN>:<PORT>/services/catalog/query?q="Aliquam"&count=20
1.6.3.1.1. Complex OpenSearch Contextual Query Format
The OpenSearch Endpoint supports the following operators: AND
, OR
, and NOT
.
These operators are case sensitive.
Implicit ANDs
are also supported.
Use parentheses to change the order of operations. Use quotes to group keywords into literal expressions.
See the OpenSearch specification for more syntax specifics.
https://<FQDN>:<PORT>/services/catalog/query?q='cat OR dog'
1.6.3.2. OpenSearch Temporal Queries
Queries can also specify a start and end time to narrow results.
OpenSearch Element | HTTPS Parameter | Possible Values | Comments |
---|---|---|---|
|
|
RFC-3399-defined value: |
Specifies the beginning of the time slice of the search. Default value of "1970-01-01T00:00:00Z" is used when |
|
|
RFC-3399-defined value: |
Specifies the ending of the time slice of the search Current GMT date/time is used when |
https://<FQDN>:<PORT>/services/catalog/query?q='*'&dtstart=2021-09-22T00:00:00Z&dtend=2021-09-22T18:00:00Z
Note
|
The start and end temporal criteria must be of the format specified above. Other formats are currently not supported. Example:
The start and end temporal elements are based on modified timestamps for a metacard. |
1.6.3.3. OpenSearch Geospatial Queries
Query by location.
Use geospatial query parameters to create a geospatial INTERSECTS
query, where INTERSECTS
means geometries that are not DISJOINT
to the given geospatial parameters.
OpenSearch Element | HTTPS Parameter | Possible Values | Comments |
---|---|---|---|
|
|
|
Used in conjunction with the |
|
|
|
Used in conjunction with the |
|
|
|
Specifies the search distance in meters from the Used in conjunction with the default: |
|
|
Comma-delimited list of lat/lon ( |
According to the OpenSearch Geo Specification this is deprecated. Use the |
|
|
4 comma-delimited |
|
|
|
WKT Geometries Examples:
|
Make sure to repeat the starting point as the last point to close the polygon. |
https://localhost:8993/services/catalog/query?q='*'&lon=44.792&lat=-6.171
1.6.3.4. Additional OpenSearch Query Parameters
The OpenSearch Endpoint can also use these additional parameters to refine queries
OpenSearch Element | HTTPS Parameter | Possible Values | Comments |
---|---|---|---|
|
|
|
Sorting by default: |
|
|
Integer >= 0 |
Maximum # of results to return. If default: |
|
|
Integer > 0 |
Maximum timeout (milliseconds) for query to respond. default: |
|
|
Integer > 0 |
Specifies an offset (milliseconds), backwards from the current time, to search on the modified time field for entries. |
|
|
Any valid datatype (e.g. |
Specifies the type of data to search for. |
|
|
Comma-delimited list of strings (e.g. 20,30) |
Version values for which to search. |
OpenSearch Element | HTTPS Parameter | Possible Values | Comments |
---|---|---|---|
|
|
Comma-delimited list of site names to query. Varies depending on the names of the sites in the federation. |
If |
1.6.4. Prometheus Endpoint
The Prometheus endpoint provides various metrics about DDF such as the number of queries made to a specific source and counters of ingest operations.
An external Prometheus server will need to be setup and configured to scrape from DDF. The endpoint is exposed at:
https://<FQDN>:<PORT>/metrics
1.6.4.1. Visualising Metrics
A visualization software, such as Grafana, can be connected to Prometheus and configured to display available metrics.
1.6.5. Queries Endpoint
The queries endpoint enables an application to create, retrieve, update, and delete query metacards.
Query metacards represent queries within the UI. A query metacard is what is persisted in the data store.
The queries endpoint can be used for one or more of these operations on an instance of DDF:
-
Create query metacards and store them in the DDF catalog.
-
Retrieve all query metacards stored in the DDF catalog and sort them based on attribute and sort order.
-
Retrieve a specific query metacard stored in the DDF catalog.
-
Update query metacards that are stored in the DDF catalog.
-
Delete query metacards that are stored in the DDF catalog.
https://<HOSTNAME>:<PORT>/search/catalog/internal/queries
1.6.5.1. Queries Endpoint Create Examples
To create a query metacard through the queries endpoint, send a POST
request to the queries endpoint.
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"cql":"(\"anyText\" ILIKE 'foo bar')",
"filterTree":"{\"type\":\"AND\",\"filters\":[{\"type\":\"ILIKE\",\"property\":\"anyText\",\"value\":\"foo bar\"}]}",
"federation":"enterprise",
"sorts":[
{
"attribute":"modified",
"direction":"descending"
}
],
"type":"advanced",
"title":"Search Title"
}
A successful create request will return a status of 201 CREATED
.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"id": "12bfc601cda449d58733eacaf613b93d",
"title": "Search Title",
"created": "Apr 18, 2019 10:20:55 AM",
"modified": "Apr 18, 2019 10:20:55 AM",
"owner": "admin@localhost.local",
"cql": "(\"anyText\" ILIKE 'foo bar')",
"filterTree": "{\"type\":\"AND\",\"filters\":[{\"type\":\"ILIKE\",\"property\":\"anyText\",\"value\":\"foo bar\"}]}",
"enterprise": null,
"sources": [],
"sorts": [
{
"attribute": "modified",
"direction": "descending"
}
],
"polling": null,
"federation": "enterprise",
"type": "advanced",
"detailLevel": null,
"schedules": [],
"facets": []
}
An unsuccessful create request will return a status of 500 SERVER ERROR
.
1
2
3
{
"message": "Something went wrong."
}
1.6.5.2. Queries Endpoint Retrieve All Examples
To retrieve a query metacard through the queries endpoint, send a GET
request to the queries endpoint.
Query Param | Description | Default Value | Valid Values | Type |
---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A successful retrieval request will return a status of 200 OK
.
1.6.5.3. Queries Endpoint Retrieve All Fuzzy Examples
To retrieve all query metacards based on some text based value through the queries endpoint, send a GET
request to the queries endpoint specifying a value for text
as a query parameters.
https://<HOSTNAME>:<PORT>/search/catalog/internal/queries?text=<VALUE>
A fuzzy search will only be performed against the title
, modified
, owner
, and description
attributes.
1.6.5.4. Queries Endpoint Retrieve Examples
https://<HOSTNAME>:<PORT>/search/catalog/internal/queries/<ID>
To retrieve a specific query metacard through the queries endpoint, send a GET
request to the queries endpoint with an id.
A successful retrieval request will return a status of 200 OK
.
1
2
3
{
"message": "Could not find metacard for id: <metacardId>"
}
An unsuccessful retrieval request will return a status of 404 NOT FOUND
.
1.6.5.5. Queries Endpoint Update Examples
https://<HOSTNAME>:<PORT>/search/catalog/internal/queries/<ID>
To update a specific query metacard through the queries endpoint, send a PUT
request to the queries endpoint with an id.
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"cql":"(\"anyText\" ILIKE 'foo bar')",
"filterTree":"{\"type\":\"AND\",\"filters\":[{\"type\":\"ILIKE\",\"property\":\"anyText\",\"value\":\"foo bar\"}]}",
"federation":"enterprise",
"sorts":[
{
"attribute":"modified",
"direction":"descending"
}
],
"type":"advanced",
"title":"New Search Title"
}
A successful update request will return a status of 200 OK
.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"id": "cd6b83db301544e4bb7ece39564261ca",
"title": "New Search Title",
"created": "Apr 18, 2019 11:09:35 AM",
"modified": "Apr 18, 2019 11:09:35 AM",
"owner": null,
"cql": "(\"anyText\" ILIKE 'foo barararra')",
"filterTree": "{\"type\":\"AND\",\"filters\":[{\"type\":\"ILIKE\",\"property\":\"anyText\",\"value\":\"foo bar\"}]}",
"enterprise": null,
"sources": [],
"sorts": [
{
"attribute": "modified",
"direction": "descending"
}
],
"polling": null,
"federation": "enterprise",
"type": "advanced",
"detailLevel": null,
"schedules": [],
"facets": []
}
An unsuccessful update request will return a status of 404 NOT FOUND
.
1
2
3
{
"message": "Form is either restricted or not found."
}
1.6.5.6. Queries Endpoint Delete Examples
https://<HOSTNAME>:<PORT>/search/catalog/internal/queries/<ID>
To delete a specific query metacard through the queries endpoint, send a GET
request to the queries endpoint with an id.
A successful deletion request will return a status of 204 NO CONTENT
.
An unsuccessful deletion request will return a status of 404 NOT FOUND
.
1
2
3
{
"message": "Form is either restricted or not found."
}