diff --git a/README.md b/README.md
index cab5b48..61d5f73 100644
--- a/README.md
+++ b/README.md
@@ -39,8 +39,24 @@ poetry run docs
+
+
## Schemas
+ [Area Extraction](#Area-Extraction)
+ [Cog Metadata](#Cog-Metadata)
+ [Document](#Document)
+ [Feature Results](#Feature-Results)
+ [Georeference](#Georeference)
+ [Line Feature](#Line-Feature)
+ [Map](#Map)
+ [Map Results](#Map-Results)
+ [Metadata](#Metadata)
+ [Mineral](#Mineral)
+ [Point Feature](#Point-Feature)
+ [Polygon Feature](#Polygon-Feature)
+
+
### Area Extraction
@@ -63,13 +79,6 @@ classDiagram
Correlation_Diagram: str = 'Correlation_Diagram'
}
- class GeomType {
- <>
- Point: str = 'Point'
- LineString: str = 'LineString'
- Polygon: str = 'Polygon'
- }
-
class Area_Extraction {
type: GeomType = GeomType.Polygon
coordinates: list[list[list[Union[float, int]]]]
@@ -81,6 +90,13 @@ classDiagram
model_version: Optional[str]
}
+ class GeomType {
+ <>
+ Point: str = 'Point'
+ LineString: str = 'LineString'
+ Polygon: str = 'Polygon'
+ }
+
Area_Extraction ..> AreaType
Area_Extraction ..> GeomType
@@ -97,18 +113,28 @@ classDiagram
```mermaid
classDiagram
- class ProjectionResult {
- crs: str
- gcp_ids: list[str]
- file_name: str
+ class GeoreferenceResult {
+ likely_CRSs: Optional[list[str]]
+ map_area: Optional[Area_Extraction]
+ projections: Optional[list[ProjectionResult]]
}
- class GeoreferenceResults {
- cog_id: str
- georeference_results: Optional[list[GeoreferenceResult]]
- gcps: Optional[list[GroundControlPoint]]
- system: str
- system_version: str
+ class Area_Extraction {
+ type: GeomType = GeomType.Polygon
+ coordinates: list[list[list[Union[float, int]]]]
+ bbox: Optional[list[Union[float, int]]]
+ category: AreaType
+ text: Optional[str]
+ confidence: Optional[float]
+ model: Optional[str]
+ model_version: Optional[str]
+ }
+
+ class GeomType {
+ <>
+ Point: str = 'Point'
+ LineString: str = 'LineString'
+ Polygon: str = 'Polygon'
}
class Pixel_Point {
@@ -117,10 +143,10 @@ classDiagram
type: GeomType = GeomType.Point
}
- class GeoreferenceResult {
- likely_CRSs: Optional[list[str]]
- map_area: Optional[Area_Extraction]
- projections: Optional[list[ProjectionResult]]
+ class ProjectionResult {
+ crs: str
+ gcp_ids: list[str]
+ file_name: str
}
class GroundControlPoint {
@@ -133,22 +159,12 @@ classDiagram
crs: Optional[str]
}
- class GeomType {
- <>
- Point: str = 'Point'
- LineString: str = 'LineString'
- Polygon: str = 'Polygon'
- }
-
- class Area_Extraction {
- type: GeomType = GeomType.Polygon
- coordinates: list[list[list[Union[float, int]]]]
- bbox: Optional[list[Union[float, int]]]
- category: AreaType
- text: Optional[str]
- confidence: Optional[float]
- model: Optional[str]
- model_version: Optional[str]
+ class GeoreferenceResults {
+ cog_id: str
+ georeference_results: Optional[list[GeoreferenceResult]]
+ gcps: Optional[list[GroundControlPoint]]
+ system: str
+ system_version: str
}
class Geom_Point {
@@ -161,10 +177,10 @@ classDiagram
Area_Extraction ..> GeomType
Geom_Point ..> GeomType
Pixel_Point ..> GeomType
- GroundControlPoint ..> Pixel_Point
GroundControlPoint ..> Geom_Point
- GeoreferenceResult ..> ProjectionResult
+ GroundControlPoint ..> Pixel_Point
GeoreferenceResult ..> Area_Extraction
+ GeoreferenceResult ..> ProjectionResult
GeoreferenceResults ..> GeoreferenceResult
GeoreferenceResults ..> GroundControlPoint
@@ -187,14 +203,6 @@ classDiagram
non_rectangular: str = 'non_rectangular'
}
- class CogMetaData {
- cog_id: str
- system: str
- system_version: str
- multiple_maps: Optional[bool]
- map_metadata: Optional[list[MapMetaData]]
- }
-
class MapMetaData {
title: Optional[str]
year: Optional[int]
@@ -211,6 +219,14 @@ classDiagram
model_version: str
}
+ class CogMetaData {
+ cog_id: str
+ system: str
+ system_version: str
+ multiple_maps: Optional[bool]
+ map_metadata: Optional[list[MapMetaData]]
+ }
+
class MapColorSchemeTypes {
<>
full_color: str = 'full_color'
@@ -235,12 +251,15 @@ classDiagram
```mermaid
classDiagram
- class CogMetaData {
- cog_id: str
- system: str
- system_version: str
- multiple_maps: Optional[bool]
- map_metadata: Optional[list[MapMetaData]]
+ class Area_Extraction {
+ type: GeomType = GeomType.Polygon
+ coordinates: list[list[list[Union[float, int]]]]
+ bbox: Optional[list[Union[float, int]]]
+ category: AreaType
+ text: Optional[str]
+ confidence: Optional[float]
+ model: Optional[str]
+ model_version: Optional[str]
}
class PointLegendAndFeaturesResult {
@@ -253,27 +272,6 @@ classDiagram
point_features: Optional[list[PointFeatureCollection]]
}
- class FeatureResults {
- cog_id: str
- line_feature_results: Optional[list[LineLegendAndFeaturesResult]]
- point_feature_results: Optional[list[PointLegendAndFeaturesResult]]
- polygon_feature_results: Optional[list[PolygonLegendAndFeauturesResult]]
- cog_area_extractions: Optional[list[Area_Extraction]]
- cog_metadata_extractions: Optional[list[CogMetaData]]
- system: str
- system_version: str
- }
-
- class LineLegendAndFeaturesResult {
- id: str
- crs: str
- cdr_projection_id: Optional[str]
- name: Optional[str]
- description: Optional[str]
- legend_bbox: Optional[list[Union[float, int]]]
- line_features: Optional[LineFeatureCollection]
- }
-
class PolygonLegendAndFeauturesResult {
id: str
crs: str
@@ -288,15 +286,33 @@ classDiagram
polygon_features: Optional[PolygonFeatureCollection]
}
- class Area_Extraction {
- type: GeomType = GeomType.Polygon
- coordinates: list[list[list[Union[float, int]]]]
- bbox: Optional[list[Union[float, int]]]
- category: AreaType
- text: Optional[str]
- confidence: Optional[float]
- model: Optional[str]
- model_version: Optional[str]
+ class LineLegendAndFeaturesResult {
+ id: str
+ crs: str
+ cdr_projection_id: Optional[str]
+ name: Optional[str]
+ description: Optional[str]
+ legend_bbox: Optional[list[Union[float, int]]]
+ line_features: Optional[LineFeatureCollection]
+ }
+
+ class FeatureResults {
+ cog_id: str
+ line_feature_results: Optional[list[LineLegendAndFeaturesResult]]
+ point_feature_results: Optional[list[PointLegendAndFeaturesResult]]
+ polygon_feature_results: Optional[list[PolygonLegendAndFeauturesResult]]
+ cog_area_extractions: Optional[list[Area_Extraction]]
+ cog_metadata_extractions: Optional[list[CogMetaData]]
+ system: str
+ system_version: str
+ }
+
+ class CogMetaData {
+ cog_id: str
+ system: str
+ system_version: str
+ multiple_maps: Optional[bool]
+ map_metadata: Optional[list[MapMetaData]]
}
Area_Extraction ..> AreaType
@@ -306,11 +322,11 @@ classDiagram
PolygonLegendAndFeauturesResult ..> PolygonFeatureCollection
PolygonLegendAndFeauturesResult ..> MapUnit
CogMetaData ..> MapMetaData
- FeatureResults ..> CogMetaData
+ FeatureResults ..> Area_Extraction
FeatureResults ..> PointLegendAndFeaturesResult
- FeatureResults ..> LineLegendAndFeaturesResult
FeatureResults ..> PolygonLegendAndFeauturesResult
- FeatureResults ..> Area_Extraction
+ FeatureResults ..> LineLegendAndFeaturesResult
+ FeatureResults ..> CogMetaData
```
@@ -325,9 +341,13 @@ classDiagram
```mermaid
classDiagram
- class PointFeatureCollection {
- type: GeoJsonType = GeoJsonType.FeatureCollection
- features: list[PointFeature]
+ class PointProperties {
+ model: Optional[str]
+ model_version: Optional[str]
+ confidence: Optional[float]
+ bbox: Optional[list[Union[float, int]]]
+ dip: Optional[int]
+ dip_direction: Optional[int]
}
class PointLegendAndFeaturesResult {
@@ -340,15 +360,11 @@ classDiagram
point_features: Optional[list[PointFeatureCollection]]
}
- class Point {
- coordinates: list[Union[float, int]]
- type: GeomType = GeomType.Point
- }
-
- class GeoJsonType {
+ class GeomType {
<>
- Feature: str = 'Feature'
- FeatureCollection: str = 'FeatureCollection'
+ Point: str = 'Point'
+ LineString: str = 'LineString'
+ Polygon: str = 'Polygon'
}
class PointFeature {
@@ -358,26 +374,26 @@ classDiagram
properties: PointProperties
}
- class PointProperties {
- model: Optional[str]
- model_version: Optional[str]
- confidence: Optional[float]
- bbox: Optional[list[Union[float, int]]]
- dip: Optional[int]
- dip_direction: Optional[int]
+ class GeoJsonType {
+ <>
+ Feature: str = 'Feature'
+ FeatureCollection: str = 'FeatureCollection'
}
- class GeomType {
- <>
- Point: str = 'Point'
- LineString: str = 'LineString'
- Polygon: str = 'Polygon'
+ class Point {
+ coordinates: list[Union[float, int]]
+ type: GeomType = GeomType.Point
+ }
+
+ class PointFeatureCollection {
+ type: GeoJsonType = GeoJsonType.FeatureCollection
+ features: list[PointFeature]
}
Point ..> GeomType
+ PointFeature ..> GeoJsonType
PointFeature ..> PointProperties
PointFeature ..> Point
- PointFeature ..> GeoJsonType
PointFeatureCollection ..> GeoJsonType
PointFeatureCollection ..> PointFeature
PointLegendAndFeaturesResult ..> PointFeatureCollection
@@ -395,27 +411,16 @@ classDiagram
```mermaid
classDiagram
- class LineFeature {
- type: GeoJsonType = GeoJsonType.Feature
- id: str
- geometry: Line
- properties: LineProperty
- }
-
class Line {
coordinates: list[list[Union[float, int]]]
type: GeomType = GeomType.LineString
}
- class LineFeatureCollection {
- type: GeoJsonType = GeoJsonType.FeatureCollection
- features: Optional[list[LineFeature]]
- }
-
- class GeoJsonType {
+ class GeomType {
<>
- Feature: str = 'Feature'
- FeatureCollection: str = 'FeatureCollection'
+ Point: str = 'Point'
+ LineString: str = 'LineString'
+ Polygon: str = 'Polygon'
}
class LineLegendAndFeaturesResult {
@@ -428,35 +433,46 @@ classDiagram
line_features: Optional[LineFeatureCollection]
}
- class LineProperty {
- model: Optional[str]
- model_version: Optional[str]
- confidence: Optional[float]
- dash_pattern: Optional[DashType] = None
- symbol: Optional[str]
+ class GeoJsonType {
+ <>
+ Feature: str = 'Feature'
+ FeatureCollection: str = 'FeatureCollection'
}
- class GeomType {
- <>
- Point: str = 'Point'
- LineString: str = 'LineString'
- Polygon: str = 'Polygon'
- }
-
- class DashType {
+ class DashType {
<>
solid: str = 'solid'
dash: str = 'dash'
dotted: str = 'dotted'
}
+ class LineFeature {
+ type: GeoJsonType = GeoJsonType.Feature
+ id: str
+ geometry: Line
+ properties: LineProperty
+ }
+
+ class LineFeatureCollection {
+ type: GeoJsonType = GeoJsonType.FeatureCollection
+ features: Optional[list[LineFeature]]
+ }
+
+ class LineProperty {
+ model: Optional[str]
+ model_version: Optional[str]
+ confidence: Optional[float]
+ dash_pattern: Optional[DashType] = None
+ symbol: Optional[str]
+ }
+
Line ..> GeomType
LineProperty ..> DashType
LineFeature ..> LineProperty
- LineFeature ..> Line
LineFeature ..> GeoJsonType
- LineFeatureCollection ..> LineFeature
+ LineFeature ..> Line
LineFeatureCollection ..> GeoJsonType
+ LineFeatureCollection ..> LineFeature
LineLegendAndFeaturesResult ..> LineFeatureCollection
@@ -472,15 +488,18 @@ classDiagram
```mermaid
classDiagram
- class MapUnit {
- age_text: Optional[str]
- b_age: Optional[float]
- b_interval: Optional[str]
- lithology: Optional[str]
- name: Optional[str]
- t_age: Optional[float]
- t_interval: Optional[str]
- comments: Optional[str]
+ class GeomType {
+ <>
+ Point: str = 'Point'
+ LineString: str = 'LineString'
+ Polygon: str = 'Polygon'
+ }
+
+ class PolygonFeature {
+ type: GeoJsonType = GeoJsonType.Feature
+ id: str
+ geometry: Polygon
+ properties: PolygonProperty
}
class PolygonLegendAndFeauturesResult {
@@ -497,29 +516,21 @@ classDiagram
polygon_features: Optional[PolygonFeatureCollection]
}
- class PolygonFeatureCollection {
- type: GeoJsonType = GeoJsonType.FeatureCollection
- features: Optional[list[PolygonFeature]]
- }
-
- class PolygonFeature {
- type: GeoJsonType = GeoJsonType.Feature
- id: str
- geometry: Polygon
- properties: PolygonProperty
- }
-
class GeoJsonType {
<>
Feature: str = 'Feature'
FeatureCollection: str = 'FeatureCollection'
}
- class GeomType {
- <>
- Point: str = 'Point'
- LineString: str = 'LineString'
- Polygon: str = 'Polygon'
+ class PolygonFeatureCollection {
+ type: GeoJsonType = GeoJsonType.FeatureCollection
+ features: Optional[list[PolygonFeature]]
+ }
+
+ class PolygonProperty {
+ model: Optional[str]
+ model_version: Optional[str]
+ confidence: Optional[float]
}
class Polygon {
@@ -527,18 +538,23 @@ classDiagram
type: GeomType = GeomType.Polygon
}
- class PolygonProperty {
- model: Optional[str]
- model_version: Optional[str]
- confidence: Optional[float]
+ class MapUnit {
+ age_text: Optional[str]
+ b_age: Optional[float]
+ b_interval: Optional[str]
+ lithology: Optional[str]
+ name: Optional[str]
+ t_age: Optional[float]
+ t_interval: Optional[str]
+ comments: Optional[str]
}
Polygon ..> GeomType
- PolygonFeature ..> Polygon
- PolygonFeature ..> GeoJsonType
PolygonFeature ..> PolygonProperty
- PolygonFeatureCollection ..> PolygonFeature
+ PolygonFeature ..> GeoJsonType
+ PolygonFeature ..> Polygon
PolygonFeatureCollection ..> GeoJsonType
+ PolygonFeatureCollection ..> PolygonFeature
PolygonLegendAndFeauturesResult ..> PolygonFeatureCollection
PolygonLegendAndFeauturesResult ..> MapUnit
@@ -561,14 +577,6 @@ classDiagram
non_rectangular: str = 'non_rectangular'
}
- class CogMetaData {
- cog_id: str
- system: str
- system_version: str
- multiple_maps: Optional[bool]
- map_metadata: Optional[list[MapMetaData]]
- }
-
class MapMetaData {
title: Optional[str]
year: Optional[int]
@@ -585,6 +593,14 @@ classDiagram
model_version: str
}
+ class CogMetaData {
+ cog_id: str
+ system: str
+ system_version: str
+ multiple_maps: Optional[bool]
+ map_metadata: Optional[list[MapMetaData]]
+ }
+
class MapColorSchemeTypes {
<>
full_color: str = 'full_color'
@@ -609,6 +625,15 @@ classDiagram
```mermaid
classDiagram
+ class UploadDocument {
+ title: str
+ is_open: bool = True
+ provenance: Optional[DocumentProvenance] = None
+ metadata: Optional[DocumentMetaData] = None
+ system: str
+ system_version: str
+ }
+
class DocumentExtraction {
id: UnionType[str, NoneType] = None
document_id: str = None
@@ -618,7 +643,7 @@ classDiagram
bbox: UnionType[tuple[float, float, float, float], NoneType] = None
page_num: UnionType[int, NoneType] = None
external_link: UnionType[str, NoneType] = None
- data: UnionType[dict, NoneType] = None
+ data: Optional[dict[]] = None
system: str
system_version: str
}
@@ -627,20 +652,35 @@ classDiagram
id: str
title: str
is_open: bool
- pages: Optional[int] = None
- provenance: Optional[list[DocumentProvenance]] = None
+ pages: int
+ size: int
+ provenance: list[DocumentProvenance] = list
+ metadata: Optional[DocumentMetaData] = None
system: str
system_version: str
}
+ class DocumentMetaData {
+ doi: str = ''
+ authors: list[str] = list
+ journal: str = ''
+ year: Optional[int] = None
+ month: Optional[int] = None
+ volume: Optional[int] = None
+ issue: Optional[int] = None
+ description: str = ''
+ }
+
class DocumentProvenance {
external_system_name: str
- external_system_id: str = None
- external_system_url: str = None
+ external_system_id: Optional[str] = ''
+ external_system_url: Optional[str] = ''
}
+ UploadDocument ..> DocumentMetaData
+ UploadDocument ..> DocumentProvenance
+ Document ..> DocumentMetaData
Document ..> DocumentProvenance
- DocumentExtraction ..> dict
```
@@ -655,20 +695,84 @@ classDiagram
```mermaid
classDiagram
+ class PageInfo {
+ page: int
+ bounding_box: Optional[BoundingBox]
+ }
+
+ class EvidenceLayer {
+ name: str
+ relevance_score: float
+ }
+
+ class Reference {
+ document: Document
+ page_info: list[PageInfo]
+ }
+
+ class MineralSystem {
+ deposit_type: list[DepositType]
+ source: list[MappableCriteria]
+ pathway: list[MappableCriteria]
+ trap: Optional[list[MappableCriteria]]
+ preservation: Optional[list[MappableCriteria]]
+ energy: Optional[list[MappableCriteria]]
+ outflow: Optional[list[MappableCriteria]]
+ }
+
+ class ResourceReserveCategory {
+ <>
+ INFERRED: str = 'Inferred Mineral Resource'
+ INDICATED: str = 'Indicated Mineral Resource'
+ MEASURED: str = 'Measured Mineral Resource'
+ PROBABLE: str = 'Probable Mineral Reserve'
+ PROVEN: str = 'Proven Mineral Reserve'
+ }
+
+ class DepositTypeCandidate {
+ observed_name: str
+ normalized_uri: DepositType
+ confidence: float
+ source: str
+ }
+
+ class MappableCriteria {
+ criteria: str
+ theoretical: Optional[str]
+ potential_dataset: Optional[list[EvidenceLayer]]
+ supporting_references: list[Reference]
+ }
+
class Ore {
ore_unit: str
ore_value: float
}
- class Geometry {
- <>
- Point: str = 'Point'
- Polygon: str = 'Polygon'
+ class MineralSite {
+ source_id: str
+ record_id: str
+ name: Optional[str]
+ mineral_inventory: list[MineralInventory]
+ location_info: LocationInfo
+ geology_info: Optional[GeologyInfo]
+ deposit_type_candidate: list[DepositTypeCandidate]
}
- class PageInfo {
- page: int
- bounding_box: Optional[BoundingBox]
+ class Grade {
+ grade_unit: str
+ grade_value: float
+ }
+
+ class Document {
+ id: str
+ title: str
+ is_open: bool
+ pages: int
+ size: int
+ provenance: list[DocumentProvenance] = list
+ metadata: Optional[DocumentMetaData] = None
+ system: str
+ system_version: str
}
class GeologyInfo {
@@ -681,11 +785,6 @@ classDiagram
comments: Optional[str]
}
- class Reference {
- document: Document
- page_info: list[PageInfo]
- }
-
class MineralInventory {
commodity: Commodity
observed_commodity: Optional[str]
@@ -699,55 +798,12 @@ classDiagram
zone: Optional[str]
}
- class DepositTypeCandidate {
- observed_name: str
- normalized_uri: DepositType
- confidence: float
- source: str
- }
-
- class Commodity {
- name: str
- }
-
- class Document {
- id: str
- title: str
- is_open: bool
- pages: Optional[int] = None
- provenance: Optional[list[DocumentProvenance]] = None
- system: str
- system_version: str
- }
-
class DepositType {
name: str
environment: str
group: str
}
- class BoundingBox {
- x_min: float
- x_max: float
- y_min: float
- y_max: float
- }
-
- class Grade {
- grade_unit: str
- grade_value: float
- }
-
- class MineralSite {
- source_id: str
- record_id: str
- name: Optional[str]
- mineral_inventory: list[MineralInventory]
- location_info: LocationInfo
- geology_info: Optional[GeologyInfo]
- deposit_type_candidate: list[DepositTypeCandidate]
- }
-
class LocationInfo {
location: Geometry
crs: str
@@ -755,56 +811,43 @@ classDiagram
state_or_province: Optional[str]
}
- class MineralSystem {
- deposit_type: list[DepositType]
- source: list[MappableCriteria]
- pathway: list[MappableCriteria]
- trap: Optional[list[MappableCriteria]]
- preservation: Optional[list[MappableCriteria]]
- energy: Optional[list[MappableCriteria]]
- outflow: Optional[list[MappableCriteria]]
+ class Commodity {
+ name: str
}
- class MappableCriteria {
- criteria: str
- theoretical: Optional[str]
- potential_dataset: Optional[list[EvidenceLayer]]
- supporting_references: list[Reference]
+ class BoundingBox {
+ x_min: float
+ x_max: float
+ y_min: float
+ y_max: float
}
- class ResourceReserveCategory {
+ class Geometry {
<>
- INFERRED: str = 'Inferred Mineral Resource'
- INDICATED: str = 'Indicated Mineral Resource'
- MEASURED: str = 'Measured Mineral Resource'
- PROBABLE: str = 'Probable Mineral Reserve'
- PROVEN: str = 'Proven Mineral Reserve'
- }
-
- class EvidenceLayer {
- name: str
- relevance_score: float
+ Point: str = 'Point'
+ Polygon: str = 'Polygon'
}
+ Document ..> DocumentMetaData
Document ..> DocumentProvenance
DepositTypeCandidate ..> DepositType
PageInfo ..> BoundingBox
- Reference ..> Document
Reference ..> PageInfo
- MappableCriteria ..> Reference
+ Reference ..> Document
MappableCriteria ..> EvidenceLayer
+ MappableCriteria ..> Reference
MineralSystem ..> MappableCriteria
MineralSystem ..> DepositType
- MineralInventory ..> Grade
MineralInventory ..> datetime
- MineralInventory ..> Ore
+ MineralInventory ..> ResourceReserveCategory
MineralInventory ..> Reference
+ MineralInventory ..> Ore
MineralInventory ..> Commodity
- MineralInventory ..> ResourceReserveCategory
+ MineralInventory ..> Grade
LocationInfo ..> Geometry
- MineralSite ..> GeologyInfo
MineralSite ..> LocationInfo
MineralSite ..> MineralInventory
+ MineralSite ..> GeologyInfo
MineralSite ..> DepositTypeCandidate
@@ -820,10 +863,12 @@ classDiagram
```mermaid
classDiagram
- class MapResults {
+ class GeoreferenceResults {
cog_id: str
- georef_results: Optional[list[GeoreferenceResults]]
- extraction_results: Optional[list[FeatureResults]]
+ georeference_results: Optional[list[GeoreferenceResult]]
+ gcps: Optional[list[GroundControlPoint]]
+ system: str
+ system_version: str
}
class FeatureResults {
@@ -837,23 +882,21 @@ classDiagram
system_version: str
}
- class GeoreferenceResults {
+ class MapResults {
cog_id: str
- georeference_results: Optional[list[GeoreferenceResult]]
- gcps: Optional[list[GroundControlPoint]]
- system: str
- system_version: str
+ georef_results: Optional[list[GeoreferenceResults]]
+ extraction_results: Optional[list[FeatureResults]]
}
- FeatureResults ..> CogMetaData
+ FeatureResults ..> Area_Extraction
FeatureResults ..> PointLegendAndFeaturesResult
- FeatureResults ..> LineLegendAndFeaturesResult
FeatureResults ..> PolygonLegendAndFeauturesResult
- FeatureResults ..> Area_Extraction
+ FeatureResults ..> LineLegendAndFeaturesResult
+ FeatureResults ..> CogMetaData
GeoreferenceResults ..> GeoreferenceResult
GeoreferenceResults ..> GroundControlPoint
- MapResults ..> FeatureResults
MapResults ..> GeoreferenceResults
+ MapResults ..> FeatureResults
```
@@ -868,6 +911,12 @@ classDiagram
```mermaid
classDiagram
+ class MapProvenance {
+ system_name: str
+ id: str = None
+ url: str = None
+ }
+
class Map {
id: str
provenance: Optional[list[MapProvenance]] = None
@@ -876,12 +925,6 @@ classDiagram
system_version: str
}
- class MapProvenance {
- system_name: str
- id: str = None
- url: str = None
- }
-
Map ..> MapProvenance
diff --git a/cdr_schemas/document.py b/cdr_schemas/document.py
index c1a865b..5646bde 100644
--- a/cdr_schemas/document.py
+++ b/cdr_schemas/document.py
@@ -1,17 +1,58 @@
-from typing import Optional
+from typing import Dict, List, Optional
from pydantic import BaseModel, Field
+class DocumentMetaData(BaseModel):
+ doi: str = Field("", description="Document DOI")
+ authors: List[str] = Field(description="Document Authors", default_factory=list)
+ journal: str = Field("", description="Document Journal")
+ year: Optional[int] = Field(None, description="year")
+ month: Optional[int] = Field(None, description="month")
+ volume: Optional[int] = Field(None, description="volume")
+ issue: Optional[int] = Field(None, description="issue")
+ description: str = Field("", description="description")
+
+
class DocumentProvenance(BaseModel):
"""JSON model for Document Provenance"""
external_system_name: str = Field(
..., description="Name of system storing document"
)
- external_system_id: str = Field(None, description="The system ID of the document")
- external_system_url: str = Field(
- None, description="Name of system storing document"
+ external_system_id: Optional[str] = Field(
+ "", description="The system ID of the document"
+ )
+ external_system_url: Optional[str] = Field(
+ "", description="Name of system storing document"
+ )
+
+
+class UploadDocument(BaseModel):
+ """JSON model for uploading new document"""
+
+ title: str = Field(..., description="Title of the document")
+ is_open: bool = Field(
+ True,
+ description="Whether document is open or not.",
+ )
+
+ provenance: Optional[DocumentProvenance] = Field(
+ None, description="provenance list"
+ )
+ metadata: Optional[DocumentMetaData] = Field(None, description="document metadata")
+
+ system: str = Field(
+ ...,
+ description="""
+ The name of the system used.
+ """,
+ )
+ system_version: str = Field(
+ ...,
+ description="""
+ The version of the system used.
+ """,
)
@@ -25,10 +66,14 @@ class Document(BaseModel):
description="Whether document is open or not.",
)
- pages: Optional[int] = Field(None, description="Document page count")
+ pages: int = Field(..., description="Document page count")
+ size: int = Field(..., description="Document size in bytes")
- provenance: Optional[list[DocumentProvenance]] = Field(
- None, description="provenance list"
+ provenance: list[DocumentProvenance] = Field(
+ ..., description="provenance list", default_factory=list
+ )
+ metadata: Optional[DocumentMetaData] | None = Field(
+ None, description="document metadata"
)
system: str = Field(
@@ -62,7 +107,7 @@ class DocumentExtraction(BaseModel):
)
page_num: int | None = Field(None, description="The page number of the extraction")
external_link: str | None = Field(None, description="A link to the extraction")
- data: dict | None = Field(
+ data: Dict | None = Field(
None, description="Extra information about the extraction"
)
diff --git a/dev/docs.py b/dev/docs.py
index f8caa94..d4dffd3 100644
--- a/dev/docs.py
+++ b/dev/docs.py
@@ -3,6 +3,7 @@
from types import ModuleType
from jinja2 import Template
+from jinja2.filters import FILTERS
from pydantic_mermaid import MermaidGenerator
import cdr_schemas.area_extraction
@@ -47,10 +48,14 @@ def replaces_block(text: str, block: str):
return f"{prefix}{begin_mark}\n{comment}\n{block}\n{end_mark}{suffix}"
+def mk_quote(s: str) -> str:
+ return s.replace(" ", "-")
+
+
def run():
diagrams = []
+ FILTERS["mk_quote"] = mk_quote
template = Template(Path("docs/schemas.md.j2").read_text())
-
modules = [
Module(title="area extraction", ref=cdr_schemas.area_extraction),
Module(title="georeference", ref=cdr_schemas.georeference),
diff --git a/docs/schemas.md.j2 b/docs/schemas.md.j2
index d4c8db3..e9e365f 100644
--- a/docs/schemas.md.j2
+++ b/docs/schemas.md.j2
@@ -1,5 +1,11 @@
+
+
## Schemas
+{% for diag in diagrams|sort(attribute="title") %}
+ [{{ diag.title|title }}](#{{ diag.title|title|mk_quote }})
+{%- endfor %}
+
{% for diag in diagrams %}
### {{ diag.title|title }}
diff --git a/pyproject.toml b/pyproject.toml
index 689fb57..a0240c3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cdr_schemas"
-version = "0.2.2+draft"
+version = "0.2.3+draft"
description = "CDR Schemas"
authors = []
readme = "README.md"