Skip to content

Commit

Permalink
docs: update query documentation for DESC date (MAPCO-2922) (#68)
Browse files Browse the repository at this point in the history
* docs: update query documentation for DESC date

* docs: update query documentation

* docs: update query documentation

* chore: make DESC bold

---------

Co-authored-by: Asaf Masa <ASAFMAS@rafael.co.il>
  • Loading branch information
asafMasa and asafmas-rnd authored Dec 7, 2023
1 parent 07293dd commit 14712b3
Showing 1 changed file with 50 additions and 14 deletions.
64 changes: 50 additions & 14 deletions docs/ogc/protocols/examples/ogc-csw-query-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ GET request
http://localhost:8080/csw?request=GetCapabilities&service=CSW
```

## Query by field value
## Query by ***IsEqualTo*** value
How to query the catalog by **specific property** and his **value**
```xml
POST request
Expand All @@ -55,30 +55,28 @@ outputSchema="http://schema.mapcolonies.com/raster" version="2.0.2" xmlns:mc="[S
<csw:ElementSetName>full</csw:ElementSetName>
<csw:Constraint version="1.1.0">
<Filter xmlns="http://www.opengis.net/ogc">
<PropertyIsLike wildCard="%" singleChar="_" escapeChar="\\">

<PropertyIsEqualTo matchCase="true">
<!-- ****** INSERT PROFILE FIELD NAME START ********************** -->
<PropertyName>mc:productId</PropertyName>
<!-- ****** INSERT PROFILE FIELD NAME END ********************** -->

<!-- ****** INSERT PROFILE FIELD VALUE START ********************** -->
<Literal>MAS_6_ORT</Literal>
<!-- ****** INSERT PROFILE FIELD VALUE END ********************** -->

</PropertyIsLike>
</PropertyIsEqualTo>
</Filter>
</csw:Constraint>
</csw:Query>
</csw:GetRecords>
```
above example declare a query for `mc:productId` field in catalog and response with the full metadata of `MAS_6_ORT match` result.
Above example declare a query for `mc:productId` field in catalog and response with the full metadata of `MAS_6_ORT match` result.

`maxRecords` attribute in `<csw:GetRecords></csw:GetRecords>`element is equals to "1" means response will contain only 1 result.

`startPosition` will display records from all result start from the first one to the `maxRecords` value
***(1 to 1 in example)***.

## Query by ***IsEqualTo*** value
## Query by field value
How to query the catalog by **specific property** and his **value**
```xml
POST request
Expand All @@ -97,15 +95,17 @@ outputSchema="http://schema.mapcolonies.com/raster" version="2.0.2" xmlns:mc="[S
<csw:ElementSetName>full</csw:ElementSetName>
<csw:Constraint version="1.1.0">
<Filter xmlns="http://www.opengis.net/ogc">
<PropertyIsEqualTo matchCase="true">
<PropertyIsLike wildCard="%" singleChar="_" escapeChar="\\">

<!-- ****** INSERT PROFILE FIELD NAME START ********************** -->
<PropertyName>mc:productId</PropertyName>
<!-- ****** INSERT PROFILE FIELD NAME END ********************** -->

<!-- ****** INSERT PROFILE FIELD VALUE START ********************** -->
<Literal>MAS_6_ORT</Literal>
<!-- ****** INSERT PROFILE FIELD VALUE END ********************** -->
</PropertyIsEqualTo>

</PropertyIsLike>
</Filter>
</csw:Constraint>
</csw:Query>
Expand Down Expand Up @@ -216,7 +216,7 @@ outputSchema="http://schema.mapcolonies.com/raster" version="2.0.2" xmlns:mc="[S
</csw:Query>
</csw:GetRecords>
```
Response will contain up to 10 records (`maxRecords="10"`) that their ingestion date is Greater or Equal
Response will contain up to 10 records (`maxRecords="10"`) that their **ingestion date** is Greater or Equal **2020-09-03T00:00:01Z**

```xml
<PropertyIsGreaterThanOrEqualTo></<PropertyIsGreaterThanOrEqualTo>
Expand All @@ -241,7 +241,7 @@ outputSchema="http://schema.mapcolonies.com/raster" version="2.0.2" xmlns:mc="[S
</csw:Query>
</csw:GetRecords>
```
Response will contain up to 10 records (maxRecords="10") that their ingestion date is Less or Equal
Response will contain up to 10 records (maxRecords="10") that their **ingestion date** is Less or Equal **2022-09-03T00:00:01Z**
```xml
<PropertyIsLessThanOrEqualTo></<PropertyIsLessThanOrEqualTo>
```
Expand Down Expand Up @@ -272,7 +272,7 @@ outputSchema="http://schema.mapcolonies.com/raster" version="2.0.2" xmlns:mc="[S
</csw:Query>
</csw:GetRecords>
```
Response will contain up to 10 records (maxRecords="10") that includes product version `"4.0"` and their ingestion date is Less than the desired date.
Response will contain up to 10 records (maxRecords="10") that includes product version `"4.0"` and their ingestion date is Less than the desired date **2022-09-03T00:00:01Z** .

## Query by ***BBOX***
```xml
Expand All @@ -295,7 +295,7 @@ outputSchema="http://schema.mapcolonies.com/raster" version="2.0.2" xmlns:mc="[S
</csw:Query>
</csw:GetRecords>
```
Response will contain up to 10 records ('maxRecords="10"') that their **BBOX** includes in the desired extent (in example: -180, -190, 180, 90
Response will contain up to 10 records ('maxRecords="10"') that their **BBOX** includes in the desired extent (in example: -180, -190, 180, 90)

## Query by ***BBOX*** and ***region***
```xml
Expand Down Expand Up @@ -324,4 +324,40 @@ outputSchema="http://schema.mapcolonies.com/raster" version="2.0.2" xmlns:mc="[S
</csw:Query>
</csw:GetRecords>
```
Response will contain up to 10 records ('maxRecords="10"') that their **BBOX includes includes in the desired extent and their region is contains the word “ירדן”** (`<Literal>%ירדן%</Literal>`)
Response will contain up to 10 records ('maxRecords="10"') that their **BBOX includes in the desired extent and their region is contains the word “ירדן”** (`<Literal>%ירדן%</Literal>`)


## Query by ***productType***, ***ingestionDate*** and ***maxResolutionDeg*** ordered by ***DESC ingestionDate***
```xml
<?xml version="1.0" encoding="UTF-8"?>
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:ogc="http://www.opengis.net/ogc" service="CSW" maxRecords="100" startPosition="1" outputSchema="http://schema.mapcolonies.com/raster" version="2.0.2" xmlns:mc="http://schema.mapcolonies.com/raster" >
<csw:Query typeNames="mc:MCRasterRecord">
<csw:ElementSetName>full</csw:ElementSetName>
<csw:Constraint version="1.1.0">
<Filter xmlns="http://www.opengis.net/ogc">
<And>
<PropertyIsEqualTo>
<PropertyName>mc:productType</PropertyName>
<Literal>Orthophoto</Literal>
</PropertyIsEqualTo>
<PropertyIsGreaterThan>
<PropertyName>mc:ingestionDate</PropertyName>
<Literal>2023-10-15T00:00:01Z</Literal>
</PropertyIsGreaterThan>
<PropertyIsLessThanOrEqualTo>
<PropertyName>mc:maxResolutionDeg</PropertyName>
<Literal>5.36441E-06</Literal>
</PropertyIsLessThanOrEqualTo>
</And>
</Filter>
</csw:Constraint>
<ogc:SortBy>
<ogc:SortProperty>
<ogc:PropertyName>mc:ingestionDate</ogc:PropertyName>
<ogc:SortOrder>DESC</ogc:SortOrder>
</ogc:SortProperty>
</ogc:SortBy>
</csw:Query>
</csw:GetRecords>
```
Response will contain up to 100 records ('maxRecords="100"') that their **productType** is **'Orthophoto'**, **maxResolutionDeg** is less than **'5.36441E-06'** ordered by **DESC ingestionDate** after **'2023-10-15T00:00:01Z'**

0 comments on commit 14712b3

Please sign in to comment.