diff --git a/cmd/version.go b/cmd/version.go index b25ce31..79d9681 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -13,7 +13,7 @@ var versionCmd = &cobra.Command{ Short: "Print the version number of commonmeta", Long: `All software has versions. This is commonmeta's`, Run: func(cmd *cobra.Command, args []string) { - cmd.Println("Commonmeta v0.3.24 -- HEAD") + cmd.Println("Commonmeta v0.3.25 -- HEAD") }, } diff --git a/jsonfeed/reader.go b/jsonfeed/reader.go index af573dc..8263b39 100644 --- a/jsonfeed/reader.go +++ b/jsonfeed/reader.go @@ -349,7 +349,7 @@ func Read(content Content) (commonmeta.Data, error) { {Title: utils.Sanitize(content.Title)}, } - url, err := utils.NormalizeURL(content.URL, true, true) + url, err := utils.NormalizeURL(content.URL, true, false) if err != nil { return data, err } diff --git a/jsonfeed/reader_test.go b/jsonfeed/reader_test.go index 03f7102..6309ed6 100644 --- a/jsonfeed/reader_test.go +++ b/jsonfeed/reader_test.go @@ -53,6 +53,7 @@ func TestFetch(t *testing.T) { testCases := []testCase{ {name: "blog post with funding", id: "8a4de443-3347-4b82-b57d-e3c82b6485fc"}, {name: "project blog", id: "4d51f3c9-151d-4030-9893-ddbca37f54bb"}, + {name: "url with uppercase characters", id: "3d02cf64-c600-4eb1-91b4-02f5bade5691"}, } for _, tc := range testCases { got, err := jsonfeed.Fetch(tc.id) diff --git a/jsonfeed/testdata/3d02cf64-c600-4eb1-91b4-02f5bade5691.json b/jsonfeed/testdata/3d02cf64-c600-4eb1-91b4-02f5bade5691.json new file mode 100644 index 0000000..1fc7650 --- /dev/null +++ b/jsonfeed/testdata/3d02cf64-c600-4eb1-91b4-02f5bade5691.json @@ -0,0 +1,83 @@ +{ + "abstract": null, + "archive_url": null, + "authors": [ + { + "name": "Dorothea Strecker", + "url": "https://orcid.org/0000-0002-9754-3807" + }, + { + "affiliation": [], + "name": "Heinz Pampel", + "url": "https://orcid.org/0000-0003-3334-2771" + } + ], + "blog": { + "archive_prefix": null, + "authors": null, + "canonical_url": null, + "category": "computerAndInformationSciences", + "created_at": 1717668020, + "current_feed_url": null, + "description": "Research Group Information Management @ Humboldt-Universität zu Berlin", + "favicon": null, + "feed_format": "application/rss+xml", + "feed_url": "https://infomgnt.org/index.xml", + "filter": null, + "funding": null, + "generator": "Quarto", + "generator_raw": "Quarto 1.4.555", + "home_page_url": "https://infomgnt.org", + "id": "17927ce5-1239-43fb-a3c9-2acb8a679d11", + "indexed": true, + "issn": null, + "language": "en", + "license": "https://creativecommons.org/licenses/by/4.0/legalcode", + "mastodon": "", + "plan": "Starter", + "prefix": "10.59350", + "relative_url": null, + "ror": null, + "secure": true, + "slug": "infomgnt", + "status": "active", + "title": "Research Group Information Management @ Humboldt-Universität zu Berlin", + "updated_at": 1718748000, + "use_api": null, + "use_mastodon": false, + "user_id": "dbffda7d-f391-48fb-a6d2-d4a284c59c8d" + }, + "blog_name": "Research Group Information Management @ Humboldt-Universität zu Berlin", + "blog_slug": "infomgnt", + "content_text": "We are excited to announce the launch of our new project, \"Data\nPractices for Shaping Open Access Transformation - Analysis,\nRecommendation, Training & Networking - OA Datenpraxis\" funded by the\nDeutsche Forschungsgemeinschaft (DFG, German Research Foundation).\n\nTogether with our colleagues at the [Helmholtz Open Science\nOffice](https://os.helmholtz.de/) and the [Scholarly Communication\nAnalytics Team](https://subugoe.github.io/scholcomm_analytics/) at the\n[Lower Saxony State and University Library\nGöttingen](https://www.sub.uni-goettingen.de/sub-aktuell/) (SUB), we,\nthe research group Information Management at the [Berlin School of\nLibrary and Information\nScience](https://www.ibi.hu-berlin.de/en/about-us) (IBI), will work\ntowards strengthening structures for the use of data on the open access\ntransformation at research institutions in Germany.\n\nThe project supports practitioners in research administration, libraries\nand other service institutions in professionalizing their data practices\nthrough various activities. As a first step, the team at IBI will\nconduct a comprehensive study on how research institutions handle\npublication costs. Our research will build on existing research and\nprevious work of the project partners. Our goal is to get a better\nunderstanding of current practices and challenges associated with\nmanaging data on Open Access publications and associated costs.\n\nIn strengthening the abilities of research institutions to leverage data\nto monitor publication output and associated costs, we are addressing\nsome of the recommendations of the German Council of Science and\nHumanities for fostering the Open Access transformation in Germany\n[(Wissenschaftsrat 2022)]{.citation\ncites=\"wissenschaftsrat_empfehlungen_2022\"}. Additional information\nabout the project and its goals can be found in the project proposal (in\nGerman) [(Pampel et al. 2024)]{.citation\ncites=\"pampel_datenpraxis_2024\"}.\n\nAt this year's Open-Access-Tage in Cologne, we are organizing a workshop\nwith [Open-Access-Büro Berlin](https://www.open-access-berlin.de/),\n[Vernetzungs- und Kompetenzstelle Open Access\nBrandenburg](https://open-access-brandenburg.de/) and [Open Access\nMonitor](https://open-access-monitor.de/) at Forschungszentrum Jülich\n(FZJ). If you are interested in Open Access reporting and are attending,\nplease feel free to approach us at the conference or contact us via\n[email](info.oa-datenpraxis@listserv.dfn.de).\n\nWe will report on current activities and project outputs on the [project\nwebsite](https://oa-datenpraxis.de/) and\n[Mastodon](https://openbiblio.social/@oa_datenpraxis).\n\n![](https://infomgnt.org/posts/2024-07-01-Vorstellung-OA-Datenpraxis/logo_oa_datenpraxis.png){.img-fluid}\n\nFurther information about the research group can be found on our\n[official website](http://hu.berlin/infomgnt).\n\nThis text -- excluding quotes and otherwise labeled parts -- is licensed\nunder the [CC BY 4.0\nDEED](https://creativecommons.org/licenses/by/4.0/deed.de).\n\n:::::::::::: {#quarto-appendix .default}\n:::::: {#quarto-bibliography .section .quarto-appendix-contents}\n## References {#references .anchored .quarto-appendix-heading}\n\n::::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\"}\n::: {#ref-pampel_datenpraxis_2024 .csl-entry}\nPampel, Heinz, Najko Jahn, Roland Bertelmann, Wolfram Horstmann, Laura\nRothfritz, Lea Maria Ferguson, Birgit Schmidt, and Anna Stisser. 2024.\n\"Datenpraxis Zur Gestaltung Der Open-Access-Transformation - Analyse,\nEmpfehlung, Training & Vernetzung (OA Datenpraxis).\"\n.\n:::\n\n::: {#ref-wissenschaftsrat_empfehlungen_2022 .csl-entry}\nWissenschaftsrat. 2022. \"Empfehlungen Zur Transformation Des\nWissenschaftlichen Publizierens Zu Open Access.\"\n.\n:::\n:::::\n::::::\n\n::::::: {#quarto-citation .section .quarto-appendix-contents}\n## Citation {#citation .anchored .quarto-appendix-heading}\n\n
\n\n::: {.quarto-appendix-secondary-label}\nBibTeX citation:\n:::\n\n``` {.sourceCode .code-with-copy .quarto-appendix-bibtex}\n@online{strecker2024,\n author = {Strecker, Dorothea and Pampel, Heinz},\n title = {Project Launch: {OA} {Datenpraxis-} {Data} {Practices} for\n {Shaping} the {Open} {Access} {Transformation}},\n date = {2024-06-19},\n url = {https://infomgnt.org/posts/2024-07-01-Vorstellung-OA-Datenpraxis/},\n langid = {en}\n}\n```\n\n::: {.quarto-appendix-secondary-label}\nFor attribution, please cite this work as:\n:::\n\n::: {#ref-strecker2024 .csl-entry .quarto-appendix-citeas}\nStrecker, Dorothea, and Heinz Pampel. 2024. \"Project Launch: OA\nDatenpraxis- Data Practices for Shaping the Open Access Transformation.\"\nJune 19, 2024.\n.\n:::\n\n
\n:::::::\n::::::::::::\n", + "doi": "https://doi.org/10.59350/es0dc-vhb02", + "guid": "https://infomgnt.org/posts/2024-07-01-Vorstellung-OA-Datenpraxis/", + "id": "3d02cf64-c600-4eb1-91b4-02f5bade5691", + "image": "https://infomgnt.org/posts/2024-07-01-Vorstellung-OA-Datenpraxis/logo_oa_datenpraxis.png", + "indexed_at": 1719930844, + "language": "en", + "published_at": 1718748000, + "reference": [ + { + "id": "https://doi.org/10.5281/zenodo.10794298", + "key": "ref1", + "publicationYear": "2024", + "title": "Datenpraxis zur Gestaltung der Open-Access-Transformation - Analyse, Empfehlung, Training & Vernetzung (OA Datenpraxis)" + }, + { + "id": "https://doi.org/10.57674/fyrc-vb61", + "key": "ref2", + "publicationYear": "2022", + "title": "Empfehlungen zur Transformation des wissenschaftlichen Publizierens zu Open Access" + } + ], + "relationships": [], + "summary": "We are excited to announce the launch of our new project, “Data Practices for Shaping Open Access Transformation - Analysis, Recommendation, Training &", + "tags": [ + "Lab Life", + "Research" + ], + "title": "Project launch: OA Datenpraxis- Data Practices for Shaping the Open Access Transformation", + "updated_at": 1718748000, + "url": "https://infomgnt.org/posts/2024-07-01-Vorstellung-OA-Datenpraxis" +} diff --git a/utils/utils_test.go b/utils/utils_test.go index a34c967..c595be2 100644 --- a/utils/utils_test.go +++ b/utils/utils_test.go @@ -44,6 +44,7 @@ func TestNormalizeURL(t *testing.T) { {input: "https://elifesciences.org/Articles/91729/", secure: true, lower: false, want: "https://elifesciences.org/Articles/91729"}, {input: "http://elifesciences.org/Articles/91729/", secure: false, lower: false, want: "http://elifesciences.org/Articles/91729"}, {input: "https://www.ch.ic.ac.uk/rzepa/blog/?p=27133", secure: true, lower: true, want: "https://www.ch.ic.ac.uk/rzepa/blog/?p=27133"}, + {input: "https://infomgnt.org/posts/2024-07-01-Vorstellung-OA-Datenpraxis/", secure: true, lower: false, want: "https://infomgnt.org/posts/2024-07-01-Vorstellung-OA-Datenpraxis"}, } for _, tc := range testCases { got, err := utils.NormalizeURL(tc.input, tc.secure, tc.lower)