Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions markdown/icpsr_study_schema.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ICPSR Metadata Schema

Last updated: May 19, 2025
Last updated: September 05, 2025

This is the metadata schema used to describe data collections at the Inter-university Consortium for Political and Social Research (ICPSR). These rules and definitions represent ICPSR's metadata practices and are intended to (a) assist ICPSR staff with metadata entry, and (b) help ICPSR users -- including data depositors and researchers accessing data -- understand how to use and interpret our metadata.

Expand Down Expand Up @@ -308,7 +308,7 @@ Time Period:

**Controlled Vocabulary:** The [ICPSR Personal Names Authority List](https://www.icpsr.umich.edu/web/ICPSR/thesaurus/10002) and [Organization Names Authority List](https://www.icpsr.umich.edu/web/ICPSR/thesaurus/10004) are the primary authority control sources for PI names. The [Virtual International Authority File](https://viaf.org/) (VIAF) serves as a secondary resource if names are not present in ICPSR lists.

**Usage Notes:** A principal investigator (PI) may be a person or an organization; use the Person or Organization element as appropriate. If the PI is identified as a person, their affiliated organization (if applicable) should be included in the Organization element.
**Usage Notes:** List individuals and organizations that are chiefly responsible for the study across its entire life cycle or made significant intellectual contributions to the research. A principal investigator (PI) may be a person or an organization; use the Person or Organization element as appropriate. If the PI is identified as a person, their affiliated organization (if applicable) should be included in the Organization element.

When entering the name of an individual or organizational PI, the following hierarchy of authority control sources should be used to make sure the name conforms to best practices within ICPSR and the broader academic community:

Expand Down
25 changes: 18 additions & 7 deletions projects/somar/somar_register_dois.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,35 @@
# set variables.
working_dir = os.path.dirname(os.path.abspath(__file__))
draft_dois = os.path.join(working_dir, "draft_dois.csv")
minted_dois = os.path.join(working_dir, "minted_dois.csv")
xml_dir = os.path.join(working_dir, "XML")

#check 'test' vs. 'prod'
try:
if sys.argv[1].lower() == 'test':
credentials = os.path.join(working_dir, "test_credentials.json")
minted_dois = os.path.join(working_dir, "test_minted_dois.csv")
elif sys.argv[1].lower() == 'prod':
credentials = os.path.join(working_dir, "prod_credentials.json")
minted_dois = os.path.join(working_dir, "minted_dois.csv")
else:
print('\n\nWARNING: script only accepts "prod" or "test" as first argument.')
sys.exit(1)

except IndexError:
print('\n\nUsage: python somar_dois.py <prod OR test>')
print('\n\nUsage: python somar_dois.py <prod OR test> <draft or publish>')
sys.exit(1)

#check 'draft' vs. 'publish'
try:
if sys.argv[2].lower() == 'publish':
event_status = 'publish'
elif sys.argv[2].lower() == 'draft':
event_status = ''
else:
print('\n\nWARNING: script only accepts "publish" or "draft" as first argument.')
sys.exit(1)
except IndexError:
print('\n\nUsage: python somar_dois.py <prod OR test> <draft or publish>')
sys.exit(1)

#make sure we have our draft_dois CSV in our working dir
Expand Down Expand Up @@ -146,7 +161,7 @@
'data': {
'type': 'dois',
'attributes': {
'event': 'publish',
'event': event_status,
'identifiers': {
'identifier': item_doi,
'identifierType': 'DOI'
Expand Down Expand Up @@ -183,7 +198,3 @@

#Save the dataframe as a csv, for easiest copy/pasting into the google sheet. MAKE SURE TO KEEP THIS, YOU WILL NEED IT WHEN YOU UPDATE.
somar.to_csv(minted_dois, index=False)
try:
os.replace(minted_dois, draft_dois)
except Exception as e:
print(f"Error replacing file: {e}")
2 changes: 1 addition & 1 deletion schema/yaml/pi_names.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$schema: https://json-schema.org/draft-07/schema#
$id: https://schemas.icpsr.umich.edu/schema/yaml/pi_names?version=v1
usageNotes: |+
A principal investigator (PI) may be a person or an organization; use the Person or Organization element as appropriate. If the PI is identified as a person, their affiliated organization (if applicable) should be included in the Organization element.
List individuals and organizations that are chiefly responsible for the study across its entire life cycle or made significant intellectual contributions to the research. A principal investigator (PI) may be a person or an organization; use the Person or Organization element as appropriate. If the PI is identified as a person, their affiliated organization (if applicable) should be included in the Organization element.

When entering the name of an individual or organizational PI, the following hierarchy of authority control sources should be used to make sure the name conforms to best practices within ICPSR and the broader academic community:

Expand Down