Skip to content

Commit c9d6b27

Browse files
authored
Merge pull request #2 from stac-api-extensions/pv/fields-names-semantics
clarify that field names can be prefixed with properties or not
2 parents 4ead48c + fd7d346 commit c9d6b27

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased] - TBD
88

9+
### Fixed
10+
11+
- Clarify that the names for fields can either be prefixed by `properties` or not.
12+
913
## [v1.0.0-rc.1](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-rc.1) - 2022-03-17
1014

1115
None

README.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
1-
# STAC API - Fields Fragment
1+
# STAC API - Fields Extension
22

33
- **OpenAPI specification:** [openapi.yaml](openapi.yaml)
44
- **Conformance Classes:**
55
- `STAC API - Item Search` binding: <https://api.stacspec.org/v1.0.0-rc.1/item-search#fields>
66
- `STAC API - Features` binding: <https://api.stacspec.org/v1.0.0-rc.1/ogcapi-features#fields>
7-
- **Extension [Maturity Classification](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-rc.1/README.md#maturity-classification):** Candidate
7+
- **Extension [Maturity Classification](https://github.com/radiantearth/stac-api-spec/tree/main/README.md#maturity-classification):** Candidate
88
- **Dependencies:**
99
- [STAC API - Item Search](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-rc.1/item-search)
1010
- [STAC API - Features](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-rc.1/ogcapi-features)
1111

12-
STAC API by default returns every attribute in an item. However, Item objects can have hundreds of fields, or incredibly large
13-
geometries, and even smaller Item objects can get big when millions are requested but not all information is used. This
14-
fragment provides a mechanism for clients to request that servers to explicitly include or exclude certain fields.
12+
By default, STAC API endpoints that return Item objects return every field of those Items. However,
13+
Item objects can have hundreds of fields, or large
14+
geometries, and even smaller Item objects can add up when large numbers of them are in results. Frequently, not all
15+
fields in an Item are used, so this
16+
specification provides a mechanism for clients to request that servers to explicitly include or exclude certain fields.
1517

16-
This fragment may be bound to either or both of
18+
This behavior may be bound to either or both of
1719
[STAC API - Item Search](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-rc.1/item-search) (`/search` endpoint) or
18-
[STAC API - Features](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-rc.1/ogcapi-features) (`/collections/{collectionId}/items` endpoint) by
19-
advertising the relevant conformance class.
20+
[STAC API - Features](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-rc.1/ogcapi-features)
21+
(`/collections/{collectionId}/items` endpoint) by advertising the relevant conformance class.
2022

2123
When used in a POST request with `Content-Type: application/json`, this adds an attribute `fields` with
2224
an object value to the core JSON search request body. The `fields` object contains two attributes with string array
2325
values, `include` and `exclude`.
2426

25-
When used with GET or POST with `Content-Type: application/x-www-form-urlencoded` or
26-
`Content-Type: multipart/form-data`, the semantics are the same, except the syntax is a single parameter `fields` with
27+
When used with GET, the semantics are the same, except the syntax is a single parameter `fields` with
2728
a comma-separated list of attribute names, where `exclude` values are those prefixed by a `-` and `include` values are
2829
those with no prefix, e.g., `-geometry`, or `id,-geometry,properties`.
2930

@@ -39,8 +40,8 @@ Implementations are also not required to implement semantics for nested values w
3940
exclude attributes of that object, e.g., include `properties` but exclude `properties.datetime`.
4041

4142
No error must be returned if a specified field has no value for it in the catalog. For example, if the attribute
42-
"properties.eo:cloud_cover" is specified but there is no cloud cover value for an Item or the API does not even
43-
support the EO Extension, a successful HTTP response must be returned and the Item entities will not contain that
43+
"properties.eo:cloud_cover" is specified but there is no cloud cover value for an Item, a successful HTTP response
44+
must be returned and the Item entities will not contain that
4445
attribute.
4546

4647
If no `fields` are specified, the response is **must** be a valid
@@ -50,7 +51,13 @@ and `geometry` are excluded, the entity will not even be a valid GeoJSON Feature
5051
will not be a valid STAC Item.
5152

5253
Implementations may return attributes not specified, e.g., id, but must avoid anything other than a minimal entity
53-
representation.
54+
representation.
55+
56+
This specification does not yet require the implementation of an "-ables" endpoint (like CQL2 does for queryables)
57+
that defines the names of the
58+
fields that can be selected, so implementations must provide this out-of-band. Implementers may choose to require
59+
fields in Item Properties to be prefixed with `properties.` or not, or support use of both the prefixed and non-prefixed
60+
name, e.g., `properties.datetime` or `datetime`.
5461

5562
## Include/Exclude Semantics
5663

0 commit comments

Comments
 (0)