diff --git a/README.md b/README.md index b206130b..c4224315 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,13 @@ CIOOS Metadata entry form This will start a hot-reloading dev server. Click on the link that it outputs to open in your browser. +### Running the Firebase emulator + +Install firebase CLI [as described here](https://firebase.google.com/docs/emulator-suite/install_and_configure). + +Run `firebase emulators:start` from the `firebase-functions/functions` directory. +Redirect function calls to this emulator by uncommenting the call to `useFunctionsEmulator` in [firebase.js](firebase.js). + ## Deploy to testing site at GitHub pages Pushes to master automatically deploy to diff --git a/firebase_to_xml/firebase_to_xml/resources/licenses.json b/firebase_to_xml/firebase_to_xml/resources/licenses.json index 7982fef0..eff33ebd 100644 --- a/firebase_to_xml/firebase_to_xml/resources/licenses.json +++ b/firebase_to_xml/firebase_to_xml/resources/licenses.json @@ -1,102 +1,110 @@ { - "CC-BY-4.0": { - "title": { - "en": "Creative Commons Attribution 4.0 Attribution" + "CC-BY-4.0": { + "title": { + "en": "Creative Commons Attribution 4.0 Attribution" + }, + "url": "https://creativecommons.org/licenses/by/4.0", + "code": "CC-BY-4.0" }, - "url": "https://creativecommons.org/licenses/by/4.0", - "code": "CC-BY-4.0" - }, - "CC-BY-SA-4.0": { - "title": { - "en": "Creative Commons Attribution 4.0 Attribution-ShareAlike" + "CC-BY-SA-4.0": { + "title": { + "en": "Creative Commons Attribution 4.0 Attribution-ShareAlike" + }, + "url": "https://creativecommons.org/licenses/by-sa/4.0/", + "code": "CC-BY-SA-4.0" }, - "url": "https://creativecommons.org/licenses/by-sa/4.0/", - "code": "CC-BY-SA-4.0" - }, - "CC-BY-ND-4.0": { - "title": { - "en": "Creative Commons Attribution 4.0 Attribution-NoDerivs " + "CC-BY-ND-4.0": { + "title": { + "en": "Creative Commons Attribution 4.0 Attribution-NoDerivs " + }, + "url": "https://creativecommons.org/licenses/by-nd/4.0/", + "code": "CC-BY-ND-4.0" }, - "url": "https://creativecommons.org/licenses/by-nd/4.0/", - "code": "CC-BY-ND-4.0" - }, - "CC-BY-NC-4.0": { - "title": { - "en": "Creative Commons Attribution 4.0 Attribution-NonCommercial " + "CC-BY-NC-4.0": { + "title": { + "en": "Creative Commons Attribution 4.0 Attribution-NonCommercial " + }, + "url": "https://creativecommons.org/licenses/by-nc/4.0/", + "code": "CC-BY-NC-4.0" }, - "url": "https://creativecommons.org/licenses/by-nc/4.0/", - "code": "CC-BY-NC-4.0" - }, - "CC-BY-NC-SA-4.0": { - "title": { - "en": "Creative Commons Attribution 4.0 Attribution-NonCommercial-ShareAlike " + "CC-BY-NC-SA-4.0": { + "title": { + "en": "Creative Commons Attribution 4.0 Attribution-NonCommercial-ShareAlike " + }, + "url": "https://creativecommons.org/licenses/by-nc-sa/4.0/", + "code": "CC-BY-NC-SA-4.0" }, - "url": "https://creativecommons.org/licenses/by-nc-sa/4.0/", - "code": "CC-BY-NC-SA-4.0" - }, - "CC-BY-NC-ND-4.0": { - "title": { - "en": "Creative Commons Attribution 4.0 Attribution-NonCommercial-NoDerivs" + "CC-BY-NC-ND-4.0": { + "title": { + "en": "Creative Commons Attribution 4.0 Attribution-NonCommercial-NoDerivs" + }, + "url": "https://creativecommons.org/licenses/by-nc-nd/4.0/", + "code": "CC-BY-NC-ND-4.0" }, - "url": "https://creativecommons.org/licenses/by-nc-nd/4.0/", - "code": "CC-BY-NC-ND-4.0" - }, - "CC0": { - "title": { - "en": "Creative Commons 0" + "CC0": { + "title": { + "en": "Creative Commons 0" + }, + "url": "https://creativecommons.org/share-your-work/public-domain/cc0", + "code": "CC0" }, - "url": "https://creativecommons.org/share-your-work/public-domain/cc0", - "code": "CC0" - }, - "government-open-license-canada": { - "title": { - "en": "Open Government Licence - Canada", - "fr": "Licence du gouvernement ouvert – Canada " + "government-open-license-canada": { + "title": { + "en": "Open Government Licence - Canada", + "fr": "Licence du gouvernement ouvert – Canada " + }, + "url": "https://open.canada.ca/en/open-government-licence-canada", + "code": "government-open-license-canada" }, - "url": "https://open.canada.ca/en/open-government-licence-canada", - "code": "government-open-license-canada" - }, - "government-open-license-nova-scotia": { - "title": { - "en": "Open Government Licence - Nova Scotia" + "government-open-license-nova-scotia": { + "title": { + "en": "Open Government Licence - Nova Scotia" + }, + "url": "https://novascotia.ca/opendata/licence.asp", + "code": "government-open-license-nova-scotia" }, - "url": "https://novascotia.ca/opendata/licence.asp", - "code": "government-open-license-nova-scotia" - }, - "OGL-NB": { - "title": { - "en": "Open Government Licence – New Brunswick" + "OGL-NB": { + "title": { + "en": "Open Government Licence – New Brunswick" + }, + "url": "http://www.snb.ca/e/2000/data-E.html", + "code": "OGL-NB" }, - "url": "http://www.snb.ca/e/2000/data-E.html", - "code": "OGL-NB" - }, - "OGL-BC": { - "title": { - "en": "Open Government Licence - British Columbia" + "OGL-BC": { + "title": { + "en": "Open Government Licence - British Columbia" + }, + "url": "https://www2.gov.bc.ca/gov/content/data/open-data/open-government-licence-bc", + "code": "OGL-BC" }, - "url": "https://www2.gov.bc.ca/gov/content/data/open-data/open-government-licence-bc", - "code": "OGL-BC" - }, - "government-open-license-newfoundland": { - "title": { - "en": "Open Government Licence - Newfoundland and Labrador" + "government-open-license-newfoundland": { + "title": { + "en": "Open Government Licence - Newfoundland and Labrador" + }, + "url": "https://opendata.gov.nl.ca/public/opendata/page/?page-id=licence", + "code": "government-open-license-newfoundland" }, - "url": "https://opendata.gov.nl.ca/public/opendata/page/?page-id=licence", - "code": "government-open-license-newfoundland" - }, - "Apache-2.0": { - "title": { - "en": "Apache License, Version 2.0" + "Apache-2.0": { + "title": { + "en": "Apache License, Version 2.0" + }, + "url": "https://www.apache.org/licenses/LICENSE-2.0", + "code": "Apache-2.0" }, - "url": "https://www.apache.org/licenses/LICENSE-2.0", - "code": "Apache-2.0" - }, - "No License": { - "title": { - "en": "No License", - "fr": "Aucune licence" + "No License": { + "title": { + "en": "No License", + "fr": "Aucune licence" + }, + "url": "https://choosealicense.com/no-permission/", + "code": "None" }, - "url": "https://choosealicense.com/no-permission/", - "code": "None" - } -} + "ca-eccc-odl": { + "title": { + "en": "Environment and Climate Change Canada Data Servers End-use Licence", + "fr": "Licence d’utilisation finale pour les serveurs de données d’Environnement et Changement climatique Canada" + }, + "url": "https://eccc-msc.github.io/open-data/licence/readme_en/", + "code": "ca-eccc-odl" + } +} \ No newline at end of file diff --git a/src/__testData__/expectedDataCiteStructure.js b/src/__testData__/expectedDataCiteStructure.js new file mode 100644 index 00000000..ed05142d --- /dev/null +++ b/src/__testData__/expectedDataCiteStructure.js @@ -0,0 +1,103 @@ + +const expectedDataCiteStructure = { + "data": { + "type": "dois", + "attributes": { + "prefix": "10.21966", + "creators": [ + { + "name": "Sorochak, Austen", + "nameType": "Personal", + "givenName": "Austen", + "familyName": "Sorochak", + "affiliation": [ + { + "name": "Royal Roads University", + "schemeUri": "https://ror.org", + "affiliationIdentifier": "https://ror.org/05w4ste42", + "affiliationIdentifierScheme": "ROR", + }, + ], + }, + { + "name": "PumpkinKing, Jack", + "nameType": "Personal", + "givenName": "Jack", + "familyName": "PumpkinKing", + "affiliation": [], + }, + ], + "titles": [ + { + "lang": "en", + "title": "This is a mock record", + }, + { + "lang": "fr", + "title": "Il s'agit d'un faux record", + }, + ], + "publisher": "Royal Roads University", + "publicationYear": 2023, + "subjects": [ + { + "lang": "en", + "subject": "abundance and biomass", + }, + { + "lang": "fr", + "subject": "abondance et biomasse", + }, + ], + "dates": [ + { + "date": "2023-10-01T19:00:00.000Z", + "dateType": "Collected", + "dateInformation": "Start date when data was first collected", + }, + { + "date": "2023-10-04T19:00:00.000Z", + "dateType": "Collected", + "dateInformation": "End date when data was last collected", + }, + ], + "rightsList": [ + { + "rights": "Creative Commons Attribution 4.0 Attribution", + "rightsUri": "https://creativecommons.org/licenses/by/4.0", + "schemeUri": "https://spdx.org/licenses/", + "rightsIdentifier": "CC-BY-4.0", + "rightsIdentifierScheme": "SPDX", + }, + ], + "descriptions": [ + { + "lang": "en", + "description": "This is a mock record to be used in unit tests, to ensure the continued functionality of the mapping function.", + "descriptionType": "Abstract", + }, + { + "lang": "fr", + "description": "Il s'agit d'un enregistrement fictif à utiliser dans les tests unitaires, afin de garantir la fonctionnalité continue de la fonction de mappage.", + "descriptionType": "Abstract", + }, + ], + "geoLocations": [ + { + "geoLocationBox": { + "eastBoundLongitude": -160, + "northBoundLatitude": 60, + "southBoundLatitude": 45, + "westBoundLongitude": -120, + }, + }, + ], + "types": { + "resourceTypeGeneral": "Dataset", + }, + "url": "https://catalogue.hakai.org/dataset/ca-cioos_b6f44266-5815-48bb-bd0c-dd050c6fe465", + }, + }, +} + +export default expectedDataCiteStructure; \ No newline at end of file diff --git a/src/__testData__/mockMetadataRecord.js b/src/__testData__/mockMetadataRecord.js new file mode 100644 index 00000000..dd09e5de --- /dev/null +++ b/src/__testData__/mockMetadataRecord.js @@ -0,0 +1,119 @@ + +const mockMetadataRecord = { + "title": { + "en": "This is a mock record", + "fr": "Il s'agit d'un faux record", + }, + "abstract": { + "en": "This is a mock record to be used in unit tests, to ensure the continued functionality of the mapping function.", + "fr": "Il s'agit d'un enregistrement fictif à utiliser dans les tests unitaires, afin de garantir la fonctionnalité continue de la fonction de mappage.", + }, + "keywords": { + "en": [ + "abundance and biomass", + ], + "fr": [ + "abondance et biomasse", + ], + }, + "eov": [ + "dissolvedOrganicCarbon", + ], + "progress": "onGoing", + "distribution": [], + "dateStart": "2023-10-01T19:00:00.000Z", + "dateEnd": "2023-10-04T19:00:00.000Z", + "map": { + "east": "-160", + "north": "60", + "polygon": "", + "south": "45", + "west": "-120", + }, + "verticalExtentMin": "", + "verticalExtentMax": "", + "datePublished": "2023-10-26T19:00:00.000Z", + "dateRevised": null, + "edition": "", + "recordID": "-Nhi6_2lQjNwKkzdv_Qu", + "instruments": [], + "platform": "", + "platformID": "", + "platformDescription": "", + "language": "en", + "license": "CC-BY-4.0", + "contacts": [ + { + "role": [ + "custodian", + ], + "orgName": "Royal Roads University", + "orgEmail": "", + "orgURL": "http://www.royalroads.ca/", + "orgAdress": "", + "orgCity": "Victoria", + "orgCountry": "Canada", + "orgRor": "https://ror.org/05w4ste42", + "indPosition": "", + "indEmail": "", + "indOrcid": "", + "givenNames": "Austen", + "lastName": "Sorochak", + "inCitation": true, + }, + { + "role": [], + "orgName": "", + "orgEmail": "", + "orgURL": "", + "orgAdress": "", + "orgCity": "", + "orgCountry": "", + "orgRor": "", + "indPosition": "", + "indEmail": "", + "indOrcid": "", + "givenNames": "Jack", + "lastName": "PumpkinKing", + "inCitation": true, + }, + { + "role": [ + "publisher", + ], + "orgName": "Royal Roads University", + "orgEmail": "", + "orgURL": "", + "orgAdress": "", + "orgCity": "", + "orgCountry": "", + "orgRor": "", + "indPosition": "", + "indEmail": "", + "indOrcid": "", + "givenNames": "", + "lastName": "", + "inCitation": true, + }, + ], + "status": "", + "comment": "", + "limitations": "", + "lastEditedBy": { + "displayName": "Austen Sorochak", + "email": "austen.sorochak@hakai.org", + }, + "category": "", + "verticalExtentDirection": "", + "datasetIdentifier": "", + "doiCreationStatus": "", + "noPlatform": false, + "filename": "", + "organization": "", + "timeFirstPublished": "", + "identifier": "b6f44266-5815-48bb-bd0c-dd050c6fe465", + "created": "2023-11-03T21:04:37.548Z", + "userID": "gP03Su7SUndv1bwlW6YnBhtAwSw2", +} + +export default mockMetadataRecord \ No newline at end of file diff --git a/src/__tests__/recordToDataCite.test.js b/src/__tests__/recordToDataCite.test.js new file mode 100644 index 00000000..014723b6 --- /dev/null +++ b/src/__tests__/recordToDataCite.test.js @@ -0,0 +1,19 @@ +import recordToDataCite from './../utils/recordToDataCite' +import licenses from './../utils/licenses'; +import regions from './../regions'; +import mockMetadataRecord from '../__testData__/mockMetadataRecord'; +import expectedDataCiteStructure from '../__testData__/expectedDataCiteStructure'; + +const language = 'en'; +const region = 'hakai'; + +describe('recordToDataCite', () => { + it('should correctly map metadata record to DataCite format', () => { + + const testResult = recordToDataCite(mockMetadataRecord, language, region); + + // Assert that the output matches the expected structure + expect(testResult).toEqual(expectedDataCiteStructure); + + }); +}) \ No newline at end of file diff --git a/src/components/Tabs/IdentificationTab.jsx b/src/components/Tabs/IdentificationTab.jsx index d94207cf..a9d29820 100644 --- a/src/components/Tabs/IdentificationTab.jsx +++ b/src/components/Tabs/IdentificationTab.jsx @@ -82,7 +82,7 @@ const IdentificationTab = ({ setLoadingDoi(true); try { - const mappedDataCiteObject = recordToDataCite(record); + const mappedDataCiteObject = recordToDataCite(record, language, region); await createDraftDoi(mappedDataCiteObject) .then((response) => { return response.data.data.attributes; @@ -130,7 +130,7 @@ const IdentificationTab = ({ setLoadingDoiUpdate(true); try { - const mappedDataCiteObject = recordToDataCite(record); + const mappedDataCiteObject = recordToDataCite(record, language, region); delete mappedDataCiteObject.data.type; delete mappedDataCiteObject.data.attributes.prefix; diff --git a/src/utils/licenses.js b/src/utils/licenses.js index ced90b9d..a4586727 100644 --- a/src/utils/licenses.js +++ b/src/utils/licenses.js @@ -1,86 +1,112 @@ const licenses = { - "CC-BY-4.0": { - title: { en: "Creative Commons Attribution 4.0 Attribution" }, - url: "https://creativecommons.org/licenses/by/4.0", - code: "CC-BY-4.0", - }, - "CC-BY-SA-4.0": { - title: { en: "Creative Commons Attribution 4.0 Attribution-ShareAlike" }, - url: "https://creativecommons.org/licenses/by-sa/4.0/", - code: "CC-BY-SA-4.0", - }, - "CC-BY-ND-4.0": { - title: { en: "Creative Commons Attribution 4.0 Attribution-NoDerivs " }, - url: "https://creativecommons.org/licenses/by-nd/4.0/", - code: "CC-BY-ND-4.0", - }, - "CC-BY-NC-4.0": { - title: { - en: "Creative Commons Attribution 4.0 Attribution-NonCommercial ", + "CC-BY-4.0": { + "title": { + "en": "Creative Commons Attribution 4.0 Attribution" + }, + "url": "https://creativecommons.org/licenses/by/4.0", + "code": "CC-BY-4.0" }, - url: "https://creativecommons.org/licenses/by-nc/4.0/", - code: "CC-BY-NC-4.0", - }, - "CC-BY-NC-SA-4.0": { - title: { - en: - "Creative Commons Attribution 4.0 Attribution-NonCommercial-ShareAlike ", + "CC-BY-SA-4.0": { + "title": { + "en": "Creative Commons Attribution 4.0 Attribution-ShareAlike" + }, + "url": "https://creativecommons.org/licenses/by-sa/4.0/", + "code": "CC-BY-SA-4.0" }, - url: "https://creativecommons.org/licenses/by-nc-sa/4.0/", - code: "CC-BY-NC-SA-4.0", - }, - "CC-BY-NC-ND-4.0": { - title: { - en: "Creative Commons Attribution 4.0 Attribution-NonCommercial-NoDerivs", + "CC-BY-ND-4.0": { + "title": { + "en": "Creative Commons Attribution 4.0 Attribution-NoDerivs " + }, + "url": "https://creativecommons.org/licenses/by-nd/4.0/", + "code": "CC-BY-ND-4.0" }, - url: "https://creativecommons.org/licenses/by-nc-nd/4.0/", - code: "CC-BY-NC-ND-4.0", - }, - CC0: { - title: { en: "Creative Commons 0" }, - url: "https://creativecommons.org/share-your-work/public-domain/cc0", - code: "CC0", - }, - "government-open-license-canada": { - title: { - en: "Open Government Licence - Canada", - fr: "Licence du gouvernement ouvert – Canada ", + "CC-BY-NC-4.0": { + "title": { + "en": "Creative Commons Attribution 4.0 Attribution-NonCommercial " + }, + "url": "https://creativecommons.org/licenses/by-nc/4.0/", + "code": "CC-BY-NC-4.0" }, - url: "https://open.canada.ca/en/open-government-licence-canada", - code: "government-open-license-canada", - }, - "government-open-license-nova-scotia": { - title: { en: "Open Government Licence - Nova Scotia" }, - url: "https://novascotia.ca/opendata/licence.asp", - code: "government-open-license-nova-scotia", - }, - "OGL-NB": { - title: { en: "Open Government Licence – New Brunswick" }, - url: "http://www.snb.ca/e/2000/data-E.html", - code: "OGL-NB", - }, - "OGL-BC": { - title: { en: "Open Government Licence - British Columbia" }, - url: - "https://www2.gov.bc.ca/gov/content/data/open-data/open-government-licence-bc", - code: "OGL-BC", - }, - - "government-open-license-newfoundland": { - title: { en: "Open Government Licence - Newfoundland and Labrador" }, - url: "https://opendata.gov.nl.ca/public/opendata/page/?page-id=licence", - code: "government-open-license-newfoundland", - }, - "Apache-2.0": { - title: { en: "Apache License, Version 2.0" }, - url: "https://www.apache.org/licenses/LICENSE-2.0", - code: "Apache-2.0", - }, - "No License": { - title: {en: "No License", fr: "Aucune licence"}, - url: "https://choosealicense.com/no-permission/", - code: "None", - }, + "CC-BY-NC-SA-4.0": { + "title": { + "en": "Creative Commons Attribution 4.0 Attribution-NonCommercial-ShareAlike " + }, + "url": "https://creativecommons.org/licenses/by-nc-sa/4.0/", + "code": "CC-BY-NC-SA-4.0" + }, + "CC-BY-NC-ND-4.0": { + "title": { + "en": "Creative Commons Attribution 4.0 Attribution-NonCommercial-NoDerivs" + }, + "url": "https://creativecommons.org/licenses/by-nc-nd/4.0/", + "code": "CC-BY-NC-ND-4.0" + }, + "CC0": { + "title": { + "en": "Creative Commons 0" + }, + "url": "https://creativecommons.org/share-your-work/public-domain/cc0", + "code": "CC0" + }, + "government-open-license-canada": { + "title": { + "en": "Open Government Licence - Canada", + "fr": "Licence du gouvernement ouvert – Canada " + }, + "url": "https://open.canada.ca/en/open-government-licence-canada", + "code": "government-open-license-canada" + }, + "government-open-license-nova-scotia": { + "title": { + "en": "Open Government Licence - Nova Scotia" + }, + "url": "https://novascotia.ca/opendata/licence.asp", + "code": "government-open-license-nova-scotia" + }, + "OGL-NB": { + "title": { + "en": "Open Government Licence – New Brunswick" + }, + "url": "http://www.snb.ca/e/2000/data-E.html", + "code": "OGL-NB" + }, + "OGL-BC": { + "title": { + "en": "Open Government Licence - British Columbia" + }, + "url": "https://www2.gov.bc.ca/gov/content/data/open-data/open-government-licence-bc", + "code": "OGL-BC" + }, + "government-open-license-newfoundland": { + "title": { + "en": "Open Government Licence - Newfoundland and Labrador" + }, + "url": "https://opendata.gov.nl.ca/public/opendata/page/?page-id=licence", + "code": "government-open-license-newfoundland" + }, + "Apache-2.0": { + "title": { + "en": "Apache License, Version 2.0" + }, + "url": "https://www.apache.org/licenses/LICENSE-2.0", + "code": "Apache-2.0" + }, + "No License": { + "title": { + "en": "No License", + "fr": "Aucune licence" + }, + "url": "https://choosealicense.com/no-permission/", + "code": "None" + }, + "ca-eccc-odl": { + "title": { + "en": "Environment and Climate Change Canada Data Servers End-use Licence", + "fr": "Licence d’utilisation finale pour les serveurs de données d’Environnement et Changement climatique Canada" + }, + "url": "https://eccc-msc.github.io/open-data/licence/readme_en/", + "code": "ca-eccc-odl" + } }; export default licenses; diff --git a/src/utils/recordToDataCite.js b/src/utils/recordToDataCite.js index 1e9959e4..3360b03c 100644 --- a/src/utils/recordToDataCite.js +++ b/src/utils/recordToDataCite.js @@ -2,29 +2,35 @@ import licenses from "./licenses"; import regions from "../regions"; -function recordToDataCite(metadata) { +function recordToDataCite(metadata, language, region) { // Reduce contacts to a list of creators const creators = metadata.contacts ? metadata.contacts.reduce((creatorList, contact) => { let creator; - if (contact.inCitation) { + if (contact.inCitation && !contact.role.includes("publisher")) { const { - indName, - orgName, - lastName, givenNames, + lastName, + orgName, indOrcid, orgRor, } = contact; - // Create an individual creator object if indName is present - if (indName) { + // Create an individual creator object with names + if (givenNames) { creator = { name: `${lastName}, ${givenNames}`, nameType: "Personal", givenName: givenNames, familyName: lastName, + // Add affiliation for individual if organization details are provided + affiliation: orgName ? [{ + name: orgName, + schemeUri: "https://ror.org", + affiliationIdentifier: orgRor, + affiliationIdentifierScheme: "ROR", + }] : [], }; // Add nameIdentifiers for individual with an ORCID @@ -38,25 +44,6 @@ function recordToDataCite(metadata) { ]; } } - - // Create an organizational creator object if orgName is present - if (orgName) { - creator = { - name: orgName, - nameType: "Organizational", - }; - - // Add nameIdentifiers for organization with a ROR - if (orgRor) { - creator.nameIdentifiers = [ - { - schemeUri: "https://ror.org", - nameIdentifier: orgRor, - nameIdentifierScheme: "ROR", - }, - ]; - } - } } // Add the creator to the list if it exists @@ -157,7 +144,7 @@ function recordToDataCite(metadata) { data: { type: "dois", attributes: { - prefix: regions.hakai.datacitePrefix, + prefix: regions[region].datacitePrefix, creators, // Initialize an empty array for titles titles: [], @@ -219,6 +206,14 @@ function recordToDataCite(metadata) { mappedDataCiteObject.data.attributes.geoLocations = geoLocations; } + // Auto-populate Datacite Resource type general as 'dataset' + mappedDataCiteObject.data.attributes.types = { + resourceTypeGeneral: "Dataset", + }; + + // Generate URL element + mappedDataCiteObject.data.attributes.url = `${regions[region].catalogueURL[language]}dataset/ca-cioos_${metadata.identifier}`; + return mappedDataCiteObject; }