diff --git a/CITATION.cff b/CITATION.cff index e8b5e457..574a8707 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -14,7 +14,7 @@ authors: repository-code: "https://github.com/caltechlibrary/irdmtools" -version: 0.0.83 +version: 0.0.84-dev license-url: "https://caltechlibrary.github.io/irdmtools/LICENSE" keywords: [ "institutional repository", "data management", "Invenio", "Invenio-RDM" ] diff --git a/CaltechAUTHORS_publisher_groups.csv b/CaltechAUTHORS_publisher_groups.csv index 15afb56e..425e778a 100644 --- a/CaltechAUTHORS_publisher_groups.csv +++ b/CaltechAUTHORS_publisher_groups.csv @@ -189,23 +189,81 @@ American Astronomical Society,Astrophysical Journal,0004-637X,1538-4357,,omit in American Astronomical Society,Astrophysical Journal Supplement Series,1538-4365,0067-0049,,omit initial The from journal title American Astronomical Society,Planetary Science Journal,,2632-3338,,omit initial The from journal title American Astronomical Society,Research Notes of the AAS,,2515-5172,,omit initial The from journal title -American Chemical Society,Journal of Organic Chemistry,,,,omit initial The from journal title -American Chemical Society,Journal of Physical Chemistry,,,,omit initial The from journal title -American Chemical Society,Journal of Physical Chemistry A,,,,omit initial The from journal title -American Chemical Society,Journal of Physical Chemistry B,,,,omit initial The from journal title -American Chemical Society,Journal of Physical Chemistry C,,,,omit initial The from journal title -American Chemical Society,Journal of Physical Chemistry Letters,,,,omit initial The from journal title +American Chemical Society,Journal of Organic Chemistry,0022-3263,1520-6904,,omit initial The from journal title +American Chemical Society,Journal of Physical Chemistry,0022-3654,,,omit initial The from journal title +American Chemical Society,Journal of Physical Chemistry A,1089-5639,1520-5215,,omit initial The from journal title +American Chemical Society,Journal of Physical Chemistry B,1520-6106,1520-5207,,omit initial The from journal title +American Chemical Society,Journal of Physical Chemistry C,1932-7447,1932-7455,,omit initial The from journal title +American Chemical Society,Journal of Physical Chemistry Letters,,1948-7185,,omit initial The from journal title American Associaition for the Advancement of Science,Science,,,, American Associaition for the Advancement of Science,Science Advances,,,, American Associaition for the Advancement of Science,Science Immunology,,,, American Associaition for the Advancement of Science,Science Robitics,,,, American Associaition for the Advancement of Science,Science Signaling,,,, American Associaition for the Advancement of Science,Science Translational Medicine,,,, -National Academy of Sciences,Proceedings of the National Academy of Sciences,,,, -National Academy of Sciences,PNAS Nexus,,,, +National Academy of Sciences,Proceedings of the National Academy of Sciences,0027-8424,1091-6490,, +National Academy of Sciences,PNAS Nexus,,2752-6542,, Seismological Society of America,Bulletin of the Seismological Society of America,0037-1106,0037-1107,, -Seismological Society of America,Seismological Research Letters,,,, +Seismological Society of America,Seismological Research Letters,0895-0695,1938-2057,, Royal Astronomical Society,Monthly Notice of the Royal Astronomial Society,0035-2966,1365-2966,, Royal Astronomical Society,Monthly Notice of the Royal Astronomial Society Letters,1745-3925,1745-3933,, Royal Astronomical Society,Geophysical Journal International,0956-540X,1365-246X,, -Royal Astronomical Society,RAS Techniques and Instruments,,2752-8200,, \ No newline at end of file +Royal Astronomical Society,RAS Techniques and Instruments,,2752-8200,, +American Geophysical Union,AGU Advances,,2576-604X,, +American Geophysical Union,Community Science,2692-9430,2692-9430,, +American Geophysical Union,Earth's Future,,2328-4277,, +American Geophysical Union,Earth and Space Science,,2333-5084,, +American Geophysical Union,"Geochemistry, Geophysics, Geosystems",,1525-2027,, +American Geophysical Union,GeoHealth,,2471-1403,, +American Geophysical Union,Geophysical Research Letters,0094-8276,1944-8007,, +American Geophysical Union,Global Biogeochemical Cycles,0886-6236,1944-9224,, +American Geophysical Union,Journal of Advances in Modeling Earth System (JAMES),,1942-2466,, +American Geophysical Union,Paleoceanography and Paleoclimatology,,2572-4525,, +American Geophysical Union,Perspectives of Earth and Space Scientists,,2637-6989,, +American Geophysical Union,Radio Science,0048-6604,1944-799X,, +American Geophysical Union,Reviews of Geophysics,8755-1209,1944-9208,, +American Geophysical Union,Space Weather,,1542-7390,, +American Geophysical Union,Space Weather Quarterly,,1539-4964,, +American Geophysical Union,Tectonics,0278-7407,1944-9194,, +American Geophysical Union,Water Resources Research,0043-1397,1944-7973,, +American Geophysical Union,Journal of Geophysical Research: Atmospheres,2169-897X,2169-8996,, +American Geophysical Union,Journal of Geophysical Research: Biogeosciences,2169-8953,2169-8961,, +American Geophysical Union,Journal of Geophysical Research: Earth Surface,2169-9011,2169-9003,, +American Geophysical Union,Journal of Geophysical Research: Machine Learning and Computation,,2993-5210,, +American Geophysical Union,Journal of Geophysical Research: Oceans,2169-9275,2169-9291,, +American Geophysical Union,Journal of Geophysical Research: Planets,2169-9097,2169-9100,, +American Geophysical Union,Journal of Geophysical Research: Solid Earth,2169-9356,2169-9313,, +American Geophysical Union,Journal of Geophysical Research: Space Physics,2169-9380,2169-9402,, +American Geophysical Union,Journal of Geophysical Research,2156-2202,0148-0227,, +International Union of Crystallography,Acta Crystallographica. Section A,0108-7673,2053-2733,, +International Union of Crystallography,Acta Crystallographica. Section A,1600-5724,0108-7673,, +International Union of Crystallography,Acta Crystallographica. Section B,2052-5192,2052-5206,, +International Union of Crystallography,Acta Crystallographica. Section B,0108-7681,,, +International Union of Crystallography,Acta Crystallographica. Section C,1600-5759,2053-2296,, +International Union of Crystallography,Acta Crystallographica. Section D,,2059-7983,, +International Union of Crystallography,Acta Crystallographica. Section E,2056-9890,2056-9890,, +International Union of Crystallography,Acta Crystallographica. Section F,,2053-230X,, +International Union of Crystallography,Acta Crystallographica. Section E,1600-5368,,, +International Union of Crystallography,Journal of Applied Crystallography,,1600-5767,, +International Union of Crystallography,Journal of Synchrotron Radiation,,1600-5775,, +International Union of Crystallography,IUCrJ,,2052-2525,, +International Union of Crystallography,IUCrData,,2414-3146,, +,,,,, +,,,,, +,,,,, +,,,,, +,,,,, +,,,,, +,,,,, +,,,,, +,,,,, +,,,,, +,,,,, +,,,,, +,,,,, +,,,,, +,,,,, +,,,,, +,,,,, +,,,,, +IUCr,,,,, \ No newline at end of file diff --git a/INSTALL.html b/INSTALL.html index 66a4d884..ece942c4 100644 --- a/INSTALL.html +++ b/INSTALL.html @@ -31,14 +31,15 @@
To test the latest version you need the required development environment and follow the steps listed below in “Compiling from Source”.
-The following experimental installer should get the latest stable release for macOS and Linux (e.g. Debian, Ubuntu, Raspberry Pi OS).
Copy and run the following command in your shell (e.g. Terminal)
curl https://caltechlibrary.github.io/irdmtools/installer.sh | sh
-NOTE: Windows 11 support is via Window’s Sub-System for Linux (aka -WSL). If you have that available then you can use the installer example -above.
+For Windows you can use a Powershell script with the following +command.
+irm https://caltechlibrary.github.io/irdmtools/installer.ps1 | iex
This may change in the future.
© 1989 Elsevier. Received 11 October 1988, Revised 28 November 1988.
", + "type": { + "title": { + "de": "Sonstige", + "en": "Copyright and License" + }, + "id": "copyright" + } + }, + { + "description": "This work supported in part by the US Department of Energy under Contract Nos. DE-AC0381-ER40050 and DE-FG03-84ER40172.
", + "type": { + "title": { + "de": "Sonstige", + "en": "Acknowledgement" + }, + "id": "acknowledgement" + } + } + ], + "publication_date": "1989-02-09", + "description": "Wormhole solutions to the euclidean field equations have been found for a U(1) Goldstone boson, interacting gravitationally. Using these solutions we discuss the interactions or correlations between wormholes. Some remarks, concerning the effects of wormhole correlaions on the locality of the effective theory below the wormhole scale and on the importance of large wormholes, are presented.", + "publisher": "Elsevier", + "identifiers": [ + { + "identifier": "80283", + "scheme": "eprintid" + }, + { + "identifier": "CaltechAUTHORS:20170811-082351145", + "scheme": "resolverid" + } + ], + "version": "Published", + "rights": [ + { + "description": { + "en": "No commercial reproduction, distribution, display or performance rights in this work are provided." + }, + "id": "default", + "title": { + "en": "Default" + } + } + ] + }, + "versions": { + "is_latest": false, + "index": 1 + }, + "is_draft": false, + "files": { + "enabled": true + }, + "pids": { + "doi": { + "identifier": "10.1016/0370-2693(89)90468-1", + "provider": "external" + }, + "oai": { + "identifier": "oai:authors.library.caltech.edu:580bm-z1182", + "provider": "oai" + } + }, + "created": "2023-08-19T21:25:41.000387+00:00" +} \ No newline at end of file diff --git a/deleted_records/wx3zr-hbc08.json b/deleted_records/wx3zr-hbc08.json new file mode 100644 index 00000000..fe0c8648 --- /dev/null +++ b/deleted_records/wx3zr-hbc08.json @@ -0,0 +1,237 @@ +{ + "is_published": true, + "links": { + "self": "https://authors.library.caltech.edu/api/records/wx3zr-hbc08", + "self_html": "https://authors.library.caltech.edu/records/wx3zr-hbc08", + "self_iiif_manifest": "https://authors.library.caltech.edu/api/iiif/record:wx3zr-hbc08/manifest", + "self_iiif_sequence": "https://authors.library.caltech.edu/api/iiif/record:wx3zr-hbc08/sequence/default", + "files": "https://authors.library.caltech.edu/api/records/wx3zr-hbc08/files", + "archive": "https://authors.library.caltech.edu/api/records/wx3zr-hbc08/files-archive", + "latest": "https://authors.library.caltech.edu/api/records/wx3zr-hbc08/versions/latest", + "latest_html": "https://authors.library.caltech.edu/records/wx3zr-hbc08/latest", + "draft": "https://authors.library.caltech.edu/api/records/wx3zr-hbc08/draft", + "versions": "https://authors.library.caltech.edu/api/records/wx3zr-hbc08/versions", + "access_links": "https://authors.library.caltech.edu/api/records/wx3zr-hbc08/access/links", + "reserve_doi": "https://authors.library.caltech.edu/api/records/wx3zr-hbc08/draft/pids/doi", + "communities": "https://authors.library.caltech.edu/api/records/wx3zr-hbc08/communities", + "communities-suggestions": "https://authors.library.caltech.edu/api/records/wx3zr-hbc08/communities-suggestions", + "requests": "https://authors.library.caltech.edu/api/records/wx3zr-hbc08/requests" + }, + "revision_id": 11, + "parent": { + "communities": { + "ids": [ + "aedd135f-227e-4fdf-9476-5b3fd011bac6" + ], + "default": "aedd135f-227e-4fdf-9476-5b3fd011bac6" + }, + "id": "j2p00-1v782" + }, + "access": { + "status": "metadata-only", + "embargo": { + "active": false, + "reason": null + }, + "files": "restricted", + "record": "public" + }, + "custom_fields": { + "journal:journal": { + "pages": "21-25", + "volume": "218", + "issn": "0370-2693", + "issue": "1", + "title": "Physics Letters B" + } + }, + "stats": { + "this_version": { + "unique_downloads": 0, + "views": 13, + "downloads": 0, + "data_volume": 0.0, + "unique_views": 13 + }, + "all_versions": { + "unique_downloads": 0, + "views": 13, + "downloads": 0, + "data_volume": 0.0, + "unique_views": 13 + } + }, + "updated": "2024-05-13T23:53:23.866820+00:00", + "id": "wx3zr-hbc08", + "status": "published", + "metadata": { + "creators": [ + { + "person_or_org": { + "type": "personal", + "identifiers": [ + { + "identifier": "Gupta-A-K", + "scheme": "clpid" + } + ], + "name": "Gupta, Arun K.", + "given_name": "Arun K.", + "family_name": "Gupta" + } + }, + { + "person_or_org": { + "type": "personal", + "identifiers": [ + { + "identifier": "Wise-M-B", + "scheme": "clpid" + }, + { + "identifier": "0000 0001 1006 3759", + "scheme": "isni" + }, + { + "identifier": "0000-0002-9125-801X", + "scheme": "orcid" + } + ], + "name": "Wise, Mark B.", + "given_name": "Mark B.", + "family_name": "Wise" + }, + "affiliations": [ + { + "name": "California Institute of Technology", + "id": "05dxps055" + } + ] + } + ], + "funding": [ + { + "funder": { + "name": "Department of Energy (DOE)" + }, + "award": { + "title": { + "en": " " + }, + "number": "DE-AC0381-ER40050" + } + }, + { + "funder": { + "name": "Department of Energy (DOE)" + }, + "award": { + "title": { + "en": " " + }, + "number": "DE-FG03-84ER40172" + } + } + ], + "dates": [ + { + "description": "Created from EPrint's datestamp field", + "type": { + "title": { + "de": "Erstellt", + "en": "Created" + }, + "id": "created" + }, + "date": "2017-08-11" + }, + { + "description": "Created from EPrint's last_modified field", + "type": { + "title": { + "de": "Aktualisiert", + "en": "Updated" + }, + "id": "updated" + }, + "date": "2021-11-15" + } + ], + "related_identifiers": [ + { + "relation_type": { + "title": { + "de": "Beschreibt", + "en": "Describes" + }, + "id": "describes" + }, + "identifier": "10.1016/0370-2693(89)90468-1", + "scheme": "doi" + } + ], + "resource_type": { + "title": { + "de": "Zeitschriftenartikel", + "en": "Journal Article" + }, + "id": "publication-article" + }, + "title": "Comment on wormhole correlations", + "additional_descriptions": [ + { + "description": "\u00a9 1989 Elsevier. \n\nReceived 11 October 1988, Revised 28 November 1988. \n\nThis work supported in part by the US Department of Energy under Contract Nos. DE-AC0381-ER40050 and DE-FG03-84ER40172.", + "type": { + "title": { + "de": "Sonstige", + "en": "Additional Information" + }, + "id": "additional" + } + } + ], + "publication_date": "1989-02-09", + "description": "Wormhole solutions to the euclidean field equations have been found for a U(1) Goldstone boson, interacting gravitationally. Using these solutions we discuss the interactions or correlations between wormholes. Some remarks, concerning the effects of wormhole correlaions on the locality of the effective theory below the wormhole scale and on the importance of large wormholes, are presented.", + "publisher": "Elsevier", + "identifiers": [ + { + "identifier": "80283", + "scheme": "eprintid" + }, + { + "identifier": "10.1016/0370-2693(89)90468-1", + "scheme": "doi" + }, + { + "identifier": "CaltechAUTHORS:20170811-082351145", + "scheme": "resolverid" + } + ], + "version": "public", + "rights": [ + { + "description": { + "en": "No commercial reproduction, distribution, display or performance rights in this work are provided." + }, + "title": { + "en": "Other" + } + } + ] + }, + "versions": { + "is_latest": true, + "index": 2 + }, + "is_draft": false, + "files": { + "enabled": false + }, + "pids": { + "oai": { + "identifier": "oai:authors.library.caltech.edu:wx3zr-hbc08", + "provider": "oai" + } + }, + "created": "2023-08-19T21:25:43.768671+00:00" +} \ No newline at end of file diff --git a/doi2rdm.1.md b/doi2rdm.1.md index d694c1c6..3fd7e738 100644 --- a/doi2rdm.1.md +++ b/doi2rdm.1.md @@ -1,6 +1,6 @@ -%doi2rdm(1) irdmtools user manual | version 0.0.83 ebd3803d +%doi2rdm(1) irdmtools user manual | version 0.0.84-dev 3d8dd325 % R. S. Doiel and Tom Morrell -% 2024-05-01 +% 2024-07-09 # NAME diff --git a/ep3ds2citations.1.md b/ep3ds2citations.1.md index 7fddb614..8c247422 100644 --- a/ep3ds2citations.1.md +++ b/ep3ds2citations.1.md @@ -1,6 +1,6 @@ -%ep3ds2citations(1) irdmtools user manual | version 0.0.83 ebd3803d +%ep3ds2citations(1) irdmtools user manual | version 0.0.84-dev 3d8dd325 % R. S. Doiel and Tom Morrell -% 2024-05-01 +% 2024-07-09 # NAME diff --git a/ep3util.1.html b/ep3util.1.html index b38aaf74..cd8bc086 100644 --- a/ep3util.1.html +++ b/ep3util.1.html @@ -137,6 +137,11 @@Action parameters are the specific optional or required parameters diff --git a/ep3util.1.md b/ep3util.1.md index 6a25d95f..1972c8d1 100644 --- a/ep3util.1.md +++ b/ep3util.1.md @@ -1,6 +1,6 @@ -%ep3util(1) irdmtools user manual | version 0.0.83 ebd3803d +%ep3util(1) irdmtools user manual | version 0.0.84-dev 3d8dd325 % R. S. Doiel and Tom Morrell -% 2024-05-01 +% 2024-07-09 # NAME @@ -90,6 +90,9 @@ with one of the options, e.g. `-all`, you can skip providing the KEY_LIST_JSON f -modified START [END] : Harvest records modified between start and end dates. +-as-citations +: This harvests the record into a minimal citation form similar to citeproc + # ACTION_PARAMETERS Action parameters are the specific optional or required parameters need to complete an aciton. diff --git a/ep3util.go b/ep3util.go index f8e31027..c5071b1c 100644 --- a/ep3util.go +++ b/ep3util.go @@ -194,7 +194,7 @@ func (app *Ep3Util) GetRecord(id string) ([]byte, error) { // harvests them into a dataset v2 collection. The dataset collection // must exist and be configured in either the environment or // configuration file. -func (app *Ep3Util) RunHarvest(in io.Reader, out io.Writer, eout io.Writer, all bool, modified bool, params []string) error { +func (app *Ep3Util) RunHarvest(in io.Reader, out io.Writer, eout io.Writer, all bool, modified bool, asCitations bool, params []string) error { switch { case all: timeout := time.Duration(timeoutSeconds) @@ -202,9 +202,9 @@ func (app *Ep3Util) RunHarvest(in io.Reader, out io.Writer, eout io.Writer, all if err != nil { return err } - return HarvestEPrintRecords(app.Cfg, ids, app.Cfg.Debug) + return HarvestEPrintRecords(app.Cfg, ids, asCitations, app.Cfg.Debug) case modified: - // FIXME: need to harvest modified eprints ... + // NOTE: need to harvest modified eprints ... today := time.Now().Format("2006-01-02") start, end := today, today if len(params) < 1 { @@ -218,9 +218,9 @@ func (app *Ep3Util) RunHarvest(in io.Reader, out io.Writer, eout io.Writer, all if err != nil { return err } - return HarvestEPrintRecords(app.Cfg, ids, app.Cfg.Debug) + return HarvestEPrintRecords(app.Cfg, ids, asCitations, app.Cfg.Debug) default: - return HarvestEPrints(app.Cfg, params[0], app.Cfg.Debug) + return HarvestEPrints(app.Cfg, params[0], asCitations, app.Cfg.Debug) } } @@ -276,10 +276,11 @@ func (app *Ep3Util) Run(in io.Reader, out io.Writer, eout io.Writer, action stri } src, err = app.GetRecord(recordId) case "harvest": - all, modified := false, false + all, modified, asCitation := false, false, false flagSet := flag.NewFlagSet("harvest", flag.ContinueOnError) flagSet.BoolVar(&all, "all", all, "harvest all records") flagSet.BoolVar(&modified, "modified", modified, "harvest records between start and optional end date") + flagSet.BoolVar(&asCitation, "as-citation", asCitation, "harvest the records storing in citation format") flagSet.Parse(params) params = flagSet.Args() if (! all) && len(params) < 1 { @@ -288,7 +289,7 @@ func (app *Ep3Util) Run(in io.Reader, out io.Writer, eout io.Writer, action stri } return fmt.Errorf("JSON Identifier file required") } - return app.RunHarvest(in, out, eout, all, modified, params) + return app.RunHarvest(in, out, eout, all, modified, asCitation, params) default: err = fmt.Errorf("%q action is not supported", action) } diff --git a/eprint2rdm.1.md b/eprint2rdm.1.md index dac69c55..93f858cf 100644 --- a/eprint2rdm.1.md +++ b/eprint2rdm.1.md @@ -1,6 +1,6 @@ -%eprint2rdm(1) irdmtools user manual | version 0.0.83 ebd3803d +%eprint2rdm(1) irdmtools user manual | version 0.0.84-dev 3d8dd325 % R. S. Doiel and Tom Morrell -% 2024-05-01 +% 2024-07-09 # NAME diff --git a/eprintrest.1.md b/eprintrest.1.md index c9f779b9..2e93b7e9 100644 --- a/eprintrest.1.md +++ b/eprintrest.1.md @@ -1,6 +1,6 @@ -%eprintrest(1) irdmtools user manual | version 0.0.83 ebd3803d +%eprintrest(1) irdmtools user manual | version 0.0.84-dev 3d8dd325 % R. S. Doiel and Tom Morrell -% 2024-05-01 +% 2024-07-09 # NAME diff --git a/harvest.go b/harvest.go index c1ec354e..fc736e5a 100644 --- a/harvest.go +++ b/harvest.go @@ -129,7 +129,7 @@ func Harvest(cfg *Config, fName string, debug bool) error { return nil } -func harvestEPrintRecordsFromMySQL(cfg *Config, recordIds []int, debug bool) error { +func harvestEPrintRecordsFromMySQL(cfg *Config, recordIds []int, asCitation bool, debug bool) error { cName := cfg.CName c, err := dataset.Open(cName) if err != nil { @@ -166,6 +166,29 @@ func harvestEPrintRecordsFromMySQL(cfg *Config, recordIds []int, debug bool) err if err != nil { l.Printf("failed to get (%d) %d, %s", i, eprintid, err) eCnt++ + } else if asCitation { + // NOTE: I need to convert eprint to citation record + citation := new(Citation) + if err := citation.CrosswalkEPrint(cName, id, cfg.EPrintBaseURL, eprint); err != nil { + l.Printf("failed to convert eprint %s to citation, %s", id, err) + eCnt++ + } else { + if c.HasKey(id) { + if err := c.UpdateObject(id, citation); err != nil { + l.Printf("failed to write %d to %s, %s", eprintid, cName, err) + eCnt++ + } else { + hCnt++ + } + } else { + if err := c.CreateObject(id, citation); err != nil { + l.Printf("failed to write %d to %s, %s", eprintid, cName, err) + eCnt++ + } else { + hCnt++ + } + } + } } else { if c.HasKey(id) { if err := c.UpdateObject(id, eprint); err != nil { @@ -195,10 +218,10 @@ func harvestEPrintRecordsFromMySQL(cfg *Config, recordIds []int, debug bool) err return nil } -func HarvestEPrintRecords(cfg *Config, recordIds []int, debug bool) error { +func HarvestEPrintRecords(cfg *Config, recordIds []int, asCitation bool, debug bool) error { // Check if we can harvest directly from EPrnits MySQL database. if cfg.EPrintDbHost != "" && cfg.EPrintDbUser != "" && cfg.EPrintDbPassword != "" { - return harvestEPrintRecordsFromMySQL(cfg, recordIds, debug) + return harvestEPrintRecordsFromMySQL(cfg, recordIds, asCitation, debug) } cName := cfg.CName if cName == "" { @@ -232,6 +255,29 @@ func HarvestEPrintRecords(cfg *Config, recordIds []int, debug bool) error { } l.Printf("failed to get (%d) %q, %s", i, id, err) eCnt++ + } else if asCitation { + // NOTE: I need to convert rec to citation format + citation := new(Citation) + if err := citation.CrosswalkEPrint(cName, id, cfg.EPrintBaseURL, rec.EPrint[0]); err != nil { + l.Printf("failed to convert EPrint %s to citation, %s", id, err) + eCnt++ + } else { + if c.HasKey(id) { + if err := c.UpdateObject(id, citation); err != nil { + l.Printf("failed to write %q to %s, %s", id, cName, err) + eCnt++ + } else { + hCnt++ + } + } else { + if err := c.CreateObject(id, citation); err != nil { + l.Printf("failed to write %q to %s, %s", id, cName, err) + eCnt++ + } else { + hCnt++ + } + } + } } else { if c.HasKey(id) { if err := c.UpdateObject(id, rec); err != nil { @@ -261,7 +307,7 @@ func HarvestEPrintRecords(cfg *Config, recordIds []int, debug bool) error { return nil } -func HarvestEPrints(cfg *Config, fName string, debug bool) error { +func HarvestEPrints(cfg *Config, fName string, asCitation bool, debug bool) error { cName := cfg.CName if cName == "" { return fmt.Errorf("dataset collection not configured") @@ -302,7 +348,25 @@ func HarvestEPrints(cfg *Config, fName string, debug bool) error { } log.Printf("failed to get (%d) %q, %s", i, id, err) eCnt++ - } else { + } else if asCitation { + // FIXME: convert rec to citation record. + citation := rec + if c.HasKey(id) { + if err := c.UpdateObject(id, citation); err != nil { + log.Printf("failed to write %q to %s, %s", id, cName, err) + eCnt++ + } else { + hCnt++ + } + } else { + if err := c.CreateObject(id, citation); err != nil { + log.Printf("failed to write %q to %s, %s", id, cName, err) + eCnt++ + } else { + hCnt++ + } + } + } else { if c.HasKey(id) { if err := c.UpdateObject(id, rec); err != nil { log.Printf("failed to write %q to %s, %s", id, cName, err) diff --git a/installer.ps1 b/installer.ps1 new file mode 100755 index 00000000..00771fc4 --- /dev/null +++ b/installer.ps1 @@ -0,0 +1,48 @@ +#!/usr/bin/env pwsh +# Generated with codemeta-ps1-installer.tmpl, see https://github.com/caltechlibrary/codemeta-pandoc-examples + +# +# Set the package name and version to install +# +$PACKAGE = "irdmtools" +$VERSION = "0.0.84-dev" +$GIT_GROUP = "caltechlibrary" +$RELEASE = "https://github.com/${GIT_GROUP}/${PACKAGE}/releases/tag/v${VERSION}" +$SYSTEM_TYPE = Get-ComputerInfo -Property CsSystemType +if ($SYSTEM_TYPE.CsSystemType.Contains("ARM64")) { + $MACHINE = "arm64" +} else { + $MACHINE = "x86_64" +} + +# FIGURE OUT Install directory +$BIN_DIR = "${Home}\bin" +Write-Output "${PACKAGE} will be installed in ${BIN_DIR}" + +# +# Figure out what the zip file is named +# +$ZIPFILE = "${PACKAGE}-v${VERSION}-Windows-${MACHINE}.zip" + +# +# Check to see if this zip file has been downloaded. +# +$DOWNLOAD_URL = "https://github.com/${GIT_GROUP}/${PACKAGE}/releases/download/v${VERSION}/${ZIPFILE}" + +if (!(Test-Path $BIN_DIR)) { + New-Item $BIN_DIR -ItemType Directory | Out-Null +} +curl.exe -Lo "${ZIPFILE}" "${DOWNLOAD_URL}" + +tar.exe xf "${ZIPFILE}" -C "${Home}" + +Remove-Item $ZIPFILE + +$User = [System.EnvironmentVariableTarget]::User +$Path = [System.Environment]::GetEnvironmentVariable('Path', $User) +if (!(";${Path};".ToLower() -like "*;${BIN_DIR};*".ToLower())) { + [System.Environment]::SetEnvironmentVariable('Path', "${Path};${BIN_DIR}", $User) + $Env:Path += ";${BIN_DIR}" +} + +Write-Output "${PACKAGE} was installed successfully to ${BIN_DIR}" diff --git a/installer.sh b/installer.sh index ae8d8685..c63c8ce8 100755 --- a/installer.sh +++ b/installer.sh @@ -4,7 +4,7 @@ # Set the package name and version to install # PACKAGE="irdmtools" -VERSION="0.0.83" +VERSION="0.0.84-dev" GIT_GROUP="caltechlibrary" RELEASE="https://github.com/$GIT_GROUP/$PACKAGE/releases/tag/v$VERSION" diff --git a/options.yaml b/options.yaml deleted file mode 100644 index ef2726bf..00000000 --- a/options.yaml +++ /dev/null @@ -1,561 +0,0 @@ -# This YAML file controls the mappings of -# CrossRef records to RDM records values. It is based on the practice -# of Caltech Library in the development of CaltechAUTHORS and CaltechTHESIS -# over the last decades. -# -# Set the mail to used when connecting to CrossRef. This is usually the -# email address for our organization but could be for a person. -# It is the email address CrossRef will use if you're causing a problem -# and they need you to stop. -# -#mailto: jane.doe@example.edu -mailto: helpdesk@library.caltech.edu -# Add a period after initials is missing -dot_initials: true -# Map the CrossRef type to RDM type -contributor_types: - author: author - editor: editor - reviewer: reviewer - review-assistent: other - stats-reviewer: other - reader: other - translator: translator -# Map the CrossRef resource type to the RDM type -resource_types: - article: publication-article - Preprint: publication-preprint - preprint: publication-preprint - journal-article: publication-article - book: publication-book - book_section: publication-section - book-chapter: publication-section - conference_item: conference-paper - proceedings-article: conference-paper - dataset: dataset - experiment: publication-deliverable - journal_issue: publication-issue - lab_notes: labnotebook - monograph: publication-report - oral_history: publication-oralhistory - patent: publication-patent - software: software - teaching_resource: teachingresource - thesis: publication-thesis - video: video - website: other - other: other - image: other - report: publication-workingpaper - report-component: publication-workingpaper - posted-content: publication-preprint -# Mapping DOI prefixes to Publisher names (used to normalize publisher names) -doi_prefix_publishers: - 10.1103: American Physical Society - 10.1063: American Institute of Physics - 10.1039: Royal Society of Chemistry - 10.1242: Company of Biologists - 10.1073: PNAS - 10.1109: IEEE - 10.2514: AIAA - 10.1029: AGU (pre-Wiley hosting) - 10.1093: MNRAS - 10.1046: Geophysical Journal International - 10.1175: American Meteorological Society - 10.1083: Rockefeller University Press - 10.1084: Rockefeller University Press - 10.1085: Rockefeller University Press - 10.26508: Rockefeller University Press - 10.1371: PLOS - 10.5194: European Geosciences Union - 10.1051: EDP Sciences - 10.2140: Mathematical Sciences Publishers - 10.1074: ASBMB - 10.1091: ASCB - 10.1523: Society for Neuroscience - 10.1101: Cold Spring Harbor - 10.1128: American Society for Microbiology - 10.1115: ASME - 10.1061: ASCE - 10.1038: Nature - 10.1126: Science - 10.1021: American Chemical Society - 10.1002: Wiley - 10.1016: Elsevier -# Mapping ISSN prefixes to Journals (used to normalize journal titles names) -issn_journals: - 0002-9297: AJHG - 0004-6256: Astronomical Journal - 0004-637X: Astrophysical Journal - 0006-3495: Biophysical Journal - 0028-0836: Nature - 0035-2966: Monthly Notice of the Royal Astronomial Society - 0037-1106: Bulletin of the Seismological Society of America - 0037-1107: Bulletin of the Seismological Society of America - 0067-0049: Astrophysical Journal Supplement Series - 0092-8674: Cell - 0893-133X: Neuropsyhopharmacology - 0896-6273: Neuron - 0956-540X: Geophysical Journal International - 1061-4036: Nature Genetics - 1078-8956: Nature Medicine - 1087-0156: Nature Biotechnology - 1097-4164: Molecular Cell - 1097-4172: Cell - 1097-4180: Immunity - 1097-6256: Nature Neuroscience - 1362-4326: Trends in Biochemical Sciences - 1362-4555: Trends in Genetics - 1365-246X: Geophysical Journal International - 1365-2966: Monthly Notice of the Royal Astronomial Society - 1465-7392: Nature Cell Biology - 1471-003X: Nature Reviews Neuroscience - 1471-0048: Nature Reviews Neuroscience - 1471-0056: Nature Reviews Genetics - 1471-0064: Nature Reviews Genetics - 1471-0072: Nature Reviews Molecular Cell Biology - 1471-0080: Nature Reviews Molecular Cell Biology - 1471-4981: Trends in Immunology - 1471-499X: Trends in Molecular Medicine - 1471-5007: Trends in Parasitology - 1474-1733: Nature Reviews Immunology - 1474-1741: Nature Reviews Immunology - 1474-175X: Nature Reviews Cancer - 1474-1768: Nature Reviews Cancer - 1474-1776: Nature Reviews Drug Discovery - 1474-1784: Nature Reviews Drug Discovery - 1476-1122: Nature Materials - 1476-4660: Nature Materials - 1476-4679: Nature Cell Biology - 1476-4687: Nature - 1525-0016: Molecular Therapy - 1525-0024: Molecular Therapy - 1529-2908: Nature Immunoogy - 1529-2916: Nature Immunoogy - 1535-6108: Cancer Cell - 1537-6605: AJHG - 1538-3881: Astronomical Journal - 1538-4357: Astrophysical Journal - 1538-4365: Astrophysical Journal Supplement Series - 1542-0086: Biophysical Journal - 1545-9985: Nature Structural & Molecular Biology - 1545-9993: Nature Structural & Molecular Biology - 1546-170X: Nature Medicine - 1546-1718: Nature Genetics - 1546-1726: Nature Neuroscience - 1548-7091: Nature Methods - 1548-7105: Nature Methods - 1552-4450: Nature Chemical Biology - 1552-4469: Nature Chemical Biology - 1674-2052: Molecular Plant - 1740-1526: Nature Reviews Microbiology - 1740-1534: Nature Reviews Microbiology - 1745-2473: Nature Physics - 1745-2481: Nature Physics - 1745-3925: Monthly Notice of the Royal Astronomial Society Letters - 1745-3933: Monthly Notice of the Royal Astronomial Society Letters - 1748-3387: Nature Nanotechnology - 1748-3395: Nature Nanotechnology - 1749-4885: Nature Photonics - 1749-4893: Nature Photonics - 1750-2799: Nature Protocols - 1752-0894: Nature Geoscience - 1752-0908: Nature Geoscience - 1752-9867: Molecular Plant - 1754-2189: Nature Protocols - 1755-4330: Nature Chemistry - 1755-4349: Nature Chemistry - 1758-678X: Nature Climate Change - 1758-6798: Nature Climate Change - 1759-4758: Nature Reviews Neurology - 1759-4766: Nature Reviews Neurology - 1759-4774: Nature Reviews Clinical Oncology - 1759-4782: Nature Reviews Clinical Oncology - 1759-4790: Nature Reviews Rheumatology - 1759-4804: Nature Reviews Rheumatology - 1759-4812: Nature Reviews Urology - 1759-4820: Nature Reviews Urology - 1759-5002: Nature Reviews Cardiology - 1759-5010: Nature Reviews Cardiology - 1759-5029: Nature Reviews Endocrinology - 1759-5037: Nature Reviews Endocrinology - 1759-5045: Nature Reviews Gastroenterology & Hepatology - 1759-5053: Nature Reviews Gastroenterology & Hepatology - 1759-5061: Nature Reviews Nephrology - 1759-507X: Nature Reviews Nephrology - 1872-8383: Trends in Ecology & Evolution - 1873-3735: Trends in Pharmacological Sciences - 1875-9777: Cell Stem Cell - 1878-108X: Trends in Neurosciences - 1878-1551: Developmental Cell - 1878-3686: Cancer Cell - 1878-4186: Structure - 1878-4372: Trends in Plant Science - 1878-4380: Trends in Microbiology - 1879-0445: Current Biology - 1879-3061: Trends in Endocrinology & Metabolism - 1879-307X: Trends in Cognitive Sciences - 1879-3088: Trends in Cell Biology - 1879-3096: Trends in Biotechnology - 1884-4049: NPG Asia Materials - 1884-4057: NPG Asia Materials - 1932-7420: Cell Metabolism - 1934-6069: Cell Host & Microbe - 2041-1723: Nature Communications - 2041-8205: Astrophysical Journal Letters - 2041-8213: Astrophysical Journal Letters - 2044-4052: Nutrition & Diabetes - 2055-0278: Nature Plants - 2055-1010: npj Primary Care Respiratory Medicine - 2055-5008: npj Biofilms and Microbiomes - 2056-6387: npj Quantum Information - 2056-676X: Nature Reviews Disease Primers - 2056-7189: npj Systems Biology and Applications - 2056-7936: npj Science of Learning - 2056-7944: npj Genomic Medicine - 2057-3960: npj Computational Materials - 2057-3995: npj Regenerative Medicine - 2058-5276: Nature Microbiology - 2058-7546: Nature Energy - 2058-8437: Nature Reviews Materials - 2059-0105: npj Vaccines - 2059-7037: npj Clean Water - 2157-846X: Nature Biomedical Engineering - 2162-2531: Moleclar Therapy - Nucleic Acids - 2211-1247: Cell Reports - 2213-6711: Stem Cell Reports - 2329-0501: Molecular Therapy Methods & Clinical Development - 2373-8057: npj Parkinson's Disease - 2373-8065: npj Microgravity - 2374-4677: npj Breast Cancer - 2396-8370: npj Science of Food - 2397-2106: npj Materials Degradation - 2397-334X: Nature Ecology & Evolution - 2397-3358: Nature Reviews Chemistry - 2397-3366: Nature Astronomy - 2397-3374: Nature Human Behaviour - 2397-3722: npj Climate and Atmospheric Science - 2397-4621: npj Fleible Electronics - 2397-4648: npj Quantum Materials - 2397-7132: npj 2D Materials and Applications - 2397-768X: npj Precision Oncology - 2398-6352: npj Digital Medicine - 2398-9629: Nature Sustainability - 2405-4720: Cell Systems - 2405-8025: Trends in Cancer - 2405-8440: Heliyon - 2451-9294: Chem - 2451-9448: Cell Chemical Biology - 2515-5172: Research Notes of the AAS - 2520-1131: Nature Electronics - 2520-1158: Nature Catalysis - 2522-5812: Nature Metabolism - 2522-5820: Nature Reviews Physics - 2522-5839: Nature Machine Intelligence - 2542-4351: Joule - 2589-0042: iScience - 2589-5974: Trends in Chemistry - 2590-2385: Metter - 2590-3322: One Earth - 2590-3462: Plant Communications - 2632-3338: Planetary Science Journal - 2661-8001: npj Urban Sustainability - 2662-1347: Nature Cancer - 2662-1355: Nature Food - 2662-138X: Nature Reviews Earth & Environment - 2662-8449: Nature Reviews Methods Primers - 2662-8457: Nature Computational Science - 2662-8465: Nature Aging - 2666-1667: STAR Protocols - 2666-2477: HGG Advances - 2666-3791: Cell Reports Medicine - 2666-3864: Cell Reports Physical Science - 2666-3899: Patterns - 2666-6340: Med - 2666-6758: The Innovation - 2666-979X: Cell Genomics - 2666-9986: Device - 2667-0747: Biophysical Reports - 2667-1093: Chem Catalysis - 2667-2375: Cell Reports Methods - 2730-9878: Nature Africa - 2731-0574: Nature Reviews Psychology - 2731-0582: Nature Synthesis - 2731-0590: Nature Cardiovascular Research - 2731-4243: npj Biodiversity - 2731-4251: npj Mental Health Research - 2731-426X: npj Ocean Sustainability - 2731-4278: npj Robotics - 2731-6068: npj Aging - 2731-6076: Nature Mental Health - 2731-6084: Nature Water - 2731-6092: Nature Reviews Bioengineering - 2731-8745: npj Antimicrobials and Resistance - 2731-8753: npj Complexity - 2731-9202: npj Sustainable Agriculture - 2731-9814: npj Climate Action - 2731-9997: Nature Cities - 2752-8200: RAS Techniques and Instruments - 2948-1198: Nature Chemical Engineering - 2948-1201: Nature Reviews Electrical Engineering - 2948-1570: NPP -- Digital Psychiatry and Neuroscience - 2948-1716: nph Women's Health - 2948-1767: npj Viruses - 2948-1775: npj Materials Sustainability - 2948-197X: npj Imaging - 2948-2100: npj Natural Hazards - 2948-2119: npj Spintronics - 2948-216X: npj Nanophotonics - 2948-281X: npj Biological TIming and Sleep - 2948-2828: npj Metabolic Health and Disease - 2948-2836: npj Cardiovascular Health - 2949-7906: Cell Reports Sustainability - 2950-1601: Nexus - 2950-3299: Molecular Therapy Oncology - 3004-8621: npj Advanced Manuscfacturing - 3004-863X: npj Biological Physics and Mechanics - 3004-8656: npj Biosensing - 3004-8664: npj Sustainable Mobility and Transport - 3004-8672: npj Unconventional Computing - 3004-9806: npj Gut and Liver - 3005-0677: Nature Reviews Biodiversity - 3005-0685: Nature Reviews Clean Technology -# Mapping ISSN prefixes to Publishers (used to normalize publisher names) -issn_publishers: - 0002-9297: Cell Press - 0004-6256: American Astronomical Society - 0004-637X: American Astronomical Society - 0006-3495: Cell Press - 0028-0836: Nature Publishing Group - 0035-2966: Royal Astronomical Society - 0037-1106: Seismological Society of America - 0037-1107: Seismological Society of America - 0067-0049: American Astronomical Society - 0092-8674: Cell Press - 0893-133X: Nature Publishing Group - 0896-6273: Cell Press - 0956-540X: Royal Astronomical Society - 1061-4036: Nature Publishing Group - 1078-8956: Nature Publishing Group - 1087-0156: Nature Publishing Group - 1097-4164: Cell Press - 1097-4172: Cell Press - 1097-4180: Cell Press - 1097-6256: Nature Publishing Group - 1362-4326: Cell Press - 1362-4555: Cell Press - 1365-246X: Royal Astronomical Society - 1365-2966: Royal Astronomical Society - 1465-7392: Nature Publishing Group - 1471-003X: Nature Publishing Group - 1471-0048: Nature Publishing Group - 1471-0056: Nature Publishing Group - 1471-0064: Nature Publishing Group - 1471-0072: Nature Publishing Group - 1471-0080: Nature Publishing Group - 1471-4981: Cell Press - 1471-499X: Cell Press - 1471-5007: Cell Press - 1474-1733: Nature Publishing Group - 1474-1741: Nature Publishing Group - 1474-175X: Nature Publishing Group - 1474-1768: Nature Publishing Group - 1474-1776: Nature Publishing Group - 1474-1784: Nature Publishing Group - 1476-1122: Nature Publishing Group - 1476-4660: Nature Publishing Group - 1476-4679: Nature Publishing Group - 1476-4687: Nature Publishing Group - 1525-0016: Cell Press - 1525-0024: Cell Press - 1529-2908: Nature Publishing Group - 1529-2916: Nature Publishing Group - 1535-6108: Cell Press - 1537-6605: Cell Press - 1538-3881: American Astronomical Society - 1538-4357: American Astronomical Society - 1538-4365: American Astronomical Society - 1542-0086: Cell Press - 1545-9985: Nature Publishing Group - 1545-9993: Nature Publishing Group - 1546-170X: Nature Publishing Group - 1546-1718: Nature Publishing Group - 1546-1726: Nature Publishing Group - 1548-7091: Nature Publishing Group - 1548-7105: Nature Publishing Group - 1552-4450: Nature Publishing Group - 1552-4469: Nature Publishing Group - 1674-2052: Cell Press - 1740-1526: Nature Publishing Group - 1740-1534: Nature Publishing Group - 1745-2473: Nature Publishing Group - 1745-2481: Nature Publishing Group - 1745-3925: Royal Astronomical Society - 1745-3933: Royal Astronomical Society - 1748-3387: Nature Publishing Group - 1748-3395: Nature Publishing Group - 1749-4885: Nature Publishing Group - 1749-4893: Nature Publishing Group - 1750-2799: Nature Publishing Group - 1752-0894: Nature Publishing Group - 1752-0908: Nature Publishing Group - 1752-9867: Cell Press - 1754-2189: Nature Publishing Group - 1755-4330: Nature Publishing Group - 1755-4349: Nature Publishing Group - 1758-678X: Nature Publishing Group - 1758-6798: Nature Publishing Group - 1759-4758: Nature Publishing Group - 1759-4766: Nature Publishing Group - 1759-4774: Nature Publishing Group - 1759-4782: Nature Publishing Group - 1759-4790: Nature Publishing Group - 1759-4804: Nature Publishing Group - 1759-4812: Nature Publishing Group - 1759-4820: Nature Publishing Group - 1759-5002: Nature Publishing Group - 1759-5010: Nature Publishing Group - 1759-5029: Nature Publishing Group - 1759-5037: Nature Publishing Group - 1759-5045: Nature Publishing Group - 1759-5053: Nature Publishing Group - 1759-5061: Nature Publishing Group - 1759-507X: Nature Publishing Group - 1872-8383: Cell Press - 1873-3735: Cell Press - 1875-9777: Cell Press - 1878-108X: Cell Press - 1878-1551: Cell Press - 1878-3686: Cell Press - 1878-4186: Cell Press - 1878-4372: Cell Press - 1878-4380: Cell Press - 1879-0445: Cell Press - 1879-3061: Cell Press - 1879-307X: Cell Press - 1879-3088: Cell Press - 1879-3096: Cell Press - 1884-4049: Nature Publishing Group - 1884-4057: Nature Publishing Group - 1932-7420: Cell Press - 1934-6069: Cell Press - 2041-1723: Nature Publishing Group - 2041-8205: American Astronomical Society - 2041-8213: American Astronomical Society - 2044-4052: Nature Publishing Group - 2055-0278: Nature Publishing Group - 2055-1010: Nature Publishing Group - 2055-5008: Nature Publishing Group - 2056-6387: Nature Publishing Group - 2056-676X: Nature Publishing Group - 2056-7189: Nature Publishing Group - 2056-7936: Nature Publishing Group - 2056-7944: Nature Publishing Group - 2057-3960: Nature Publishing Group - 2057-3995: Nature Publishing Group - 2058-5276: Nature Publishing Group - 2058-7546: Nature Publishing Group - 2058-8437: Nature Publishing Group - 2059-0105: Nature Publishing Group - 2059-7037: Nature Publishing Group - 2157-846X: Nature Publishing Group - 2162-2531: Cell Press - 2211-1247: Cell Press - 2213-6711: Cell Press - 2329-0501: Cell Press - 2373-8057: Nature Publishing Group - 2373-8065: Nature Publishing Group - 2374-4677: Nature Publishing Group - 2396-8370: Nature Publishing Group - 2397-2106: Nature Publishing Group - 2397-334X: Nature Publishing Group - 2397-3358: Nature Publishing Group - 2397-3366: Nature Publishing Group - 2397-3374: Nature Publishing Group - 2397-3722: Nature Publishing Group - 2397-4621: Nature Publishing Group - 2397-4648: Nature Publishing Group - 2397-7132: Nature Publishing Group - 2397-768X: Nature Publishing Group - 2398-6352: Nature Publishing Group - 2398-9629: Nature Publishing Group - 2405-4720: Cell Press - 2405-8025: Cell Press - 2405-8440: Cell Press - 2451-9294: Cell Press - 2451-9448: Cell Press - 2515-5172: American Astronomical Society - 2520-1131: Nature Publishing Group - 2520-1158: Nature Publishing Group - 2522-5812: Nature Publishing Group - 2522-5820: Nature Publishing Group - 2522-5839: Nature Publishing Group - 2542-4351: Cell Press - 2589-0042: Cell Press - 2589-5974: Cell Press - 2590-2385: Cell Press - 2590-3322: Cell Press - 2590-3462: Cell Press - 2632-3338: American Astronomical Society - 2661-8001: Nature Publishing Group - 2662-1347: Nature Publishing Group - 2662-1355: Nature Publishing Group - 2662-138X: Nature Publishing Group - 2662-8449: Nature Publishing Group - 2662-8457: Nature Publishing Group - 2662-8465: Nature Publishing Group - 2666-1667: Cell Press - 2666-2477: Cell Press - 2666-3791: Cell Press - 2666-3864: Cell Press - 2666-3899: Cell Press - 2666-6340: Cell Press - 2666-6758: Cell Press - 2666-979X: Cell Press - 2666-9986: Cell Press - 2667-0747: Cell Press - 2667-1093: Cell Press - 2667-2375: Cell Press - 2730-9878: Nature Publishing Group - 2731-0574: Nature Publishing Group - 2731-0582: Nature Publishing Group - 2731-0590: Nature Publishing Group - 2731-4243: Nature Publishing Group - 2731-4251: Nature Publishing Group - 2731-426X: Nature Publishing Group - 2731-4278: Nature Publishing Group - 2731-6068: Nature Publishing Group - 2731-6076: Nature Publishing Group - 2731-6084: Nature Publishing Group - 2731-6092: Nature Publishing Group - 2731-8745: Nature Publishing Group - 2731-8753: Nature Publishing Group - 2731-9202: Nature Publishing Group - 2731-9814: Nature Publishing Group - 2731-9997: Nature Publishing Group - 2752-8200: Royal Astronomical Society - 2948-1198: Nature Publishing Group - 2948-1201: Nature Publishing Group - 2948-1570: Nature Publishing Group - 2948-1716: Nature Publishing Group - 2948-1767: Nature Publishing Group - 2948-1775: Nature Publishing Group - 2948-197X: Nature Publishing Group - 2948-2100: Nature Publishing Group - 2948-2119: Nature Publishing Group - 2948-216X: Nature Publishing Group - 2948-281X: Nature Publishing Group - 2948-2828: Nature Publishing Group - 2948-2836: Nature Publishing Group - 2949-7906: Cell Press - 2950-1601: Cell Press - 2950-3299: Cell Press - 3004-8621: Nature Publishing Group - 3004-863X: Nature Publishing Group - 3004-8656: Nature Publishing Group - 3004-8664: Nature Publishing Group - 3004-8672: Nature Publishing Group - 3004-9806: Nature Publishing Group - 3005-0677: Nature Publishing Group - 3005-0685: Nature Publishing Group - diff --git a/pagefind/fragment/unknown_25a443c.pf_fragment b/pagefind/fragment/unknown_25a443c.pf_fragment new file mode 100644 index 00000000..3423da8a Binary files /dev/null and b/pagefind/fragment/unknown_25a443c.pf_fragment differ diff --git a/pagefind/fragment/unknown_7e9fe31.pf_fragment b/pagefind/fragment/unknown_7e9fe31.pf_fragment new file mode 100644 index 00000000..0789e461 Binary files /dev/null and b/pagefind/fragment/unknown_7e9fe31.pf_fragment differ diff --git a/pagefind/fragment/unknown_7fa327d.pf_fragment b/pagefind/fragment/unknown_7fa327d.pf_fragment new file mode 100644 index 00000000..dce5194f Binary files /dev/null and b/pagefind/fragment/unknown_7fa327d.pf_fragment differ diff --git a/pagefind/fragment/unknown_c988bd6.pf_fragment b/pagefind/fragment/unknown_c988bd6.pf_fragment new file mode 100644 index 00000000..471f66f9 Binary files /dev/null and b/pagefind/fragment/unknown_c988bd6.pf_fragment differ diff --git a/pagefind/index/unknown_c96490b.pf_index b/pagefind/index/unknown_c96490b.pf_index new file mode 100644 index 00000000..418bc0ba Binary files /dev/null and b/pagefind/index/unknown_c96490b.pf_index differ diff --git a/pagefind/pagefind-entry.json b/pagefind/pagefind-entry.json index f3f00d1d..04fa5ebe 100644 --- a/pagefind/pagefind-entry.json +++ b/pagefind/pagefind-entry.json @@ -1 +1 @@ -{"version":"1.1.0","languages":{"unknown":{"hash":"unknown_cfe43c953ae8668","wasm":null,"page_count":22}}} \ No newline at end of file +{"version":"1.1.0","languages":{"unknown":{"hash":"unknown_cd8e22b74a2a0ce","wasm":null,"page_count":23}}} \ No newline at end of file diff --git a/pagefind/pagefind.unknown_cd8e22b74a2a0ce.pf_meta b/pagefind/pagefind.unknown_cd8e22b74a2a0ce.pf_meta new file mode 100644 index 00000000..d210c68e Binary files /dev/null and b/pagefind/pagefind.unknown_cd8e22b74a2a0ce.pf_meta differ diff --git a/people2vocabulary.1.md b/people2vocabulary.1.md index eccfcd20..5114f8f6 100644 --- a/people2vocabulary.1.md +++ b/people2vocabulary.1.md @@ -1,6 +1,6 @@ -%people2vocabulary(1) irdmtools user manual | version 0.0.83 ebd3803d +%people2vocabulary(1) irdmtools user manual | version 0.0.84-dev 3d8dd325 % R. S. Doiel -% 2024-05-01 +% 2024-07-09 # NAME diff --git a/publisher_groups_to_yaml.py b/publisher_groups_to_yaml.py deleted file mode 100755 index 6740ce1e..00000000 --- a/publisher_groups_to_yaml.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 - -import csv -import yaml - -def load(f_name): - '''read in a vocabulary expressed in YAML and return a python object''' - data = None - with open(f_name, encoding = 'utf-8') as f: - src = f.read() - data = yaml.load(src, Loader= yaml.Loader) - if data is None: - print(f'failed to load {f_name}', file = sys.stderr) - return False - return data - -with open("CaltechAUTHORS_publisher_groups.csv", newline = "") as csvfile: - m = load("options.yaml") - issn_publishers = {} - issn_journals = {} - #doi_prefix_to_publisher = {} - header = [ "Preferred Publisher Name","journal","issn","e-issn","DOI pattern","Note" - ] - reader = csv.DictReader(csvfile, header) - for i, row in enumerate(reader): - if i > 0: - issn = row.get('issn', '').strip() - e_issn = row.get('e-issn', '').strip() - publisher = row.get('Preferred Publisher Name', '').strip() - journal = row.get('journal', '').strip() - if issn != '': - if publisher != '': - issn_publishers[issn] = publisher - if journal != '': - issn_journals[issn] = journal - if e_issn != '': - if publisher != '': - issn_publishers[e_issn] = publisher - if journal != '': - issn_journals[e_issn] = journal - m['issn_journals'] = issn_publishers - m['issn_publishers'] = issn_journals - print(yaml.dump(m)) - diff --git a/rdm2eprint.1.md b/rdm2eprint.1.md index e51e05c6..ed29698d 100644 --- a/rdm2eprint.1.md +++ b/rdm2eprint.1.md @@ -1,6 +1,6 @@ -%rdm2eprint(1) irdmtools user manual | version 0.0.83 ebd3803d +%rdm2eprint(1) irdmtools user manual | version 0.0.84-dev 3d8dd325 % R. S. Doiel and Tom Morrell -% 2024-05-01 +% 2024-07-09 # NAME diff --git a/rdmds2citations.1.md b/rdmds2citations.1.md index 703b2b48..b14b399c 100644 --- a/rdmds2citations.1.md +++ b/rdmds2citations.1.md @@ -1,6 +1,6 @@ -%rdmds2citations(1) irdmtools user manual | version 0.0.83 ebd3803d +%rdmds2citations(1) irdmtools user manual | version 0.0.84-dev 3d8dd325 % R. S. Doiel and Tom Morrell -% 2024-05-01 +% 2024-07-09 # NAME diff --git a/rdmutil.1.md b/rdmutil.1.md index 893304b9..b20825c0 100644 --- a/rdmutil.1.md +++ b/rdmutil.1.md @@ -1,6 +1,6 @@ -%rdmutil(1) irdmtools user manual | version 0.0.83 ebd3803d +%rdmutil(1) irdmtools user manual | version 0.0.84-dev 3d8dd325 % R. S. Doiel and Tom Morrell -% 2024-05-01 +% 2024-07-09 # NAME diff --git a/update_publisher_options.py b/update_publisher_options.py new file mode 100755 index 00000000..03a0afb5 --- /dev/null +++ b/update_publisher_options.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 + +import sys +import os +import csv +import yaml + +def load(f_name): + '''read in a vocabulary expressed in YAML and return a python object''' + data = None + with open(f_name, encoding = 'utf-8') as f: + src = f.read() + data = yaml.load(src, Loader= yaml.Loader) + if data is None: + print(f'failed to load {f_name}', file = sys.stderr) + return False + return data + +def merge_publisher_data(yaml_name, csv_name): + '''read in the yaml and CSV File and merge the CSV content into the YAML + data structure. Dump to standard out''' + with open(csv_name, newline = "") as csvfile: + m = load(yaml_name) + issn_publishers = {} + issn_journals = {} + #doi_prefix_to_publisher = {} + header = [ "Preferred Publisher Name","journal","issn","e-issn","DOI pattern","Note" ] + reader = csv.DictReader(csvfile, header) + for i, row in enumerate(reader): + if i > 0: + issn = row.get('issn', '').strip() + e_issn = row.get('e-issn', '').strip() + publisher = row.get('Preferred Publisher Name', '').strip() + journal = row.get('journal', '').strip() + if issn != '': + if publisher != '': + issn_publishers[issn] = publisher + if journal != '': + issn_journals[issn] = journal + if e_issn != '': + if publisher != '': + issn_publishers[e_issn] = publisher + if journal != '': + issn_journals[e_issn] = journal + m['issn_journals'] = issn_publishers + m['issn_publishers'] = issn_journals + print(yaml.dump(m)) + +# +# Main +# +if __name__ == "__main__": + app_name = os.path.basename(sys.argv[0]) + if len(sys.argv) != 3: + print(f'''USAGE: {app_name} YAML_NAME CSV_FILE >OUTPUT_YAML + + Updates the YAML_FILE based on the contents of the CSV_FILE. The + CSV file iexpected to have th following columns. + + Preferred Publisher Name, journal, issn, e-issn, DOI pattern, Note + + If the columns are labeled differently you will not get the results you + expect. The columns can be in a different order. + +''') + sys.exit(1) + merge_publisher_data(sys.argv[1], sys.argv[2]) diff --git a/version.go b/version.go index 6e59be26..08a24690 100644 --- a/version.go +++ b/version.go @@ -6,13 +6,13 @@ import ( const ( // Version number of release - Version = "0.0.83" + Version = "0.0.84-dev" // ReleaseDate, the date version.go was generated - ReleaseDate = "2024-05-01" + ReleaseDate = "2024-07-09" // ReleaseHash, the Git hash when version.go was generated - ReleaseHash = "ebd3803d" + ReleaseHash = "3d8dd325" LicenseText = ` Redistribution and use in source and binary forms, with or without