Skip to content

Commit

Permalink
Fix 43 customization and add example
Browse files Browse the repository at this point in the history
  • Loading branch information
tmorrell committed May 27, 2021
1 parent 0809e37 commit 7edd34a
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 4 deletions.
8 changes: 6 additions & 2 deletions caltechdata_api/customize_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ def customize_schema_43(json_record):
alt = []
for identifier in json_record["identifiers"]:
if identifier["identifierType"] == "DOI":
json_record["doi"] = identifier
json_record["doi"] = identifier['identifier']
else:
alt.append(identifier)
if alt != []:
json_record["alternativeIdentifiers"] = alt
del json_record["identifier"]
del json_record["identifiers"]

# change author formatting
# We're dropping URIs
Expand Down Expand Up @@ -159,6 +159,10 @@ def customize_schema_43(json_record):
for funding in json_record["fundingReferences"]:
if "awardNumber" in funding:
funding["awardNumber"] = {"awardNumber": funding["awardNumber"]}
if 'funderIdentifier' in funding:
funding['funderIdentifier'] = {'funderIdentifier':
funding['funderIdentifier']}


# resourceTypeGeneral
typeg = json_record["types"]["resourceTypeGeneral"]
Expand Down
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"codeRepository": "https://github.com/caltechlibrary/caltechdata_api",
"issueTracker": "https://github.com/caltechlibrary/caltechdata_api/issues",
"license": "https://data.caltech.edu/license",
"version": "0.1.8",
"version": "0.1.10",
"author": [
{
"@type": "Person",
Expand All @@ -18,7 +18,7 @@
}],
"developmentStatus": "active",
"downloadUrl":
"https://github.com/caltechlibrary/caltechdata_api/archive/0.1.5.zip",
"https://github.com/caltechlibrary/caltechdata_api/archive/0.1.10.zip",
"keywords": [
"GitHub",
"metadata",
Expand Down
141 changes: 141 additions & 0 deletions example43.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
"identifiers": [
{
"identifier": "10.14291/1",
"identifierType": "DOI"
}],
"alternateIdentifiers": [
{
"alternateIdentifier": "Alt_Identifier",
"alternateIdentifierType": "Alt_Identifier_Type"
}
],
"contributors": [
{
"nameType": "Personal",
"affiliation": [
{
"name": "DataCite",
"affiliationIdentifier": "https://ror.org/04wxnsj81",
"affiliationIdentifierScheme": "ROR"
}
],
"name": "Contributor Name",
"contributorType": "ContactPerson",
"nameIdentifiers": [
{
"nameIdentifier": "Contributor Identifier",
"nameIdentifierScheme": "GRID",
"schemeUri": "https://www.grid.ac/institutes/"
}
]
}
],
"creators": [
{
"nameType": "Personal",
"affiliation": [
{
"name": "DataCite",
"affiliationIdentifier": "https://ror.org/04wxnsj81",
"affiliationIdentifierScheme": "ROR"
}
],
"name": "Name",
"familyName": "Family Name",
"givenName": "Given Name",
"nameIdentifiers": [
{
"nameIdentifier": "Name Identifier",
"nameIdentifierScheme": "ORCID",
"schemeUri": "http://orcid.org/"
}
]
}
],
"dates": [
{
"date": "2014-10-01",
"dateType": "Created"
},
{
"date": "2017-03-01",
"dateType": "Updated"
},
{
"date": "2012-05-22/2016-12-21",
"dateType": "Collected"
}
],
"descriptions": [
{
"description": "Description",
"descriptionType": "Abstract"
}
],
"formats": [
"format"
],
"fundingReferences": [
{
"awardTitle": "Measurement of Column-Averaged CO2",
"funderName": "National Aeronautics and Space Administration",
"funderIdentifierType": "GRID",
"funderIdentifier": "grid.238252.c",
"awardNumber": "NAG5-12247"
}
],
"geoLocations": [
{
"geoLocationPlace": "Place Name",
"geoLocationPoint": {
"pointLatitude": "0.000",
"pointLongitude": "0.000"
}
}
],
"language": "en",
"publicationYear": "2017",
"publisher": "Publisher",
"relatedIdentifiers": [
{
"relatedIdentifier": "http://www.url.org/",
"relatedIdentifierType": "URL",
"relationType": "IsPartOf"
},
{
"relatedIdentifier": "10.5072/FK2",
"relatedIdentifierType": "DOI",
"relationType": "IsDocumentedBy"
}
],
"types": {
"resourceTypeGeneral": "Dataset",
"resourceType": "Dataset"
},
"rightsList": [
{
"rights": "Rights Name",
"rightsURI": "Rights List"
}
],
"subjects": [
{
"subject": "subject1"
},
{
"subject": "subject2"
}
],
"titles": [
{
"title": "Title"
},
{
"title": "Alternative Title",
"titleType": "AlternativeTitle"
}
],
"version": "0",
"schemaVersion": "http://datacite.org/schema/kernel-4"
}

0 comments on commit 7edd34a

Please sign in to comment.