diff --git a/.github/workflows/bot.yaml b/.github/workflows/bot.yaml new file mode 100644 index 0000000..dd5a930 --- /dev/null +++ b/.github/workflows/bot.yaml @@ -0,0 +1,57 @@ +name: Bot validation + +on: + push: + paths: + - 'caltechdata_api/cli.py' + - 'caltechdata_api/customize_schema.py' + - 'caltechdata_api/caltechdata_write.py' + - 'caltechdata_api/caltechdata_edit.py' + - 'README.md' + pull_request: + paths: + - 'caltechdata_api/cli.py' + - 'caltechdata_api/customize_schema.py' + - 'caltechdata_api/caltechdata_write.py' + - 'caltechdata_api/caltechdata_edit.py' + - 'README.md' + +jobs: + validate-metadata: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Check for Required Environment Variables + env: + CALTECHDATA_TOKEN: ${{ secrets.CALTECHDATA_TOKEN }} + run: | + if [ -z "$CALTECHDATA_TOKEN" ]; then + echo "Error: CALTECHDATA_TOKEN environment variable is not set" + exit 1 + fi + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest requests s3fs cryptography + pip install . + + - name: Run CaltechDATA Metadata Validation + env: + CALTECHDATA_TOKEN: ${{ secrets.CALTECHDATA_TOKEN }} + run: | + python tests/bot_yaml.py + - name: Run Unit Tests + run: | + cd tests + pytest test_unit.py + pytest test_rdm.py diff --git a/CITATION.cff b/CITATION.cff index 42d962f..755abe9 100755 --- a/CITATION.cff +++ b/CITATION.cff @@ -22,4 +22,4 @@ keywords: - metadata - software - InvenioRDM -date-released: 2024-12-18 + diff --git a/caltechdata_api/__init__.py b/caltechdata_api/__init__.py index 8a6ff52..b289898 100644 --- a/caltechdata_api/__init__.py +++ b/caltechdata_api/__init__.py @@ -9,7 +9,8 @@ caltechdata_unembargo, caltechdata_accept, ) -from .customize_schema import customize_schema +from .customize_schema import customize_schema, validate_metadata from .get_metadata import get_metadata from .download_file import download_file, download_url from .utils import humanbytes +from .md_to_json import parse_readme_to_json diff --git a/caltechdata_api/cli.py b/caltechdata_api/cli.py index a0b46ae..21afd7a 100644 --- a/caltechdata_api/cli.py +++ b/caltechdata_api/cli.py @@ -1,8 +1,7 @@ import argparse import requests import s3fs -from caltechdata_api import caltechdata_write, caltechdata_edit -from md_to_json import parse_readme_to_json +from caltechdata_api import caltechdata_write, caltechdata_edit, parse_readme_to_json import json import os from cryptography.fernet import Fernet @@ -34,7 +33,7 @@ def generate_key(): return Fernet.generate_key() -# Load the key from a file or generate a new one if not present +# Load the key from a file or generate a new one if not present. def load_or_generate_key(): key_file = os.path.join(caltechdata_directory, "key.key") if os.path.exists(key_file): @@ -59,11 +58,17 @@ def decrypt_token(encrypted_token, key): return f.decrypt(encrypted_token).decode() -# Function to get or set token with support for test system +# Function to get or set token with support for test systems def get_or_set_token(production=True): + # First check for environment variable + env_token = os.environ.get("CALTECHDATA_TOKEN") + if env_token: + print("Using token from environment variable") + return env_token + key = load_or_generate_key() - # Use different token files for production and test environments + # Use different token files for production and test environment token_filename = "token.txt" if production else "token_test.txt" token_file = os.path.join(caltechdata_directory, token_filename) diff --git a/caltechdata_api/customize_schema.py b/caltechdata_api/customize_schema.py index 846b2d6..d3bfbf9 100644 --- a/caltechdata_api/customize_schema.py +++ b/caltechdata_api/customize_schema.py @@ -480,18 +480,17 @@ def validate_metadata(json_record): errors.append("Each 'subject' must have a 'subject' key.") # Check for 'dates' - if "dates" not in json_record: - errors.append("'dates' field is missing.") - elif not isinstance(json_record["dates"], list) or len(json_record["dates"]) == 0: - errors.append("'dates' should be a non-empty list.") - else: - for date in json_record["dates"]: - if ( - not isinstance(date, dict) - or "date" not in date - or "dateType" not in date - ): - errors.append("Each 'date' must have 'date' and 'dateType'.") + if "dates" in json_record: + if not isinstance(json_record["dates"], list) or len(json_record["dates"]) == 0: + errors.append("'dates' should be a non-empty list.") + else: + for date in json_record["dates"]: + if ( + not isinstance(date, dict) + or "date" not in date + or "dateType" not in date + ): + errors.append("Each 'date' must have 'date' and 'dateType'.") # Check for 'creators' if "creators" not in json_record: @@ -601,10 +600,9 @@ def validate_metadata(json_record): errors.append("'publisher' should be a string.") # Check for 'publicationYear' - if "publicationYear" not in json_record: - errors.append("'publicationYear' field is missing.") - elif not isinstance(json_record["publicationYear"], str): - errors.append("'publicationYear' should be a string.") + if "publicationYear" in json_record: + if not isinstance(json_record["publicationYear"], str): + errors.append("'publicationYear' should be a string.") # Check for 'types' if "types" not in json_record: diff --git a/tests/10.22002-D1.1098 b/tests/10.22002-D1.1098 deleted file mode 100644 index 83bf35d..0000000 Binary files a/tests/10.22002-D1.1098 and /dev/null differ diff --git a/tests/bot_yaml.py b/tests/bot_yaml.py new file mode 100644 index 0000000..fe3d489 --- /dev/null +++ b/tests/bot_yaml.py @@ -0,0 +1,157 @@ +import subprocess +import time +from unittest.mock import patch +import sys +import os +import json +import requests +from datetime import datetime +import pytest +import importlib.util +import traceback + + +class CaltechDataTester: + def __init__(self): + # Use GitHub Actions environment or create a local test directory + self.test_dir = os.environ.get( + "GITHUB_WORKSPACE", os.path.join(os.getcwd(), "caltech_test_data") + ) + self.timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") + + # Ensure test directory exists + os.makedirs(self.test_dir, exist_ok=True) + + # Create test run directory + self.test_run_dir = os.path.join(self.test_dir, f"test_run_{self.timestamp}") + os.makedirs(self.test_run_dir, exist_ok=True) + + # Initialize logging + self.log_file = os.path.join(self.test_run_dir, "test_log.txt") + + def log(self, message): + """Log message to both console and file""" + print(message) + with open(self.log_file, "a") as f: + f.write(f"{datetime.now()}: {message}\n") + + def create_test_files(self): + """Create necessary test files""" + csv_path = os.path.join(self.test_run_dir, "test_data.csv") + with open(csv_path, "w") as f: + f.write("date,temperature,humidity\n") + f.write("2023-01-01,25.5,60\n") + f.write("2023-01-02,26.0,62\n") + f.write("2023-01-03,24.8,65\n") + + self.log(f"Created test CSV file: {csv_path}") + return csv_path + + def import_cli_module(self): + """Dynamically import cli module from the correct path""" + cli_path = os.path.join( + os.environ.get("GITHUB_WORKSPACE", os.getcwd()), "caltechdata_api", "cli.py" + ) + spec = importlib.util.spec_from_file_location("cli", cli_path) + cli_module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(cli_module) + return cli_module + + def generate_test_responses(self): + """Generate test responses for CLI prompts""" + return { + "Do you want to create or edit a CaltechDATA record? (create/edit): ": "create", + "Do you want to use metadata from an existing file or create new metadata? (existing/create): ": "create", + "Enter the title of the dataset: ": f"Test Dataset {self.timestamp}", + "Enter the abstract or description of the dataset: ": "This is an automated test dataset containing sample climate data for validation purposes.", + "Enter the number corresponding to the desired license: ": "1", + "Enter your ORCID identifier: ": os.environ.get( + "TEST_ORCID", "0000-0002-1825-0097" + ), + "How many funding entries do you want to provide? ": "1", + "Enter the award number for funding: ": "NSF-1234567", + "Enter the award title for funding: ": "Automated Testing Grant", + "Enter the funder ROR (https://ror.org): ": "021nxhr62", + "Do you want to upload or link data files? (upload/link/n): ": "upload", + "Enter the filename to upload as a supporting file (or 'n' to finish): ": "test_data.csv", + "Do you want to add more files? (y/n): ": "n", + "Do you want to send this record to CaltechDATA? (y/n): ": "y", + } + + def run_test_submission(self): + """Run the complete test submission process""" + try: + self.log("Starting test submission process...") + + # Create test files + test_csv = self.create_test_files() + + # Dynamically import cli module + cli_module = self.import_cli_module() + + # Generate responses + responses = self.generate_test_responses() + + # Setup output capture + class OutputCapture: + def __init__(self): + self.output = [] + + def write(self, text): + self.output.append(text) + sys.__stdout__.write(text) + + def flush(self): + pass + + def get_output(self): + return "".join(self.output) + + output_capture = OutputCapture() + sys.stdout = output_capture + + # Mock input and run CLI + def mock_input(prompt): + self.log(f"Prompt: {prompt}") + if prompt in responses: + response = responses[prompt] + self.log(f"Response: {response}") + return response + return "" + + with patch("builtins.input", side_effect=mock_input): + # Use -test flag to use test mode + sys.argv = [sys.argv[0], "-test"] + cli_module.main() + + # Restore stdout + sys.stdout = sys.__stdout__ + + return True + + except Exception as e: + self.log(f"Error in test submission: {e}") + traceback.print_exc() + return False + finally: + # Cleanup + if "test_csv" in locals() and os.path.exists(test_csv): + os.remove(test_csv) + self.log("Test files cleaned up") + + +def main(): + tester = CaltechDataTester() + + success = tester.run_test_submission() + + if success: + tester.log("\n🎉 Test submission completed successfully!") + sys.exit(0) + else: + tester.log("\n❌ Test submission failed - check logs for details") + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/tests/data/datacite4/1171.json b/tests/data/datacite4/1171.json deleted file mode 100644 index a4e9d27..0000000 --- a/tests/data/datacite4/1171.json +++ /dev/null @@ -1,342 +0,0 @@ -{ - "alternateIdentifiers": [ - { - "alternateIdentifier": "GGG2014", - "alternateIdentifierType": "Software_Version" - }, - { - "alternateIdentifier": "eu", - "alternateIdentifierType": "id" - }, - { - "alternateIdentifier": "eureka01", - "alternateIdentifierType": "longName" - }, - { - "alternateIdentifier": "R1", - "alternateIdentifierType": "Data_Revision" - }, - { - "alternateIdentifier": "1171", - "alternateIdentifierType": "CaltechDATA_Identifier" - }, - { - "alternateIdentifier": "1171", - "alternateIdentifierType": "CaltechDATA_Identifier" - }, - { - "alternateIdentifier": "1171", - "alternateIdentifierType": "CaltechDATA_Identifier" - } - ], - "contributors": [ - { - "contributorName": "California Institute of Techonolgy, Pasadena, CA (US)", - "contributorType": "HostingInstitution", - "nameIdentifiers": [ - { - "nameIdentifier": "grid.20861.3d", - "nameIdentifierScheme": "GRID" - } - ] - }, - { - "contributorName": "Roehl, C. M.", - "contributorType": "DataCurator", - "affiliations": [ - "California Institute of Technology, Pasadena, CA (US)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5383-8462", - "nameIdentifierScheme": "ORCID" - } - ] - }, - { - "contributorName": "Kimberly Strong", - "contributorType": "ContactPerson", - "contributorEmail": "strong@atmosp.physics.utoronto.ca", - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-9947-1053", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "D-2563-2012", - "nameIdentifierScheme": "ResearcherID" - } - ] - }, - { - "contributorName": "TCCON", - "contributorType": "ResearchGroup" - } - ], - "descriptions": [ - { - "descriptionType": "Abstract", - "description": "
The Total Carbon Column Observing Network (TCCON) is a network of ground-based Fourier Transform Spectrometers that record direct solar absorption spectra of the atmosphere in the near-infrared. From these spectra, accurate and precise column-averaged abundances of atmospheric constituents including CO2, CH4, N2O, HF, CO, H2O, and HDO, are retrieved. This data set contains observations from the TCCON station at Eureka, Canada." - }, - { - "descriptionType": "Other", - "description": "
Cite this record as:
Strong, K., Roche, S., Franklin, J. E., Mendonca, J., Lutsch, E., Weaver, D., … Lindenmaier, R. (2018). TCCON data from Eureka (CA), Release GGG2014.R3 [Data set]. CaltechDATA. https://doi.org/10.14291/tccon.ggg2014.eureka01.r3
or choose a different citation style.
Download Citation
" - } - ], - "fundingReferences": [ - { - "funderName": "Atlantic Innovation Fund" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.439998.6", - "funderIdentifierType": "GRID" - }, - "funderName": "Canada Foundation for Innovation" - }, - { - "funderName": "Canadian Foundation for Climate and Atmospheric Sciences" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.236846.d", - "funderIdentifierType": "GRID" - }, - "funderName": "Canadian Space Agency" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.410334.1", - "funderIdentifierType": "GRID" - }, - "funderName": "Environment and Climate Change Canada" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.451254.3", - "funderIdentifierType": "GRID" - }, - "funderName": "Government of Canada (International Polar Year funding)" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.452912.9", - "funderIdentifierType": "GRID" - }, - "funderName": "Natural Sciences and Engineering Research Council of Canada" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.465477.3", - "funderIdentifierType": "GRID" - }, - "funderName": "Polar Commission (Northern Scientific Training Program)" - }, - { - "funderName": "Nova Scotia Research Innovation Trust" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.451078.f", - "funderIdentifierType": "GRID" - }, - "funderName": "Ministry of Research and Innovation (Ontario Innovation Trust and Ontario Research Fund)" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.202033.0", - "funderIdentifierType": "GRID" - }, - "funderName": "Natural Resources Canada (Polar Continental Shelf Program)" - } - ], - "language": "eng", - "relatedIdentifiers": [ - { - "relatedIdentifier": "10.14291/tccon.ggg2014.documentation.R0/1221662", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.14291/tccon.ggg2014.eureka01.R0/1149271", - "relationType": "IsNewVersionOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Network_Policy/Data_Use_Policy/Data_Description", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Sites", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "10.14291/TCCON.GGG2014", - "relationType": "IsPartOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.14291/tccon.ggg2014.eureka01.R1/1325515", - "relationType": "IsNewVersionOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.14291/tccon.ggg2014.eureka01.R2", - "relationType": "IsNewVersionOf", - "relatedIdentifierType": "DOI" - } - ], - "resourceType": { - "resourceTypeGeneral": "Dataset" - }, - "rightsList": [ - { - "rights": "TCCON Data License", - "rightsURI": "https://data.caltech.edu/tindfiles/serve/8298981c-6613-4ed9-9c54-5ef8fb5180f4/" - } - ], - "subjects": [ - { - "subject": "atmospheric trace gases" - }, - { - "subject": "CO2" - }, - { - "subject": "CH4" - }, - { - "subject": "CO" - }, - { - "subject": "N2O" - }, - { - "subject": "column-averaged dry-air mole fractions" - }, - { - "subject": "remote sensing" - }, - { - "subject": "FTIR spectroscopy" - }, - { - "subject": "TCCON" - } - ], - "version": "R3", - "identifier": { - "identifier": "10.14291/tccon.ggg2014.eureka01.R3", - "identifierType": "DOI" - }, - "titles": [ - { - "title": "TCCON data from Eureka (CA), Release GGG2014.R3" - } - ], - "creators": [ - { - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)" - ], - "creatorName": "Strong, K." - }, - { - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)" - ], - "creatorName": "Roche, S." - }, - { - "affiliations": [ - "School of Engineering and Applied Sciences, Harvard University, Cambridge, MA (USA)" - ], - "creatorName": "Franklin, J. E." - }, - { - "affiliations": [ - "Environment and Climate Change Canada, Downsview, ON (CA)" - ], - "creatorName": "Mendonca, J." - }, - { - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)" - ], - "creatorName": "Lutsch, E." - }, - { - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)" - ], - "creatorName": "Weaver, D." - }, - { - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)" - ], - "creatorName": "Fogal, P. F." - }, - { - "affiliations": [ - "Department of Physics & Atmospheric Science, Dalhousie University, Halifax, NS, CA" - ], - "creatorName": "Drummond, J. R." - }, - { - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)", - "UCAR Center for Science Education, Boulder, CO (US)" - ], - "creatorName": "Batchelor, R." - }, - { - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)", - "Pacific Northwest National Laboratory, Richland, WA (US)" - ], - "creatorName": "Lindenmaier, R." - } - ], - "formats": [ - "application/x-netcdf" - ], - "dates": [ - { - "date": "2019-01-31", - "dateType": "Created" - }, - { - "date": "2019-05-01", - "dateType": "Updated" - }, - { - "date": "2010-07-24/2018-04-28", - "dateType": "Collected" - }, - { - "date": "2019-01-31", - "dateType": "Submitted" - }, - { - "date": "2019-01-31", - "dateType": "Issued" - } - ], - "publicationYear": "2018", - "geoLocations": [ - { - "geoLocationPlace": "Eureka, NU (CA)", - "geoLocationPoint": { - "pointLatitude": 80.05, - "pointLongitude": -86.42 - } - } - ], - "publisher": "CaltechDATA" -} diff --git a/tests/data/datacite4/1235.json b/tests/data/datacite4/1235.json deleted file mode 100644 index 650d32d..0000000 --- a/tests/data/datacite4/1235.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "descriptions": [ - { - "descriptionType": "Abstract", - "description": "First included in ames, this notebook dynamically shows how many records are in CaltechDATA and where they come from (GitHub, Deposit Form, or API). This repository is set to work with MyBinder so you can easily reproduce the plot and include new records. " - }, - { - "descriptionType": "Other", - "description": "
Cite this record as:
Morrell, T. E. (2019, April 29). caltechlibrary/caltechdata_usage: First release of CaltechDATA Usage notebook (Version v0.0.1). CaltechDATA. https://doi.org/10.22002/d1.1235
or choose a different citation style.
Download Citation
" - }, - { - "descriptionType": "Other", - "description": "
Unique Views: 2
Unique Downloads: 1
between April 29, 2019 and June 12, 2019
More info on how stats are collected
" - } - ], - "relatedIdentifiers": [ - { - "relatedIdentifier": "https://github.com/caltechlibrary/caltechdata_usage/releases/tag/v0.0.1", - "relationType": "IsIdenticalTo", - "relatedIdentifierType": "URL" - } - ], - "resourceType": { - "resourceTypeGeneral": "Software" - }, - "rightsList": [ - { - "rights": "license", - "rightsURI": "https://data.caltech.edu/license" - } - ], - "subjects": [ - { - "subject": "CaltechDATA" - }, - { - "subject": "reporitory" - }, - { - "subject": "usage" - }, - { - "subject": "Jupyter" - }, - { - "subject": "GitHub" - } - ], - "version": "v0.0.1", - "identifier": { - "identifier": "10.22002/D1.1235", - "identifierType": "DOI" - }, - "titles": [ - { - "title": "caltechlibrary/caltechdata_usage: First release of CaltechDATA Usage notebook" - } - ], - "creators": [ - { - "affiliations": [ - "Caltech Library" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-9266-5146", - "nameIdentifierScheme": "ORCID" - } - ], - "creatorName": "Morrell, Thomas E" - } - ], - "dates": [ - { - "date": "2019-04-29", - "dateType": "Issued" - } - ], - "publicationYear": "2019", - "publisher": "CaltechDATA", - "alternateIdentifiers": [ - { - "alternateIdentifier": "1235", - "alternateIdentifierType": "CaltechDATA_Identifier" - } - ] -} diff --git a/tests/data/datacite4/1250.json b/tests/data/datacite4/1250.json deleted file mode 100644 index 388fc7e..0000000 --- a/tests/data/datacite4/1250.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "descriptions": [ - { - "descriptionType": "Abstract", - "description": "This release includes two months more data and has some dependency updates." - }, - { - "descriptionType": "Other", - "description": "Jupyter notebooks highlighting usage of CaltechDATA" - }, - { - "descriptionType": "Other", - "description": "
Click to run this software:
" - }, - { - "descriptionType": "Other", - "description": "
Cite this record as:
Morrell, T. E. (2019, June 19). caltechlibrary/caltechdata_usage: New months and dependency fixes (Version v0.0.2). CaltechDATA. https://doi.org/10.22002/d1.1250
or choose a different citation style.
Download Citation
" - } - ], - "relatedIdentifiers": [ - { - "relatedIdentifier": "https://github.com/caltechlibrary/caltechdata_usage/releases/tag/v0.0.2", - "relationType": "IsIdenticalTo", - "relatedIdentifierType": "URL" - } - ], - "resourceType": { - "resourceTypeGeneral": "Software" - }, - "rightsList": [ - { - "rights": "license", - "rightsURI": "https://data.caltech.edu/license" - } - ], - "subjects": [ - { - "subject": "CaltechDATA" - }, - { - "subject": "reporitory" - }, - { - "subject": "usage" - }, - { - "subject": "Jupyter" - }, - { - "subject": "GitHub" - } - ], - "version": "v0.0.2", - "identifier": { - "identifier": "10.22002/D1.1250", - "identifierType": "DOI" - }, - "titles": [ - { - "title": "caltechlibrary/caltechdata_usage: Jupyter notebook with visualization of submissions to CaltechDATA" - } - ], - "creators": [ - { - "affiliations": [ - "Caltech Library" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-9266-5146", - "nameIdentifierScheme": "ORCID" - } - ], - "creatorName": "Morrell, Thomas E" - } - ], - "dates": [ - { - "date": "2019-06-19", - "dateType": "Issued" - } - ], - "publicationYear": "2019", - "publisher": "CaltechDATA", - "alternateIdentifiers": [ - { - "alternateIdentifier": "1250", - "alternateIdentifierType": "CaltechDATA_Identifier" - } - ] -} diff --git a/tests/data/datacite4/1259.json b/tests/data/datacite4/1259.json deleted file mode 100644 index 3f9747b..0000000 --- a/tests/data/datacite4/1259.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "descriptions": [ - { - "descriptionType": "Abstract", - "description": "This release includes a new notebook that determines the use of ORCID iDs across Caltech Library DOIs. It also updates all notebooks to use the latest version of ames and streamlines dependencies." - }, - { - "descriptionType": "Other", - "description": "Jupyter notebooks highlighting usage of CaltechDATA" - }, - { - "descriptionType": "Other", - "description": "
Click to run this software:
" - } - ], - "relatedIdentifiers": [ - { - "relatedIdentifier": "https://github.com/caltechlibrary/caltechdata_usage/releases/tag/v0.1.0", - "relationType": "IsIdenticalTo", - "relatedIdentifierType": "URL" - } - ], - "resourceType": { - "resourceTypeGeneral": "Software" - }, - "rightsList": [ - { - "rights": "license", - "rightsURI": "https://data.caltech.edu/license" - } - ], - "subjects": [ - { - "subject": "CaltechDATA" - }, - { - "subject": "reporitory" - }, - { - "subject": "usage" - }, - { - "subject": "Jupyter" - }, - { - "subject": "GitHub" - } - ], - "version": "v0.1.0", - "identifier": { - "identifier": "10.22002/D1.1259", - "identifierType": "DOI" - }, - "titles": [ - { - "title": "caltechlibrary/caltechdata_usage: Addition of ORCID analysis notebook and update for new ames version" - } - ], - "creators": [ - { - "affiliations": [ - "Caltech Library" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-9266-5146", - "nameIdentifierScheme": "ORCID" - } - ], - "creatorName": "Morrell, Thomas E" - } - ], - "dates": [ - { - "date": "2019-07-16", - "dateType": "Issued" - } - ], - "publicationYear": "2019", - "publisher": "CaltechDATA", - "alternateIdentifiers": [ - { - "alternateIdentifier": "1259", - "alternateIdentifierType": "CaltechDATA_Identifier" - } - ] -} diff --git a/tests/data/datacite4/1300.json b/tests/data/datacite4/1300.json deleted file mode 100644 index 7c2d185..0000000 --- a/tests/data/datacite4/1300.json +++ /dev/null @@ -1,400 +0,0 @@ -{ - "alternateIdentifiers": [ - { - "alternateIdentifier": "GGG2014", - "alternateIdentifierType": "Software_Version" - }, - { - "alternateIdentifier": "bi", - "alternateIdentifierType": "id" - }, - { - "alternateIdentifier": "bialystok01", - "alternateIdentifierType": "longName" - }, - { - "alternateIdentifier": "R1", - "alternateIdentifierType": "Data_Revision" - }, - { - "alternateIdentifier": "267", - "alternateIdentifierType": "CaltechDATA_Identifier" - } - ], - "contributors": [ - { - "contributorName": "California Institute of Techonolgy, Pasadena, CA (US)", - "contributorType": "HostingInstitution", - "nameIdentifiers": [ - { - "nameIdentifier": "grid.20861.3d", - "nameIdentifierScheme": "GRID" - } - ] - }, - { - "contributorName": "Roehl, C. M.", - "contributorType": "DataCurator", - "affiliations": [ - "California Institute of Technology, Pasadena, CA (US)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5383-8462", - "nameIdentifierScheme": "ORCID" - } - ] - }, - { - "contributorName": "Katryński, K.", - "contributorType": "Other", - "affiliations": [ - "AeroMeteo Service, Białystok (PL)" - ] - }, - { - "contributorName": "Christof Petri", - "contributorType": "ContactPerson" - }, - { - "contributorName": "TCCON", - "contributorType": "ResearchGroup" - } - ], - "descriptions": [ - { - "descriptionType": "Abstract", - "description": "The Total Carbon Column Observing Network (TCCON) is a network of ground-based Fourier Transform Spectrometers that record direct solar absorption spectra of the atmosphere in the near-infrared. From these spectra, accurate and precise column-averaged abundances of atmospheric constituents including CO2, CH4, N2O, HF, CO, H2O, and HDO, are retrieved. This data set contains observations from the TCCON station at Bialystok, Poland." - } - ], - "fundingReferences": [ - { - "awardNumber": { - "awardNumber": "26188", - "awardURI": "http://cordis.europa.eu/project/rcn/81606_en.html" - }, - "awardTitle": "Infrastructure for Measurement of the European Carbon Cycle (IMECC)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "36677", - "awardURI": "http://cordis.europa.eu/project/rcn/84619_en.html" - }, - "awardTitle": "Global Earth observation and monitoring (GEOMON)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "284274", - "awardURI": "http://cordis.europa.eu/project/rcn/101549_en.html" - }, - "awardTitle": "Integrated non-CO2 Greenhouse gas Observing System (INGOS)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "313169", - "awardURI": "http://cordis.europa.eu/project/rcn/106570_en.html" - }, - "awardTitle": "ICOS improved sensors, network and interoperability for GMES (ICOS-INWIRE)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "640276", - "awardURI": "http://cordis.europa.eu/project/rcn/193710_en.html" - }, - "awardTitle": "Gap Analysis for Integrated Atmospheric ECV CLImate Monitoring (GAIA-CLIM)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "funderName": "Senate of Bremen" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.7704.4", - "funderIdentifierType": "GRID" - }, - "funderName": "University of Bremen" - } - ], - "language": "eng", - "relatedIdentifiers": [ - { - "relatedIdentifier": "10.14291/tccon.ggg2014.documentation.R0/1221662", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-9-683-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-16-14003-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-9-3491-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/rs8050414", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.14291/tccon.ggg2014.bialystok01.R0/1149277", - "relationType": "IsNewVersionOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Network_Policy/Data_Use_Policy/Data_Description", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Sites", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "10.14291/TCCON.GGG2014", - "relationType": "IsPartOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "http://tccondata.org", - "relationType": "IsPartOf", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "10.3390/rs9101033", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-17-4781-2017", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/atmos9050175", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/rs10030469", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-10-4135-2017", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-11-1251-2018", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-11-3111-2018", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.14291/tccon.ggg2014.bialystok01.R1/1183984", - "relationType": "IsNewVersionOf", - "relatedIdentifierType": "DOI" - } - ], - "resourceType": { - "resourceTypeGeneral": "Dataset" - }, - "rightsList": [ - { - "rights": "TCCON Data License", - "rightsURI": "https://data.caltech.edu/tindfiles/serve/7a5e834c-39e9-4d13-9c55-f50a4532885d/" - } - ], - "subjects": [ - { - "subject": "atmospheric trace gases" - }, - { - "subject": "CO2" - }, - { - "subject": "CH4" - }, - { - "subject": "CO" - }, - { - "subject": "N2O" - }, - { - "subject": "column-averaged dry-air mole fractions" - }, - { - "subject": "remote sensing" - }, - { - "subject": "FTIR spectroscopy" - }, - { - "subject": "TCCON" - } - ], - "version": "R2", - "identifier": { - "identifier": "10.14291/tccon.ggg2014.bialystok01.R2", - "identifierType": "DOI" - }, - "titles": [ - { - "title": "TCCON data from Bialystok (PL), Release GGG2014.R2" - } - ], - "creators": [ - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)", - "Centre for Atmospheric Chemistry, School of Chemistry, University of Wollongong, Wollongong, NSW (AU)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-2906-2577", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "E-3683-2015", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Deutscher, N. M." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-3324-885X", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "P-4520-2016", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Notholt, J." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "creatorName": "Messerschmidt, J." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "creatorName": "Weinzierl, C." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5185-3415", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "K-1884-2012", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Warneke, T." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-7010-5532", - "nameIdentifierScheme": "ORCID" - } - ], - "creatorName": "Petri, C." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "creatorName": "Grupe, P." - } - ], - "formats": [ - "application/x-netcdf" - ], - "dates": [ - { - "date": "2019-10-21", - "dateType": "Created" - }, - { - "date": "2019-10-21", - "dateType": "Updated" - }, - { - "date": "2009-03-01/2018-09-29", - "dateType": "Collected" - }, - { - "date": "2019-10-21", - "dateType": "Submitted" - }, - { - "date": "2019-10-21", - "dateType": "Issued" - } - ], - "publicationYear": "2019", - "geoLocations": [ - { - "geoLocationPlace": "Białystok (PL)", - "geoLocationPoint": { - "pointLatitude": 53.23, - "pointLongitude": 23.025 - } - } - ], - "publisher": "CaltechDATA" -} diff --git a/tests/data/datacite4/210.json b/tests/data/datacite4/210.json deleted file mode 100644 index 71851ff..0000000 --- a/tests/data/datacite4/210.json +++ /dev/null @@ -1,403 +0,0 @@ -{ - "alternateIdentifiers": [ - { - "alternateIdentifier": "GGG2014", - "alternateIdentifierType": "Software_Version" - }, - { - "alternateIdentifier": "ae", - "alternateIdentifierType": "id" - }, - { - "alternateIdentifier": "ascension01", - "alternateIdentifierType": "longName" - }, - { - "alternateIdentifier": "R0", - "alternateIdentifierType": "Data_Revision" - }, - { - "alternateIdentifier": "210", - "alternateIdentifierType": "CaltechDATA_Identifier" - } - ], - "contributors": [ - { - "contributorName": "California Institute of Techonolgy, Pasadena, CA (US)", - "contributorType": "HostingInstitution", - "nameIdentifiers": [ - { - "nameIdentifier": "grid.20861.3d", - "nameIdentifierScheme": "GRID" - } - ] - }, - { - "contributorName": "Roehl, C. M.", - "contributorType": "DataCurator", - "affiliations": [ - "California Institute of Technology, Pasadena, CA (US)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5383-8462", - "nameIdentifierScheme": "ORCID" - } - ] - }, - { - "contributorName": "Dietrich Feist", - "contributorType": "ContactPerson", - "contributorEmail": "d.feist@lmu.de" - }, - { - "contributorName": "TCCON", - "contributorType": "ResearchGroup" - } - ], - "creators": [ - { - "affiliations": [ - "Ludwig-Maximilians-Universität München, Lehrstuhl für Physik der Atmosphäre, Munich (DE)", - "Deutsches Zentrum für Luft- und Raumfahrt, Institut für Physik der Atmosphäre, Oberpfaffenhofen (DE)", - "Max Planck Institute for Biogeochemistry, Jena (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-5890-6687", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "B-6489-2013", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Feist, D. G." - }, - { - "affiliations": [ - "Max Planck Institute for Biogeochemistry, Jena (DE)" - ], - "creatorName": "Arnold, S. G." - }, - { - "affiliations": [ - "Ariane Tracking Station, Ascension Island (SH)" - ], - "creatorName": "John, N." - }, - { - "affiliations": [ - "Stockholm University, Stockholm (SE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-7369-0781", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "B-8591-2015", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Geibel, M. C." - } - ], - "descriptions": [ - { - "descriptionType": "Abstract", - "description": "The Total Carbon Column Observing Network (TCCON) is a network of ground-based Fourier Transform Spectrometers that record direct solar absorption spectra of the atmosphere in the near-infrared. From these spectra, accurate and precise column-averaged abundances of atmospheric constituents including CO2, CH4, N2O, HF, CO, H2O, and HDO, are retrieved. This data set contains observations from the TCCON station on Ascension Island." - }, - { - "descriptionType": "Other", - "description": "
Cite this record as:
Feist, D. G., Arnold, S. G., John, N., & Geibel, M. C. (2014). TCCON data from Ascension Island (SH), Release GGG2014.R0 [Data set]. CaltechDATA. https://doi.org/10.14291/tccon.ggg2014.ascension01.r0/1149285
or choose a different citation style.
Download Citation
" - }, - { - "descriptionType": "Other", - "description": "
Unique Views: 463
Unique Downloads: 103
between February 21, 2017 and September 04, 2019
More info on how stats are collected
" - } - ], - "fundingReferences": [ - { - "awardNumber": { - "awardNumber": "50EE1711E" - }, - "funderIdentifier": { - "funderIdentifier": "grid.424440.2", - "funderIdentifierType": "GRID" - }, - "funderName": "Bundesministerium fĂĽr Wirtschaft und Energie" - }, - { - "awardNumber": { - "awardNumber": "50EE1711C" - }, - "funderIdentifier": { - "funderIdentifier": "grid.424440.2", - "funderIdentifierType": "GRID" - }, - "funderName": "Bundesministerium fĂĽr Wirtschaft und Energie" - }, - { - "awardNumber": { - "awardNumber": "3-14737" - }, - "funderIdentifier": { - "funderIdentifier": "grid.410379.8", - "funderIdentifierType": "GRID" - }, - "funderName": "European Space Agency" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.419500.9", - "funderIdentifierType": "GRID" - }, - "funderName": "Max Planck Institute for Biogeochemistry" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.4372.2", - "funderIdentifierType": "GRID" - }, - "funderName": "Max Planck Society" - } - ], - "language": "eng", - "publicationYear": "2014", - "publisher": "CaltechDATA", - "relatedIdentifiers": [ - { - "relatedIdentifier": "10.14291/tccon.ggg2014.documentation.R0/1221662", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Network_Policy/Data_Use_Policy/Data_Description", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Sites", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "10.14291/TCCON.GGG2014", - "relationType": "IsPartOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "http://tccondata.org", - "relationType": "IsPartOf", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "10.5194/acp-19-9797-2019", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-19-7347-2019", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-12-2241-2019", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-12-1495-2019", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-11-6539-2018", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-11-5507-2018", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-11-3111-2018", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/rs10010155", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.1002/2017JD026453", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.1109/jstars.2017.2650942", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/gmd-10-1261-2017", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/gmd-10-1-2017", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-17-4781-2017", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-10-4135-2017", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-10-2209-2017", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/rs9101033", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.1038/s41598-017-13459-0", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-9-3491-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-9-2381-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-9-1415-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-9-683-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-16-1653-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.1002/2016JD026164", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.1002/2015JD023389", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.1002/2015JD024157", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - } - ], - "resourceType": { - "resourceTypeGeneral": "Dataset" - }, - "rightsList": [ - { - "rights": "TCCON Data Use Policy", - "rightsURI": "https://data.caltech.edu/tindfiles/serve/cb9b01e4-56ea-4b8c-9543-0c61d0c72148/" - } - ], - "subjects": [ - { - "subject": "atmospheric trace gases" - }, - { - "subject": "CO2" - }, - { - "subject": "CH4" - }, - { - "subject": "CO" - }, - { - "subject": "N2O" - }, - { - "subject": "column-averaged dry-air mole fractions" - }, - { - "subject": "remote sensing" - }, - { - "subject": "FTIR spectroscopy" - }, - { - "subject": "TCCON" - } - ], - "titles": [ - { - "title": "TCCON data from Ascension Island (SH), Release GGG2014.R0" - } - ], - "version": "GGG2014.R0", - "identifier": { - "identifier": "10.14291/tccon.ggg2014.ascension01.R0/1149285", - "identifierType": "DOI" - }, - "formats": [ - "application/x-netcdf" - ], - "dates": [ - { - "date": "2014-10-01", - "dateType": "Created" - }, - { - "date": "2014-10-10", - "dateType": "Issued" - }, - { - "date": "2019-09-06", - "dateType": "Updated" - }, - { - "date": "2012-05-22/2018-10-31", - "dateType": "Collected" - }, - { - "date": "2017-02-21", - "dateType": "Submitted" - } - ], - "geoLocations": [ - { - "geoLocationPlace": "Ariane Tracking Station (AC)", - "geoLocationPoint": { - "pointLatitude": -7.9165, - "pointLongitude": -14.3325 - } - } - ] -} diff --git a/tests/data/datacite4/266.json b/tests/data/datacite4/266.json deleted file mode 100644 index c2ccc4f..0000000 --- a/tests/data/datacite4/266.json +++ /dev/null @@ -1,205 +0,0 @@ -{ - "alternateIdentifiers": [ - { - "alternateIdentifier": "GGG2014", - "alternateIdentifierType": "Software_Version" - }, - { - "alternateIdentifier": "an", - "alternateIdentifierType": "id" - }, - { - "alternateIdentifier": "anmeyondo01", - "alternateIdentifierType": "longName" - }, - { - "alternateIdentifier": "R0", - "alternateIdentifierType": "Data_Revision" - }, - { - "alternateIdentifier": "266", - "alternateIdentifierType": "CaltechDATA_Identifier" - } - ], - "contributors": [ - { - "contributorName": "California Institute of Techonolgy, Pasadena, CA (US)", - "contributorType": "HostingInstitution", - "nameIdentifiers": [ - { - "nameIdentifier": "grid.20861.3d", - "nameIdentifierScheme": "GRID" - } - ] - }, - { - "contributorName": "Roehl, C. M.", - "contributorType": "DataCurator", - "affiliations": [ - "California Institute of Technology, Pasadena, CA (US)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5383-8462", - "nameIdentifierScheme": "ORCID" - } - ] - }, - { - "contributorEmail": "ysoh306@gmail.com", - "contributorName": "Young-Suk Oh", - "contributorType": "ContactPerson" - }, - { - "contributorName": "TCCON", - "contributorType": "ResearchGroup" - } - ], - "creators": [ - { - "affiliations": [ - "National Institute of Meteorological Sciences, Seogwipo-si (KR)" - ], - "creatorName": "Goo, T.-Y." - }, - { - "affiliations": [ - "National Institute of Meteorological Sciences, Seogwipo-si (KR)" - ], - "creatorName": "Oh, Y.-S." - }, - { - "affiliations": [ - "Centre for Atmospheric Chemistry, School of Chemistry, University of Wollongong, Wollongong, NSW (AU)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-1376-438X", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "H-2280-2011", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Velazco, V. A." - } - ], - "descriptions": [ - { - "descriptionType": "Abstract", - "description": "The Total Carbon Column Observing Network (TCCON) is a network of ground-based Fourier Transform Spectrometers that record direct solar absorption spectra of the atmosphere in the near-infrared. From these spectra, accurate and precise column-averaged abundances of atmospheric constituents including CO2, CH4, N2O, HF, CO, H2O, and HDO, are retrieved. This data set contains observations from the TCCON station at Anmeyondo, South Korea." - }, - { - "descriptionType": "Other", - "description": "
Cite this record as:
Goo, T.-Y., Oh, Y.-S., & Velazco, V. A. (2017). TCCON data from Anmeyondo (KR), Release GGG2014.R0 [Data set]. CaltechDATA. https://doi.org/10.14291/tccon.ggg2014.anmeyondo01.r0/1149284
or choose a different citation style.
Download Citation
" - }, - { - "descriptionType": "Other", - "description": "
Unique Views: 176
Unique Downloads: 58
between September 08, 2017 and June 12, 2019
More info on how stats are collected
" - } - ], - "language": "eng", - "publicationYear": "2014", - "publisher": "CaltechDATA", - "relatedIdentifiers": [ - { - "relatedIdentifier": "10.14291/tccon.ggg2014.documentation.R0/1221662", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Network_Policy/Data_Use_Policy/Data_Description", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Sites", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "10.14291/TCCON.GGG2014", - "relationType": "IsPartOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "http://tccondata.org", - "relationType": "IsPartOf", - "relatedIdentifierType": "URL" - } - ], - "resourceType": { - "resourceTypeGeneral": "Dataset" - }, - "rightsList": [ - { - "rights": "TCCON Data Use Policy", - "rightsURI": "https://data.caltech.edu/tindfiles/serve/1f568dd3-02e4-4020-a146-12ee8b53f78a/" - } - ], - "subjects": [ - { - "subject": "atmospheric trace gases" - }, - { - "subject": "CO2" - }, - { - "subject": "CH4" - }, - { - "subject": "CO" - }, - { - "subject": "N2O" - }, - { - "subject": "column-averaged dry-air mole fractions" - }, - { - "subject": "remote sensing" - }, - { - "subject": "FTIR spectroscopy" - }, - { - "subject": "TCCON" - } - ], - "titles": [ - { - "title": "TCCON data from Anmeyondo (KR), Release GGG2014.R0" - } - ], - "version": "GGG2014.R0", - "identifier": { - "identifier": "10.14291/tccon.ggg2014.anmeyondo01.R0/1149284", - "identifierType": "DOI" - }, - "formats": [ - "application/x-netcdf" - ], - "dates": [ - { - "date": "2014-10-10", - "dateType": "Created" - }, - { - "date": "2019-06-01", - "dateType": "Updated" - }, - { - "date": "2015-02-02/2018-04-18", - "dateType": "Collected" - }, - { - "date": "2017-09-08", - "dateType": "Submitted" - }, - { - "date": "2014-10-10", - "dateType": "Issued" - } - ] -} diff --git a/tests/data/datacite4/267.json b/tests/data/datacite4/267.json deleted file mode 100644 index d276824..0000000 --- a/tests/data/datacite4/267.json +++ /dev/null @@ -1,403 +0,0 @@ -{ - "alternateIdentifiers": [ - { - "alternateIdentifier": "GGG2014", - "alternateIdentifierType": "Software_Version" - }, - { - "alternateIdentifier": "bi", - "alternateIdentifierType": "id" - }, - { - "alternateIdentifier": "bialystok01", - "alternateIdentifierType": "longName" - }, - { - "alternateIdentifier": "R1", - "alternateIdentifierType": "Data_Revision" - }, - { - "alternateIdentifier": "267", - "alternateIdentifierType": "CaltechDATA_Identifier" - } - ], - "contributors": [ - { - "contributorName": "California Institute of Techonolgy, Pasadena, CA (US)", - "contributorType": "HostingInstitution", - "nameIdentifiers": [ - { - "nameIdentifier": "grid.20861.3d", - "nameIdentifierScheme": "GRID" - } - ] - }, - { - "contributorName": "Roehl, C. M.", - "contributorType": "DataCurator", - "affiliations": [ - "California Institute of Technology, Pasadena, CA (US)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5383-8462", - "nameIdentifierScheme": "ORCID" - } - ] - }, - { - "contributorName": "Katryński, K.", - "contributorType": "Other", - "affiliations": [ - "AeroMeteo Service, Białystok (PL)" - ] - }, - { - "contributorName": "Christof Petri", - "contributorType": "ContactPerson" - }, - { - "contributorName": "TCCON", - "contributorType": "ResearchGroup" - } - ], - "creators": [ - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)", - "Centre for Atmospheric Chemistry, School of Chemistry, University of Wollongong, Wollongong, NSW (AU)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-2906-2577", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "E-3683-2015", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Deutscher, N. M." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-3324-885X", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "P-4520-2016", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Notholt, J." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "creatorName": "Messerschmidt, J." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "creatorName": "Weinzierl, C." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5185-3415", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "K-1884-2012", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Warneke, T." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-7010-5532", - "nameIdentifierScheme": "ORCID" - } - ], - "creatorName": "Petri, C." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "creatorName": "Grupe, P." - } - ], - "descriptions": [ - { - "descriptionType": "Abstract", - "description": "The Total Carbon Column Observing Network (TCCON) is a network of ground-based Fourier Transform Spectrometers that record direct solar absorption spectra of the atmosphere in the near-infrared. From these spectra, accurate and precise column-averaged abundances of atmospheric constituents including CO2, CH4, N2O, HF, CO, H2O, and HDO, are retrieved. This data set contains observations from the TCCON station at Bialystok, Poland." - }, - { - "descriptionType": "Other", - "description": "
Cite this record as:
Deutscher, N. M., Notholt, J., Messerschmidt, J., Weinzierl, C., Warneke, T., Petri, C., & Grupe, P. (2015). TCCON data from Bialystok (PL), Release GGG2014.R1 [Data set]. CaltechDATA. https://doi.org/10.14291/tccon.ggg2014.bialystok01.r1/1183984
or choose a different citation style.
Download Citation
" - }, - { - "descriptionType": "Other", - "description": "
Unique Views: 213
Unique Downloads: 65
between September 08, 2017 and October 01, 2019
More info on how stats are collected
" - } - ], - "fundingReferences": [ - { - "awardNumber": { - "awardNumber": "26188", - "awardURI": "http://cordis.europa.eu/project/rcn/81606_en.html" - }, - "awardTitle": "Infrastructure for Measurement of the European Carbon Cycle (IMECC)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "36677", - "awardURI": "http://cordis.europa.eu/project/rcn/84619_en.html" - }, - "awardTitle": "Global Earth observation and monitoring (GEOMON)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "284274", - "awardURI": "http://cordis.europa.eu/project/rcn/101549_en.html" - }, - "awardTitle": "Integrated non-CO2 Greenhouse gas Observing System (INGOS)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "313169", - "awardURI": "http://cordis.europa.eu/project/rcn/106570_en.html" - }, - "awardTitle": "ICOS improved sensors, network and interoperability for GMES (ICOS-INWIRE)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "640276", - "awardURI": "http://cordis.europa.eu/project/rcn/193710_en.html" - }, - "awardTitle": "Gap Analysis for Integrated Atmospheric ECV CLImate Monitoring (GAIA-CLIM)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "funderName": "Senate of Bremen" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.7704.4", - "funderIdentifierType": "GRID" - }, - "funderName": "University of Bremen" - } - ], - "geoLocations": [ - { - "geoLocationPlace": "Białystok (PL)", - "geoLocationPoint": { - "pointLatitude": 53.23, - "pointLongitude": 23.025 - } - } - ], - "language": "eng", - "publicationYear": "2015", - "publisher": "CaltechDATA", - "relatedIdentifiers": [ - { - "relatedIdentifier": "10.14291/tccon.ggg2014.documentation.R0/1221662", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-9-683-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-16-14003-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-9-3491-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/rs8050414", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.14291/tccon.ggg2014.bialystok01.R0/1149277", - "relationType": "IsNewVersionOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Network_Policy/Data_Use_Policy/Data_Description", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Sites", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "10.14291/TCCON.GGG2014", - "relationType": "IsPartOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "http://tccondata.org", - "relationType": "IsPartOf", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "10.3390/rs9101033", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-17-4781-2017", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/atmos9050175", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/rs10030469", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-10-4135-2017", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-11-1251-2018", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-11-3111-2018", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - } - ], - "resourceType": { - "resourceTypeGeneral": "Dataset" - }, - "rightsList": [ - { - "rights": "TCCON Data Use Policy", - "rightsURI": "https://cd-sandbox.tind.io/tindfiles/serve/ce27a3a2-14f1-40ea-a898-3c6c5adba935/" - } - ], - "subjects": [ - { - "subject": "atmospheric trace gases" - }, - { - "subject": "CO2" - }, - { - "subject": "CH4" - }, - { - "subject": "CO" - }, - { - "subject": "N2O" - }, - { - "subject": "column-averaged dry-air mole fractions" - }, - { - "subject": "remote sensing" - }, - { - "subject": "FTIR spectroscopy" - }, - { - "subject": "TCCON" - } - ], - "titles": [ - { - "title": "TCCON data from Bialystok (PL), Release GGG2014.R1" - } - ], - "version": "GGG2014.R1", - "identifier": { - "identifier": "10.14291/tccon.ggg2014.bialystok01.R1/1183984", - "identifierType": "DOI" - }, - "formats": [ - "application/x-netcdf" - ], - "dates": [ - { - "date": "2015-06-10", - "dateType": "Created" - }, - { - "date": "2018-12-01", - "dateType": "Updated" - }, - { - "date": "2009-03-01/2017-11-28", - "dateType": "Collected" - }, - { - "date": "2017-09-08", - "dateType": "Submitted" - }, - { - "date": "2015-06-10", - "dateType": "Issued" - } - ] -} diff --git a/tests/data/datacite4/268.json b/tests/data/datacite4/268.json deleted file mode 100644 index efeb496..0000000 --- a/tests/data/datacite4/268.json +++ /dev/null @@ -1,475 +0,0 @@ -{ - "alternateIdentifiers": [ - { - "alternateIdentifier": "GGG2014", - "alternateIdentifierType": "Software_Version" - }, - { - "alternateIdentifier": "br", - "alternateIdentifierType": "id" - }, - { - "alternateIdentifier": "bremen01", - "alternateIdentifierType": "longName" - }, - { - "alternateIdentifier": "R0", - "alternateIdentifierType": "Data_Revision" - }, - { - "alternateIdentifier": "268", - "alternateIdentifierType": "CaltechDATA_Identifier" - } - ], - "contributors": [ - { - "contributorName": "California Institute of Techonolgy, Pasadena, CA (US)", - "contributorType": "HostingInstitution", - "nameIdentifiers": [ - { - "nameIdentifier": "grid.20861.3d", - "nameIdentifierScheme": "GRID" - } - ] - }, - { - "contributorName": "Roehl, C. M.", - "contributorType": "DataCurator", - "affiliations": [ - "California Institute of Technology, Pasadena, CA (US)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5383-8462", - "nameIdentifierScheme": "ORCID" - } - ] - }, - { - "contributorName": "Kowalewski, S.", - "contributorType": "DataCollector", - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ] - }, - { - "contributorName": "Wang, Y.", - "contributorType": "DataCollector", - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ] - }, - { - "contributorName": "Wang, Z.", - "contributorType": "DataCollector", - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ] - }, - { - "contributorName": "Messerschmidt, J.", - "contributorType": "DataCollector", - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ] - }, - { - "contributorName": "Nicholas Deutscher", - "contributorType": "ContactPerson" - }, - { - "contributorName": "TCCON", - "contributorType": "ResearchGroup" - } - ], - "creators": [ - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-3324-885X", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "P-4520-2016", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Notholt, J." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-7010-5532", - "nameIdentifierScheme": "ORCID" - } - ], - "creatorName": "Petri, C." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5185-3415", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "K-1884-2012", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Warneke, T." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)", - "Centre for Atmospheric Chemistry, School of Chemistry, University of Wollongong, Wollongong, NSW (AU)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-2906-2577", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "E-3683-2015", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Deutscher, N. M." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-7191-6911", - "nameIdentifierScheme": "ORCID" - } - ], - "creatorName": "Palm, M." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5077-9524", - "nameIdentifierScheme": "ORCID" - } - ], - "creatorName": "Buschmann, M." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "creatorName": "Weinzierl, C." - }, - { - "affiliations": [ - "National Astronomical Research Institute of Thailand, Chiang Mai (TH)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-8020-8642", - "nameIdentifierScheme": "ORCID" - } - ], - "creatorName": "Macatangay, R. C." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "creatorName": "Grupe, P." - } - ], - "descriptions": [ - { - "descriptionType": "Abstract", - "description": "
These data are now obsolete and should be replaced by the most recent data: https://doi.org/10.14291/tccon.ggg2014.bremen01.R1

