10.12.3 XML encoding
The following XML-Schema fragment defines the XML encoding for a Harvest operation request:
xsd:element name=Harvest type=csw:HarvestType xsd:complexType
name=HarvestType xsd:complexContent
xsd:extension base=csw:RequestBaseType xsd:sequence
xsd:element name=Source type=xsd:anyURI xsd:element name=ResourceType type=xsd:anyURI
xsd:element name=ResourceFormat type=xsd:string minOccurs=0 default=applicationxml
xsd:element name=HarvestInterval type=xsd:duration
minOccurs=0 xsd:element name=ResponseHandler type=xsd:anyURI
minOccurs=0 maxOccurs=unbounded xsd:sequence
xsd:extension xsd:complexContent
xsd:complexType
10.12.4 Parameter descriptions
10.12.4.1 Source parameter
The Source parameter is used to specify a URI reference to the metadata resource to be harvested.
10.12.4.2 ResourceType parameter
The ResourceType parameter references a document that defines the structure of the resource being harvested. For high interoperability, this resource should be an XML
document, and the ResourceType parameter string value should be a URI that references the structure of that XML document i.e., its XML Schema namespace identifier URI. If
a server can harvest resources in the schema of an information model it supports, the ResourceType URI should be the same as the outputSchema parameter URI defined for
the GetRecords operation.
Table 69 defines a set of URIs that may be used to identify well know metadata formats. CSW implementations and CSW application profiles may support other values of the
ResourceType parameter for harvesting additional artifact types. If creating new ResourceType URNs is needed, the format of the values may be
urn:ogc:def:resourceType:CSW:token,
where token is a placeholder for a value that denotes the specific resource type.
172
Copyright © 2007 Open Geospatial Consortium, Inc. All Rights Reserved.
Table 69 — URIs for well known metadata standards
URI Description
http:www.opengis.netwms WMS capability document, all current versions
http:www.opengis.netwfs WFS capability document, versions 1.0 and 1.1
http:www.opengis.netwfs1.2.0 WFS capability document, version 1.2
http:www.opengis.netwcs WCS capability document, version 1.0
http:www.opengis.netwcs1.1 WCS capability document, version 1.1
http:www.opengis.netcatcsw CSW capability document, versions 2.0.0 and 2.0.1
http:www.opengis.netcatcsw2.0.2 CSW capability document, version 2.0.2
http:www.fgdc.govmetadatacsdgm Content Standard for Digital Geospatial Metadata
CSDGM, Vers. 2 FGDC-STD-001-1998 http:www.auslig.gov.audtdanzmeta-1.3.dtd
Australian Spatial Data Infrastructure Standard http:www.isotc211.orgschemas2005gmd
ISO19139 document http:metadata.dod.milmdrnsDDMS1.3
DEPARTMENT OF DEFENSE DISCOVERY METADATA STANDARD DDMS
A CSW may accept a MIME type as the string value of the ResourceType parameter. If MIME types are accepted, the value of the MIME type shall match the value of the
Content Type: MIME header when the resource is accessed by the catalogue. If these two values do not agree, the catalogue shall raise as exception
A compliant server shall, in its Capabilities document, advertise the resource type URIs it recognizes using the Parameter element within the Operation element.
EXAMPLE The following XML fragment illustrates how a catalogue server could advertise which resource
types it can harvest: ows:Operation name=Harvest
... ows:Parameter name=ResourceType
ows:Valuehttp:www.opengis.netwmsows:Value ows:Valuehttp:www.opengis.netwfsows:Value
ows:Valuehttp:www.opengis.netwmsows:Value ows:Valuehttp:www.opengis.netwfsows:Value
ows:Valuehttp:www.opengis.netcatcsw2.0.2ows:Value ows:Valueurn:ogc:def:resourceType:CSW:FGDCows:Value
ows:Valuehttp:www.auslig.gov.audtdanzmeta-1.3.dtdows:Value ows:Valuehttp:metadata.dod.milmdrnsDDMS1.3ows:Value
ows:Valueaudiompegows:Value ows:Valueapplicationpdfows:Value
ows:Parameter ...
ows:Operation
10.12.4.3 ResourceFormat parameter
The ResourceFormat parameter is used to indicate the encoding used for the resource being harvested. This parameter is included to support the harvesting of metadata
resources available in various formats such as plain text, XML or HTML. The values of
Copyright © 2007 Open Geospatial Consortium, Inc. All Rights Reserved.
173
this parameter shall be a MIME type. If the parameter is not specified then the default value of applicationxml shall be assumed.
10.12.4.4 ResponseHandler parameter
The ResponseHandler parameter is a flag that indicates how the Harvest operation should be processed by a CSW server.
If the parameter is not present, then the Harvest operation is processed synchronously meaning that the client sends the Harvest request to a CSW and then waits to receive a
HarvestResponse
or exception message as described in Subclause 10.3.7. The CSW
immediately processes the Harvest request, while the client waits for a response. The problem with this mode of operation is that the client may timeout waiting for the server
to process the request.
If the parameter is present, the Harvest operation is processed asynchronously. In this case, the server responds immediately to a client’s request with an acknowledgement
message as defined in Subclause 10.8.4.13. The acknowledgment message echoes the client’s request, using the EchoedRequest element, and may include an optionally
generated request identifier using the RequestId element. The acknowledgement message tells the client that the request has been received and notification of completion
will be send to the URL specified as the value of the ResponseHandler parameter. The Harvest
request may then be processed at some later time taking as much time as is required to complete the operation. When the operation is completed, a
HarvestResponse
message or exception message per Subclause 10.3.7 if a problem was
encountered is sent to the URL specified as the value of the ResponseHandler parameter.
10.12.4.5 HarvestInterval Parameter
The HarvestInterval parameter is used to specify the period of time, in ISO 8601 period format, that should elapse before a CSW attempts to re-harvest the specified resource
thus refreshing it copy of a resource.
If no HarvestInterval parameter is specified then the resource is harvested only once in response to the Harvest request.
10.12.5 Response
The following XML-Schema fragment defines the HarvestResponse message:
xsd:element name=HarvestResponse type=csw:HarvestResponseType xsd:complexType name=HarvestResponseType
id=HarvestResponseType xsd:choice
xsd:element ref=csw:Acknowledgement xsd:element ref=csw:TransactionResponse
xsd:choice xsd:complexType
174
Copyright © 2007 Open Geospatial Consortium, Inc. All Rights Reserved.
The Harvest operation can respond in one of two ways depending on the presence or absence of the ResponseHandler parameter.
If the ResponseHandler parameter is present, then the CSW server should verify the request syntax and immediately respond to the client with an acknowledgment message
as defined in Subclause 10.12.4.4. Later, after the server has processed the request, it shall generate a HarvestResponse message and send it to the URI specified by the
ResponseHandler
parameter using the protocol encoded therein. Common protocols are
ftp for sending the response to a ftp server and mailto which may be used to send the
response to an email address.
If the ResponseHandler parameter is not present, the CSW server shall process the Harvest
request immediately and respond to the waiting client with a HarvestResponse
message.
If the Harvest attempt is successful, the response may include summary representations of the newly created or modified catalogue objects. The response is the same as the
TransactionResponse
.
10.12.6 Examples