From 009e6a76a8efdff09f5044a86dbb7a3020af8ce7 Mon Sep 17 00:00:00 2001 From: pkdash Date: Sat, 16 Nov 2024 23:33:20 -0500 Subject: [PATCH] [#52] adding missing metadata models to markdown file generation script --- docs/ModelInstanceMetadata.md | 70 ++++++++++++++++++++++++++ docs/ModelProgramMetadata.md | 89 +++++++++++++++++++++++++++++++++ docs/generate_model_markdown.py | 16 +++++- 3 files changed, 173 insertions(+), 2 deletions(-) create mode 100644 docs/ModelInstanceMetadata.md create mode 100644 docs/ModelProgramMetadata.md diff --git a/docs/ModelInstanceMetadata.md b/docs/ModelInstanceMetadata.md new file mode 100644 index 0000000..216e5b5 --- /dev/null +++ b/docs/ModelInstanceMetadata.md @@ -0,0 +1,70 @@ +# Model Instance Aggregation Metadata + +## Properties + +- **`title`** *(string)*: A string containing a descriptive title for the aggregation. Default: `null`. +- **`subjects`** *(array)*: A list of keyword strings expressing the topic of the aggregation. Default: `[]`. + - **Items** *(string)* +- **`language`** *(string)*: The 3-character string for the language in which the metadata and content are expressed. Default: `"eng"`. +- **`additional_metadata`** *(array)*: A dictionary of additional metadata elements expressed as key-value pairs. + - **Items** *(object)*: A key-value pair. Default: `[]`. + - **`key`** *(string)* + - **`value`** *(string)* +- **`spatial_coverage`**: An object containing the geospatial coverage for the aggregation expressed as either a bounding box or point. Default: `null`. + - **Any of** + - : Refer to *[#/definitions/PointCoverage](#definitions/PointCoverage)*. + - : Refer to *[#/definitions/BoxCoverage](#definitions/BoxCoverage)*. + - *null* +- **`period_coverage`**: An object containing the temporal coverage for a aggregation expressed as a date range. Default: `null`. + - **Any of** + - : Refer to *[#/definitions/PeriodCoverage](#definitions/PeriodCoverage)*. + - *null* +- **`includes_model_output`** *(boolean)*: Indicates whether model output files are included in the aggregation. +- **`executed_by`**: A URL to the Model Program that can be used to execute this model instance. Default: `null`. + - **Any of** + - *string* + - *null* +- **`program_schema_json`**: A URL to the JSON metadata schema for the related model program. Default: `null`. + - **Any of** + - *string* + - *null* +- **`program_schema_json_values`**: A URL to a JSON file containing the metadata values conforming to the JSON metadata schema for the related model program. Default: `null`. + - **Any of** + - *string* + - *null* +- **`type`**: A string expressing the aggregation type from the list of HydroShare aggregation types. Default: `"ModelInstance"`. + - **All of** + - : Refer to *[#/definitions/AggregationType](#definitions/AggregationType)*. +- **`url`** *(string)*: An object containing the URL of the aggregation. +- **`rights`**: An object containing information about the rights held in and over the aggregation and the license under which a aggregation is shared. Default: `null`. + - **Any of** + - : Refer to *[#/definitions/Rights](#definitions/Rights)*. + - *null* +## Definitions + +- **`AggregationType`** *(string)*: Must be one of: `["Generic", "FileSet", "GeoRaster", "NetCDF", "GeoFeature", "RefTimeseries", "TimeSeries", "ModelProgram", "ModelInstance", "CSV"]`. +- **`BoxCoverage`** *(object)*: A class used to represent geographic coverage metadata for a resource or aggregation expressed as a +latitude-longitude bounding box. + - **`type`** *(string)*: A string containing the type of geographic coverage. Must be one of: `["box"]`. Default: `"box"`. + - **`name`** *(string)*: A string containing a name for the place associated with the geographic coverage. Default: `null`. + - **`northlimit`** *(number, required)*: A floating point value containing the constant coordinate for the northernmost face or edge of the bounding box. Exclusive minimum: `-90.0`. Exclusive maximum: `90.0`. + - **`eastlimit`** *(number, required)*: A floating point value containing the constant coordinate for the easternmost face or edge of the bounding box. Exclusive minimum: `-180.0`. Exclusive maximum: `180.0`. + - **`southlimit`** *(number, required)*: A floating point value containing the constant coordinate for the southernmost face or edge of the bounding box. Exclusive minimum: `-90.0`. Exclusive maximum: `90.0`. + - **`westlimit`** *(number, required)*: A floating point value containing the constant coordinate for the westernmost face or edge of the bounding box. Exclusive minimum: `-180.0`. Exclusive maximum: `180.0`. + - **`units`** *(string, required)*: A string containing the units applying to the unlabelled numeric values of northlimit, eastlimit, southlimit, and westlimit. + - **`projection`** *(string)*: A string containing the name of the projection used with any parameters required, such as ellipsoid parameters, datum, standard parallels and meridians, zone, etc. Default: `null`. +- **`PeriodCoverage`** *(object)*: A class used to represent temporal coverage metadata for a resource or aggregation. + - **`name`** *(string)*: A string containing a name for the time interval. Default: `null`. + - **`start`** *(string, required)*: A datetime object containing the instant corresponding to the commencement of the time interval. + - **`end`** *(string, required)*: A datetime object containing the instant corresponding to the termination of the time interval. +- **`PointCoverage`** *(object)*: A class used to represent geographic coverage metadata for a resource or aggregation expressed as a +point location. + - **`type`** *(string)*: A string containing the type of geographic coverage. Must be one of: `["point"]`. Default: `"point"`. + - **`name`** *(string)*: A string containing a name for the place associated with the geographic coverage. Default: `null`. + - **`east`** *(number, required)*: The coordinate of the point location measured in the east direction. Exclusive minimum: `-180.0`. Exclusive maximum: `180.0`. + - **`north`** *(number, required)*: The coordinate of the point location measured in the north direction. Exclusive minimum: `-90.0`. Exclusive maximum: `90.0`. + - **`units`** *(string, required)*: The units applying to the unlabelled numeric values of north and east. + - **`projection`** *(string, required)*: The name of the projection used with any parameters required, such as ellipsoid parameters, datum, standard parallels and meridians, zone, etc. +- **`Rights`** *(object)*: A class used to represent the rights statement metadata associated with a resource. + - **`statement`** *(string, required)*: A string containing the text of the license or rights statement. + - **`url`** *(string, required)*: An object containing the URL pointing to a description of the license or rights statement. diff --git a/docs/ModelProgramMetadata.md b/docs/ModelProgramMetadata.md new file mode 100644 index 0000000..92cae43 --- /dev/null +++ b/docs/ModelProgramMetadata.md @@ -0,0 +1,89 @@ +# Model Program Aggregation Metadata + +## Properties + +- **`title`** *(string)*: A string containing a descriptive title for the aggregation. Default: `null`. +- **`subjects`** *(array)*: A list of keyword strings expressing the topic of the aggregation. Default: `[]`. + - **Items** *(string)* +- **`language`** *(string)*: The 3-character string for the language in which the metadata and content are expressed. Default: `"eng"`. +- **`additional_metadata`** *(array)*: A dictionary of additional metadata elements expressed as key-value pairs. + - **Items** *(object)*: A key-value pair. Default: `[]`. + - **`key`** *(string)* + - **`value`** *(string)* +- **`spatial_coverage`**: An object containing the geospatial coverage for the aggregation expressed as either a bounding box or point. Default: `null`. + - **Any of** + - : Refer to *[#/definitions/PointCoverage](#definitions/PointCoverage)*. + - : Refer to *[#/definitions/BoxCoverage](#definitions/BoxCoverage)*. + - *null* +- **`period_coverage`**: An object containing the temporal coverage for a aggregation expressed as a date range. Default: `null`. + - **Any of** + - : Refer to *[#/definitions/PeriodCoverage](#definitions/PeriodCoverage)*. + - *null* +- **`version`**: The software version or build number of the model. Default: `null`. + - **Any of** + - *string* + - *null* +- **`programming_languages`** *(array)*: The programming languages that the model is written in. Length must be at most 100. Default: `[]`. + - **Items** *(string)* +- **`operating_systems`** *(array)*: Compatible operating systems to setup and run the model. Length must be at most 100. Default: `[]`. + - **Items** *(string)* +- **`release_date`**: The date that this version of the model was released. Default: `null`. + - **Any of** + - *string* + - *null* +- **`website`**: A URL to a website describing the model that is maintained by the model developers. Default: `null`. + - **Any of** + - *string* + - *null* +- **`code_repository`**: A URL to the source code repository for the model code (e.g., git, mercurial, svn, etc.). Default: `null`. + - **Any of** + - *string* + - *null* +- **`file_types`** *(array)*: File types used by the model program. Default: `[]`. + - **Items**: Refer to *[#/definitions/ModelProgramFile](#definitions/ModelProgramFile)*. +- **`program_schema_json`**: A url to the JSON metadata schema for the model program. Default: `null`. + - **Any of** + - *string* + - *null* +- **`type`**: A string expressing the aggregation type from the list of HydroShare aggregation types. Default: `"ModelProgram"`. + - **All of** + - : Refer to *[#/definitions/AggregationType](#definitions/AggregationType)*. +- **`url`** *(string)*: An object containing the URL of the aggregation. +- **`rights`**: An object containing information about the rights held in and over the aggregation and the license under which a aggregation is shared. Default: `null`. + - **Any of** + - : Refer to *[#/definitions/Rights](#definitions/Rights)*. + - *null* +## Definitions + +- **`AggregationType`** *(string)*: Must be one of: `["Generic", "FileSet", "GeoRaster", "NetCDF", "GeoFeature", "RefTimeseries", "TimeSeries", "ModelProgram", "ModelInstance", "CSV"]`. +- **`BoxCoverage`** *(object)*: A class used to represent geographic coverage metadata for a resource or aggregation expressed as a +latitude-longitude bounding box. + - **`type`** *(string)*: A string containing the type of geographic coverage. Must be one of: `["box"]`. Default: `"box"`. + - **`name`** *(string)*: A string containing a name for the place associated with the geographic coverage. Default: `null`. + - **`northlimit`** *(number, required)*: A floating point value containing the constant coordinate for the northernmost face or edge of the bounding box. Exclusive minimum: `-90.0`. Exclusive maximum: `90.0`. + - **`eastlimit`** *(number, required)*: A floating point value containing the constant coordinate for the easternmost face or edge of the bounding box. Exclusive minimum: `-180.0`. Exclusive maximum: `180.0`. + - **`southlimit`** *(number, required)*: A floating point value containing the constant coordinate for the southernmost face or edge of the bounding box. Exclusive minimum: `-90.0`. Exclusive maximum: `90.0`. + - **`westlimit`** *(number, required)*: A floating point value containing the constant coordinate for the westernmost face or edge of the bounding box. Exclusive minimum: `-180.0`. Exclusive maximum: `180.0`. + - **`units`** *(string, required)*: A string containing the units applying to the unlabelled numeric values of northlimit, eastlimit, southlimit, and westlimit. + - **`projection`** *(string)*: A string containing the name of the projection used with any parameters required, such as ellipsoid parameters, datum, standard parallels and meridians, zone, etc. Default: `null`. +- **`ModelProgramFile`** *(object)*: A class used to represent the metadata associated with a file used by a model program aggregation. + - **`type`**: The type of the file used by the model program. + - **All of** + - : Refer to *[#/definitions/ModelProgramFileType](#definitions/ModelProgramFileType)*. + - **`url`** *(string, required)*: The url of the file used by the model program. +- **`ModelProgramFileType`** *(string)*: Must be one of: `["https://www.hydroshare.org/terms/modelReleaseNotes", "https://www.hydroshare.org/terms/modelDocumentation", "https://www.hydroshare.org/terms/modelSoftware", "https://www.hydroshare.org/terms/modelEngine"]`. +- **`PeriodCoverage`** *(object)*: A class used to represent temporal coverage metadata for a resource or aggregation. + - **`name`** *(string)*: A string containing a name for the time interval. Default: `null`. + - **`start`** *(string, required)*: A datetime object containing the instant corresponding to the commencement of the time interval. + - **`end`** *(string, required)*: A datetime object containing the instant corresponding to the termination of the time interval. +- **`PointCoverage`** *(object)*: A class used to represent geographic coverage metadata for a resource or aggregation expressed as a +point location. + - **`type`** *(string)*: A string containing the type of geographic coverage. Must be one of: `["point"]`. Default: `"point"`. + - **`name`** *(string)*: A string containing a name for the place associated with the geographic coverage. Default: `null`. + - **`east`** *(number, required)*: The coordinate of the point location measured in the east direction. Exclusive minimum: `-180.0`. Exclusive maximum: `180.0`. + - **`north`** *(number, required)*: The coordinate of the point location measured in the north direction. Exclusive minimum: `-90.0`. Exclusive maximum: `90.0`. + - **`units`** *(string, required)*: The units applying to the unlabelled numeric values of north and east. + - **`projection`** *(string, required)*: The name of the projection used with any parameters required, such as ellipsoid parameters, datum, standard parallels and meridians, zone, etc. +- **`Rights`** *(object)*: A class used to represent the rights statement metadata associated with a resource. + - **`statement`** *(string, required)*: A string containing the text of the license or rights statement. + - **`url`** *(string, required)*: An object containing the URL pointing to a description of the license or rights statement. diff --git a/docs/generate_model_markdown.py b/docs/generate_model_markdown.py index d02cc76..09c5a5d 100644 --- a/docs/generate_model_markdown.py +++ b/docs/generate_model_markdown.py @@ -3,8 +3,18 @@ import json from hsmodels.schemas.resource import ResourceMetadata -from hsmodels.schemas.aggregations import FileSetMetadata, GeographicRasterMetadata, GeographicFeatureMetadata, \ - MultidimensionalMetadata, ReferencedTimeSeriesMetadata, SingleFileMetadata, TimeSeriesMetadata, CSVFileMetadata +from hsmodels.schemas.aggregations import ( + FileSetMetadata, + GeographicRasterMetadata, + GeographicFeatureMetadata, + MultidimensionalMetadata, + ReferencedTimeSeriesMetadata, + SingleFileMetadata, + TimeSeriesMetadata, + ModelProgramMetadata, + ModelInstanceMetadata, + CSVFileMetadata, +) aggregation_models = [ ResourceMetadata, @@ -15,6 +25,8 @@ ReferencedTimeSeriesMetadata, SingleFileMetadata, TimeSeriesMetadata, + ModelProgramMetadata, + ModelInstanceMetadata, CSVFileMetadata ]