The Total Carbon Column Observing Network (TCCON) is a network of ground-based Fourier Transform Spectrometers that record direct solar absorption spectra of the atmosphere in the near-infrared. From these spectra, accurate and precise column-averaged abundances of atmospheric constituents including CO2, CH4, N2O, HF, CO, H2O, and HDO, are retrieved. This data set contains observations from the TCCON station at Bremen, Germany." - }, - { - "descriptionType": "Other", - "description": "
Cite this record as:
Notholt, J., Petri, C., Warneke, T., Deutscher, N. M., Palm, M., Buschmann, M., … Grupe, P. (2014). TCCON data from Bremen (DE), Release GGG2014.R0 [Data set]. CaltechDATA. https://doi.org/10.14291/tccon.ggg2014.bremen01.r0/1149275
or choose a different citation style.
Download Citation
" - } - ], - "fundingReferences": [ - { - "awardNumber": { - "awardNumber": "26188", - "awardURI": "http://cordis.europa.eu/project/rcn/81606_en.html" - }, - "awardTitle": "Infrastructure for Measurement of the European Carbon Cycle (IMECC)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "36677", - "awardURI": "http://cordis.europa.eu/project/rcn/84619_en.html" - }, - "awardTitle": "Global Earth observation and monitoring (GEOMON)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "284274", - "awardURI": "http://cordis.europa.eu/project/rcn/101549_en.html" - }, - "awardTitle": "Integrated non-CO2 Greenhouse gas Observing System (INGOS)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "313169", - "awardURI": "http://cordis.europa.eu/project/rcn/106570_en.html" - }, - "awardTitle": "ICOS improved sensors, network and interoperability for GMES (ICOS-INWIRE)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "640276", - "awardURI": "http://cordis.europa.eu/project/rcn/193710_en.html" - }, - "awardTitle": "Gap Analysis for Integrated Atmospheric ECV CLImate Monitoring (GAIA-CLIM)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "funderName": "Senate of Bremen" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.7704.4", - "funderIdentifierType": "GRID" - }, - "funderName": "University of Bremen" - } - ], - "geoLocations": [ - { - "geoLocationPlace": "Bremen (DE)", - "geoLocationPoint": { - "pointLatitude": 53.1, - "pointLongitude": 8.85 - } - } - ], - "language": "eng", - "publicationYear": "2014", - "publisher": "CaltechDATA", - "relatedIdentifiers": [ - { - "relatedIdentifier": "10.14291/tccon.ggg2014.documentation.R0/1221662", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-9-683-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-16-5043-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-16-14003-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-15-13023-2015", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-16-12005-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-16-1653-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-9-3491-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/rs8050414", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Network_Policy/Data_Use_Policy/Data_Description", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Sites", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "10.14291/TCCON.GGG2014", - "relationType": "IsPartOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "http://tccondata.org", - "relationType": "IsPartOf", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "10.3390/rs9101033", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-17-4781-2017", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-10-2209-2017", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/rs10030469", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-11-3111-2018", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/atmos9050175", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-10-4135-2017", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/atmos10070354", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.14291/tccon.ggg2014.bremen01.R1", - "relationType": "IsPreviousVersionOf", - "relatedIdentifierType": "DOI" - } - ], - "resourceType": { - "resourceTypeGeneral": "Dataset" - }, - "rightsList": [ - { - "rights": "TCCON Data Use Policy", - "rightsURI": "https://data.caltech.edu/tindfiles/serve/b6002cc3-520a-42aa-bc63-81c97ab5982a/" - } - ], - "subjects": [ - { - "subject": "atmospheric trace gases" - }, - { - "subject": "CO2" - }, - { - "subject": "CH4" - }, - { - "subject": "CO" - }, - { - "subject": "N2O" - }, - { - "subject": "column-averaged dry-air mole fractions" - }, - { - "subject": "remote sensing" - }, - { - "subject": "FTIR spectroscopy" - }, - { - "subject": "TCCON" - } - ], - "titles": [ - { - "title": "TCCON data from Bremen (DE), Release GGG2014.R0" - } - ], - "version": "GGG2014.R0", - "identifier": { - "identifier": "10.14291/tccon.ggg2014.bremen01.R0/1149275", - "identifierType": "DOI" - }, - "formats": [ - "application/x-netcdf" - ], - "dates": [ - { - "date": "2014-10-10", - "dateType": "Created" - }, - { - "date": "2019-06-01", - "dateType": "Updated" - }, - { - "date": "2007-01-15/2018-04-20", - "dateType": "Collected" - }, - { - "date": "2017-09-08", - "dateType": "Submitted" - }, - { - "date": "2014-10-10", - "dateType": "Issued" - } - ] -} diff --git a/tests/data/datacite4/283.json b/tests/data/datacite4/283.json deleted file mode 100644 index a68faed..0000000 --- a/tests/data/datacite4/283.json +++ /dev/null @@ -1,482 +0,0 @@ -{ - "alternateIdentifiers": [ - { - "alternateIdentifier": "GGG2014", - "alternateIdentifierType": "Software_Version" - }, - { - "alternateIdentifier": "or", - "alternateIdentifierType": "id" - }, - { - "alternateIdentifier": "orleans01", - "alternateIdentifierType": "longName" - }, - { - "alternateIdentifier": "R0", - "alternateIdentifierType": "Data_Revision" - }, - { - "alternateIdentifier": "283", - "alternateIdentifierType": "CaltechDATA_Identifier" - } - ], - "contributors": [ - { - "contributorName": "California Institute of Techonolgy, Pasadena, CA (US)", - "contributorType": "HostingInstitution", - "nameIdentifiers": [ - { - "nameIdentifier": "grid.20861.3d", - "nameIdentifierScheme": "GRID" - } - ] - }, - { - "contributorName": "Roehl, C. M.", - "contributorType": "DataCurator", - "affiliations": [ - "California Institute of Technology, Pasadena, CA (US)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5383-8462", - "nameIdentifierScheme": "ORCID" - } - ] - }, - { - "contributorName": "Vuillemin, C.", - "contributorType": "ProjectMember", - "affiliations": [ - "Laboratoire des Sciences du Climat et de l'Environnement, Gif-sur-Yvette (FR)" - ] - }, - { - "contributorName": "Truong, F.ç.", - "contributorType": "ProjectMember", - "affiliations": [ - "Laboratoire des Sciences du Climat et de l'Environnement, Gif-sur-Yvette (FR)" - ] - }, - { - "contributorName": "Schmidt, M.", - "contributorType": "ProjectMember", - "affiliations": [ - "Laboratoire des Sciences du Climat et de l'Environnement, Gif-sur-Yvette (FR)" - ] - }, - { - "contributorName": "Ramonet, M.", - "contributorType": "ProjectMember", - "affiliations": [ - "Laboratoire des Sciences du Climat et de l'Environnement, Gif-sur-Yvette (FR)" - ] - }, - { - "contributorName": "Parmentier, E.", - "contributorType": "RelatedPerson", - "affiliations": [ - "Institut de Physique du Globe de Paris, Observatoire magnétique de Chambon la Forêt, Cambon la Forêt (FR)" - ] - }, - { - "contributorName": "Thorsten Warneke", - "contributorType": "ContactPerson" - }, - { - "contributorName": "TCCON", - "contributorType": "ResearchGroup" - } - ], - "creators": [ - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5185-3415", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "K-1884-2012", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Warneke, T." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "creatorName": "Messerschmidt, J." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-3324-885X", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "P-4520-2016", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Notholt, J." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "creatorName": "Weinzierl, C." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)", - "Centre for Atmospheric Chemistry, School of Chemistry, University of Wollongong, Wollongong, NSW (AU)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-2906-2577", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "E-3683-2015", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Deutscher, N. M." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-7010-5532", - "nameIdentifierScheme": "ORCID" - } - ], - "creatorName": "Petri, C." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "creatorName": "Grupe, P." - } - ], - "descriptions": [ - { - "descriptionType": "Abstract", - "description": "The Total Carbon Column Observing Network (TCCON) is a network of ground-based Fourier Transform Spectrometers that record direct solar absorption spectra of the atmosphere in the near-infrared. From these spectra, accurate and precise column-averaged abundances of atmospheric constituents including CO2, CH4, N2O, HF, CO, H2O, and HDO, are retrieved. This data set contains observations from the TCCON station at Orléans, France." - }, - { - "descriptionType": "Other", - "description": "
Cite this record as:
Warneke, T., Messerschmidt, J., Notholt, J., Weinzierl, C., Deutscher, N. M., Petri, C., & Grupe, P. (2014). TCCON data from Orléans (FR), Release GGG2014.R0 [Data set]. CaltechDATA. https://doi.org/10.14291/tccon.ggg2014.orleans01.r0/1149276
or choose a different citation style.
Download Citation
" - }, - { - "descriptionType": "Other", - "description": "
Unique Views: 185
Unique Downloads: 54
between September 08, 2017 and October 01, 2019
More info on how stats are collected
" - } - ], - "fundingReferences": [ - { - "awardNumber": { - "awardNumber": "26188", - "awardURI": "http://cordis.europa.eu/project/rcn/81606_en.html" - }, - "awardTitle": "Infrastructure for Measurement of the European Carbon Cycle (IMECC)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "36677", - "awardURI": "http://cordis.europa.eu/project/rcn/84619_en.html" - }, - "awardTitle": "Global Earth observation and monitoring (GEOMON)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "284274", - "awardURI": "http://cordis.europa.eu/project/rcn/101549_en.html" - }, - "awardTitle": "Integrated non-CO2 Greenhouse gas Observing System (INGOS)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "313169", - "awardURI": "http://cordis.europa.eu/project/rcn/106570_en.html" - }, - "awardTitle": "ICOS improved sensors, network and interoperability for GMES (ICOS-INWIRE)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "awardNumber": { - "awardNumber": "640276", - "awardURI": "http://cordis.europa.eu/project/rcn/193710_en.html" - }, - "awardTitle": "Gap Analysis for Integrated Atmospheric ECV CLImate Monitoring (GAIA-CLIM)", - "funderIdentifier": { - "funderIdentifier": "grid.453396.e", - "funderIdentifierType": "GRID" - }, - "funderName": "European Union" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.425996.5", - "funderIdentifierType": "GRID" - }, - "funderName": "Senate of Bremen" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.457340.1", - "funderIdentifierType": "GRID" - }, - "funderName": "Laboratoire des Sciences du Climat et de l'Environnement" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.7704.4", - "funderIdentifierType": "GRID" - }, - "funderName": "University of Bremen" - } - ], - "geoLocations": [ - { - "geoLocationPlace": "Traînou, Orléans (FR)", - "geoLocationPoint": { - "pointLatitude": 47.97, - "pointLongitude": 2.113 - } - } - ], - "language": "eng", - "publicationYear": "2014", - "publisher": "CaltechDATA", - "relatedIdentifiers": [ - { - "relatedIdentifier": "10.14291/tccon.ggg2014.documentation.R0/1221662", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/rs9010064", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-9-683-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-9-227-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-16-5043-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-16-14003-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-8-4785-2015", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-15-13023-2015", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-16-12005-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-9-4843-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-16-1653-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-9-3491-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/rs8050414", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Network_Policy/Data_Use_Policy/Data_Description", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Sites", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "10.14291/TCCON.GGG2014", - "relationType": "IsPartOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "http://tccondata.org", - "relationType": "IsPartOf", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "10.3390/rs9101033", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/acp-17-4781-2017", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/atmos9050175", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-11-3111-2018", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-11-1251-2018", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-10-4135-2017", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-10-2209-2017", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.3390/atmos10070354", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - } - ], - "resourceType": { - "resourceTypeGeneral": "Dataset" - }, - "rightsList": [ - { - "rights": "TCCON Data Use Policy", - "rightsURI": "https://data.caltech.edu/tindfiles/serve/d0bf0bd6-739b-4aad-9e5d-45338391727f/" - } - ], - "subjects": [ - { - "subject": "atmospheric trace gases" - }, - { - "subject": "CO2" - }, - { - "subject": "CH4" - }, - { - "subject": "CO" - }, - { - "subject": "N2O" - }, - { - "subject": "column-averaged dry-air mole fractions" - }, - { - "subject": "remote sensing" - }, - { - "subject": "FTIR spectroscopy" - }, - { - "subject": "TCCON" - } - ], - "titles": [ - { - "title": "TCCON data from Orléans (FR), Release GGG2014.R0" - } - ], - "version": "GGG2014.R0", - "identifier": { - "identifier": "10.14291/tccon.ggg2014.orleans01.R0/1149276", - "identifierType": "DOI" - }, - "formats": [ - "application/x-netcdf" - ], - "dates": [ - { - "date": "2014-10-10", - "dateType": "Created" - }, - { - "date": "2018-12-01", - "dateType": "Updated" - }, - { - "date": "2009-08-29/2017-11-28", - "dateType": "Collected" - }, - { - "date": "2017-09-08", - "dateType": "Submitted" - }, - { - "date": "2014-10-10", - "dateType": "Issued" - } - ] -} diff --git a/tests/data/datacite4/293.json b/tests/data/datacite4/293.json deleted file mode 100644 index b617773..0000000 --- a/tests/data/datacite4/293.json +++ /dev/null @@ -1,188 +0,0 @@ -{ - "contributors": [ - { - "contributorName": "Wunch, Debra", - "contributorType": "ContactPerson", - "affiliations": [ - "California Institute of Technology, Pasadena, CA, U.S.A." - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-4924-0377", - "nameIdentifierScheme": "ORCID" - } - ] - }, - { - "contributorName": "Wennberg, P. O. ", - "contributorType": "ContactPerson", - "affiliations": [ - "California Institute of Technology, Pasadena, CA (US)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-6126-3854", - "nameIdentifierScheme": "ORCID" - } - ] - }, - { - "contributorName": "Griffith, D. W.T.", - "contributorType": "ContactPerson", - "affiliations": [ - "Centre for Atmospheric Chemistry, School of Chemistry, University of Wollongong, Wollongong, NSW (AU)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": " 0000-0002-7986-1924", - "nameIdentifierScheme": "ORCID" - } - ] - }, - { - "contributorName": "Deutscher, N. M.", - "contributorType": "ContactPerson", - "affiliations": [ - " Institute of Environmental Physics, University of Bremen, Bremen (DE), Centre for Atmospheric Chemistry, School of Chemistry, University of Wollongong, Wollongong, NSW (AU) " - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-2906-2577", - "nameIdentifierScheme": "ORCID" - } - ] - }, - { - "contributorName": "Feist, D. G.", - "contributorType": "ContactPerson", - "affiliations": [ - "Max Planck Institute for Biogeochemistry, Jena (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-5890-6687", - "nameIdentifierScheme": "ORCID" - } - ] - }, - { - "contributorName": "Notholt, J.", - "contributorType": "ContactPerson", - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-3324-885X", - "nameIdentifierScheme": "ORCID" - } - ] - } - ], - "descriptions": [ - { - "descriptionType": "Other", - "description": "The Total Carbon Column Observing Network (TCCON) is a network of ground-based Fourier Transform Spectrometers that record direct solar absorption spectra of the atmosphere in the near-infrared. From these spectra, accurate and precise column-averaged abundances of atmospheric constituents including CO2, CH4, N2O, HF, CO, H2O, and HDO, are retrieved. This is the 2014 data release." - }, - { - "descriptionType": "Other", - "description": "
Cite this record as:
Total Carbon Column Observing Network (TCCON) Team. (2017). 2014 TCCON Data Release (Version GGG2014) [Data set]. CaltechDATA. https://doi.org/10.14291/tccon.ggg2014
or choose a different citation style.
Download Citation
" - } - ], - "language": "eng", - "relatedIdentifiers": [ - { - "relatedIdentifier": "10.14291/TCCON.GGG2014.DOCUMENTATION.R0/1221662", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Network_Policy/Data_Use_Policy/Data_Description", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Sites", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "DOI" - } - ], - "resourceType": { - "resourceTypeGeneral": "Dataset" - }, - "rightsList": [ - { - "rights": "TCCON Data Use Policy", - "rightsURI": "https://data.caltech.edu/tindfiles/serve/24d2401d-d2b7-42e1-83b1-1ee01839d84d/" - } - ], - "subjects": [ - { - "subject": "atmospheric trace gases" - }, - { - "subject": " CO2" - }, - { - "subject": " CH4" - }, - { - "subject": " CO" - }, - { - "subject": " N2O" - }, - { - "subject": " column-averaged dry-air mole fractions" - }, - { - "subject": " remote sensing" - }, - { - "subject": " FTIR spectroscopy" - }, - { - "subject": " TCCON" - } - ], - "version": "GGG2014", - "identifier": { - "identifier": "10.14291/TCCON.GGG2014", - "identifierType": "DOI" - }, - "titles": [ - { - "title": "2014 TCCON Data Release" - } - ], - "creators": [ - { - "affiliations": [ - "TCCON Consortium" - ], - "creatorName": "Total Carbon Column Observing Network (TCCON) Team" - } - ], - "formats": [ - ".tgz", - ".nc" - ], - "dates": [ - { - "date": "2019-05-01", - "dateType": "Updated" - }, - { - "date": "2017-09-13", - "dateType": "Submitted" - } - ], - "publicationYear": "2017", - "publisher": "CaltechDATA", - "alternateIdentifiers": [ - { - "alternateIdentifier": "293", - "alternateIdentifierType": "CaltechDATA_Identifier" - } - ] -} diff --git a/tests/data/datacite4/301.json b/tests/data/datacite4/301.json deleted file mode 100644 index 01de516..0000000 --- a/tests/data/datacite4/301.json +++ /dev/null @@ -1,291 +0,0 @@ -{ - "alternateIdentifiers": [ - { - "alternateIdentifier": "GGG2014", - "alternateIdentifierType": "Software_Version" - }, - { - "alternateIdentifier": "sp", - "alternateIdentifierType": "id" - }, - { - "alternateIdentifier": "nyalesund01", - "alternateIdentifierType": "longName" - }, - { - "alternateIdentifier": "R0", - "alternateIdentifierType": "Data_Revision" - }, - { - "alternateIdentifier": "301", - "alternateIdentifierType": "CaltechDATA_Identifier" - } - ], - "contributors": [ - { - "contributorName": "CaltechDATA, California Institute of Technology, CA (US)", - "contributorType": "HostingInstitution", - "nameIdentifiers": [ - { - "nameIdentifier": "grid.20861.3d", - "nameIdentifierScheme": "GRID" - } - ] - }, - { - "contributorName": "Roehl, C. M.", - "contributorType": "DataCurator", - "affiliations": [ - "California Institute of Technology, Pasadena, CA (US)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5383-8462", - "nameIdentifierScheme": "ORCID" - } - ] - }, - { - "contributorName": "AWIPEV Arctic Research Base, Ny-Ă…lesund, Spitsbergen (NO)", - "contributorType": "DataCollector" - }, - { - "contributorName": "Justus Notholt", - "contributorType": "ContactPerson" - }, - { - "contributorName": "TCCON", - "contributorType": "ResearchGroup" - } - ], - "descriptions": [ - { - "descriptionType": "Abstract", - "description": "
These data are now obsolete and should be replaced by the most recent data: https://doi.org/10.14291/tccon.ggg2014.nyalesund01.R1

