diff --git a/archive_api/service/essdive_transfer/crosswalk.py b/archive_api/service/essdive_transfer/crosswalk.py index 0b5059ca..8523c9d2 100644 --- a/archive_api/service/essdive_transfer/crosswalk.py +++ b/archive_api/service/essdive_transfer/crosswalk.py @@ -5,6 +5,7 @@ """ import csv import collections +import re from io import StringIO from typing import Dict, IO, List, Optional, TextIO, Tuple, Union @@ -266,6 +267,18 @@ def dataset_transform(dataset) -> Tuple[Dict, Optional[TextIO]]: if dataset.qaqc_method_description is not None: measurement_technique = dataset.qaqc_method_description and [r for r in dataset.qaqc_method_description .split('\n') if r] or list() + # --- 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): + funders.append({"name": f.strip()}) + + # --- DOE Funding Contract Numbers -- + awards = None + if dataset.doe_funding_contract_numbers: + awards = re.split('[\n,;]', dataset.doe_funding_contract_numbers) + # --- ASSIGN TO JSON-LD ---- json_ld = { @@ -282,7 +295,8 @@ def dataset_transform(dataset) -> Tuple[Dict, Optional[TextIO]]: "variableMeasured": variable_measured, "license": JSONLD_LICENSE, "spatialCoverage": spatial_coverage, - "funder": JSONLD_FUNDER, + "funder": funders, + "award": awards, "temporalCoverage": temporal_coverage, "editor": editor, "provider": JSONLD_PROVIDER, diff --git a/archive_api/tests/essdive-transfer.jsonld b/archive_api/tests/essdive-transfer.jsonld index 6da8c464..9b5a4c4e 100644 --- a/archive_api/tests/essdive-transfer.jsonld +++ b/archive_api/tests/essdive-transfer.jsonld @@ -4,6 +4,7 @@ "@id": "http://dx.doi.org/10.15486/ngt/1783737", "name": "Leaf structural and chemical traits, and BNL field campaign sample details, San Lorenzo, Panama, 2020", "alternateName": "NGT0004", + "award": ["DE-SC0012704"], "citation": [ "Larson, Kristine & Small, Eric & Gutmann, Ethan & Bilich, Andria & Braun, John & Zavorotny, Valery & Larson, Citation. (2008). Use of GPS receivers as a soil moisture network for water cycle studies. Geophysical Research Letters - GEOPHYS RES LETT. 35. 10.1029/2008GL036013. Solander et al.: The pantropical response of soil moisture to El Niño, Hydrol. Earth Syst. Sci., 24, 2303–2322, https://doi.org/10.5194/hess-24-2303-2020, 2020.", "Additional information about citations:", @@ -56,9 +57,10 @@ ] } ], - "funder": { - "name": "U.S. DOE > Office of Science > Biological and Environmental Research (BER)" - }, + "funder": + [{"name": "U.S. DOE > Office of Science > Biological and Environmental Research (BER)"}, + {"name": "U.S. Department of Energy Office of Science Office of Biological and Environmental Research"}] +, "temporalCoverage": { "endDate": "2020-03-13", "startDate": "2020-01-14" diff --git a/archive_api/tests/test_essdive_transfer.py b/archive_api/tests/test_essdive_transfer.py index 90f34c9c..2b0ba287 100644 --- a/archive_api/tests/test_essdive_transfer.py +++ b/archive_api/tests/test_essdive_transfer.py @@ -283,6 +283,7 @@ def test_dataset_transform(celery_setup, ack_size): dataset.acknowledgement += added_ack jsonld, ack_fp = crosswalk.dataset_transform(dataset) + print(jsonld) if len(dataset.description)+ack_size >= 5000: assert ack_fp is not None diff --git a/ui/static/js/app.js b/ui/static/js/app.js index 37f8597c..bb11119a 100644 --- a/ui/static/js/app.js +++ b/ui/static/js/app.js @@ -236,7 +236,7 @@ $(document).ready(function () { } }); - $.getJSON("static/js/metadata/dataset.json?v=20240209", function (data) { + $.getJSON("static/js/metadata/dataset.json?v=20240329", function (data) { templates.datasets = data; createEditForm('datasets'); }); @@ -1715,15 +1715,21 @@ function createEditForm(templateType) { label += '*'; } - var tooltip = ' ?'; - + var tooltip = ' ?'; paramHTML.append($('').html(label + ' ' + tooltip)); + + if (templates[templateType][param].description) { + paramHTML.append($(templates[templateType][param].description)); + } switch (templates[templateType][param].type) { case "string": var tag = $('.js-template' + '.' + templates[templateType][param].type).clone(); if (templates[templateType][param].max_length) { tag.attr('maxlength', templates[templateType][param].max_length); } + if(templates[templateType][param].placeholder) { + tag.attr('placeholder', templates[templateType][param].placeholder); + } tag.removeClass('js-template').addClass('js-input'); paramHTML.append(tag); break; diff --git a/ui/static/js/metadata/dataset.json b/ui/static/js/metadata/dataset.json index 08ba88b9..ea9f0c77 100644 --- a/ui/static/js/metadata/dataset.json +++ b/ui/static/js/metadata/dataset.json @@ -21,7 +21,7 @@ "max_length": 120, "sequence": 3, "multiple": false, - "description": "
This is the title of the dataset that will be listed in the DOI and dataset viewing pages. The title should be descriptive, and include what, when, and where data was collected. If possible, include the site ID in the title.
E.g.: Sapflow and Soil Moisture Raw data, Jan 2016-Apr 2016, BR-Ma2: Manaus. This field has a limit of 100 characters.
" + "tooltip": "This is the title of the dataset that will be listed in the DOI and dataset viewing pages. The title should be descriptive, and include what, when, and where data was collected. If possible, include the site ID in the title.
E.g.: Sapflow and Soil Moisture Raw data, Jan 2016-Apr 2016, BR-Ma2: Manaus. This field has a limit of 100 characters.
" }, "description": { "type": "string", @@ -30,7 +30,7 @@ "label": "Dataset Description", "sequence": 4, "multiple": false, - "description": "Dataset description and overview. This should read as an abstract for the dataset, and provide users with adequate information about what the dataset contains, and how to use it. Include details on what data what, when and where data was collected, and if any data processing was done.
E.g.: Raw output from the data logger connected to 9 sapflow and 5 soil moisture sensors are provided in xxx.dat. The metadata file (BR-Ma2 E-field log_20160501.xls) has information on locations where the sensors were installed, and other installation/maintenance details. No data processing or QA/QC was done on the raw datasets. Processed datasets will be uploaded separately. Contact janedoe@lbl.gov if you need to use this dataset for additional information. This field has a limit of 4,000 characters and must have at least 100 words.
" + "tooltip": "Dataset tooltip and overview. This should read as an abstract for the dataset, and provide users with adequate information about what the dataset contains, and how to use it. Include details on what data what, when and where data was collected, and if any data processing was done.
E.g.: Raw output from the data logger connected to 9 sapflow and 5 soil moisture sensors are provided in xxx.dat. The metadata file (BR-Ma2 E-field log_20160501.xls) has information on locations where the sensors were installed, and other installation/maintenance details. No data processing or QA/QC was done on the raw datasets. Processed datasets will be uploaded separately. Contact janedoe@lbl.gov if you need to use this dataset for additional information. This field has a limit of 4,000 characters and must have at least 100 words.
" }, "sites": { "type": "reference_list", @@ -40,7 +40,7 @@ "label": "Dataset Field Site", "sequence": 5, "multiple": true, - "description": "Field site(s) where the data were collected from. Select all that apply. Click the +Add button to add more than one site. Additional site information can be viewed using the 'View Sites and Plots' option on the main menu. Contact ngee-tropics-archive@lbl.gov if the site you need is not listed.
" + "tooltip": "Field site(s) where the data were collected from. Select all that apply. Click the +Add button to add more than one site. Additional site information can be viewed using the 'View Sites and Plots' option on the main menu. Contact ngee-tropics-archive@lbl.gov if the site you need is not listed.
" }, "plots": { "type": "reference_list", @@ -50,7 +50,7 @@ "label": "Dataset Field Plot", "sequence": 6, "multiple": true, - "description": "Field plot(s) where the data were collected from. Select all that apply. Click the +Add button to add more than one plot. Only the plots belonging to the field site selected above can be chosen. Additional plot information can be viewed using the “View Sites and Plots” option on the main menu. Contact ngee-tropics-archive@lbl.gov if the plot you need is not listed.
" + "tooltip": "Field plot(s) where the data were collected from. Select all that apply. Click the +Add button to add more than one plot. Only the plots belonging to the field site selected above can be chosen. Additional plot information can be viewed using the “View Sites and Plots” option on the main menu. Contact ngee-tropics-archive@lbl.gov if the plot you need is not listed.
" }, "authors": { "type": "reference_list", @@ -60,7 +60,7 @@ "label": "Dataset Author", "sequence": 7, "multiple": true, - "description": "Dataset Authors needed for the purposes of a DOI. Add the authors in dataset citation order. List the main researchers involved in producing the data, or the authors of the publication who should be listed in the citation for this data. Select authors from picklist. Hit the +Add button to add more authors. If the author is not listed, select --Add Collaborator -- from the top of the picklist and add an author.
" + "tooltip": "Dataset Authors needed for the purposes of a DOI. Add the authors in dataset citation order. List the main researchers involved in producing the data, or the authors of the publication who should be listed in the citation for this data. Select authors from picklist. Hit the +Add button to add more authors. If the author is not listed, select --Add Collaborator -- from the top of the picklist and add an author.
" }, "originating_institution": { "type": "string", @@ -69,7 +69,7 @@ "label": "Dataset Originating Institution(s)", "sequence": 8, "multiple": false, - "description": "Name of the organization(s) that performed the research or issued the dataset. Separate multiple organizations with a semicolon and a space.
" + "tooltip": "Name of the organization(s) that performed the research or issued the dataset. Separate multiple organizations with a semicolon and a space.
" }, "contact": { "type": "reference_list", @@ -79,7 +79,7 @@ "label": "Dataset Contact", "sequence": 9, "multiple": false, - "description": "Person who should be listed as the contact for the dataset for the purposes of the DOI or for users seeking further information/usage permissions for the data. Select contact from picklist. Only one contact is allowed per dataset. If the contact is not listed, select --Add New Contact -- from the top of the picklist and add the contact.
" + "tooltip": "Person who should be listed as the contact for the dataset for the purposes of the DOI or for users seeking further information/usage permissions for the data. Select contact from picklist. Only one contact is allowed per dataset. If the contact is not listed, select --Add New Contact -- from the top of the picklist and add the contact.
" }, "variables": { "type": "reference_list", @@ -89,7 +89,7 @@ "label": "Dataset Variable", "sequence": 10, "multiple": true, - "description": "Measurement variables present in the dataset (select all that apply). Select each variable from the picklist. To add more than one variable, hit the +Add button. If the variable you need is not listed, contact ngee-tropics-archive@lbl.gov.
" + "tooltip": "Measurement variables present in the dataset (select all that apply). Select each variable from the picklist. To add more than one variable, hit the +Add button. If the variable you need is not listed, contact ngee-tropics-archive@lbl.gov.
" }, "start_date": { "type": "date", @@ -99,7 +99,7 @@ "sequence": 11, "multiple": false, "units": "YYYYMMDD", - "description": "Earliest date in dataset. Provide in ISO format (YYYY-MM-DD). E.g. 2016-01-10
", + "tooltip": "
Earliest date in dataset. Provide in ISO format (YYYY-MM-DD). E.g. 2016-01-10
", "format": "ISO" }, "end_date": { @@ -110,7 +110,7 @@ "sequence": 12, "multiple": false, "units": "YYYYMMDD", - "description": "
Last date in dataset. Provide in ISO format (YYYY-MM-DD). E.g. 2016-01-10
", + "tooltip": "Last date in dataset. Provide in ISO format (YYYY-MM-DD). E.g. 2016-01-10
", "format": "ISO" }, "qaqc_status": { @@ -134,16 +134,16 @@ ], "sequence": 13, "multiple": false, - "description": "Indicate if any QA/QC has been performed on the dataset. Choices are None, Provisional QA-QC, Final QA-QC.
" + "tooltip": "Indicate if any QA/QC has been performed on the dataset. Choices are None, Provisional QA-QC, Final QA-QC.
" }, - "qaqc_method_description": { + "qaqc_method_tooltip": { "type": "string", "required": true, "read_only": false, "label": "Method Description", "sequence": 14, "multiple": false, - "description": "Information about the methods employed in collecting or generating a data set or other resource. These include descriptions of sampling or experimental procedures, data QA/QC, processing and synthesis.
" + "tooltip": "Information about the methods employed in collecting or generating a data set or other resource. These include tooltips of sampling or experimental procedures, data QA/QC, processing and synthesis.
" }, "ngee_tropics_resources": { "type": "boolean", @@ -152,16 +152,18 @@ "label": "NGEE Tropics Resources Used? (If \"yes\", internal data policy applies)", "sequence": 15, "multiple": false, - "description": "This should be checked if any NGEE Tropics Resources (financial, personnel, etc.) were used to generate the data. If marked yes, the data will will be subject to the NGEE Tropics Internal Data Policy. NGEE Tropics Internal Data Policy: 'Private' Datasets that have used NGEE Tropics Resources (financial, personnel etc.) will automatically be set to 'NGEE Tropics' access within 6 months of submission. 'Private and 'NGEE Tropics' datasets that have used NGEE Tropics Resources will be set to 'Public' access within 18 months of submission.
" + "tooltip": "This should be checked if any NGEE Tropics Resources (financial, personnel, etc.) were used to generate the data. If marked yes, the data will will be subject to the NGEE Tropics Internal Data Policy. NGEE Tropics Internal Data Policy: 'Private' Datasets that have used NGEE Tropics Resources (financial, personnel etc.) will automatically be set to 'NGEE Tropics' access within 6 months of submission. 'Private and 'NGEE Tropics' datasets that have used NGEE Tropics Resources will be set to 'Public' access within 18 months of submission.
" }, "funding_organizations": { "type": "string", - "required": true, + "required": false, "read_only": false, "label": "Dataset Funding organization(s)", + "description": "(BER is assumed by default.)
U.S. DOE > Office of Science > Biological and Environmental Research (BER)
", "sequence": 16, "multiple": false, - "description": "Identify the agencies and offices that funded the work to generate the dataset. Separate multiple funders with a comma and a space. This field has a limit of 1024 characters.
" + "tooltip": "Identify the agencies and offices that funded the work to generate the dataset. Separate multiple funders with a comma and a space. This field has a limit of 1024 characters.
", + "placeholder": "Add additional funding organizations other than the default." }, "doe_funding_contract_numbers": { "type": "string", @@ -170,7 +172,7 @@ "label": "Dataset Funding Contract Number(s)", "sequence": 17, "multiple": false, - "description": "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 'NONE'. 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. The 'DE' should not be included as a part of the number. This field has a limit of 100 characters.
" + "tooltip": "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 'NONE'. 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. The 'DE' should not be included as a part of the number. This field has a limit of 100 characters.
" }, "acknowledgement": { "type": "string", @@ -179,7 +181,7 @@ "sequence": 18, "multiple": false, "label": "Dataset Acknowledgement(s)", - "description": "Acknowledgement that you want the users of this data to include when they use the data (different from citation). Acknowledgements can include relevant DOI or paper(s), and/or funding for the site support. You can also indicate that you prefer to be contacted for acknowledgement text. If NGEE Tropics resources (financial, personnel etc.) were used, include the following line: 'Funding for NGEE-Tropics data resources was provided by the U.S. Department of Energy Office of Science, Office of Biological and Environmental Research.'
" + "tooltip": "Acknowledgement that you want the users of this data to include when they use the data (different from citation). Acknowledgements can include relevant DOI or paper(s), and/or funding for the site support. You can also indicate that you prefer to be contacted for acknowledgement text. If NGEE Tropics resources (financial, personnel etc.) were used, include the following line: 'Funding for NGEE-Tropics data resources was provided by the U.S. Department of Energy Office of Science, Office of Biological and Environmental Research.'
" }, "reference": { "type": "string", @@ -188,7 +190,7 @@ "label": "Dataset Reference(s)", "sequence": 19, "multiple": false, - "description": "Associated publications or datasets where users can learn more about the data, processing method, or how the data were used. Ideally, provide complete citation information for the publication (including DOI). This field has a limit of 2,255 characters.
" + "tooltip": "Associated publications or datasets where users can learn more about the data, processing method, or how the data were used. Ideally, provide complete citation information for the publication (including DOI). This field has a limit of 2,255 characters.
" }, "additional_reference_information": { "type": "string", @@ -197,7 +199,7 @@ "label": "Additional Information about Dataset Reference(s)", "sequence": 20, "multiple": false, - "description": "Brief description of dataset reference (e,g, paper) relevance, relationship with this dataset or other comments. This field has a limit of 2,255 characters.
" + "tooltip": "Brief tooltip of dataset reference (e,g, paper) relevance, relationship with this dataset or other comments. This field has a limit of 2,255 characters.
" }, "access_level": { "type": "choice", @@ -216,7 +218,7 @@ ], "sequence": 21, "multiple": false, - "description": "Privacy setting for data files once the submitted record is approved. Choices are Public, NGEE Tropics, Private. Public: Data and metadata can be viewed and downloaded by anyone. NGEE Tropics: Metadata can be viewed by anyone. Data files are available for download to NGEE Tropics personnel and collaborators only. Private: Metadata can be viewed by anyone. Data files are not available for download. 'Private' Datasets that have used NGEE Tropics Resources (financial, personnel etc.) will automatically be set to 'NGEE Tropics' access within 6 months of submission. 'Private and 'NGEE Tropics' datasets that have used NGEE Tropics Resources will be set to 'Public' access within 18 months of submission.
" + "tooltip": "Privacy setting for data files once the submitted record is approved. Choices are Public, NGEE Tropics, Private. Public: Data and metadata can be viewed and downloaded by anyone. NGEE Tropics: Metadata can be viewed by anyone. Data files are available for download to NGEE Tropics personnel and collaborators only. Private: Metadata can be viewed by anyone. Data files are not available for download. 'Private' Datasets that have used NGEE Tropics Resources (financial, personnel etc.) will automatically be set to 'NGEE Tropics' access within 6 months of submission. 'Private and 'NGEE Tropics' datasets that have used NGEE Tropics Resources will be set to 'Public' access within 18 months of submission.
" }, "additional_access_information": { "type": "string", @@ -225,7 +227,7 @@ "label": "Additional Information about Dataset Access", "sequence": 22, "multiple": false, - "description": "Provide comments, if necessary regarding data access. Indicate if there are any data usage constraints here. Specify a publication date if you DO NOT wish this dataset to go public on March 31, 2019.
" + "tooltip": "Provide comments, if necessary regarding data access. Indicate if there are any data usage constraints here. Specify a publication date if you DO NOT wish this dataset to go public on March 31, 2019.
" }, "cdiac_submission_contact": { "type": "field", @@ -241,7 +243,7 @@ "label": "Dataset DOI", "sequence": -1, "multiple": false, - "description": "DOI for this dataset.
" + "tooltip": "DOI for this dataset.
" }, "url": { "type": "field",