diff --git a/CHANGELOG.md b/CHANGELOG.md index abb1cdc..6a53296 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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]: diff --git a/README.md b/README.md index 00134d1..066997a 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 diff --git a/examples/collection.json b/examples/collection.json deleted file mode 100644 index 874027b..0000000 --- a/examples/collection.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "stac_version": "1.0.0", - "stac_extensions": [ - "https://stac-extensions.github.io/item-assets/v1.0.0/schema.json", - "https://github.com/DACCS-Climate/marble-stac-extension/v1.0.0/schema.json" - ], - "type": "Collection", - "id": "collection", - "title": "A title", - "description": "A description", - "license": "Apache-2.0", - "extent": { - "spatial": { - "bbox": [ - [ - 172.9, - 1.3, - 173, - 1.4 - ] - ] - }, - "temporal": { - "interval": [ - [ - "2015-06-23T00:00:00Z", - null - ] - ] - } - }, - "template:new_field": "test", - "template:xyz": { - "x": 1, - "y": 2, - "z": 3 - }, - "template:another_one": [ - 1, - 2, - 3 - ], - "assets": { - "example": { - "href": "https://example.com/examples/file.xyz", - "template:new_field": "test" - } - }, - "item_assets": { - "data": { - "roles": [ - "data" - ], - "template:new_field": "test" - } - }, - "summaries": { - "datetime": { - "minimum": "2015-06-23T00:00:00Z", - "maximum": "2019-07-10T13:44:56Z" - } - }, - "links": [ - { - "href": "https://example.com/examples/collection.json", - "rel": "self" - }, - { - "href": "https://example.com/examples/item.json", - "rel": "item" - } - ] -} diff --git a/examples/item.json b/examples/item.json index b8f9eb8..100f43c 100644 --- a/examples/item.json +++ b/examples/item.json @@ -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": [ { @@ -61,7 +52,7 @@ "assets": { "data": { "href": "https://example.com/examples/file.xyz", - "template:new_field": "test" + "marble:is_local": true } } } diff --git a/json-schema/schema.json b/json-schema/schema.json index 6595f22..54f2bf5 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -26,7 +26,8 @@ { "$comment": "Require fields here for Item Properties.", "required": [ - "template:new_field" + "marble:host_node", + "marble:is_local" ] }, { @@ -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": { @@ -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" } },