Skip to content

Commit 8362f82

Browse files
committed
added new values for related identifier relationships
added new contributor types for Crossref updated hidden_flag to boolean type modified CHANGELOG Signed-off-by: Neal Ensor <ensorn@osti.gov>
1 parent 0603752 commit 8362f82

7 files changed

Lines changed: 58 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,32 @@
3636
- update requirements to include requests-toolbelt properly, and indicate python >=3.9 versioning
3737
- remove deprecated/legacy product types from Record definition
3838
- modified Person requirements to reflect only type and last_name requirements
39+
40+
## 0.3.7 - 11/7/2024
41+
- maintenance/bugfixes publishing release
42+
43+
## 0.3.8 - 1/8/2025
44+
- change hidden_flag to boolean
45+
- adding new relation types for RelatedIdentifier:
46+
- BasedOnData
47+
- Finances
48+
- HasComment
49+
- HasDerivation
50+
- HasReply
51+
- IsBasedOn
52+
- IsBasisFor
53+
- IsCommentOn
54+
- IsDataBasisFor
55+
- IsFinancedBy
56+
- IsRelatedMaterial
57+
- IsReplyTo
58+
- IsReviewOf
59+
- adding new contributor types for Person:
60+
- Chair
61+
- Reader
62+
- Reviewer
63+
- ReviewAssistant
64+
- ReviewerExternal
65+
- StatsReviewer
66+
- Translator
67+

elinkapi_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
],
3030
"orcid": "0000000155554447",
3131
"phone": "Optional",
32-
"role": "PRIMARY",
3332
"affiliations": [
3433
{ "name": "Optional" }
3534
]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "elinkapi"
7-
version = "0.3.7"
7+
version = "0.3.8"
88
authors = [
99
{ name="Jacob Samar", email="samarj@osti.gov" },
1010
{ name="Neal Ensor", email="ensorn@osti.gov" }

src/elinkapi/organization.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ def validate_ror_id(cls, value: str) -> str:
7777
Add an identifier to this Organization.
7878
"""
7979
def add(self, item: Identifier):
80+
if self.type is not None and self.type != Organization.Type.SPONSOR:
81+
raise ValueError ("Only sponsoring organizations may specify identifiers.")
82+
83+
if item.type not in [Identifier.Type.AWARD_DOI, Identifier.Type.CONTRACT_NUMBER, Identifier.Type.DOE_CONTRACT_NUMBER]:
84+
raise ValueError ("Organization identifier type is not allowed.")
85+
8086
if self.identifiers is None:
8187
self.identifiers=[]
8288
self.identifiers.append(item)

src/elinkapi/person.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ class Type(Enum):
1616
BUSINESS_OFFICIAL="SBIZ_BO"
1717
PRINCIPAL_INVESTIGATOR="SBIZ_PI"
1818
class Contribution(Enum):
19+
Chair="Chair"
20+
Reader="Reader"
21+
Reviewer="Reviewer"
22+
ReviewAssistant="ReviewAssistant"
23+
ReviewerExternal="ReviewerExternal"
24+
StatsReviewer="StatsReviewer"
25+
Translator="Translator"
1926
DataCollector="DataCollector"
2027
DataCurator="DataCurator"
2128
DataManager="DataManager"

src/elinkapi/record.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,5 +232,5 @@ class RecordResponse(Record):
232232
date_metadata_updated: datetime.datetime = None
233233
date_submitted_to_osti_first: datetime.datetime = None
234234
date_submitted_to_osti_last: datetime.datetime = None
235-
hidden_flag: str = None
235+
hidden_flag: bool = False
236236
media: list[MediaInfo] = None

src/elinkapi/related_identifier.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ class Type(Enum):
2525
ARXIV="arXiv"
2626
ARK="ARK"
2727
class Relation(Enum):
28+
BasedOnData="BasedOnData"
29+
Finances="Finances"
30+
HasComment="HasComment"
31+
HasDerivation="HasDerivation"
32+
HasReply="HasReply"
33+
HasReview="HasReview"
34+
IsBasedOn="IsBasedOn"
35+
IsBasisFor="IsBasisFor"
36+
IsCommentOn="IsCommentOn"
37+
IsDataBasisFor="IsDataBasisFor"
38+
IsFinancedBy="IsFinancedBy"
39+
IsRelatedMaterial="IsRelatedMaterial"
40+
IsReployTo="IsReplyTo"
41+
IsReviewOf="IsReviewOf"
2842
IsDescribed_by="IsDescribedBy"
2943
Describes="Describes"
3044
HasVersion="HasVersion"

0 commit comments

Comments
 (0)