Skip to content

Commit

Permalink
[#8] Renaming some schema model classes
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdash committed Jun 20, 2024
1 parent 1183e82 commit ee5b2a9
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions hsextract/models/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,20 +530,8 @@ class CoreMetadata(SchemaBaseModel):
citation: Optional[List[str]] = Field(title="Citation", description="A bibliographic citation for the resource.")


class DatasetMetadata(CoreMetadata):
# used only for generating the JSON-LD schema for a dataset.
variableMeasured: Optional[List[Union[str, PropertyValue]]] = Field(
title="Variables measured", description="Measured variables."
)
additionalProperty: Optional[List[PropertyValue]] = Field(
title="Additional properties",
default=[],
description="Additional properties of the Dataset."
)
sourceOrganization: Optional[Organization] = Field(
title="Source organization",
description="The organization that provided the data for this dataset."
)
class HSResourceMetadata(CoreMetadata):
pass


class CoreMetadataDOC(CoreMetadata):
Expand All @@ -560,11 +548,11 @@ class Settings:
}


class DatasetMetadataDOC(CoreMetadataDOC, DatasetMetadata):
class HSResourceMetadataDOC(CoreMetadataDOC, HSResourceMetadata):
pass


class BaseAggregationMetadata(BaseModel):
class _BaseAggregationMetadata(BaseModel):
"""Base class for aggregation metadata - used for metadata view in UI."""

context: HttpUrl = Field(
Expand Down Expand Up @@ -617,7 +605,7 @@ class BaseAggregationMetadata(BaseModel):
)


class NetCDFAggregationMetadata(BaseAggregationMetadata):
class NetCDFAggregationMetadata(_BaseAggregationMetadata):
additionalType: str = Field(
default="Multidimensional Dataset",
const=True,
Expand All @@ -628,23 +616,23 @@ class NetCDFAggregationMetadata(BaseAggregationMetadata):
)


class RasterAggregationMetadata(BaseAggregationMetadata):
class RasterAggregationMetadata(_BaseAggregationMetadata):
additionalType: str = Field(
default="Geo Raster Dataset",
const=True,
description="Additional type of aggregation."
)


class FeatureAggregationMetadata(BaseAggregationMetadata):
class FeatureAggregationMetadata(_BaseAggregationMetadata):
additionalType: str = Field(
default="Geo Feature Dataset",
const=True,
description="Additional type of aggregation."
)


class TimeseriesAggregationMetadata(BaseAggregationMetadata):
class TimeseriesAggregationMetadata(_BaseAggregationMetadata):
additionalType: str = Field(
default="Timeseries Dataset",
const=True,
Expand Down

0 comments on commit ee5b2a9

Please sign in to comment.