Skip to content

Commit

Permalink
feat(transfer): splits fundorg on \n and contract nos on , and \n
Browse files Browse the repository at this point in the history
+ Adds instructions to field tooltip on metadata editor ui

Closes #433
  • Loading branch information
vchendrix committed Aug 29, 2024
1 parent f8f5100 commit 2b5d031
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions archive_api/service/essdive_transfer/crosswalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,16 @@ def dataset_transform(dataset) -> Tuple[Dict, Optional[TextIO]]:
# --- Funding Organization and Contract Numbers ---
funders = [JSONLD_FUNDER]
if dataset.funding_organizations:
# if there are line breaks, commas, or semicolons, we assume multiple funders
for f in re.split('[\n,;]', dataset.funding_organizations):
# if there are line breaks, we assume multiple funders
for f in re.split('\n', dataset.funding_organizations):
funders.append({"name": f.strip()})

# --- DOE Funding Contract Numbers --
awards = None
awards = []
if dataset.doe_funding_contract_numbers:
awards = re.split('[\n,;]', dataset.doe_funding_contract_numbers)
# if there are line breaks, we assume multiple funders
for f in re.split('[\n,]', dataset.doe_funding_contract_numbers):
awards.append(f.strip())

# --- ASSIGN TO JSON-LD ----

Expand Down
4 changes: 2 additions & 2 deletions ui/static/js/metadata/dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"description": "<p style='font-size: small;'>(BER is assumed by default.)</p><p>U.S. DOE > Office of Science > Biological and Environmental Research (BER)</p>",
"sequence": 16,
"multiple": false,
"tooltip": "<p>Identify the agencies and offices that funded the work to generate the dataset. Separate multiple funders with a comma and a space. <b>This field has a limit of 1024 characters.</b></p>",
"tooltip": "<p>Identify the agencies and offices that funded the work to generate the dataset. Separate multiple funders with a newline. <b>This field has a limit of 1024 characters.</b></p>",
"placeholder": "Add additional funding organizations other than the default."
},
"doe_funding_contract_numbers": {
Expand All @@ -173,7 +173,7 @@
"description": "<p style='font-size: small;'>(NGEE-Tropics is assumed by default through LBNL contract)</p><p>DE-AC02-05CH11231 will be automatically prepended</p>",
"sequence": 17,
"multiple": false,
"tooltip": "<p>List the numbers of any DOE contract under which the work was funded. If no DOE funding for this dataset or field is empty set as 'DE-AC02-05CH11231'. If the dataset is a result of a joint effort between two or more DOE Site/Facility Management Contractors, etc., additional DOE contract numbers may be entered. <b>This field has a limit of 100 characters.</b></p>",
"tooltip": "<p>List the numbers of any DOE contract under which the work was funded.If no DOE funding for this dataset or field is empty set as 'DE-AC02-05CH11231'. If the dataset is a result of a joint effort between two or more DOE Site/Facility Management Contractors, etc., additional DOE contract numbers may be entered. <b>This field has a limit of 100 characters. Separate multiple funders with a newline or comma(,). </b></p>",
"placeholder": "Add additional contract numbers other than the default."
},
"acknowledgement": {
Expand Down

0 comments on commit 2b5d031

Please sign in to comment.