@@ -71,44 +71,56 @@ name, e.g., `properties.datetime` or `datetime`.
71
71
72
72
## Include/Exclude Semantics
73
73
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 (for POST requests), an empty string (for GET requests),
75
+ or with both ` include ` and ` exclude ` set to null or an
76
+ empty array, then the recommended behavior is to ` include ` the following keys:
77
+ ` ["id", "type", "geometry", "bbox", "links", "assets", "properties.datetime", "stac_version"] ` .
78
+ This default is so that the entity returned is a valid STAC Item.
79
+ Implementations may choose to add other properties, e.g., ` properties.created ` , but the number
78
80
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 ` .
81
+ 2 . If only ` include ` is specified, these attributes should be the only attributes included.
82
+ 3 . If only ` exclude ` is specified, these attributes are subtracted from the full item.
83
+ This may result in an entity that is not a valid STAC Item.
84
+ 4 . If ` exclude ` is specified and ` include ` is null or an empty
85
+ array, then the ` exclude ` attributes are subtracted from the default set.
86
+ This may result in an entity that is not a valid STAC Item.
87
+ 5 . If a key is in ` exclude ` , and a sub-key is in ` include ` , the sub-key should be included, but no other fields
88
+ in the key should be included. E.g., if ` properties ` is excluded and ` properties.datetime ` is included, then ` datetime `
89
+ should be the only attribute in ` properties ` .
90
+ 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.
91
+ E.g., if ` properties ` is included and ` properties.datetime ` is excluded, then ` datetime `
92
+ should not be in ` properties ` .
93
+ 7 . If the same attribute is present in both ` include ` and ` exclude ` , it should be included.
86
94
87
95
## Examples
88
96
89
- Return baseline fields. This ** must ** return valid STAC Item entities.
97
+ Return the default fields. This should return valid STAC Item entities.
90
98
91
99
Query Parameters
92
- ``` http
100
+
101
+ ``` text
93
102
?fields=
94
103
```
95
104
96
105
JSON
106
+
97
107
``` json
98
108
{
99
109
"fields" : {
100
110
}
101
111
}
102
112
```
103
113
104
- This has a similar effect as an empty object for ` fields ` , but it is up to the discretion of the implementation
114
+ This has a similar effect as an empty object for ` fields ` , but it is up to the discretion of the implementation.
105
115
106
116
Query Parameters
107
- ``` http
108
- ?fields=id,type,geometry,bbox,properties,links,assets
117
+
118
+ ``` text
119
+ ?fields=id,type,geometry,bbox,properties.datetime,links,assets,stac_version
109
120
```
110
121
111
122
JSON
123
+
112
124
``` json
113
125
{
114
126
"fields" : {
@@ -117,22 +129,25 @@ JSON
117
129
" type" ,
118
130
" geometry" ,
119
131
" bbox" ,
120
- " properties" ,
132
+ " properties.datetime " ,
121
133
" links" ,
122
- " assets"
134
+ " assets" ,
135
+ " stac_version" ,
123
136
]
124
137
}
125
138
}
126
139
```
127
140
128
- Exclude ` geometry ` from the baseline fields . This ** must** return an entity that is not a valid GeoJSON Feature or a valid STAC Item.
141
+ Exclude ` geometry ` from the full item . This ** must** return an entity that is not a valid GeoJSON Feature or a valid STAC Item.
129
142
130
143
Query Parameters
131
- ``` http
144
+
145
+ ``` text
132
146
?fields=-geometry
133
147
```
134
148
135
149
JSON
150
+
136
151
``` json
137
152
{
138
153
"fields" : {
@@ -143,17 +158,17 @@ JSON
143
158
}
144
159
```
145
160
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.
161
+ Return the ` id ` , ` type ` , ` geometry ` , and the Properties attribute ` eo:cloud_cover ` .
162
+ This might not return a valid STAC Item, since not all required Item attributes are included.
150
163
151
164
Query Parameters
152
- ``` http
165
+
166
+ ``` text
153
167
?fields=id,type,geometry,properties.eo:cloud_cover
154
168
```
155
169
156
170
JSON
171
+
157
172
``` json
158
173
{
159
174
"fields" : {
@@ -170,16 +185,19 @@ JSON
170
185
To include ` id ` and all the properties fields, except for the ` foo ` field.
171
186
172
187
Query Parameters
173
- ``` http
188
+
189
+ ``` text
174
190
?fields=id,properties,-properties.foo
175
191
```
176
192
177
193
also valid:
178
- ``` http
194
+
195
+ ``` text
179
196
?fields=+id,+properties,-properties.foo
180
197
```
181
198
182
199
JSON
200
+
183
201
``` json
184
202
{
185
203
"fields" : {
0 commit comments