This section presents some record requests to the CSW engine, and the response to each request, for each of the following operations:
GetCapabilities
DescribeRecord
GetRecords
GetDomain
GetRecordById
Transaction, with a subelement specifying the transaction type:
Insert
Update
Delete
Example 16-1 GetCapabilities Request
Example 16-1 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:GetCapabilities service="CSW" xmlns:csw="http://www.opengis.net/cat/csw" xmlns:ows="http://www.opengis.net/ows"> <ows:AcceptVersions> <ows:Version>2.0.0</ows:Version> </ows:AcceptVersions> <ows:AcceptFormats> <ows:OutputFormat>text/xml</ows:OutputFormat> </ows:AcceptFormats> </csw:GetCapabilities>
Example 16-2 GetCapabilities Response
Example 16-2 is an excerpt of the response from the request in Example 16-1.
<Capabilities xmlns="http://www.opengis.net/cat/csw" version="2.0.0" updateSequence="0" xmlns:ows="http://www.opengis.net/ows" xmlns:ogc="http://www.opengis.net/ogc" xmlns:csw="http://www.opengis.net/cat/csw" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ns0="http://www.opengis.net/cat/csw" xmlns:ns1="http://www.opengis.net/cat/csw"> <ows:ServiceIdentification xmlns:ows="http://www.opengis.net/ows"> <ows:ServiceType>CSW</ows:ServiceType> <ows:ServiceTypeVersion>2.0.0</ows:ServiceTypeVersion> <ows:Title>Company CSW</ows:Title> <ows:Abstract> A catalogue service that conforms to the HTTP protocol binding of the OpenGIS Catalogue Service specification version 2.0.0. </ows:Abstract> <ows:Keywords> <ows:Keyword>CSW</ows:Keyword> <ows:Keyword>Company Name</ows:Keyword> <ows:Keyword>geospatial</ows:Keyword> <ows:Keyword>catalogue</ows:Keyword> </ows:Keywords> <ows:Fees>NONE</ows:Fees> <ows:AccessConstraints>NONE</ows:AccessConstraints> </ows:ServiceIdentification> <ows:ServiceProvider xmlns:ows="http://www.opengis.net/ows"> <ows:ProviderName>Company Name</ows:ProviderName> <ows:ProviderSite ans1:href="http://www.oracle.com" xmlns:ans1="http://www.w3.org/1999/xlink"/> <ows:ServiceContact> <ows:IndividualName> Contact Person Name</ows:IndividualName> <ows:PositionName>Staff</ows:PositionName> <ows:ContactInfo> <ows:Phone> <ows:Voice>999-999-9999</ows:Voice> <ows:Facsimile>999-999-9999</ows:Facsimile> </ows:Phone> <ows:Address> <ows:DeliveryPoint>1 Street Name</ows:DeliveryPoint> <ows:City>CityName</ows:City> <ows:AdministrativeArea>StateName</ows:AdministrativeArea> <ows:PostalCode>09999</ows:PostalCode> <ows:Country>USA</ows:Country> <ows:ElectronicMailAddress> contact.person@example.com </ows:ElectronicMailAddress> </ows:Address> <ows:OnlineResource ans1:href="mailto:contact.person@example.com" xmlns:ans1="http://www.w3.org/1999/xlink"/> </ows:ContactInfo> </ows:ServiceContact> </ows:ServiceProvider> <ows:OperationsMetadata xmlns:ows="http://www.opengis.net/ows"> <ows:Operation name="GetCapabilities"> <ows:DCP> <ows:HTTP> <ows:Get ans1:href="http://localhost:8888/SpatialWS-SpatialWS-context-root/cswservlet" xmlns:ans1="http://www.w3.org/1999/xlink"/> <ows:Post ans1:href="http://localhost:8888/SpatialWS-SpatialWS-context-root/SpatialWSSoapHttpPort" xmlns:ans1="http://www.w3.org/1999/xlink"/> </ows:HTTP> </ows:DCP> </ows:Operation> <ows:Operation name="DescribeRecord"> <ows:DCP> <ows:HTTP> <ows:Post ans1:href="http://localhost:8888/SpatialWS-SpatialWS-context-root/SpatialWSSoapHttpPort" xmlns:ans1="http://www.w3.org/1999/xlink"/> </ows:HTTP> </ows:DCP> <ows:Parameter name="typeName"><ows:Value>ns0:SampleRecord</ows:Value><ows:Value>ns1:Record</ows:Value></ows:Parameter> <ows:Parameter name="outputFormat"> <ows:Value>text/xml</ows:Value> </ows:Parameter> <ows:Parameter name="schemaLanguage"> <ows:Value>XMLSCHEMA</ows:Value> </ows:Parameter> </ows:Operation> <ows:Operation name="GetRecords"> <ows:DCP> <ows:HTTP> <ows:Post ans1:href="http://localhost:8888/SpatialWS-SpatialWS-context-root/SpatialWSSoapHttpPort" xmlns:ans1="http://www.w3.org/1999/xlink"/> </ows:HTTP> </ows:DCP> <ows:Parameter name="TypeName"><ows:Value>ns0:SampleRecord</ows:Value><ows:Value>ns1:Record</ows:Value></ows:Parameter> <ows:Parameter name="outputFormat"> <ows:Value>text/xml </ows:Value> </ows:Parameter> <ows:Parameter name="outputSchema"> <ows:Value>OGCCORE</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:Parameter name="CONSTRAINTLANGUAGE"> <ows:Value>Filter</ows:Value> </ows:Parameter> </ows:Operation> <ows:Operation name="GetRecordById"> <ows:DCP> <ows:HTTP> <ows:Post ans1:href="http://localhost:8888/SpatialWS-SpatialWS-context-root/SpatialWSSoapHttpPort" xmlns:ans1="http://www.w3.org/1999/xlink"/> </ows:HTTP> </ows:DCP> <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="GetDomain"> <ows:DCP> <ows:HTTP> <ows:Post ans1:href="http://localhost:8888/SpatialWS-SpatialWS-context-root/SpatialWSSoapHttpPort" xmlns:ans1="http://www.w3.org/1999/xlink"/> </ows:HTTP> </ows:DCP> <ows:Parameter name="ParameterName"> <ows:Value>GetRecords.resultType</ows:Value> <ows:Value>GetRecords.outputFormat</ows:Value> <ows:Value>GetRecords.outputRecType</ows:Value> <ows:Value>GetRecords.typeNames</ows:Value> <ows:Value>GetRecords.ElementSetName</ows:Value> <ows:Value>GetRecords.ElementName</ows:Value> <ows:Value>GetRecords.CONSTRAINTLANGUAGE</ows:Value> <ows:Value>GetRecordById.ElementSetName</ows:Value> <ows:Value>DescribeRecord.typeName</ows:Value> <ows:Value>DescribeRecord.schemaLanguage</ows:Value> </ows:Parameter> </ows:Operation> <ows:Operation name="Transaction"> <ows:DCP> <ows:HTTP> <ows:Post ans1:href="http://localhost:8888/SpatialWS-SpatialWS-context-root/SpatialWSSoapHttpPort" xmlns:ans1="http://www.w3.org/1999/xlink"/> </ows:HTTP> </ows:DCP> </ows:Operation> <ows:Parameter name="service"> <ows:Value>CSW</ows:Value> </ows:Parameter> <ows:Parameter name="version"> <ows:Value>2.0.0</ows:Value> </ows:Parameter> <ows:ExtendedCapabilities> <ogc:Filter_Capabilities xmlns:ogc="http://www.opengis.net/ogc"> <ogc:Spatial_Capabilities> <ogc:Spatial_Operators> <ogc:BBOX/> <ogc:Equals/> <ogc:Disjoint/> <ogc:Intersect/> <ogc:Touches/> <ogc:Crosses/> <ogc:Within/> <ogc:Contains/> <ogc:Overlaps/> <ogc:Beyond/> <ogc:DWithin/> </ogc:Spatial_Operators> </ogc:Spatial_Capabilities> <ogc:Scalar_Capabilities> <ogc:Logical_Operators/> <ogc:Comparison_Operators> <ogc:Simple_Comparisons/> <ogc:Like/> <ogc:Between/> <ogc:NullCheck/> </ogc:Comparison_Operators> <ogc:Arithmetic_Operators> <ogc:Simple_Arithmetic/> </ogc:Arithmetic_Operators> </ogc:Scalar_Capabilities> </ogc:Filter_Capabilities> </ows:ExtendedCapabilities> </ows:OperationsMetadata> </Capabilities>
Example 16-3 DescribeRecord Request
Example 16-3 is a request to describe the record with the type name Record
for a specified namespace.
<csw:DescribeRecord service="CSW" version="2.0.0" xmlns:csw="http://www.opengis.net/cat/csw" > <csw:TypeName targetNamespace="http://www.opengis.net/cat/csw">Record</csw:TypeName> </csw:DescribeRecord>
Example 16-4 DescribeRecord Response
Example 16-4 is the response from the request in Example 16-3. The response is an XML schema definition (XSD). See the <documentation>
elements in the response for explanatory comments.
<xsd:schema targetNamespace="http://www.opengis.net/cat/csw" elementFormDefault="qualified" version="2.0.0" id="csw-record" xmlns:csw="http://www.opengis.net/cat/csw" xmlns:dc="http://www.purl.org/dc/elements/1.1/" xmlns:dct="http://www.purl.org/dc/terms/" xmlns:ows="http://www.opengis.net/ows" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:annotation> <xsd:appinfo> <dc:identifier xmlns:dc="http://www.purl.org/dc/elements/1.1/"> http://schemas.opengis.net/csw/2.0.0/record </dc:identifier> </xsd:appinfo> <xsd:documentation> This schema defines the basic record types that are common to all CSW implementations. An application profile may extend AbstractRecordType to represent model-specific content. </xsd:documentation> </xsd:annotation> <xsd:import namespace="http://www.purl.org/dc/terms/" schemaLocation="./recdcterms.xsd"/> <xsd:import namespace="http://www.purl.org/dc/elements/1.1/" schemaLocation="./recdcmes.xsd"/> <xsd:import namespace="http://www.opengis.net/ows" schemaLocation="./owsboundingbox.xsd"/> <xsd:element name="AbstractRecord" type="csw:AbstractRecordType" abstract="true" id="AbstractRecord"/> <xsd:complexType name="AbstractRecordType" abstract="true" id="AbstractRecordType"/> <xsd:element name="DCMIRecord" type="csw:DCMIRecordType" substitutionGroup="csw:AbstractRecord"/> <xsd:complexType name="DCMIRecordType"> <xsd:annotation> <xsd:documentation> 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"> <xsd:annotation> <xsd:documentation> 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"/> <xsd:element ref="dc:type" minOccurs="0"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:element name="SummaryRecord" type="csw:SummaryRecordType" substitutionGroup="csw:AbstractRecord"/> <xsd:complexType name="SummaryRecordType"> <xsd:annotation> <xsd:documentation> 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:choice maxOccurs="unbounded"> <xsd:element ref="dc:identifier"/> <xsd:element ref="dc:type"/> <xsd:element ref="dc:title"/> <xsd:element ref="dc:subject"/> <xsd:element ref="dc:format"/> <xsd:element ref="dc:relation"/> <xsd:element ref="dct:modified"/> <xsd:element ref="dct:abstract"/> <xsd:element ref="dct:spatial"/> </xsd:choice> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:element name="Record" type="csw:RecordType" substitutionGroup="csw:AbstractRecord"/> <xsd:complexType name="RecordType"> <xsd:annotation> <xsd:documentation> This type extends DCMIRecordType to add ows:BoundingBox; it may be used to specify a bounding envelope for the catalogued resource. </xsd:documentation> </xsd:annotation> <xsd:complexContent> <xsd:extension base="csw:DCMIRecordType"> <xsd:sequence> <xsd:element ref="ows:BoundingBox" minOccurs="0"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> </xsd:schema>
Example 16-5 GetRecords Request
Example 16-5 is a request to get records where the contributor is equal to Raja
.
Note that Spatial Catalog Service supports only synchronous processing of GetRecords requests.
<?xml version="1.0" ?> <csw:GetRecords service="CSW" version="2.0.0" xmlns:csw="http://www.opengis.net/cat/csw" xmlns:ogc="http://www.opengis.net/ogc" xmlns:dc="http://www.purl.org/dc/elements/1.1/" xmlns:dct="http://www.purl.org/dc/terms/" outputFormat="text/xml" resultType="results" outputSchema="csw:Record"> <csw:Query typeNames="csw:Record"> <csw:ElementName>/csw:Record/dc:identifier</csw:ElementName> <csw:ElementName>/csw:Record/dc:contributor</csw:ElementName> <csw:Constraint version="2.0.0" > <ogc:Filter> <ogc:PropertyIsEqualTo> <ogc:PropertyName>/csw:Record/dc:contributor</ogc:PropertyName> <ogc:Literal>Raja</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter> </csw:Constraint> </csw:Query> </csw:GetRecords>
Example 16-6 GetRecords Response
Example 16-6 is the response from the request in Example 16-5.
<csw:GetRecordsResponse xmlns:csw="http://www.opengis.net/cat/csw" xmlns:dc="http://www.purl.org/dc/elements/1.1/" xmlns:dct="http://www.purl.org/dc/terms/" xsi:schemaLocation="http://www.opengis.net/cat/csw http://localhost:8888/SpatialWS-SpatialWS-context-root/cswservlet?recordTypeId=1 " version="2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <csw:RequestId>4</csw:RequestId> <csw:SearchStatus status="complete"/> <csw:SearchResults recordSchema="http://www.opengis.net/cat/csw" numberOfRecordsMatched="1" numberOfRecordsReturned="1" nextRecord="0" expires="2007-02-09T16:32:35.29Z"> <csw:Record xmlns:dc="http://www.purl.org/dc/elements/1.1/" xmlns:ows="http://www.opengis.net/ows" xmlns:dct="http://www.purl.org/dc/terms/"> <dc:contributor xmlns:dc="http://www.purl.org/dc/elements/1.1/" scheme="http://www.example.com">Raja</dc:contributor> <dc:identifier xmlns:dc="http://www.purl.org/dc/elements/1.1/">REC-1</dc:identifier> </csw:Record> </csw:SearchResults> </csw:GetRecordsResponse>
Example 16-7 GetDomain Request
Example 16-7 is a request to get ___domain information related to a record type.
<csw:GetDomain service="CSW" version="2.0.0" xmlns:csw="http://www.opengis.net/cat/csw" > <csw:ParameterName>GetRecords.resultType</csw:ParameterName> </csw:GetDomain>
Example 16-8 GetDomain Response
Example 16-8 is the response from the request in Example 16-7.
<csw:GetDomainResponse xmlns:csw="http://www.opengis.net/cat/csw" xmlns:dc="http://www.purl.org/dc/elements/1.1/" xmlns:dct="http://www.purl.org/dc/terms/"> <csw:DomainValues type="csw:SampleRecord"> <csw:ParameterName>GetRecords.resultType</csw:ParameterName> <csw:ListOfValues> <csw:Value>hits</csw:Value> <csw:Value>results</csw:Value> <csw:Value>validate</csw:Value> </csw:ListOfValues> </csw:DomainValues> <csw:DomainValues type="csw:Record"> <csw:ParameterName>GetRecords.resultType</csw:ParameterName> <csw:ListOfValues> <csw:Value>hits</csw:Value> <csw:Value>results</csw:Value> <csw:Value>validate</csw:Value> </csw:ListOfValues> </csw:DomainValues> </csw:GetDomainResponse>
Example 16-9 GetRecordById Request
Example 16-9 is a request to get the record with the record ID value REC-1
.
<?xml version="1.0" ?> <csw:GetRecordById service="CSW" version="2.0.0" xmlns:csw="http://www.opengis.net/cat/csw" xmlns:ogc="http://www.opengis.net/ogc" > <csw:Id> REC-1 </csw:Id> <csw:ElementSetName>brief</csw:ElementSetName> </csw:GetRecordById>
Example 16-10 GetRecordById Response
Example 16-10 is the response from the request in Example 16-9.
<csw:GetRecordByIdResponse xmlns:csw="http://www.opengis.net/cat/csw" xmlns:dc="http://www.purl.org/dc/elements/1.1/" xmlns:dct="http://www.purl.org/dc/terms/" xsi:schemaLocation="http://www.opengis.net/cat/csw http://localhost:8888/SpatialWS-SpatialWS-context-root/cswservlet?recordTypeId=2 http://www.opengis.net/cat/csw http://localhost:8888/SpatialWS-SpatialWS-context-root/cswservlet?recordTypeId=1 " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <csw:BriefRecord xmlns:dc="http://www.purl.org/dc/elements/1.1/" xmlns:ows="http://www.opengis.net/ows" xmlns:dct="http://www.purl.org/dc/terms/"> <dc:identifier xmlns:dc="http://www.purl.org/dc/elements/1.1/">REC-1</dc:identifier> </csw:BriefRecord> </csw:GetRecordByIdResponse>
Example 16-11 Insert Request
Example 16-11 is a request to insert a record for contributor John
. The record has an ID value of REC-2
, and has the spatial attribute of the specified bounding box (optimized rectangle: lower-left and upper-right coordinates).
<csw:Transaction service="CSW" version="2.0.0" xmlns:csw="http://www.opengis.net/cat/csw" > <csw:Insert> <Record xmlns="http://www.opengis.net/cat/csw" xmlns:dc="http://www.purl.org/dc/elements/1.1/" xmlns:dct="http://www.purl.org/dc/terms/" xmlns:ows="http://www.opengis.net/ows" > <dc:contributor scheme="http://www.example.com">John</dc:contributor> <dc:identifier >REC-2</dc:identifier> <ows:WGS84BoundingBox crs="urn:opengis:crs:OGC:2:84" dimensions="2"> <ows:LowerCorner>12 12</ows:LowerCorner> <ows:UpperCorner>102 102</ows:UpperCorner> </ows:WGS84BoundingBox> </Record> </csw:Insert> </csw:Transaction>
Example 16-12 Insert Response
Example 16-12 is the response from the request in Example 16-11.
<csw:TransactionResponse xmlns:csw="http://www.opengis.net/cat/csw" xmlns:dc="http://www.purl.org/dc/elements/1.1/" xmlns:dct="http://www.purl.org/dc/terms/" xsi:schemaLocation="http://www.opengis.net/cat/csw http://localhost:8888/SpatialWS-SpatialWS-context-root/cswservlet?recordTypeId=1 " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <csw:TransactionSummary> <csw:totalInserted>1</csw:totalInserted> </csw:TransactionSummary> </csw:TransactionResponse>
Example 16-13 Update Request
Example 16-13 is a request to update the contributor value to Jane
in the record where the current contributor value is John
(that is, change the value from John
to Jane
).
<csw:Transaction service="CSW" version="2.0.0" xmlns:csw="http://www.opengis.net/cat/csw" xmlns:ogc="http://www.opengis.net/ogc" xmlns:dc="http://www.purl.org/dc/elements/1.1/"> <csw:Update> <csw:RecordProperty> <csw:Name>/csw:Record/dc:contributor</csw:Name> <csw:Value>Jane</csw:Value> </csw:RecordProperty> <csw:Constraint version="2.0.0"> <ogc:Filter> <ogc:PropertyIsEqualTo> <ogc:PropertyName>/csw:Record/dc:contributor</ogc:PropertyName> <ogc:Literal>John</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter> </csw:Constraint> </csw:Update> </csw:Transaction>
Example 16-14 Update Response
Example 16-14 is the response from the request in Example 16-13.
<csw:TransactionResponse xmlns:csw="http://www.opengis.net/cat/csw" xmlns:dc="http://www.purl.org/dc/elements/1.1/" xmlns:dct="http://www.purl.org/dc/terms/"> <csw:TransactionSummary> <csw:totalUpdated>1</csw:totalUpdated> </csw:TransactionSummary> </csw:TransactionResponse>
Example 16-15 Delete Request
Example 16-15 is a request to delete the record where the contributor value is equal to Jane
.
<csw:Transaction service="CSW" version="2.0.0" xmlns:csw="http://www.opengis.net/cat/csw" xmlns:dc="http://www.purl.org/dc/elements/1.1/" xmlns:ogc="http://www.opengis.net/ogc"> <csw:Delete typeName="csw:Record"> <csw:Constraint version="2.0.0"> <ogc:Filter> <ogc:PropertyIsEqualTo> <ogc:PropertyName>/csw:Record/dc:contributor</ogc:PropertyName> <ogc:Literal>Jane</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter> </csw:Constraint> </csw:Delete> </csw:Transaction>
Example 16-16 Delete Response
Example 16-16 is the response from the request in Example 16-15.
<csw:TransactionResponse xmlns:csw="http://www.opengis.net/cat/csw" xmlns:dc="http://www.purl.org/dc/elements/1.1/" xmlns:dct="http://www.purl.org/dc/terms/"> <csw:TransactionSummary> <csw:totalDeleted>1</csw:totalDeleted> </csw:TransactionSummary> </csw:TransactionResponse>