Skip to content

Commit

Permalink
Merge pull request #1 from DACCS-Climate/baseline-impl
Browse files Browse the repository at this point in the history
Implementation of extension
  • Loading branch information
dchandan authored Mar 11, 2024
2 parents 7e1f49a + 3b51b1f commit 6e94d8b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 216 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- Added baseline implementation for a v1.0.0 that includes fields `marble:host_node` and `marble:is_local`
- Initial README.md

[Unreleased]: <https://github.com/DACCS-Climate/marble-stac-extension/compare/v1.0.0...HEAD>
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ that describe the location of data on the Marble Network/Platform.

- Examples:
- [Item example](examples/item.json): Shows the basic usage of the extension in a STAC Item
- [Collection example](examples/collection.json): Shows the basic usage of the extension in a STAC Collection
- [JSON Schema](json-schema/schema.json)
- [Changelog](./CHANGELOG.md)

Expand All @@ -36,8 +35,8 @@ The fields in the table below can be used in these parts of STAC documents:

#### marble:host_node

This is a controlled vocabulary and the values can be one of the node names currently available in the
[Marble node registry](https://github.com/DACCS-Climate/Marble-node-registry).
This is a controlled vocabulary and the values can be one of the host IDs (not its display name or some other identifier)
currently available in the [Marble node registry](https://github.com/DACCS-Climate/Marble-node-registry).

#### marble:is_local

Expand Down
73 changes: 0 additions & 73 deletions examples/collection.json

This file was deleted.

15 changes: 3 additions & 12 deletions examples/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,8 @@
},
"properties": {
"datetime": "2020-12-11T22:38:32Z",
"template:new_field": "test",
"template:xyz": {
"x": 1,
"y": 2,
"z": 3
},
"template:another_one": [
1,
2,
3
]
"marble:host_node": "UofTRedOak",
"marble:is_local": true
},
"links": [
{
Expand All @@ -61,7 +52,7 @@
"assets": {
"data": {
"href": "https://example.com/examples/file.xyz",
"template:new_field": "test"
"marble:is_local": true
}
}
}
140 changes: 12 additions & 128 deletions json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
{
"$comment": "Require fields here for Item Properties.",
"required": [
"template:new_field"
"marble:host_node",
"marble:is_local"
]
},
{
Expand All @@ -44,102 +45,6 @@
}
}
]
},
{
"$comment": "This is the schema for STAC Collections.",
"type": "object",
"allOf": [
{
"required": [
"type"
],
"properties": {
"type": {
"const": "Collection"
}
}
},
{
"$ref": "#/definitions/stac_extensions"
}
],
"anyOf": [
{
"$comment": "This is the schema for the top-level fields in a Collection. Remove this if this extension does not define top-level fields for Collections.",
"allOf": [
{
"$comment": "Require fields here for Collections (top-level).",
"required": [
"template:new_field"
]
},
{
"$ref": "#/definitions/fields"
}
]
},
{
"$comment": "This validates the fields in Collection Assets, but does not require them.",
"required": [
"assets"
],
"properties": {
"assets": {
"type": "object",
"not": {
"additionalProperties": {
"not": {
"allOf": [
{
"$ref": "#/definitions/require_any_field"
},
{
"$ref": "#/definitions/fields"
}
]
}
}
}
}
}
},
{
"$comment": "This is the schema for the fields in Item Asset Definitions. It doesn't require any fields.",
"required": [
"item_assets"
],
"properties": {
"item_assets": {
"type": "object",
"not": {
"additionalProperties": {
"not": {
"allOf": [
{
"$ref": "#/definitions/require_any_field"
},
{
"$ref": "#/definitions/fields"
}
]
}
}
}
}
}
},
{
"$comment": "This is the schema for the fields in Summaries. By default, only checks the existence of the properties, but not the schema of the summaries.",
"required": [
"summaries"
],
"properties": {
"summaries": {
"$ref": "#/definitions/require_any_field"
}
}
}
]
}
],
"definitions": {
Expand All @@ -160,46 +65,25 @@
"require_any_field": {
"$comment": "Please list all fields here so that we can force the existence of one of them in other parts of the schemas.",
"anyOf": [
{"required": ["template:new_field"]},
{"required": ["template:xyz"]},
{"required": ["template:another_one"]}
{"required": ["marble:host_node"]},
{"required": ["marble:is_local"]}
]
},
"fields": {
"$comment": "Add your new fields here. Don't require them here, do that above in the corresponding schema.",
"type": "object",
"properties": {
"template:new_field": {
"type": "string"
"marble:host_node": {
"title": "Marble node hosting this data",
"type": "string",
"pattern": "^[a-zA-Z0-9]+$"
},
"template:xyz": {
"type": "object",
"required": [
"x",
"y",
"z"
],
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
}
},
"template:another_one": {
"type": "array",
"items": {
"type": "number"
}
"marble:is_local": {
"title": "Data locality identifier",
"type": "boolean"
}
},
"patternProperties": {
"^(?!template:)": {
"^(?!marble:)": {
"$comment": "Above, change `template` to the prefix of this extension"
}
},
Expand Down

0 comments on commit 6e94d8b

Please sign in to comment.