The GeoNetwork CSW API provides mechanisms for querying and retrieving metadata from spatial data catalogs, compliant with the OGC CSW standard. This service focuses on accessing geospatial records in XML format.
Key Features
This API supports various read-only operations essential for accessing metadata within geospatial catalogs:
GetCapabilities
This operation provides comprehensive information about the capabilities of the CSW service, including supported operations, queryable properties, and the configurations of output schemas.
Example request: /geonetwork?service=CSW&version=2.0.2&request=GetCapabilities&service=CSW&version=2.0.2
GetRecords
Users can search and retrieve metadata records using a variety of filters such as keywords, spatial data, and record types. The response is paginated and can be tailored to specific needs.
The typeNames attribute in the GetRecords operation refers to the types of records that can be queried and retrieved. For instance, types such as csw:Record, gfc:FC_FeatureCatalogue, and others determine the structure of the data in the response. To find out which typeNames are available look in the GetCapabilities document and find the ows:Parameter tag with attribute name="typeNames"
Example request: /geonetwork?service=CSW&version=2.0.2&request=GetRecords&typeNames=csw:Record&resultType=results
GetRecordById
This operation retrieves a specific metadata record by its unique identifier. It is crucial for fetching detailed information on a previously identified record from a search.
The outputSchema parameter specifies the schema that the returned record will conform to, such as ISO standards or Dublin Core. Available schemas include general metadata standards and specialized schemas for particular types of geospatial data. To find out which schemas are available look in the GetCapabilities document
Example request: /geonetwork?service=CSW&version=2.0.2&request=GetRecordById&id=[record_id]&outputSchema=http://www.opengis.net/cat/csw/2.0.2
Example Usage
This section illustrates practical examples of how to utilize the GeoNetwork CSW API to perform common tasks such as retrieving metadata records and querying specific data.
Example 1: Discovering Service Capabilities
Before starting to interact with the CSW service, it is recommended to retrieve and review the capabilities of the service to understand the available operations and their configurations.
Example request: /geonetwork?service=CSW&version=2.0.2&request=GetCapabilities
Example 2: Listing Metadata Records
To list all metadata records, use the GetRecords operation. For instance, to find the first 10 records, you might structure your request like this:
Example request: /geonetwork?service=CSW&version=2.0.2&request=GetRecords&typeNames=csw:Record&resultType=results&maxRecords=10
Example 3: Retrieving a Specific Record by ID
If you know the unique identifier of a record, you can retrieve it directly using the GetRecordById operation. This is useful for accessing detailed information about a particular item after identifying it from a broader search.
Example request: /geonetwork?service=CSW&version=2.0.2&request=GetRecordById&id=d58f7bc0a98d8b062c433ad372a0d6c1
Example 4: Searching Metadata Records
If you want to list all records that match a specific search term, you can use a CQL filter.