Skip to content

Commit

Permalink
Change type of publication year to integer
Browse files Browse the repository at this point in the history
- Changed type of publication year to integer in the yaml file
- closes GDEV-1303
  • Loading branch information
galinatremper authored Sep 22, 2022
1 parent 4494f7c commit ca1ce2b
Show file tree
Hide file tree
Showing 17 changed files with 465 additions and 1,337 deletions.
10 changes: 5 additions & 5 deletions artifacts/derived_schema/creation/ghga_creation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from ghga_creation.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-09-21T16:15:44
# Generation date: 2022-09-22T11:33:54
# Schema: GHGA-Metadata-Schema
#
# id: https://w3id.org/GHGA-Metadata-Schema
Expand Down Expand Up @@ -1887,7 +1887,7 @@ class CreatePublication(InformationContentEntity):
title: Optional[str] = None
abstract: Optional[str] = None
author: Optional[str] = None
year: Optional[str] = None
year: Optional[int] = None
journal: Optional[str] = None
xref: Optional[Union[str, List[str]]] = empty_list()

Expand All @@ -1906,8 +1906,8 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self.author is not None and not isinstance(self.author, str):
self.author = str(self.author)

if self.year is not None and not isinstance(self.year, str):
self.year = str(self.year)
if self.year is not None and not isinstance(self.year, int):
self.year = int(self.year)

if self.journal is not None and not isinstance(self.journal, str):
self.journal = str(self.journal)
Expand Down Expand Up @@ -3076,7 +3076,7 @@ class slots:
model_uri=GHGA.author, domain=None, range=Optional[str])

slots.year = Slot(uri=GHGA.year, name="year", curie=GHGA.curie('year'),
model_uri=GHGA.year, domain=None, range=Optional[str])
model_uri=GHGA.year, domain=None, range=Optional[int])

slots.journal = Slot(uri=GHGA.journal, name="journal", curie=GHGA.curie('journal'),
model_uri=GHGA.journal, domain=None, range=Optional[str])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2321,7 +2321,7 @@
},
"year": {
"description": "Year in which the paper was published.",
"type": "string"
"type": "integer"
}
},
"required": [
Expand Down
1 change: 1 addition & 0 deletions artifacts/derived_schema/creation/ghga_creation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,7 @@ slots:
year:
description: >-
Year in which the paper was published.
range: integer

journal:
description: >-
Expand Down
2 changes: 1 addition & 1 deletion artifacts/derived_schema/creation/ghga_creation_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ class CreatePublication(InformationContentEntity):
title: Optional[str] = Field(None, description="""The title for the Publication.""")
abstract: Optional[str] = Field(None, description="""The study abstract that describes the goals. Can also hold abstract from a publication related to this study.""")
author: Optional[str] = Field(None, description="""The individual who is responsible for the content of a document version.""")
year: Optional[str] = Field(None, description="""Year in which the paper was published.""")
year: Optional[int] = Field(None, description="""Year in which the paper was published.""")
journal: Optional[str] = Field(None, description="""Name of the journal.""")
alias: str = Field(None, description="""The alias for an entity.""")
xref: Optional[List[str]] = Field(None, description="""One or more cross-references for this Publication.""")
Expand Down
Loading

0 comments on commit ca1ce2b

Please sign in to comment.