Skip to content

Commit

Permalink
make agency lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jul 29, 2020
1 parent b59b2fd commit fc51c74
Show file tree
Hide file tree
Showing 15 changed files with 218 additions and 102 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
bolognese (1.8.3)
bolognese (1.8.4)
activesupport (>= 4.2.5)
benchmark_methods (~> 0.7)
bibtex-ruby (>= 5.1.0)
Expand Down
12 changes: 8 additions & 4 deletions lib/bolognese/readers/crossref_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ def read_crossref(string: nil, **options)
book_metadata = meta.dig("crossref", "book", "book_metadata")
book_series_metadata = meta.dig("crossref", "book", "book_series_metadata")
book_set_metadata = meta.dig("crossref", "book", "book_set_metadata")
bibliographic_metadata = meta.dig("crossref", "book", "content_item") || book_metadata || book_series_metadata
bibliographic_metadata = meta.dig("crossref", "book", "content_item") || book_metadata || book_series_metadata || book_set_metadata
resource_type = bibliographic_metadata.fetch("component_type", nil) ? "book-" + bibliographic_metadata.fetch("component_type") : "book"
publisher = book_metadata.present? ? book_metadata.dig("publisher", "publisher_name") : book_series_metadata.dig("publisher", "publisher_name")
# publisher = if book_metadata.present?
# book_metadata.dig("publisher", "publisher_name")
# elsif book_series_metadata.present?
# book_series_metadata.dig("publisher", "publisher_name")
# end
when "conference"
event_metadata = meta.dig("crossref", "conference", "event_metadata") || {}
bibliographic_metadata = meta.dig("crossref", "conference", "conference_paper").to_h
Expand Down Expand Up @@ -165,7 +169,7 @@ def read_crossref(string: nil, **options)
"funding_references" => crossref_funding_reference(program_metadata),
"publisher" => publisher,
"container" => container,
"agency" => agency = options[:ra] || "Crossref",
"agency" => agency = options[:ra] || "crossref",
"related_identifiers" => related_identifiers,
"dates" => dates,
"publication_year" => publication_year,
Expand Down Expand Up @@ -239,7 +243,7 @@ def crossref_people(bibliographic_metadata, contributor_role)
{ "nameType" => "Organizational",
"name" => a["name"] || a["__content__"] }
end
end.unwrap
end
end

def crossref_funding_reference(program_metadata)
Expand Down
2 changes: 1 addition & 1 deletion lib/bolognese/readers/datacite_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def read_datacite(string: nil, **options)
"contributors" => get_authors(Array.wrap(meta.dig("contributors", "contributor"))),
"container" => set_container(meta),
"publisher" => parse_attributes(meta.fetch("publisher", nil), first: true).to_s.strip.presence,
"agency" => "DataCite",
"agency" => "datacite",
"funding_references" => funding_references,
"dates" => dates,
"publication_year" => parse_attributes(meta.fetch("publicationYear", nil), first: true).to_s.strip.presence,
Expand Down
1 change: 1 addition & 0 deletions lib/bolognese/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ module Utils
"AudioObject" => "Sound",
"Blog" => "Text",
"BlogPosting" => "Text",
"Book" => "Text",
"Chapter" => "Text",
"Collection" => "Collection",
"DataCatalog" => "Dataset",
Expand Down
2 changes: 1 addition & 1 deletion lib/bolognese/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Bolognese
VERSION = "1.8.3"
VERSION = "1.8.4"
end
2 changes: 1 addition & 1 deletion spec/fixtures/crosscite.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@
"description": "This tools are used to analyse the data produced by the Crosssover Experiment I designed to test Choice Architecture techniques as UI interventions in a SEEk4Science data catalogue. It contains:\n\n- Data structures for the experimental data.<br>\n- Visualisation functions<br>\n- Analysis functions\n\n## Installation\n\n- R<br>\n- python<br>\n- ipython 4\n\nClone and use.\n\n## Usage\n\n<br>\n```python<br>\nsource('parallel_plot.r')<br>\nwith(z, parallelset(trt,response, freq=count, alpha=0.2))<br>\n```\n\n<br>\n## Contributing\n\n1. Fork it!<br>\n2. Create your feature branch: `git checkout -b my-new-feature`<br>\n3. Commit your changes: `git commit -am 'Add some feature'`<br>\n4. Push to the branch: `git push origin my-new-feature`<br>\n5. Submit a pull request :D\n\n<br>\n## License\n\nThis work supports my PhD Thesis at University of Manchester."
}],
"schema_version": "http://datacite.org/schema/kernel-4",
"agency": "DataCite",
"agency": "datacite",
"state": "findable"
}
2 changes: 1 addition & 1 deletion spec/fixtures/datacite.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@
"description": "Eating your own dog food is a slang term to describe that an organization should itself use the products and services it provides. For DataCite this means that we should use DOIs with appropriate metadata and strategies for long-term preservation for..."
}],
"schemaVersion": "http://datacite.org/schema/kernel-4",
"agency": "DataCite"
"agency": "datacite"
}
2 changes: 1 addition & 1 deletion spec/fixtures/datacite_software.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"publisher": "KNB Data Repository",
"publication-year": "2016",
"schema-version": "http://datacite.org/schema/kernel-3",
"agency": "DataCite"
"agency": "datacite"
}
2 changes: 1 addition & 1 deletion spec/fixtures/datacite_software_version.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"schemaVersion": "http://datacite.org/schema/kernel-4",
"providerId": "cern",
"clientId": "cern.zenodo",
"agency": "DataCite",
"agency": "datacite",
"state": "findable"
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fc51c74

Please sign in to comment.