The Total Carbon Column Observing Network (TCCON) is a network of ground-based Fourier Transform Spectrometers that record direct solar absorption spectra of the atmosphere in the near-infrared. From these spectra, accurate and precise column-averaged abundances of atmospheric constituents including CO2, CH4, N2O, HF, CO, H2O, and HDO, are retrieved. This data set contains observations from the TCCON station Ny Ă…lesund, Spitsbergen, Norway." - }, - { - "descriptionType": "Other", - "description": "
Cite this record as:
Notholt, J., Warneke, T., Petri, C., Deutscher, N. M., Weinzierl, C., Palm, M., & Buschmann, M. (2014). TCCON data from Ny Ă…lesund, Spitsbergen (NO), Release GGG2014.R0 [Data set]. CaltechDATA. https://doi.org/10.14291/tccon.ggg2014.nyalesund01.r0/1149278
or choose a different citation style.
Download Citation
" - } - ], - "language": "eng", - "relatedIdentifiers": [ - { - "relatedIdentifier": "10.14291/tccon.archive/1348407", - "relationType": "IsPartOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.14291/tccon.ggg2014.documentation.R0/1221662", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.5194/amt-9-3491-2016", - "relationType": "IsCitedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Network_Policy/Data_Use_Policy/Data_Description", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Sites", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "http://tccondata.org", - "relationType": "IsPartOf", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "10.14291/TCCON.GGG2014", - "relationType": "IsPartOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.14291/tccon.ggg2014.nyalesund01.R1", - "relationType": "IsPreviousVersionOf", - "relatedIdentifierType": "DOI" - } - ], - "resourceType": { - "resourceTypeGeneral": "Dataset" - }, - "rightsList": [ - { - "rights": "TCCON Data Use Policy", - "rightsURI": "https://data.caltech.edu/tindfiles/serve/90348ea4-f340-4f43-8db2-b9beb7845519/" - } - ], - "subjects": [ - { - "subject": "atmospheric trace gases" - }, - { - "subject": "CO2" - }, - { - "subject": "CH4" - }, - { - "subject": "CO" - }, - { - "subject": "N2O" - }, - { - "subject": "column-averaged dry-air mole fractions" - }, - { - "subject": "remote sensing" - }, - { - "subject": "FTIR spectroscopy" - }, - { - "subject": "TCCON" - } - ], - "version": "GGG2014.R0", - "identifier": { - "identifier": "10.14291/tccon.ggg2014.nyalesund01.R0/1149278", - "identifierType": "DOI" - }, - "titles": [ - { - "title": "TCCON data from Ny Ă…lesund, Spitsbergen (NO), Release GGG2014.R0" - } - ], - "creators": [ - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-3324-885X", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "P-4520-2016", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Notholt, J." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5185-3415", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "K-1884-2012", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Warneke, T." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-7010-5532", - "nameIdentifierScheme": "ORCID" - } - ], - "creatorName": "Petri, C." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)", - "Centre for Atmospheric Chemistry, School of Chemistry, University of Wollongong, Wollongong, NSW (AU)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0002-2906-2577", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "E-3683-2015", - "nameIdentifierScheme": "ResearcherID" - } - ], - "creatorName": "Deutscher, N. M." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "creatorName": "Weinzierl, C." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-7191-6911", - "nameIdentifierScheme": "ORCID" - } - ], - "creatorName": "Palm, M." - }, - { - "affiliations": [ - "Institute of Environmental Physics, University of Bremen, Bremen (DE)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5077-9524", - "nameIdentifierScheme": "ORCID" - } - ], - "creatorName": "Buschmann, M." - } - ], - "formats": [ - "application/x-netcdf" - ], - "dates": [ - { - "date": "2017-10-31", - "dateType": "Created" - }, - { - "date": "2019-06-01", - "dateType": "Updated" - }, - { - "date": "2006-03-28/2018-04-27", - "dateType": "Collected" - }, - { - "date": "2017-10-31", - "dateType": "Submitted" - }, - { - "date": "2014-10-10", - "dateType": "Issued" - } - ], - "publicationYear": "2014", - "geoLocations": [ - { - "geoLocationPlace": "Ny Ă…lesund (SJ)", - "geoLocationPoint": { - "pointLatitude": 78.9, - "pointLongitude": 11.9 - } - } - ], - "publisher": "CaltechDATA" -} diff --git a/tests/data/datacite4/970.json b/tests/data/datacite4/970.json deleted file mode 100644 index 4187c44..0000000 --- a/tests/data/datacite4/970.json +++ /dev/null @@ -1,334 +0,0 @@ -{ - "alternateIdentifiers": [ - { - "alternateIdentifier": "GGG2014", - "alternateIdentifierType": "Software_Version" - }, - { - "alternateIdentifier": "eu", - "alternateIdentifierType": "id" - }, - { - "alternateIdentifier": "eureka01", - "alternateIdentifierType": "longName" - }, - { - "alternateIdentifier": "R1", - "alternateIdentifierType": "Data_Revision" - }, - { - "alternateIdentifier": "970", - "alternateIdentifierType": "CaltechDATA_Identifier" - } - ], - "contributors": [ - { - "contributorName": "California Institute of Techonolgy, Pasadena, CA (US)", - "contributorType": "HostingInstitution", - "nameIdentifiers": [ - { - "nameIdentifier": "grid.20861.3d", - "nameIdentifierScheme": "GRID" - } - ] - }, - { - "contributorName": "Roehl, C. M.", - "contributorType": "DataCurator", - "affiliations": [ - "California Institute of Technology, Pasadena, CA (US)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-5383-8462", - "nameIdentifierScheme": "ORCID" - } - ] - }, - { - "contributorName": "Kimberly Strong", - "contributorType": "ContactPerson", - "contributorEmail": "strong@atmosp.physics.utoronto.ca", - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)" - ], - "nameIdentifiers": [ - { - "nameIdentifier": "0000-0001-9947-1053", - "nameIdentifierScheme": "ORCID" - }, - { - "nameIdentifier": "D-2563-2012", - "nameIdentifierScheme": "ResearcherID" - } - ] - }, - { - "contributorName": "TCCON", - "contributorType": "ResearchGroup" - } - ], - "descriptions": [ - { - "descriptionType": "Abstract", - "description": "
These data are now obsolete and should be replaced by the most recent data: https://doi.org/10.14291/tccon.ggg2014.eureka01.R3

