Skip to content

Commit

Permalink
chore: Updating configs and validation (#244)
Browse files Browse the repository at this point in the history
* Updating configs and validation

* reorganize annotationmethodlinks

* formatting

---------

Co-authored-by: Daniel Ji <[email protected]>
  • Loading branch information
manasaV3 and daniel-ji authored Sep 3, 2024
1 parent cd54d91 commit 6c9f95c
Show file tree
Hide file tree
Showing 18 changed files with 447 additions and 397 deletions.
4 changes: 2 additions & 2 deletions apiv2/schema/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2552,7 +2552,7 @@ classes:
range: boolean
AnnotationMethodLinks:
name: AnnotationMethodLinks
description: A set of links to models, sourcecode, documentation, etc referenced
description: A set of links to models, source code, documentation, etc referenced
by annotation the method
mixin: true
from_schema: cdp-dataset-config
Expand All @@ -2565,7 +2565,7 @@ classes:
required: true
link_type:
name: link_type
description: Type of link (e.g. model, sourcecode, documentation)
description: Type of link (e.g. model, source code, documentation)
from_schema: cdp-dataset-config
range: annotation_method_link_type_enum
required: true
Expand Down
2 changes: 1 addition & 1 deletion ingestion_tools/dataset_configs/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ annotations: OPTIONAL
method_links: OPTIONAL
- link: REQUIRED, STRING
link_type: REQUIRED, STRING (ENUM [documentation, model_weights, other, source_code, website])
name: OPTIONAL, STRING
custom_name: OPTIONAL, STRING
version: OPTIONAL, FLOAT (NON-NEGATIVE)
sources: REQUIRED
# The following are permissible source types (multiple, but different types can exist per annotation,
Expand Down
3 changes: 3 additions & 0 deletions schema/api/v1.0.0/api_models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ classes:
method_type:
exact_mappings:
- cdp-common:annotation_method_type
method_links:
exact_mappings:
- cdp-common:annotation_method_links_json
annotations:
plural: Annotations
DatasetAuthor:
Expand Down
1 change: 1 addition & 0 deletions schema/api/v1.0.0/codegen/ER_DIAGRAM.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Annotation {
string annotation_software
boolean is_curator_recommended
annotation_method_type_enum method_type
string method_links
integer id
date deposition_date
date release_date
Expand Down
68 changes: 14 additions & 54 deletions schema/api/v1.0.0/codegen/api_models_materialized.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,6 @@ classes:
owner: AuthorEntityMixin
domain_of:
- AuthorMixin
- AnnotationMethodLinks
- DatasetAuthor
- Run
- Tomograms
Expand Down Expand Up @@ -839,7 +838,6 @@ classes:
owner: AnnotationAuthor
domain_of:
- AuthorMixin
- AnnotationMethodLinks
- DatasetAuthor
- Run
- Tomograms
Expand Down Expand Up @@ -1348,6 +1346,20 @@ classes:
inlined: true
inlined_as_list: true
pattern: (^manual$)|(^automated$)|(^hybrid$)|(^simulated$)
method_links:
name: method_links
description: A set of links to models, source code, documentation, etc referenced
by annotation the method as json
from_schema: cdp-api-models
exact_mappings:
- cdp-common:annotation_method_links_json
alias: method_links
owner: Annotation
domain_of:
- Annotation
range: string
inlined: true
inlined_as_list: true
id:
name: id
description: An identifier to refer to a specific instance of this type
Expand Down Expand Up @@ -1455,7 +1467,6 @@ classes:
owner: DatasetAuthor
domain_of:
- AuthorMixin
- AnnotationMethodLinks
- DatasetAuthor
- Run
- Tomograms
Expand Down Expand Up @@ -2250,7 +2261,6 @@ classes:
owner: Run
domain_of:
- AuthorMixin
- AnnotationMethodLinks
- DatasetAuthor
- Run
- Tomograms
Expand Down Expand Up @@ -2943,7 +2953,6 @@ classes:
owner: TomogramAuthor
domain_of:
- AuthorMixin
- AnnotationMethodLinks
- DatasetAuthor
- Run
- Tomograms
Expand Down Expand Up @@ -3215,7 +3224,6 @@ classes:
owner: Tomograms
domain_of:
- AuthorMixin
- AnnotationMethodLinks
- DatasetAuthor
- Run
- Tomograms
Expand Down Expand Up @@ -3741,7 +3749,6 @@ classes:
owner: AuthorMixin
domain_of:
- AuthorMixin
- AnnotationMethodLinks
- DatasetAuthor
- Run
- Tomograms
Expand Down Expand Up @@ -3836,51 +3843,4 @@ classes:
range: boolean
inlined: true
inlined_as_list: true
AnnotationMethodLinks:
name: AnnotationMethodLinks
description: A set of links to models, sourcecode, documentation, etc referenced
by annotation the method
from_schema: cdp-api-models
attributes:
link:
name: link
description: URL to the resource
from_schema: cdp-api-models
alias: link
owner: AnnotationMethodLinks
domain_of:
- AnnotationMethodLinks
range: string
required: true
inlined: true
inlined_as_list: true
link_type:
name: link_type
description: Type of link (e.g. model, sourcecode, documentation)
from_schema: cdp-api-models
alias: link_type
owner: AnnotationMethodLinks
domain_of:
- AnnotationMethodLinks
range: annotation_method_link_type_enum
required: true
inlined: true
inlined_as_list: true
pattern: (^documentation$)|(^models_weights$)|(^other$)|(^source_code$)|(^website$)
name:
name: name
description: user readable name of the resource
from_schema: cdp-api-models
alias: name
owner: AnnotationMethodLinks
domain_of:
- AuthorMixin
- AnnotationMethodLinks
- DatasetAuthor
- Run
- Tomograms
range: string
recommended: true
inlined: true
inlined_as_list: true
source_file: api/v1.0.0/api_models.yaml
3 changes: 3 additions & 0 deletions schema/api/v2.0.0/api_models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ classes:
method_type:
exact_mappings:
- cdp-common:annotation_method_type
method_links:
exact_mappings:
- cdp-common:annotation_method_links_json
annotations:
plural: Annotations
DatasetAuthor:
Expand Down
27 changes: 14 additions & 13 deletions schema/api/v2.0.0/codegen/ER_DIAGRAM.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ Tomogram {
boolean is_canonical
string s3_omezarr_dir
string https_omezarr_dir
string s3_mrc_scale0
string https_mrc_scale0
string s3_mrc_file
string https_mrc_file
string scale0_dimensions
string scale1_dimensions
string scale2_dimensions
Expand Down Expand Up @@ -96,7 +96,7 @@ Annotation {
EMPIAR_EMDB_DOI_PDB_LIST annotation_publication
string annotation_method
boolean ground_truth_status
GO_ID object_id
string object_id
string object_name
string object_description
string object_state
Expand All @@ -107,6 +107,7 @@ Annotation {
string annotation_software
boolean is_curator_recommended
annotation_method_type_enum method_type
string method_links
integer id
date deposition_date
date release_date
Expand All @@ -131,9 +132,9 @@ DepositionType {
}
Tiltseries {
string s3_omezarr_dir
string s3_mrc_bin1
string s3_mrc_file
string https_omezarr_dir
string https_mrc_bin1
string https_mrc_file
string s3_collection_metadata
string https_collection_metadata
string s3_angle_list
Expand Down Expand Up @@ -217,8 +218,8 @@ DepositionAuthor {
string affiliation_name
string affiliation_address
string affiliation_identifier
string corresponding_author_status
string primary_author_status
boolean corresponding_author_status
boolean primary_author_status
}
AnnotationAuthor {
integer id
Expand All @@ -229,8 +230,8 @@ AnnotationAuthor {
string affiliation_name
string affiliation_address
string affiliation_identifier
string corresponding_author_status
string primary_author_status
boolean corresponding_author_status
boolean primary_author_status
}
TomogramAuthor {
integer id
Expand All @@ -241,8 +242,8 @@ TomogramAuthor {
string affiliation_name
string affiliation_address
string affiliation_identifier
string corresponding_author_status
string primary_author_status
boolean corresponding_author_status
boolean primary_author_status
}
DatasetAuthor {
integer id
Expand All @@ -253,8 +254,8 @@ DatasetAuthor {
string affiliation_name
string affiliation_address
string affiliation_identifier
string corresponding_author_status
string primary_author_status
boolean corresponding_author_status
boolean primary_author_status
}
DatasetFunding {
string funding_agency_name
Expand Down
50 changes: 34 additions & 16 deletions schema/api/v2.0.0/codegen/api_models_materialized.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1764,6 +1764,20 @@ classes:
inlined: true
inlined_as_list: true
pattern: (^manual$)|(^automated$)|(^hybrid$)|(^simulated$)
method_links:
name: method_links
description: A set of links to models, source code, documentation, etc referenced
by annotation the method as json
from_schema: cdp-api
exact_mappings:
- cdp-common:annotation_method_links_json
alias: method_links
owner: Annotation
domain_of:
- Annotation
range: string
inlined: true
inlined_as_list: true
id:
name: id
description: An identifier to refer to a specific instance of this type
Expand Down Expand Up @@ -3675,16 +3689,17 @@ classes:
range: string
inlined: true
inlined_as_list: true
s3_mrc_bin1:
name: s3_mrc_bin1
s3_mrc_file:
name: s3_mrc_file
description: S3 path to this tiltseries in MRC format (no scaling)
from_schema: cdp-api
exact_mappings:
- cdp-common:tiltseries_s3_mrc_bin1
alias: s3_mrc_bin1
- cdp-common:tiltseries_s3_mrc_file
alias: s3_mrc_file
owner: Tiltseries
domain_of:
- Tiltseries
- Tomogram
range: string
inlined: true
inlined_as_list: true
Expand All @@ -3702,16 +3717,17 @@ classes:
range: string
inlined: true
inlined_as_list: true
https_mrc_bin1:
name: https_mrc_bin1
https_mrc_file:
name: https_mrc_file
description: HTTPS path to this tiltseries in MRC format (no scaling)
from_schema: cdp-api
exact_mappings:
- cdp-common:tiltseries_https_mrc_bin1
alias: https_mrc_bin1
- cdp-common:tiltseries_https_mrc_file
alias: https_mrc_file
owner: Tiltseries
domain_of:
- Tiltseries
- Tomogram
range: string
inlined: true
inlined_as_list: true
Expand Down Expand Up @@ -4779,28 +4795,30 @@ classes:
range: string
inlined: true
inlined_as_list: true
s3_mrc_scale0:
name: s3_mrc_scale0
s3_mrc_file:
name: s3_mrc_file
description: S3 path to this tomogram in MRC format (no scaling)
from_schema: cdp-api
exact_mappings:
- cdp-common:tomogram_s3_mrc_scale0
alias: s3_mrc_scale0
- cdp-common:tomogram_s3_mrc_file
alias: s3_mrc_file
owner: Tomogram
domain_of:
- Tiltseries
- Tomogram
range: string
inlined: true
inlined_as_list: true
https_mrc_scale0:
name: https_mrc_scale0
https_mrc_file:
name: https_mrc_file
description: HTTPS path to this tomogram in MRC format (no scaling)
from_schema: cdp-api
exact_mappings:
- cdp-common:tomogram_https_mrc_scale0
alias: https_mrc_scale0
- cdp-common:tomogram_https_mrc_file
alias: https_mrc_file
owner: Tomogram
domain_of:
- Tiltseries
- Tomogram
range: string
inlined: true
Expand Down
Loading

0 comments on commit 6c9f95c

Please sign in to comment.