Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 1st set of Datacite field methods #178

Merged
merged 4 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,24 @@ def runner():
return CliRunner()


# aardvark ##########################


@pytest.fixture
def aardvark_records():
return JSONTransformer.parse_source_file("tests/fixtures/aardvark_records.jsonl")


Comment on lines +46 to +53
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not relevant to this transform, can it be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set up those comments (including marc, oaidc, and timdex) to organize the existing fixtures conftest by source so I'd prefer to leave it

@pytest.fixture
def aardvark_record_all_fields():
return JSONTransformer.parse_source_file(
"tests/fixtures/aardvark/aardvark_record_all_fields.jsonl"
)


# datacite ##########################


@pytest.fixture
def datacite_records():
return XMLTransformer.parse_source_file(
Expand All @@ -66,8 +77,22 @@ def datacite_record_all_fields():


@pytest.fixture
def aardvark_records():
return JSONTransformer.parse_source_file("tests/fixtures/aardvark_records.jsonl")
def datacite_record_optional_fields_blank():
source_records = XMLTransformer.parse_source_file(
"tests/fixtures/datacite/datacite_record_optional_fields_blank.xml"
)
return next(source_records)


@pytest.fixture
def datacite_record_optional_fields_missing():
source_records = XMLTransformer.parse_source_file(
"tests/fixtures/datacite/datacite_record_optional_fields_missing.xml"
)
return next(source_records)


# marc ##########################


@pytest.fixture
Expand All @@ -80,11 +105,17 @@ def marc_content_type_crosswalk():
return load_external_config("config/marc_content_type_crosswalk.json", "json")


# oaidc ##########################


@pytest.fixture
def oai_pmh_records():
return XMLTransformer.parse_source_file("tests/fixtures/oai_pmh_records.xml")


# timdex ##########################


@pytest.fixture
def timdex_record_required_fields():
return timdex.TimdexRecord(
Expand Down
251 changes: 127 additions & 124 deletions tests/fixtures/datacite/datacite_record_all_fields.xml
Original file line number Diff line number Diff line change
@@ -1,125 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<record xmlns="http://www.openarchives.org/OAI/2.0/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<header>
<identifier>doi:10.7910/DVN/19PPE7</identifier>
<datestamp>2022-03-26T06:04:55Z</datestamp>
<setSpec>Jameel_Poverty_Action_Lab</setSpec>
<setSpec>IQSS</setSpec>
</header>
<metadata>
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.1/metadata.xsd">
<identifier identifierType="DOI">10.7910/DVN/19PPE7</identifier>
<creators>
<creator>
<creatorName nameType="Personal">Banerji, Rukmini</creatorName>
<givenName>Rukmini</givenName>
<familyName>Banerji</familyName>
<affiliation>Pratham and ASER Centre</affiliation>
<nameIdentifier nameIdentifierScheme="ORCID">0000-0000-0000-0000</nameIdentifier>
</creator>
<creator>
<creatorName nameType="Personal">Berry, James</creatorName>
<givenName>James</givenName>
<familyName>Berry</familyName>
<affiliation>University of Delaware</affiliation>
<nameIdentifier nameIdentifierScheme="TREX">0000-0000-0000-0001</nameIdentifier>
</creator>
<creator>
<creatorName nameType="Personal">Shotland, Marc</creatorName>
<givenName>Marc</givenName>
<familyName>Shotland</familyName>
<affiliation>Abdul Latif Jameel Poverty Action Lab</affiliation>
<nameIdentifier>0000-0000-0000-0002</nameIdentifier>
</creator>
</creators>
<titles>
<title>The Impact of Maternal Literacy and Participation Programs</title>
<title titleType="AlternativeTitle">An Alternative Title</title>
<title titleType="Subtitle">Baseline Data</title>
</titles>
<publisher>Harvard Dataverse</publisher>
<publicationYear>2017</publicationYear>
<subjects>
<subject>Social Sciences</subject>
<subject>Educational materials</subject>
<subject subjectScheme="LCSH">Adult education, education inputs, field experiments</subject>
<subject subjectScheme="LCSH">Education</subject>
</subjects>
<alternateIdentifiers>
<alternateIdentifier alternateIdentifierType="url">https://zenodo.org/record/5524465</alternateIdentifier>
</alternateIdentifiers>
<contributors>
<contributor contributorType="ContactPerson">
<contributorName nameType="Personal">Banerji, Rukmini</contributorName>
<givenName>Rukmini</givenName>
<familyName>Banerji</familyName>
<nameIdentifier nameIdentifierScheme="ORCID">0000-0000-0000-0000</nameIdentifier>
<affiliation>Pratham and ASER Centre</affiliation>
</contributor>
</contributors>
<dates>
<date dateType="Submitted">2017-02-27</date>
<date dateType="Updated" dateInformation="This was updated on this date">2019-06-24</date>
<date dateType="Collected">2007-01-01/2007-02-28</date>
</dates>
<resourceType resourceTypeGeneral="Dataset">Survey Data</resourceType>
<relatedIdentifiers>
<relatedIdentifier relatedIdentifierType="DOI" relationType="IsCitedBy">10.1257/app.20150390</relatedIdentifier>
<relatedIdentifier relationType="IsVersionOf">10.5281/zenodo.5524464</relatedIdentifier>
<relatedIdentifier relatedIdentifierType="ISBN" relationType="IsIdenticalTo">1234567.5524464</relatedIdentifier>
<relatedIdentifier relatedIdentifierType="ISBN" relationType="Other">1234567.5524464</relatedIdentifier>
<relatedIdentifier relatedIdentifierType="URL" relationType="IsPartOf">https://zenodo.org/communities/astronomy-general</relatedIdentifier>
</relatedIdentifiers>
<language>en_US</language>
<sizes>
<size>124903</size>
<size>48958</size>
<size>199070</size>
<size>186674</size>
<size>139605</size>
<size>97304</size>
<size>9907</size>
<size>178534602</size>
<size>4032103</size>
<size>43589</size>
<size>15697</size>
</sizes>
<formats>
<format>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</format>
<format>application/pdf</format>
<format>application/pdf</format>
<format>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</format>
<format>application/pdf</format>
<format>application/x-stata-syntax</format>
<format>application/x-stata</format>
<format>application/x-stata</format>
<format>application/zip</format>
<format>application/pdf</format>
<format>application/pdf</format>
</formats>
<version>1.2</version>
<rightsList>
<rights rightsURI="info:eu-repo/semantics/openAccess" />
<rights rightsURI="http://creativecommons.org/publicdomain/zero/1.0">CC0 1.0</rights>
</rightsList>
<descriptions>
<description descriptionType="Abstract">Using a randomized field experiment in India, we evaluate the effectiveness of adult literacy and parental involvement interventions in improving children's learning. Households were assigned to receive either adult literacy (language and math) classes for mothers, training for mothers on how to enhance their children's learning at home, or a combination of the two programs. All three interventions had significant but modest impacts on childrens math scores. The interventions also increased mothers' test scores in both language and math, as well as a range of other outcomes reflecting greater involvement of mothers in their children's education.</description>
<description descriptionType="TechnicalInfo">Stata, 13</description>
</descriptions>
<geoLocations>
<geoLocation>
<geoLocationPlace>A point on the globe</geoLocationPlace>
</geoLocation>
</geoLocations>
<fundingReferences>
<fundingReference>
<funderName>3ie, Nike Foundation</funderName>
<funderIdentifier funderIdentifierType="Crossref FunderID">0987</funderIdentifier>
<awardNumber awardURI="http://awards.example/7689">OW1/1012 (3ie)</awardNumber>
</fundingReference>
</fundingReferences>
</resource>
</metadata>
</record>
<records>
<record xmlns="http://www.openarchives.org/OAI/2.0/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<header>
<identifier>doi:10.7910/DVN/19PPE7</identifier>
<datestamp>2022-03-26T06:04:55Z</datestamp>
<setSpec>Jameel_Poverty_Action_Lab</setSpec>
<setSpec>IQSS</setSpec>
</header>
<metadata>
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://datacite.org/schema/kernel-4"
xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.1/metadata.xsd">
<identifier identifierType="DOI">10.7910/DVN/19PPE7</identifier>
<creators>
<creator>
<creatorName nameType="Personal">Banerji, Rukmini</creatorName>
<givenName>Rukmini</givenName>
<familyName>Banerji</familyName>
<affiliation>Pratham and ASER Centre</affiliation>
<nameIdentifier nameIdentifierScheme="ORCID">0000-0000-0000-0000</nameIdentifier>
</creator>
<creator>
<creatorName nameType="Personal">Berry, James</creatorName>
<givenName>James</givenName>
<familyName>Berry</familyName>
<affiliation>University of Delaware</affiliation>
<nameIdentifier nameIdentifierScheme="TREX">0000-0000-0000-0001</nameIdentifier>
</creator>
<creator>
<creatorName nameType="Personal">Shotland, Marc</creatorName>
<givenName>Marc</givenName>
<familyName>Shotland</familyName>
<affiliation>Abdul Latif Jameel Poverty Action Lab</affiliation>
<nameIdentifier>0000-0000-0000-0002</nameIdentifier>
</creator>
</creators>
<titles>
<title>The Impact of Maternal Literacy and Participation Programs</title>
<title titleType="AlternativeTitle">An Alternative Title</title>
<title titleType="Subtitle">Baseline Data</title>
</titles>
<publisher>Harvard Dataverse</publisher>
<publicationYear>2017</publicationYear>
<subjects>
<subject>Social Sciences</subject>
<subject>Educational materials</subject>
<subject subjectScheme="LCSH">Adult education, education inputs, field experiments</subject>
<subject subjectScheme="LCSH">Education</subject>
</subjects>
<alternateIdentifiers>
<alternateIdentifier alternateIdentifierType="url">https://zenodo.org/record/5524465</alternateIdentifier>
</alternateIdentifiers>
<contributors>
<contributor contributorType="ContactPerson">
<contributorName nameType="Personal">Banerji, Rukmini</contributorName>
<givenName>Rukmini</givenName>
<familyName>Banerji</familyName>
<nameIdentifier nameIdentifierScheme="ORCID">0000-0000-0000-0000</nameIdentifier>
<affiliation>Pratham and ASER Centre</affiliation>
</contributor>
</contributors>
<dates>
<date dateType="Submitted">2017-02-27</date>
<date dateType="Updated" dateInformation="This was updated on this date">2019-06-24</date>
<date dateType="Collected">2007-01-01/2007-02-28</date>
</dates>
<resourceType resourceTypeGeneral="Dataset">Survey Data</resourceType>
<relatedIdentifiers>
<relatedIdentifier relatedIdentifierType="DOI" relationType="IsCitedBy">10.1257/app.20150390</relatedIdentifier>
<relatedIdentifier relationType="IsVersionOf">10.5281/zenodo.5524464</relatedIdentifier>
<relatedIdentifier relatedIdentifierType="ISBN" relationType="IsIdenticalTo">1234567.5524464</relatedIdentifier>
<relatedIdentifier relatedIdentifierType="ISBN" relationType="Other">1234567.5524464</relatedIdentifier>
<relatedIdentifier relatedIdentifierType="URL" relationType="IsPartOf">https://zenodo.org/communities/astronomy-general</relatedIdentifier>
</relatedIdentifiers>
<language>en_US</language>
<sizes>
<size>124903</size>
<size>48958</size>
<size>199070</size>
<size>186674</size>
<size>139605</size>
<size>97304</size>
<size>9907</size>
<size>178534602</size>
<size>4032103</size>
<size>43589</size>
<size>15697</size>
</sizes>
<formats>
<format>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</format>
<format>application/pdf</format>
<format>application/pdf</format>
<format>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</format>
<format>application/pdf</format>
<format>application/x-stata-syntax</format>
<format>application/x-stata</format>
<format>application/x-stata</format>
<format>application/zip</format>
<format>application/pdf</format>
<format>application/pdf</format>
</formats>
<version>1.2</version>
<rightsList>
<rights rightsURI="info:eu-repo/semantics/openAccess" />
<rights rightsURI="http://creativecommons.org/publicdomain/zero/1.0">CC0 1.0</rights>
</rightsList>
<descriptions>
<description descriptionType="Abstract">Using a randomized field experiment in India, we evaluate the effectiveness of adult literacy and parental involvement interventions in improving children's learning. Households were assigned to receive either adult literacy (language and math) classes for mothers, training for mothers on how to enhance their children's learning at home, or a combination of the two programs. All three interventions had significant but modest impacts on childrens math scores. The interventions also increased mothers' test scores in both language and math, as well as a range of other outcomes reflecting greater involvement of mothers in their children's education.</description>
<description descriptionType="TechnicalInfo">Stata, 13</description>
</descriptions>
<geoLocations>
<geoLocation>
<geoLocationPlace>A point on the globe</geoLocationPlace>
</geoLocation>
</geoLocations>
<fundingReferences>
<fundingReference>
<funderName>3ie, Nike Foundation</funderName>
<funderIdentifier funderIdentifierType="Crossref FunderID">0987</funderIdentifier>
<awardNumber awardURI="http://awards.example/7689">OW1/1012 (3ie)</awardNumber>
</fundingReference>
</fundingReferences>
</resource>
</metadata>
</record>
</records>
Loading
Loading