The Total Carbon Column Observing Network (TCCON) is a network of ground-based Fourier Transform Spectrometers that record direct solar absorption spectra of the atmosphere in the near-infrared. From these spectra, accurate and precise column-averaged abundances of atmospheric constituents including CO2, CH4, N2O, HF, CO, H2O, and HDO, are retrieved. This data set contains observations from the TCCON station at Eureka, Canada." - }, - { - "descriptionType": "Other", - "description": "
Cite this record as:
Strong, K., Roche, S., Franklin, J. E., Mendonca, J., Lutsch, E., Weaver, D., … Lindenmaier, R. (2017). TCCON data from Eureka (CA), Release GGG2014.R2 [Data set]. CaltechDATA. https://doi.org/10.14291/tccon.ggg2014.eureka01.r2
or choose a different citation style.
Download Citation
" - } - ], - "fundingReferences": [ - { - "funderName": "Atlantic Innovation Fund" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.439998.6", - "funderIdentifierType": "GRID" - }, - "funderName": "Canada Foundation for Innovation" - }, - { - "funderName": "Canadian Foundation for Climate and Atmospheric Sciences" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.236846.d", - "funderIdentifierType": "GRID" - }, - "funderName": "Canadian Space Agency" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.410334.1", - "funderIdentifierType": "GRID" - }, - "funderName": "Environment and Climate Change Canada" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.451254.3", - "funderIdentifierType": "GRID" - }, - "funderName": "Government of Canada (International Polar Year funding)" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.452912.9", - "funderIdentifierType": "GRID" - }, - "funderName": "Natural Sciences and Engineering Research Council of Canada" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.465477.3", - "funderIdentifierType": "GRID" - }, - "funderName": "Polar Commission (Northern Scientific Training Program)" - }, - { - "funderName": "Nova Scotia Research Innovation Trust" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.451078.f", - "funderIdentifierType": "GRID" - }, - "funderName": "Ministry of Research and Innovation (Ontario Innovation Trust and Ontario Research Fund)" - }, - { - "funderIdentifier": { - "funderIdentifier": "grid.202033.0", - "funderIdentifierType": "GRID" - }, - "funderName": "Natural Resources Canada (Polar Continental Shelf Program)" - } - ], - "language": "eng", - "relatedIdentifiers": [ - { - "relatedIdentifier": "10.14291/tccon.ggg2014.documentation.R0/1221662", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.14291/tccon.ggg2014.eureka01.R0/1149271", - "relationType": "IsNewVersionOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Network_Policy/Data_Use_Policy/Data_Description", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "https://tccon-wiki.caltech.edu/Sites", - "relationType": "IsDocumentedBy", - "relatedIdentifierType": "URL" - }, - { - "relatedIdentifier": "10.14291/TCCON.GGG2014", - "relationType": "IsPartOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.14291/tccon.ggg2014.eureka01.R1/1325515", - "relationType": "IsNewVersionOf", - "relatedIdentifierType": "DOI" - }, - { - "relatedIdentifier": "10.14291/tccon.ggg2014.eureka01.R3", - "relationType": "IsPreviousVersionOf", - "relatedIdentifierType": "DOI" - } - ], - "resourceType": { - "resourceTypeGeneral": "Dataset" - }, - "rightsList": [ - { - "rights": "TCCON Data License", - "rightsURI": "https://data.caltech.edu/tindfiles/serve/91de6fb9-18a5-4221-bd6b-41a9db8abc7c/" - } - ], - "subjects": [ - { - "subject": "atmospheric trace gases" - }, - { - "subject": "CO2" - }, - { - "subject": "CH4" - }, - { - "subject": "CO" - }, - { - "subject": "N2O" - }, - { - "subject": "column-averaged dry-air mole fractions" - }, - { - "subject": "remote sensing" - }, - { - "subject": "FTIR spectroscopy" - }, - { - "subject": "TCCON" - } - ], - "version": "R2", - "identifier": { - "identifier": "10.14291/tccon.ggg2014.eureka01.R2", - "identifierType": "DOI" - }, - "titles": [ - { - "title": "TCCON data from Eureka (CA), Release GGG2014.R2" - } - ], - "creators": [ - { - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)" - ], - "creatorName": "Strong, K." - }, - { - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)" - ], - "creatorName": "Roche, S." - }, - { - "affiliations": [ - "School of Engineering and Applied Sciences, Harvard University, Cambridge, MA (USA)" - ], - "creatorName": "Franklin, J. E." - }, - { - "affiliations": [ - "Environment and Climate Change Canada, Downsview, ON (CA)" - ], - "creatorName": "Mendonca, J." - }, - { - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)" - ], - "creatorName": "Lutsch, E." - }, - { - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)" - ], - "creatorName": "Weaver, D." - }, - { - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)" - ], - "creatorName": "Fogal, P. F." - }, - { - "affiliations": [ - "Department of Physics & Atmospheric Science, Dalhousie University, Halifax, NS, CA" - ], - "creatorName": "Drummond, J. R." - }, - { - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)", - "UCAR Center for Science Education, Boulder, CO (US)" - ], - "creatorName": "Batchelor, R." - }, - { - "affiliations": [ - "Department of Physics, University of Toronto, Toronto, ON (CA)", - "Pacific Northwest National Laboratory, Richland, WA (US)" - ], - "creatorName": "Lindenmaier, R." - } - ], - "formats": [ - "application/x-netcdf" - ], - "dates": [ - { - "date": "2017-09-20", - "dateType": "Created" - }, - { - "date": "2018-11-01", - "dateType": "Updated" - }, - { - "date": "2010-07-24/2017-09-10", - "dateType": "Collected" - }, - { - "date": "2017-09-20", - "dateType": "Submitted" - }, - { - "date": "2017-09-20", - "dateType": "Issued" - } - ], - "publicationYear": "2017", - "geoLocations": [ - { - "geoLocationPlace": "Eureka, NU (CA)", - "geoLocationPoint": { - "pointLatitude": 80.05, - "pointLongitude": -86.42 - } - } - ], - "publisher": "CaltechDATA" -} diff --git a/tests/test_conversion.py b/tests/test_conversion.py deleted file mode 100644 index c1174c2..0000000 --- a/tests/test_conversion.py +++ /dev/null @@ -1,64 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of caltechdata_api. -# -# Copyright (C) 2020 Caltech. -# -# caltechdata_api is free software; you can redistribute it and/or modify it -# under the terms of the Revised BSD License; see LICENSE file for -# more details. - -"""Tests for format transformations.""" - -import pytest -from datacite.schema40 import validator as validator4 -from datacite.schema43 import validator as validator43 - -from caltechdata_api import decustomize_schema -from helpers import load_json_path, write_json_path - -CALTECHDATA_FILES = [ - "data/caltechdata/210.json", - "data/caltechdata/266.json", - "data/caltechdata/267.json", - "data/caltechdata/268.json", - "data/caltechdata/283.json", - "data/caltechdata/293.json", - "data/caltechdata/301.json", - "data/caltechdata/970.json", - "data/caltechdata/1171.json", - "data/caltechdata/1235.json", - "data/caltechdata/1250.json", - "data/caltechdata/1259.json", - "data/caltechdata/1300.json", -] - -DATACITE4_FILES = [ - "data/datacite4/210.json", - "data/datacite4/266.json", - "data/datacite4/267.json", - "data/datacite4/268.json", - "data/datacite4/283.json", - "data/datacite4/293.json", - "data/datacite4/301.json", - "data/datacite4/970.json", - "data/datacite4/1171.json", - "data/datacite4/1235.json", - "data/datacite4/1250.json", - "data/datacite4/1259.json", - "data/datacite4/1300.json", -] - - -@pytest.mark.parametrize("example_caltechdata", CALTECHDATA_FILES) -def test_example_json_validates(example_caltechdata): - """Test the example file validates against the JSON schema after - decustomizing to DataCite.""" - example_json = load_json_path(example_caltechdata) - datacite4 = decustomize_schema(example_json) - validator4.validate(datacite4) - example_json = load_json_path(example_caltechdata) - datacite43 = decustomize_schema(example_json, schema="43") - validator43.validate(datacite43) - outname = example_caltechdata.split("/")[-1] - write_json_path(f"data/datacite43/{outname}", datacite43) diff --git a/tests/test_unit.py b/tests/test_unit.py index c9b57d2..1377d8f 100644 --- a/tests/test_unit.py +++ b/tests/test_unit.py @@ -1,13 +1,17 @@ import os import pytest -from customize_schema import validate_metadata as validator43 -from helpers import load_json_path import logging -from tqdm import tqdm +from caltechdata_api import validate_metadata as validator43 +from helpers import load_json_path -# Directories for valid and invalid JSON files -VALID_DATACITE43_DIR = "../tests/data/datacite43/" -INVALID_DATACITE43_DIR = "../tests/data/invalid_datacite43/" +# Configure logging +logging.basicConfig(level=logging.DEBUG) +logger = logging.getLogger(__name__) + +# Dynamically determine the base path +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) +INVALID_DATACITE43_DIR = os.path.join(BASE_DIR, "data", "invalid_datacite43") +DATACITE43_DIR = os.path.join(BASE_DIR, "data") # Function to get all JSON files in the directory @@ -17,15 +21,17 @@ def get_all_json_files(directory): ] -# Get list of all valid JSON files in the directory -VALID_DATACITE43_FILES = get_all_json_files(VALID_DATACITE43_DIR) +# Get list of all valid and invalid JSON files +VALID_DATACITE43_FILES = get_all_json_files( + os.path.join(BASE_DIR, "data", "datacite43") +) INVALID_DATACITE43_FILES = get_all_json_files(INVALID_DATACITE43_DIR) @pytest.mark.parametrize("valid_file", VALID_DATACITE43_FILES) def test_valid_json(valid_file): """Test that valid example files validate successfully.""" - print(f"\nValidating file: {valid_file}") # Log for file being tested + print(f"\nValidating file: {valid_file}") json_data = load_json_path(valid_file) validation_errors = None try: @@ -33,35 +39,55 @@ def test_valid_json(valid_file): except ValueError as e: pytest.fail(f"Validation failed for: {valid_file}\nErrors: {str(e)}") - if validation_errors: - pytest.fail(f"Validation failed for: {valid_file}\nErrors: {validation_errors}") - else: - print(f"Validation passed for: {valid_file}") + assert ( + not validation_errors + ), f"Validation failed for: {valid_file}\nErrors: {validation_errors}" + print(f"Validation passed for: {valid_file}") @pytest.mark.parametrize("invalid_file", INVALID_DATACITE43_FILES) def test_invalid_json(invalid_file): """Test that invalid example files do not validate successfully.""" - print(f"\nValidating file: {invalid_file}") # Log for file being tested + logger.debug(f"Attempting to validate invalid file: {invalid_file}") + json_data = load_json_path(invalid_file) - validation_errors = None - try: - validation_errors = validator43(json_data) - except ValueError: - print(f"Validation failed as expected for: {invalid_file}") - return # Test passes if validation raises a ValueError - if validation_errors: - print(f"Validation failed as expected for: {invalid_file}") - else: - pytest.fail(f"Validation passed unexpectedly for: {invalid_file}") + def validate_wrapper(): + try: + validation_errors = validator43(json_data) + + logger.debug(f"Validation result for {invalid_file}: {validation_errors}") + + if validation_errors: + logger.debug(f"Found validation errors in {invalid_file}") + return + + logger.error( + f"No validation errors found for supposedly invalid file: {invalid_file}" + ) + raise ValueError( + f"Validation did not fail for invalid file: {invalid_file}" + ) + + except Exception as e: + logger.error(f"Validation exception for {invalid_file}: {str(e)}") + raise + + with pytest.raises((ValueError, KeyError, AssertionError, TypeError)): + validate_wrapper() @pytest.mark.parametrize( "missing_field_file", [ - {"file": "../tests/data/missing_creators.json", "missing_field": "creators"}, - {"file": "../tests/data/missing_titles.json", "missing_field": "titles"}, + { + "file": os.path.join(DATACITE43_DIR, "missing_creators.json"), + "missing_field": "creators", + }, + { + "file": os.path.join(DATACITE43_DIR, "missing_titles.json"), + "missing_field": "titles", + }, ], ) def test_missing_required_fields(missing_field_file): @@ -69,6 +95,11 @@ def test_missing_required_fields(missing_field_file): print( f"\nTesting missing field: {missing_field_file['missing_field']} in file: {missing_field_file['file']}" ) + + # Skip the test if the file doesn't exist + if not os.path.exists(missing_field_file["file"]): + pytest.skip(f"Test file not found: {missing_field_file['file']}") + json_data = load_json_path(missing_field_file["file"]) with pytest.raises( ValueError, @@ -80,8 +111,14 @@ def test_missing_required_fields(missing_field_file): @pytest.mark.parametrize( "type_error_file", [ - {"file": "../tests/data/type_error_creators.json", "field": "creators"}, - {"file": "../tests/data/type_error_dates.json", "field": "dates"}, + { + "file": os.path.join(DATACITE43_DIR, "type_error_creators.json"), + "field": "creators", + }, + { + "file": os.path.join(DATACITE43_DIR, "type_error_dates.json"), + "field": "dates", + }, ], ) def test_incorrect_field_types(type_error_file): @@ -89,6 +126,11 @@ def test_incorrect_field_types(type_error_file): print( f"\nTesting incorrect type in field: {type_error_file['field']} for file: {type_error_file['file']}" ) + + # Skip the test if the file doesn't exist + if not os.path.exists(type_error_file["file"]): + pytest.skip(f"Test file not found: {type_error_file['file']}") + json_data = load_json_path(type_error_file["file"]) with pytest.raises( ValueError, match=f"Incorrect type for field: {type_error_file['field']}" @@ -98,55 +140,27 @@ def test_incorrect_field_types(type_error_file): def test_multiple_errors(): """Test JSON file with multiple issues to check all errors are raised.""" - json_data = load_json_path("../tests/data/multiple_errors.json") + multiple_errors_file = os.path.join(DATACITE43_DIR, "multiple_errors.json") + + # Skip the test if the file doesn't exist + if not os.path.exists(multiple_errors_file): + pytest.skip(f"Test file not found: {multiple_errors_file}") + + json_data = load_json_path(multiple_errors_file) with pytest.raises(ValueError, match="Multiple validation errors"): validator43(json_data) def test_error_logging(caplog): """Test that errors are logged correctly during validation.""" - json_data = load_json_path( - "../tests/data/invalid_datacite43/some_invalid_file.json" - ) + some_invalid_file = os.path.join(INVALID_DATACITE43_DIR, "some_invalid_file.json") + + # Skip the test if the file doesn't exist + if not os.path.exists(some_invalid_file): + pytest.skip(f"Test file not found: {some_invalid_file}") + + json_data = load_json_path(some_invalid_file) with caplog.at_level(logging.ERROR): with pytest.raises(ValueError): validator43(json_data) assert "Validation failed" in caplog.text - - -if __name__ == "__main__": - # Manual test runner for valid files - failed_valid_files = [] - print("\nRunning validation for valid files...") - for file in tqdm(VALID_DATACITE43_FILES, desc="Valid files"): - try: - test_valid_json(file) - except AssertionError as e: - failed_valid_files.append(file) - print(f"Error occurred in valid file: {file}\nError details: {e}") - - if not failed_valid_files: - print("\n✅ All valid files passed validation. Test complete.") - else: - print("\n❌ The following valid files failed validation:") - for failed_file in failed_valid_files: - print(f"- {failed_file}") - - # Manual test runner for invalid files - passed_invalid_files = [] - print("\nRunning validation for invalid files...") - for file in tqdm(INVALID_DATACITE43_FILES, desc="Invalid files"): - try: - test_invalid_json(file) - except AssertionError as e: - passed_invalid_files.append(file) - print(f"Error occurred in invalid file: {file}\nError details: {e}") - - if not passed_invalid_files: - print( - "\n✅ All invalid files failed validation as expected. Test is a success." - ) - else: - print("\n❌ The following invalid files unexpectedly passed validation:") - for passed_file in passed_invalid_files: - print(f"- {passed_file}") diff --git a/tests/tester.py b/tests/tester.py deleted file mode 100644 index 13e8250..0000000 --- a/tests/tester.py +++ /dev/null @@ -1,56 +0,0 @@ -import os -import pytest -from customize_schema import validate_metadata as validator43 -from helpers import load_json_path - -# Define the directory containing the test JSON files -VALID_DATACITE43_DIR = "../tests/data/datacite43/" # Directory for valid JSON files - - -# Function to get all JSON files in the directory -def get_all_json_files(directory): - return [ - os.path.join(directory, f) for f in os.listdir(directory) if f.endswith(".json") - ] - - -# Get list of all valid JSON files in the directory -VALID_DATACITE43_FILES = get_all_json_files(VALID_DATACITE43_DIR) - - -@pytest.mark.parametrize("valid_file", VALID_DATACITE43_FILES) -def test_valid_json(valid_file): - """Test that valid example files validate successfully.""" - print(f"Validating file: {valid_file}") # Added log for file being tested - json_data = load_json_path(valid_file) - validation_errors = None - try: - validation_errors = validator43(json_data) - except ValueError as e: - pytest.fail(f"Validation failed for: {valid_file}\nErrors: {str(e)}") - - if validation_errors: - pytest.fail(f"Validation failed for: {valid_file}\nErrors: {validation_errors}") - else: - print(f"Validation passed for: {valid_file}") - - -if __name__ == "__main__": - # Track failures for manual testing - failed_files = [] - - # Run the tests and print results for each file - for file in VALID_DATACITE43_FILES: - try: - test_valid_json(file) - except AssertionError as e: - failed_files.append(file) - print(f"Error occurred in file: {file}\nError details: {e}") - - # Print a summary of all failed files - if failed_files: - print("\nThe following files failed validation:") - for failed_file in failed_files: - print(f"- {failed_file}") - else: - print("\nAll files passed validation.")