Skip to content

Commit 4c80b35

Browse files
committed
feat: change include/exclude recommendations
1 parent 99e3612 commit 4c80b35

File tree

1 file changed

+27
-21
lines changed

1 file changed

+27
-21
lines changed

README.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,29 @@ name, e.g., `properties.datetime` or `datetime`.
7171

7272
## Include/Exclude Semantics
7373

74-
1. If `fields` attribute is specified with an empty object, or with both `include` and `exclude` set to null or an
75-
empty array, the recommended behavior is as if `include` was set to
76-
`["id", "type", "geometry", "bbox", "links", "assets", "properties.datetime"]`. This default is so that the entity
77-
returned is a valid STAC Item. Implementations may choose to add other properties, e.g., `created`, but the number
74+
1. If `fields` attribute is specified as an empty object, or with both `include` and `exclude` set to null or an
75+
empty array, then the recommended behavior is to `include` the following keys:
76+
`["id", "type", "geometry", "bbox", "links", "assets", "properties.datetime", "stac_version"]`.
77+
This default is so that the entity returned is a valid STAC Item.
78+
Implementations may choose to add other properties, e.g., `created`, but the number
7879
of default properties attributes should be kept to a minimum.
79-
2. If only `include` is specified, these attributes are added to the default set of attributes (set union operation).
80-
3. If only `exclude` is specified, these attributes are subtracted from the union of the default set of attributes and
81-
the `include` attributes (set difference operation). This will result in an entity that is not a valid Item if any
82-
of the excluded attributes are in the default set of attributes.
83-
4. If both `include` and `exclude` attributes are specified, semantics are that a field must be included and **not**
84-
excluded. E.g., if `properties` is included and `properties.datetime` is excluded, then `datetime` must not appear
85-
in the attributes of `properties`.
80+
2. If only `include` is specified, these attributes should be the only attributes included.
81+
3. If only `exclude` is specified, these attributes are subtracted from the full item.
82+
This may result in an entity that is not a valid STAC Item.
83+
4. If `exclude` is specified and `include` is null or an empty
84+
array, then the `exclude` attributes are subtracted from the default set.
85+
This may result in an entity that is not a valid STAC Item.
86+
5. If a key is in `exclude`, and a sub-key is in `include`, the sub-key should be included, but no other fields
87+
in the key should be included. E.g., if `properties` is excluded and `properties.datetime` is included, then `datetime`
88+
should be the only attribute in `properties`.
89+
6. If a key is in `include`, and a sub-key is in `exclude`, the key should be included, and the sub-key should be excluded.
90+
E.g., if `properties` is included and `properties.datetime` is excluded, then `datetime`
91+
should not be in `properties`.
92+
7. If the same attribute is present in both `include` and `exclude`, it should be included.
8693

8794
## Examples
8895

89-
Return baseline fields. This **must** return valid STAC Item entities.
96+
Return the default fields. This should return valid STAC Item entities.
9097

9198
Query Parameters
9299
```http
@@ -101,11 +108,11 @@ JSON
101108
}
102109
```
103110

104-
This has a similar effect as an empty object for `fields`, but it is up to the discretion of the implementation
111+
This has a similar effect as an empty object for `fields`, but it is up to the discretion of the implementation.
105112

106113
Query Parameters
107114
```http
108-
?fields=id,type,geometry,bbox,properties,links,assets
115+
?fields=id,type,geometry,bbox,properties.datetime,links,assets,stac_version
109116
```
110117

111118
JSON
@@ -117,15 +124,16 @@ JSON
117124
"type",
118125
"geometry",
119126
"bbox",
120-
"properties",
127+
"properties.datetime",
121128
"links",
122-
"assets"
129+
"assets",
130+
"stac_version",
123131
]
124132
}
125133
}
126134
```
127135

128-
Exclude `geometry` from the baseline fields. This **must** return an entity that is not a valid GeoJSON Feature or a valid STAC Item.
136+
Exclude `geometry` from the full item. This **must** return an entity that is not a valid GeoJSON Feature or a valid STAC Item.
129137

130138
Query Parameters
131139
```http
@@ -143,10 +151,8 @@ JSON
143151
}
144152
```
145153

146-
To return the `id`, `type`, `geometry`, and the Properties attribute `eo:cloud_cover`.
147-
This **must** return a valid STAC Item, as the includes are added to the default includes.
148-
Explicitly specifying `id`, `type`, and `geometry` has not effect as these are default fields,
149-
but `properties.eo:cloud_cover` is not a default field and thereby should be in the response.
154+
Return the `id`, `type`, `geometry`, and the Properties attribute `eo:cloud_cover`.
155+
This might not return a valid STAC Item, since not all required Item attributes are included.
150156

151157
Query Parameters
152158
```http

0 commit comments

Comments
 (0)