From dd5cb1838ca156d12dfa77fbe1c75e64e40a5b64 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 13 Jul 2022 17:16:33 -0300 Subject: [PATCH 01/41] Atualiza ScholarlyArticles --- scholarly_articles/models.py | 42 +++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/scholarly_articles/models.py b/scholarly_articles/models.py index a016a6d1..81054365 100755 --- a/scholarly_articles/models.py +++ b/scholarly_articles/models.py @@ -7,32 +7,48 @@ class ScholarlyArticles(models.Model): - doi = models.CharField("DOI", max_length=255, null=False, blank=False) - doi_url = models.URLField("DOI URL", max_length=255, null=True, blank=True) - genre = models.CharField("Resource Type", max_length=255, choices=choices.TYPE_OF_RESOURCE, null=False, blank=False) - is_oa = models.BooleanField("Opens Access", max_length=255, null=True, blank=True) - journal_is_in_doaj = models.BooleanField("DOAJ", max_length=255, null=True, blank=True) - journal_issns = models.CharField("ISSN's", max_length=255, null=False, blank=False) - journal_issn_l = models.CharField("ISSN-L", max_length=255, null=False, blank=False) - journal_name = models.CharField("Journal Name", max_length=255, null=True, blank=True) - published_date = models.DateTimeField("Published Date", max_length=255, null=True, blank=True) - publisher = models.CharField("Publisher", max_length=255, null=True, blank=True) - title = models.CharField("Title", max_length=255, null=True, blank=True) - article_json = models.JSONField("JSON File", null=True, blank=True) + doi = models.CharField(_("DOI"), max_length=255, null=False, blank=False) + doi_url = models.URLField(_("DOI URL"), max_length=255, null=True, blank=True) + # unpaywall genre + resource_type = models.CharField(_("Resource Type"), max_length=255, choices=choices.TYPE_OF_RESOURCE, null=False, + blank=True) + is_oa = models.BooleanField(_("Opens Access"), max_length=255, null=True, blank=True) + journal_is_in_doaj = models.BooleanField(_("DOAJ"), max_length=255, null=True, blank=True) + journal_issns = models.CharField(_("ISSN's"), max_length=255, null=False, blank=False) + journal_issn_l = models.CharField(_("ISSN-L"), max_length=255, null=False, blank=False) + journal_name = models.CharField(_("Journal Name"), max_length=255, null=True, blank=True) + oa_status = models.CharField(_("OA Status"), max_length=20, choices=choices.OA_STATUS, null=True, blank=True) + published_date = models.DateTimeField(_("Published Date"), max_length=20, null=True, blank=True) + publisher = models.CharField(_("Publisher"), max_length=255, null=True, blank=True) + title = models.CharField(_("Title"), max_length=255, null=True, blank=True) + update = models.DateTimeField(_("Update"), max_length=20, null=True, blank=True) + year = models.IntegerField(_("Year"), null=True, blank=True) + article_json = models.JSONField(_("JSON File"), null=True, blank=True) + contributors = models.ManyToManyField(_("Contributors")) + + def __unicode__(self): + return self.doi + + def __str__(self): + return self.doi panels = [ FieldPanel('doi'), FieldPanel('doi_url'), - FieldPanel('genre'), + FieldPanel('resource_type'), FieldPanel('is_oa'), FieldPanel('journal_is_in_doaj'), FieldPanel('journal_issns'), FieldPanel('journal_issn_l'), FieldPanel('journal_name'), + FieldPanel('oa_status'), FieldPanel('published_date'), FieldPanel('publisher'), FieldPanel('title'), + FieldPanel('update'), + FieldPanel('year'), FieldPanel('article_json'), + FieldPanel('contributors'), ] From 370f212a703996687b3a49f0a54f0110c27e915e Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 13 Jul 2022 17:17:02 -0300 Subject: [PATCH 02/41] Atualiza Contributors --- scholarly_articles/models.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/scholarly_articles/models.py b/scholarly_articles/models.py index 81054365..ce25e6c0 100755 --- a/scholarly_articles/models.py +++ b/scholarly_articles/models.py @@ -53,17 +53,19 @@ def __str__(self): class Contributors(models.Model): - doi = models.CharField("DOI", max_length=255, null=False, blank=False) - doi_url = models.URLField("DOI URL", max_length=255, null=True, blank=True) - family = models.CharField("Family", max_length=255, null=False, blank=False) - given = models.CharField("Given", max_length=255, null=False, blank=False) - orcid = models.URLField("ORCID", max_length=255, null=False, blank=False) - authenticated_orcid = models.BooleanField("Authenticated", max_length=255, null=False, blank=False) - affiliation = models.CharField("Affiliation", max_length=255, null=False, blank=False) + family = models.CharField(_("Family Name"), max_length=255, null=False, blank=False) + given = models.CharField(_("Given Name"), max_length=255, null=False, blank=False) + orcid = models.CharField("ORCID", max_length=255, null=False, blank=False) + authenticated_orcid = models.BooleanField(_("Authenticated"), max_length=20, null=False, blank=False) + affiliation = models.ForeignKey(_("Affiliations"), on_delete=models.CASCADE) + + def __unicode__(self): + return self.orcid + + def __str__(self): + return self.orcid panels = [ - FieldPanel('doi'), - FieldPanel('doi_url'), FieldPanel('family'), FieldPanel('given'), FieldPanel('orcid'), From 8adcd63f8793c14476dd2036792e806a3bfffcbd Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 13 Jul 2022 17:17:22 -0300 Subject: [PATCH 03/41] Adiciona Affiliations --- scholarly_articles/models.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scholarly_articles/models.py b/scholarly_articles/models.py index ce25e6c0..32315115 100755 --- a/scholarly_articles/models.py +++ b/scholarly_articles/models.py @@ -72,3 +72,23 @@ def __str__(self): FieldPanel('authenticated_orcid'), FieldPanel('affiliation'), ] + + +class Affiliations(models.Model): + institution_name = models.CharField(_("Institution Name"), max_length=100, null=False, blank=False) + institution_acronym = models.CharField(_("Institution Acronym"), max_length=10, null=True, blank=True) + institution_place = models.CharField(_("Institution Place"), max_length=255, null=True, blank=True) + institution_department = models.CharField(_("Institution Department"), max_length=255, null=True, blank=True) + + def __unicode__(self): + return self.institution_name + + def __str__(self): + return self.institution_name + + panels = [ + FieldPanel('institution_name'), + FieldPanel('institution_acronym'), + FieldPanel('institution_place'), + FieldPanel('institution_department'), + ] From 9ce6beb85cc8e75beb4d4b7684372f2a92107a7a Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 13 Jul 2022 17:17:50 -0300 Subject: [PATCH 04/41] Adiciona OA_STATUS --- scholarly_articles/choices.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scholarly_articles/choices.py b/scholarly_articles/choices.py index 837de2dd..edb409e6 100644 --- a/scholarly_articles/choices.py +++ b/scholarly_articles/choices.py @@ -30,3 +30,12 @@ ("Edited Book", "edited-book"), ("Standard Series", "standard-series") ] + +OA_STATUS = [ + ("", ""), + ("Gold", "gold"), + ("Hybrid", "hybrid"), + ("Bronze", "bronze"), + ("Green", "green"), + ("Closed", "closed") +] From ddd6d305c9d7ff682ce177a149daaa3efeaeb30a Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 13 Jul 2022 17:18:55 -0300 Subject: [PATCH 05/41] Atualiza ScholarlyArticlesAdmin --- scholarly_articles/wagtail_hooks.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/scholarly_articles/wagtail_hooks.py b/scholarly_articles/wagtail_hooks.py index 0ccadaeb..a62f9982 100644 --- a/scholarly_articles/wagtail_hooks.py +++ b/scholarly_articles/wagtail_hooks.py @@ -1,31 +1,40 @@ from django.utils.translation import gettext as _ -from wagtail.contrib.modeladmin.options import (ModelAdmin, modeladmin_register) +from wagtail.contrib.modeladmin.options import (ModelAdmin, modeladmin_register, ModelAdminGroup) -from .models import (ScholarlyArticles, Contributors) +from .models import (ScholarlyArticles, Contributors, Affiliations) class ScholarlyArticlesAdmin(ModelAdmin): model = ScholarlyArticles - menu_label = 'Scholarly Articles' # ditch this to use verbose_name_plural from model - menu_icon = 'folder' # change as required - menu_order = 200 # will put in 3rd place (000 being 1st, 100 2nd) + menu_label = _('Scholarly Articles') # ditch this to use verbose_name_plural from model + menu_icon = 'folder-open-inverse' # change as required + menu_order = 000 # will put in 3rd place (000 being 1st, 100 2nd) add_to_settings_menu = False # or True to add your model to the Settings sub-menu exclude_from_explorer = False # or True to exclude pages of this type from Wagtail's explorer view + + def all_contributors(self, obj): + return "\n".join([str(c) for c in obj.contributors.all()]) + list_display = ( 'doi', 'doi_url', - 'genre', + 'resource_type', + 'all_contributors', 'is_oa', 'journal_is_in_doaj', 'journal_issns', 'journal_issn_l', 'journal_name', + 'oa_status', 'published_date', 'publisher', 'title', - 'article_json', + 'update', + 'year', + #'article_json', ) + list_filter = ('journal_issn_l',) search_fields = ('doi', 'journal_issn_l') From 5877304cad712e9b2a7ebb182b8987d29a44aa04 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 13 Jul 2022 17:19:56 -0300 Subject: [PATCH 06/41] Atualiza ContributorsAdmin --- scholarly_articles/wagtail_hooks.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/scholarly_articles/wagtail_hooks.py b/scholarly_articles/wagtail_hooks.py index a62f9982..ed8fbfea 100644 --- a/scholarly_articles/wagtail_hooks.py +++ b/scholarly_articles/wagtail_hooks.py @@ -41,23 +41,19 @@ def all_contributors(self, obj): class ContributorsAdmin(ModelAdmin): model = Contributors - menu_label = 'Contributors' - menu_icon = 'folder' - menu_order = 300 + menu_label = _('Contributors') + menu_icon = 'folder-open-inverse' + menu_order = 100 add_to_settings_menu = False # or True to add your model to the Settings sub-menu exclude_from_explorer = False # or True to exclude pages of this type from Wagtail's explorer view list_display = ( - 'doi', - 'doi_url', 'family', 'given', 'orcid', 'authenticated_orcid', 'affiliation', ) - list_filter = ('orcid',) - search_fields = ('doi', 'orcid') + list_filter = ('affiliation',) + search_fields = ('orcid',) -modeladmin_register(ScholarlyArticlesAdmin) -modeladmin_register(ContributorsAdmin) From 9c3937d20dcd6bed545b7f73b6582574756341b0 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 13 Jul 2022 17:20:28 -0300 Subject: [PATCH 07/41] Adiciona AffiliationsAdmin --- scholarly_articles/wagtail_hooks.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scholarly_articles/wagtail_hooks.py b/scholarly_articles/wagtail_hooks.py index ed8fbfea..7f681099 100644 --- a/scholarly_articles/wagtail_hooks.py +++ b/scholarly_articles/wagtail_hooks.py @@ -57,3 +57,16 @@ class ContributorsAdmin(ModelAdmin): search_fields = ('orcid',) +class AffiliationsAdmin(ModelAdmin): + model = Affiliations + menu_label = _('Affiliations') + menu_icon = 'folder-open-inverse' + menu_order = 200 + list_display = ( + 'institution_name', + 'institution_acronym', + 'institution_place', + 'institution_department', + ) + list_filter = ('institution_place',) + search_fields = ('institution_name',) From 81093d74d6a9d84a27b30ce2956c05d0e917ec8a Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 13 Jul 2022 17:20:54 -0300 Subject: [PATCH 08/41] Adiciona ScholarlyArticlesAdminGroup --- scholarly_articles/wagtail_hooks.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scholarly_articles/wagtail_hooks.py b/scholarly_articles/wagtail_hooks.py index 7f681099..965646c4 100644 --- a/scholarly_articles/wagtail_hooks.py +++ b/scholarly_articles/wagtail_hooks.py @@ -70,3 +70,13 @@ class AffiliationsAdmin(ModelAdmin): ) list_filter = ('institution_place',) search_fields = ('institution_name',) + + +class ScholarlyArticlesAdminGroup(ModelAdminGroup): + menu_label = _('Articles Directory') + menu_icon = 'folder-open-inverse' # change as required + menu_order = 200 # will put in 3rd place (000 being 1st, 100 2nd) + items = (ScholarlyArticlesAdmin, ContributorsAdmin, AffiliationsAdmin,) + + +modeladmin_register(ScholarlyArticlesAdminGroup) From 39a472c47a94f9b32df23b2c7ed9be66e4eab2a9 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 13 Jul 2022 17:22:15 -0300 Subject: [PATCH 09/41] Adiciona script para popular ScholarlyArticles --- .../load_data_to_scholarly_articles.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 scholarly_articles/scripts/load_data_to_scholarly_articles.py diff --git a/scholarly_articles/scripts/load_data_to_scholarly_articles.py b/scholarly_articles/scripts/load_data_to_scholarly_articles.py new file mode 100644 index 00000000..f14ec1a1 --- /dev/null +++ b/scholarly_articles/scripts/load_data_to_scholarly_articles.py @@ -0,0 +1,27 @@ +from scholarly_articles import models + +import json + + +def run(): + data = (list(json.loads(x) for x in open('scholarly_articles/scripts/examples.json'))) + for row in data: + contributor = models.Contributors.objects.get(orcid='0000-0002-4313-1997') + message = models.ScholarlyArticles.objects.create( + doi=row['doi'], + doi_url=row['doi_url'], + resource_type=row['genre'], + is_oa=row['is_oa'], + journal_is_in_doaj=row['journal_is_in_doaj'], + journal_issns=row['journal_issns'], + journal_issn_l=row['journal_issn_l'], + journal_name=row['journal_name'], + oa_status=row['oa_status'], + published_date=row['published_date'], + publisher=row['publisher'], + title=row['title'], + update=row['updated'], + year=row['year'], + article_json=str(row), + ) + message.contributors.add(contributor) From a607a319bd0acd635eb52398c34ba48ff2e819dd Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 13 Jul 2022 17:22:47 -0300 Subject: [PATCH 10/41] Adiciona arquivo JSON (exemplo para teste) --- scholarly_articles/scripts/examples.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 scholarly_articles/scripts/examples.json diff --git a/scholarly_articles/scripts/examples.json b/scholarly_articles/scripts/examples.json new file mode 100644 index 00000000..a13ef5e3 --- /dev/null +++ b/scholarly_articles/scripts/examples.json @@ -0,0 +1,3 @@ +{"doi": "10.1007/978-3-540-75404-6_41", "year": null, "genre": "book-chapter", "is_oa": true, "title": "Coordinated Search in Cluttered Environments Using Range from Multiple Robots", "doi_url": "https://doi.org/10.1007/978-3-540-75404-6_41", "updated": "2021-12-25T07:47:44.791380", "oa_status": "green", "publisher": "Springer Berlin Heidelberg", "z_authors": [{"given": "Geoffrey", "family": "Hollinger", "sequence": "first"}, {"given": "Joseph", "family": "Djugash", "sequence": "additional"}, {"given": "Sanjiv", "family": "Singh", "sequence": "additional"}], "is_paratext": false, "journal_name": "Field and Service Robotics", "oa_locations": [{"url": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/1/files/12033758.pdf", "pmh_id": "oai:figshare.com:article/6552443", "is_best": true, "license": "cc-by", "oa_date": null, "updated": "2021-12-19T20:26:12.279292", "version": "submittedVersion", "evidence": "oa repository (via OAI-PMH title and first author match)", "host_type": "repository", "endpoint_id": "27zkeabvhilkeonkmbjy", "url_for_pdf": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/1/files/12033758.pdf", "url_for_landing_page": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443", "repository_institution": "La Trobe University - OPAL (Open@LaTrobe)"}, {"url": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/files/12033758.pdf", "pmh_id": "oai:figshare.com:article/6552443", "is_best": false, "license": "cc-by", "oa_date": null, "updated": "2021-12-04T18:58:23.567750", "version": "submittedVersion", "evidence": "oa repository (via OAI-PMH title and first author match)", "host_type": "repository", "endpoint_id": "vzs6na3qd8sizyhrp6u5", "url_for_pdf": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/files/12033758.pdf", "url_for_landing_page": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443", "repository_institution": "University of Illinois at Chicago - INDIGO"}], "data_standard": 2, "journal_is_oa": false, "journal_issns": "1610-7438,1610-742X", "journal_issn_l": "1610-7438", "published_date": null, "best_oa_location": {"url": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/1/files/12033758.pdf", "pmh_id": "oai:figshare.com:article/6552443", "is_best": true, "license": "cc-by", "oa_date": null, "updated": "2021-12-19T20:26:12.279292", "version": "submittedVersion", "evidence": "oa repository (via OAI-PMH title and first author match)", "host_type": "repository", "endpoint_id": "27zkeabvhilkeonkmbjy", "url_for_pdf": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/1/files/12033758.pdf", "url_for_landing_page": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443", "repository_institution": "La Trobe University - OPAL (Open@LaTrobe)"}, "first_oa_location": {"url": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/1/files/12033758.pdf", "pmh_id": "oai:figshare.com:article/6552443", "is_best": true, "license": "cc-by", "oa_date": null, "updated": "2021-12-19T20:26:12.279292", "version": "submittedVersion", "evidence": "oa repository (via OAI-PMH title and first author match)", "host_type": "repository", "endpoint_id": "27zkeabvhilkeonkmbjy", "url_for_pdf": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/1/files/12033758.pdf", "url_for_landing_page": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443", "repository_institution": "La Trobe University - OPAL (Open@LaTrobe)"}, "journal_is_in_doaj": false, "has_repository_copy": true, "oa_locations_embargoed": []} +{"doi": "10.1515/phys-2018-0004", "year": 2018, "genre": "journal-article", "is_oa": true, "title": "Design optimization of an axial-field eddy-current magnetic coupling based on magneto-thermal analytical model", "doi_url": "https://doi.org/10.1515/phys-2018-0004", "updated": "2022-03-03T00:42:27.887963", "oa_status": "gold", "publisher": "Walter de Gruyter GmbH", "z_authors": [{"given": "Julien", "family": "Fontchastagner", "sequence": "first"}, {"given": "Thierry", "family": "Lubin", "sequence": "additional"}, {"given": "Smaïl", "family": "Mezani", "sequence": "additional"}, {"given": "Noureddine", "family": "Takorabet", "sequence": "additional"}], "is_paratext": false, "journal_name": "Open Physics", "oa_locations": [{"url": "https://doi.org/10.1515/phys-2018-0004", "pmh_id": null, "is_best": true, "license": "cc-by-nc-nd", "oa_date": "2018-03-08", "updated": "2022-03-03T00:42:27.712056", "version": "publishedVersion", "evidence": "oa journal (via doaj)", "host_type": "publisher", "endpoint_id": null, "url_for_pdf": null, "url_for_landing_page": "https://doi.org/10.1515/phys-2018-0004", "repository_institution": null}, {"url": "https://hal.archives-ouvertes.fr/hal-01728164/file/open_physics.pdf", "pmh_id": "oai:HAL:hal-01728164v1", "is_best": false, "license": null, "oa_date": "2021-11-03", "updated": "2021-12-20T21:41:11.987881", "version": "publishedVersion", "evidence": "oa repository (via OAI-PMH doi match)", "host_type": "repository", "endpoint_id": "b7862ef9ea7817152e1", "url_for_pdf": "https://hal.archives-ouvertes.fr/hal-01728164/file/open_physics.pdf", "url_for_landing_page": "https://hal.archives-ouvertes.fr/hal-01728164/file/open_physics.pdf", "repository_institution": "Le Centre pour la Communication Scientifique Directe - HAL - Université Paris Descartes"}, {"url": "https://hal.archives-ouvertes.fr/hal-01728164/document", "pmh_id": "oai:HAL:hal-01728164v1", "is_best": false, "license": null, "oa_date": "2021-11-03", "updated": "2022-02-25T18:18:51.668238", "version": "publishedVersion", "evidence": "oa repository (via OAI-PMH doi match)", "host_type": "repository", "endpoint_id": "b7862ef9ea7817152e1", "url_for_pdf": "https://hal.archives-ouvertes.fr/hal-01728164/document", "url_for_landing_page": "https://hal.archives-ouvertes.fr/hal-01728164", "repository_institution": "Le Centre pour la Communication Scientifique Directe - HAL - Université Paris Descartes"}], "data_standard": 2, "journal_is_oa": true, "journal_issns": "2391-5471", "journal_issn_l": "2391-5471", "published_date": "2018-03-08", "best_oa_location": {"url": "https://doi.org/10.1515/phys-2018-0004", "pmh_id": null, "is_best": true, "license": "cc-by-nc-nd", "oa_date": "2018-03-08", "updated": "2022-03-03T00:42:27.712056", "version": "publishedVersion", "evidence": "oa journal (via doaj)", "host_type": "publisher", "endpoint_id": null, "url_for_pdf": null, "url_for_landing_page": "https://doi.org/10.1515/phys-2018-0004", "repository_institution": null}, "first_oa_location": {"url": "https://doi.org/10.1515/phys-2018-0004", "pmh_id": null, "is_best": true, "license": "cc-by-nc-nd", "oa_date": "2018-03-08", "updated": "2022-03-03T00:42:27.712056", "version": "publishedVersion", "evidence": "oa journal (via doaj)", "host_type": "publisher", "endpoint_id": null, "url_for_pdf": null, "url_for_landing_page": "https://doi.org/10.1515/phys-2018-0004", "repository_institution": null}, "journal_is_in_doaj": true, "has_repository_copy": true, "oa_locations_embargoed": []} +{"doi": "10.21608/bjas.2020.136128", "year": 2020, "genre": "journal-article", "is_oa": true, "title": "Five Layers Repair in Management of Pilonidal Sinus", "doi_url": "https://doi.org/10.21608/bjas.2020.136128", "updated": "2021-10-11T15:45:04.051026", "oa_status": "bronze", "publisher": "Egypts Presidential Specialized Council for Education and Scientific Research", "z_authors": [{"given": "M.M.", "family": "Rizk", "sequence": "first"}, {"given": "E.M.", "family": "Kilany", "sequence": "additional"}, {"given": "E.M.", "family": "Oraby", "sequence": "additional"}, {"given": "A.T.", "family": "Barakat", "sequence": "additional"}], "is_paratext": false, "journal_name": "Benha Journal of Applied Sciences", "oa_locations": [{"url": "https://bjas.journals.ekb.eg/article_136128_4168d4080405a8f3681d5472a30411d9.pdf", "pmh_id": null, "is_best": true, "license": null, "oa_date": null, "updated": "2021-10-11T15:44:49.238121", "version": "publishedVersion", "evidence": "open (via free pdf)", "host_type": "publisher", "endpoint_id": null, "url_for_pdf": "https://bjas.journals.ekb.eg/article_136128_4168d4080405a8f3681d5472a30411d9.pdf", "url_for_landing_page": "https://doi.org/10.21608/bjas.2020.136128", "repository_institution": null}], "data_standard": 2, "journal_is_oa": false, "journal_issns": "2356-976X", "journal_issn_l": "2356-9751", "published_date": "2020-07-01", "best_oa_location": {"url": "https://bjas.journals.ekb.eg/article_136128_4168d4080405a8f3681d5472a30411d9.pdf", "pmh_id": null, "is_best": true, "license": null, "oa_date": null, "updated": "2021-10-11T15:44:49.238121", "version": "publishedVersion", "evidence": "open (via free pdf)", "host_type": "publisher", "endpoint_id": null, "url_for_pdf": "https://bjas.journals.ekb.eg/article_136128_4168d4080405a8f3681d5472a30411d9.pdf", "url_for_landing_page": "https://doi.org/10.21608/bjas.2020.136128", "repository_institution": null}, "first_oa_location": {"url": "https://bjas.journals.ekb.eg/article_136128_4168d4080405a8f3681d5472a30411d9.pdf", "pmh_id": null, "is_best": true, "license": null, "oa_date": null, "updated": "2021-10-11T15:44:49.238121", "version": "publishedVersion", "evidence": "open (via free pdf)", "host_type": "publisher", "endpoint_id": null, "url_for_pdf": "https://bjas.journals.ekb.eg/article_136128_4168d4080405a8f3681d5472a30411d9.pdf", "url_for_landing_page": "https://doi.org/10.21608/bjas.2020.136128", "repository_institution": null}, "journal_is_in_doaj": false, "has_repository_copy": false, "oa_locations_embargoed": []} From 217df6d2e94671e496131b4702094d97ec68f60e Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 13 Jul 2022 17:23:25 -0300 Subject: [PATCH 11/41] Adiciona __init__.py na pasta scripts --- scholarly_articles/scripts/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 scholarly_articles/scripts/__init__.py diff --git a/scholarly_articles/scripts/__init__.py b/scholarly_articles/scripts/__init__.py new file mode 100644 index 00000000..e69de29b From 750b57bea83ac1d148c5f6beec6b108602cd5cb0 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Tue, 19 Jul 2022 19:56:52 -0300 Subject: [PATCH 12/41] Corrige a ordem dos valores nas tuplas --- scholarly_articles/choices.py | 58 +++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/scholarly_articles/choices.py b/scholarly_articles/choices.py index edb409e6..10d65aea 100644 --- a/scholarly_articles/choices.py +++ b/scholarly_articles/choices.py @@ -1,34 +1,34 @@ TYPE_OF_RESOURCE = [ ("", ""), - ("Book Section", "book-section"), - ("Monograph", "monograph"), - ("Report", "report"), - ("Peer Review", "peer-review"), - ("Book Track", "book-track"), - ("Journal Article", "journal-article"), - ("Part", "book-part"), - ("Other", "other"), - ("Book", "book"), - ("Journal Volume", "journal-volume"), - ("Book Set", "book-set"), - ("Reference Entry", "reference-entry"), - ("Proceedings Article", "proceedings-article"), - ("Journal", "journal"), - ("Component", "component"), - ("Book Chapter", "book-chapter"), - ("Proceedings Series", "proceedings-series"), - ("Report Series", "report-series"), - ("Proceedings", "proceedings"), - ("Standard", "standard"), - ("Reference Book", "reference-book"), - ("Posted Content", "posted-content"), - ("Journal Issue", "journal-issue"), - ("Dissertation", "dissertation"), - ("Grant", "grant"), - ("Dataset", "dataset"), - ("Book Series", "book-series"), - ("Edited Book", "edited-book"), - ("Standard Series", "standard-series") + ("book-section", "Book Section"), + ("monograph", "Monograph"), + ("report", "Report"), + ("peer-review", "Peer Review"), + ("book-track", "Book Track"), + ("journal-article", "Journal Article"), + ("book-part", "Part"), + ("other", "Other"), + ("book", "Book"), + ("journal-volume", "Journal Volume"), + ("book-set", "Book Set"), + ("reference-entry", "Reference Entry"), + ("proceedings-article", "Proceedings Article"), + ("journal", "Journal"), + ("component", "Component"), + ("book-chapter", "Book Chapter"), + ("proceedings-series", "Proceedings Series"), + ("report-series", "Report Series"), + ("proceedings", "Proceedings"), + ("standard", "Standard"), + ("reference-book", "Reference Book"), + ("posted-content", "Posted Content"), + ("journal-issue", "Journal Issue"), + ("dissertation", "Dissertation"), + ("grant", "Grant"), + ("dataset", "Dataset"), + ("book-series", "Book Series"), + ("edited-book", "Edited Book"), + ("standard-series", "Standard Series") ] OA_STATUS = [ From 4dfa309067769da294335a4bca6149c0c25738ad Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Tue, 19 Jul 2022 19:58:08 -0300 Subject: [PATCH 13/41] Modifica ScholarlyArticles --- scholarly_articles/models.py | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/scholarly_articles/models.py b/scholarly_articles/models.py index 32315115..9e54e5f7 100755 --- a/scholarly_articles/models.py +++ b/scholarly_articles/models.py @@ -4,18 +4,29 @@ from wagtail.admin.edit_handlers import FieldPanel from . import choices +from core.models import CommonControlField class ScholarlyArticles(models.Model): - doi = models.CharField(_("DOI"), max_length=255, null=False, blank=False) - doi_url = models.URLField(_("DOI URL"), max_length=255, null=True, blank=True) - # unpaywall genre - resource_type = models.CharField(_("Resource Type"), max_length=255, choices=choices.TYPE_OF_RESOURCE, null=False, - blank=True) - is_oa = models.BooleanField(_("Opens Access"), max_length=255, null=True, blank=True) - journal_is_in_doaj = models.BooleanField(_("DOAJ"), max_length=255, null=True, blank=True) - journal_issns = models.CharField(_("ISSN's"), max_length=255, null=False, blank=False) - journal_issn_l = models.CharField(_("ISSN-L"), max_length=255, null=False, blank=False) + doi = models.CharField(_("DOI"), max_length=255, null=True, blank=True) + year = models.CharField(_("Year"), max_length=4, null=True, blank=True) + contributors = models.ManyToManyField(_("Contributors"), null=True, blank=True) + journal = models.ForeignKey('Journals', on_delete=models.SET_NULL, max_length=255, null=True, blank=True) + + def __unicode__(self): + return self.doi + + def __str__(self): + return self.doi + + panels = [ + FieldPanel('doi'), + FieldPanel('year'), + FieldPanel('contributors'), + FieldPanel('journal'), + ] + + journal_name = models.CharField(_("Journal Name"), max_length=255, null=True, blank=True) oa_status = models.CharField(_("OA Status"), max_length=20, choices=choices.OA_STATUS, null=True, blank=True) published_date = models.DateTimeField(_("Published Date"), max_length=20, null=True, blank=True) From 20bd998f959b992afb1718f74d8f22b50918f123 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Tue, 19 Jul 2022 19:58:46 -0300 Subject: [PATCH 14/41] Modifica Journals --- scholarly_articles/models.py | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/scholarly_articles/models.py b/scholarly_articles/models.py index 9e54e5f7..46ba5623 100755 --- a/scholarly_articles/models.py +++ b/scholarly_articles/models.py @@ -27,39 +27,25 @@ def __str__(self): ] +class Journals(models.Model): + journal_issn_l = models.CharField(_("ISSN-L"), max_length=255, null=True, blank=True) + journal_issns = models.CharField(_("ISSN's"), max_length=255, null=True, blank=True) journal_name = models.CharField(_("Journal Name"), max_length=255, null=True, blank=True) - oa_status = models.CharField(_("OA Status"), max_length=20, choices=choices.OA_STATUS, null=True, blank=True) - published_date = models.DateTimeField(_("Published Date"), max_length=20, null=True, blank=True) publisher = models.CharField(_("Publisher"), max_length=255, null=True, blank=True) - title = models.CharField(_("Title"), max_length=255, null=True, blank=True) - update = models.DateTimeField(_("Update"), max_length=20, null=True, blank=True) - year = models.IntegerField(_("Year"), null=True, blank=True) - article_json = models.JSONField(_("JSON File"), null=True, blank=True) - contributors = models.ManyToManyField(_("Contributors")) + journal_is_in_doaj = models.BooleanField(_("DOAJ"), max_length=255, default=False, null=True, blank=True) def __unicode__(self): - return self.doi + return self.journal_issn_l def __str__(self): - return self.doi + return self.journal_issn_l panels = [ - FieldPanel('doi'), - FieldPanel('doi_url'), - FieldPanel('resource_type'), - FieldPanel('is_oa'), - FieldPanel('journal_is_in_doaj'), - FieldPanel('journal_issns'), FieldPanel('journal_issn_l'), + FieldPanel('journal_issns'), FieldPanel('journal_name'), - FieldPanel('oa_status'), - FieldPanel('published_date'), FieldPanel('publisher'), - FieldPanel('title'), - FieldPanel('update'), - FieldPanel('year'), - FieldPanel('article_json'), - FieldPanel('contributors'), + FieldPanel('journal_is_in_doaj'), ] From 53959f267b24368d7b5d3d4e4324619aafb3f1c5 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Tue, 19 Jul 2022 19:59:34 -0300 Subject: [PATCH 15/41] Modifica Contributors --- scholarly_articles/models.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scholarly_articles/models.py b/scholarly_articles/models.py index 46ba5623..237ae5f9 100755 --- a/scholarly_articles/models.py +++ b/scholarly_articles/models.py @@ -50,17 +50,17 @@ def __str__(self): class Contributors(models.Model): - family = models.CharField(_("Family Name"), max_length=255, null=False, blank=False) - given = models.CharField(_("Given Name"), max_length=255, null=False, blank=False) - orcid = models.CharField("ORCID", max_length=255, null=False, blank=False) - authenticated_orcid = models.BooleanField(_("Authenticated"), max_length=20, null=False, blank=False) - affiliation = models.ForeignKey(_("Affiliations"), on_delete=models.CASCADE) + family = models.CharField(_("Family Name"), max_length=255, null=True, blank=True) + given = models.CharField(_("Given Name"), max_length=255, null=True, blank=True) + orcid = models.CharField("ORCID", max_length=255, null=True, blank=True) + authenticated_orcid = models.BooleanField(_("Authenticated"), default=False, null=True, blank=True) + affiliation = models.ForeignKey(_("Affiliations"), on_delete=models.SET_NULL, max_length=255, null=True, blank=True) def __unicode__(self): - return self.orcid + return self.family def __str__(self): - return self.orcid + return self.family panels = [ FieldPanel('family'), From 14910646e97d0a9b39a266fbf16de1d318c7c27e Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Tue, 19 Jul 2022 20:00:12 -0300 Subject: [PATCH 16/41] Modifica Affiliations --- scholarly_articles/models.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/scholarly_articles/models.py b/scholarly_articles/models.py index 237ae5f9..8320984f 100755 --- a/scholarly_articles/models.py +++ b/scholarly_articles/models.py @@ -72,20 +72,15 @@ def __str__(self): class Affiliations(models.Model): - institution_name = models.CharField(_("Institution Name"), max_length=100, null=False, blank=False) - institution_acronym = models.CharField(_("Institution Acronym"), max_length=10, null=True, blank=True) - institution_place = models.CharField(_("Institution Place"), max_length=255, null=True, blank=True) - institution_department = models.CharField(_("Institution Department"), max_length=255, null=True, blank=True) + name = models.CharField(_("Affiliation Name"), max_length=255, null=True, blank=True) def __unicode__(self): - return self.institution_name + return self.name def __str__(self): - return self.institution_name + return self.name panels = [ - FieldPanel('institution_name'), - FieldPanel('institution_acronym'), - FieldPanel('institution_place'), - FieldPanel('institution_department'), + FieldPanel('name'), + ] ] From 7d5399432f28bbd6803b2aa9e13a1d3fe1a78414 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Tue, 19 Jul 2022 20:00:41 -0300 Subject: [PATCH 17/41] Adiciona RawUnpaywall --- scholarly_articles/models.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/scholarly_articles/models.py b/scholarly_articles/models.py index 8320984f..87630a90 100755 --- a/scholarly_articles/models.py +++ b/scholarly_articles/models.py @@ -83,4 +83,31 @@ def __str__(self): panels = [ FieldPanel('name'), ] + + +class RawUnpaywall(models.Model): + doi = models.CharField(_("DOI"), max_length=255, null=False, blank=False) + harvesting_creation = models.CharField(_("Harvesting"), max_length=255, null=False, blank=False) + is_paratext = models.BooleanField(_("Paratext"), default=False, null=True, blank=True) + year = models.CharField(_("Year"), max_length=255, null=True, blank=True) + # unpaywall genre + resource_type = models.CharField(_("Resource Type"), max_length=255, choices=choices.TYPE_OF_RESOURCE, null=False, + blank=True) + update = models.CharField(_("Update"), max_length=255, null=True, blank=True) + json = models.JSONField(_("JSON File"), null=True, blank=True) + + def __unicode__(self): + return self.doi + + def __str__(self): + return self.doi + + panels = [ + FieldPanel('doi'), + FieldPanel('harvesting_creation'), + FieldPanel('is_paratext'), + FieldPanel('year'), + FieldPanel('resource_type'), + FieldPanel('update'), + FieldPanel('json'), ] From 60790545b5522fcc9a65d2bcbe777e8cc44b39a8 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Tue, 19 Jul 2022 20:01:09 -0300 Subject: [PATCH 18/41] Altera exemplos JSON --- scholarly_articles/scripts/examples.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scholarly_articles/scripts/examples.json b/scholarly_articles/scripts/examples.json index a13ef5e3..cd70629c 100644 --- a/scholarly_articles/scripts/examples.json +++ b/scholarly_articles/scripts/examples.json @@ -1,3 +1,3 @@ -{"doi": "10.1007/978-3-540-75404-6_41", "year": null, "genre": "book-chapter", "is_oa": true, "title": "Coordinated Search in Cluttered Environments Using Range from Multiple Robots", "doi_url": "https://doi.org/10.1007/978-3-540-75404-6_41", "updated": "2021-12-25T07:47:44.791380", "oa_status": "green", "publisher": "Springer Berlin Heidelberg", "z_authors": [{"given": "Geoffrey", "family": "Hollinger", "sequence": "first"}, {"given": "Joseph", "family": "Djugash", "sequence": "additional"}, {"given": "Sanjiv", "family": "Singh", "sequence": "additional"}], "is_paratext": false, "journal_name": "Field and Service Robotics", "oa_locations": [{"url": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/1/files/12033758.pdf", "pmh_id": "oai:figshare.com:article/6552443", "is_best": true, "license": "cc-by", "oa_date": null, "updated": "2021-12-19T20:26:12.279292", "version": "submittedVersion", "evidence": "oa repository (via OAI-PMH title and first author match)", "host_type": "repository", "endpoint_id": "27zkeabvhilkeonkmbjy", "url_for_pdf": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/1/files/12033758.pdf", "url_for_landing_page": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443", "repository_institution": "La Trobe University - OPAL (Open@LaTrobe)"}, {"url": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/files/12033758.pdf", "pmh_id": "oai:figshare.com:article/6552443", "is_best": false, "license": "cc-by", "oa_date": null, "updated": "2021-12-04T18:58:23.567750", "version": "submittedVersion", "evidence": "oa repository (via OAI-PMH title and first author match)", "host_type": "repository", "endpoint_id": "vzs6na3qd8sizyhrp6u5", "url_for_pdf": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/files/12033758.pdf", "url_for_landing_page": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443", "repository_institution": "University of Illinois at Chicago - INDIGO"}], "data_standard": 2, "journal_is_oa": false, "journal_issns": "1610-7438,1610-742X", "journal_issn_l": "1610-7438", "published_date": null, "best_oa_location": {"url": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/1/files/12033758.pdf", "pmh_id": "oai:figshare.com:article/6552443", "is_best": true, "license": "cc-by", "oa_date": null, "updated": "2021-12-19T20:26:12.279292", "version": "submittedVersion", "evidence": "oa repository (via OAI-PMH title and first author match)", "host_type": "repository", "endpoint_id": "27zkeabvhilkeonkmbjy", "url_for_pdf": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/1/files/12033758.pdf", "url_for_landing_page": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443", "repository_institution": "La Trobe University - OPAL (Open@LaTrobe)"}, "first_oa_location": {"url": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/1/files/12033758.pdf", "pmh_id": "oai:figshare.com:article/6552443", "is_best": true, "license": "cc-by", "oa_date": null, "updated": "2021-12-19T20:26:12.279292", "version": "submittedVersion", "evidence": "oa repository (via OAI-PMH title and first author match)", "host_type": "repository", "endpoint_id": "27zkeabvhilkeonkmbjy", "url_for_pdf": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443/1/files/12033758.pdf", "url_for_landing_page": "https://figshare.com/articles/journal_contribution/Coordinated_Search_in_Cluttered_Environments_Using_Range_from_Multiple_Robots/6552443", "repository_institution": "La Trobe University - OPAL (Open@LaTrobe)"}, "journal_is_in_doaj": false, "has_repository_copy": true, "oa_locations_embargoed": []} -{"doi": "10.1515/phys-2018-0004", "year": 2018, "genre": "journal-article", "is_oa": true, "title": "Design optimization of an axial-field eddy-current magnetic coupling based on magneto-thermal analytical model", "doi_url": "https://doi.org/10.1515/phys-2018-0004", "updated": "2022-03-03T00:42:27.887963", "oa_status": "gold", "publisher": "Walter de Gruyter GmbH", "z_authors": [{"given": "Julien", "family": "Fontchastagner", "sequence": "first"}, {"given": "Thierry", "family": "Lubin", "sequence": "additional"}, {"given": "Smaïl", "family": "Mezani", "sequence": "additional"}, {"given": "Noureddine", "family": "Takorabet", "sequence": "additional"}], "is_paratext": false, "journal_name": "Open Physics", "oa_locations": [{"url": "https://doi.org/10.1515/phys-2018-0004", "pmh_id": null, "is_best": true, "license": "cc-by-nc-nd", "oa_date": "2018-03-08", "updated": "2022-03-03T00:42:27.712056", "version": "publishedVersion", "evidence": "oa journal (via doaj)", "host_type": "publisher", "endpoint_id": null, "url_for_pdf": null, "url_for_landing_page": "https://doi.org/10.1515/phys-2018-0004", "repository_institution": null}, {"url": "https://hal.archives-ouvertes.fr/hal-01728164/file/open_physics.pdf", "pmh_id": "oai:HAL:hal-01728164v1", "is_best": false, "license": null, "oa_date": "2021-11-03", "updated": "2021-12-20T21:41:11.987881", "version": "publishedVersion", "evidence": "oa repository (via OAI-PMH doi match)", "host_type": "repository", "endpoint_id": "b7862ef9ea7817152e1", "url_for_pdf": "https://hal.archives-ouvertes.fr/hal-01728164/file/open_physics.pdf", "url_for_landing_page": "https://hal.archives-ouvertes.fr/hal-01728164/file/open_physics.pdf", "repository_institution": "Le Centre pour la Communication Scientifique Directe - HAL - Université Paris Descartes"}, {"url": "https://hal.archives-ouvertes.fr/hal-01728164/document", "pmh_id": "oai:HAL:hal-01728164v1", "is_best": false, "license": null, "oa_date": "2021-11-03", "updated": "2022-02-25T18:18:51.668238", "version": "publishedVersion", "evidence": "oa repository (via OAI-PMH doi match)", "host_type": "repository", "endpoint_id": "b7862ef9ea7817152e1", "url_for_pdf": "https://hal.archives-ouvertes.fr/hal-01728164/document", "url_for_landing_page": "https://hal.archives-ouvertes.fr/hal-01728164", "repository_institution": "Le Centre pour la Communication Scientifique Directe - HAL - Université Paris Descartes"}], "data_standard": 2, "journal_is_oa": true, "journal_issns": "2391-5471", "journal_issn_l": "2391-5471", "published_date": "2018-03-08", "best_oa_location": {"url": "https://doi.org/10.1515/phys-2018-0004", "pmh_id": null, "is_best": true, "license": "cc-by-nc-nd", "oa_date": "2018-03-08", "updated": "2022-03-03T00:42:27.712056", "version": "publishedVersion", "evidence": "oa journal (via doaj)", "host_type": "publisher", "endpoint_id": null, "url_for_pdf": null, "url_for_landing_page": "https://doi.org/10.1515/phys-2018-0004", "repository_institution": null}, "first_oa_location": {"url": "https://doi.org/10.1515/phys-2018-0004", "pmh_id": null, "is_best": true, "license": "cc-by-nc-nd", "oa_date": "2018-03-08", "updated": "2022-03-03T00:42:27.712056", "version": "publishedVersion", "evidence": "oa journal (via doaj)", "host_type": "publisher", "endpoint_id": null, "url_for_pdf": null, "url_for_landing_page": "https://doi.org/10.1515/phys-2018-0004", "repository_institution": null}, "journal_is_in_doaj": true, "has_repository_copy": true, "oa_locations_embargoed": []} -{"doi": "10.21608/bjas.2020.136128", "year": 2020, "genre": "journal-article", "is_oa": true, "title": "Five Layers Repair in Management of Pilonidal Sinus", "doi_url": "https://doi.org/10.21608/bjas.2020.136128", "updated": "2021-10-11T15:45:04.051026", "oa_status": "bronze", "publisher": "Egypts Presidential Specialized Council for Education and Scientific Research", "z_authors": [{"given": "M.M.", "family": "Rizk", "sequence": "first"}, {"given": "E.M.", "family": "Kilany", "sequence": "additional"}, {"given": "E.M.", "family": "Oraby", "sequence": "additional"}, {"given": "A.T.", "family": "Barakat", "sequence": "additional"}], "is_paratext": false, "journal_name": "Benha Journal of Applied Sciences", "oa_locations": [{"url": "https://bjas.journals.ekb.eg/article_136128_4168d4080405a8f3681d5472a30411d9.pdf", "pmh_id": null, "is_best": true, "license": null, "oa_date": null, "updated": "2021-10-11T15:44:49.238121", "version": "publishedVersion", "evidence": "open (via free pdf)", "host_type": "publisher", "endpoint_id": null, "url_for_pdf": "https://bjas.journals.ekb.eg/article_136128_4168d4080405a8f3681d5472a30411d9.pdf", "url_for_landing_page": "https://doi.org/10.21608/bjas.2020.136128", "repository_institution": null}], "data_standard": 2, "journal_is_oa": false, "journal_issns": "2356-976X", "journal_issn_l": "2356-9751", "published_date": "2020-07-01", "best_oa_location": {"url": "https://bjas.journals.ekb.eg/article_136128_4168d4080405a8f3681d5472a30411d9.pdf", "pmh_id": null, "is_best": true, "license": null, "oa_date": null, "updated": "2021-10-11T15:44:49.238121", "version": "publishedVersion", "evidence": "open (via free pdf)", "host_type": "publisher", "endpoint_id": null, "url_for_pdf": "https://bjas.journals.ekb.eg/article_136128_4168d4080405a8f3681d5472a30411d9.pdf", "url_for_landing_page": "https://doi.org/10.21608/bjas.2020.136128", "repository_institution": null}, "first_oa_location": {"url": "https://bjas.journals.ekb.eg/article_136128_4168d4080405a8f3681d5472a30411d9.pdf", "pmh_id": null, "is_best": true, "license": null, "oa_date": null, "updated": "2021-10-11T15:44:49.238121", "version": "publishedVersion", "evidence": "open (via free pdf)", "host_type": "publisher", "endpoint_id": null, "url_for_pdf": "https://bjas.journals.ekb.eg/article_136128_4168d4080405a8f3681d5472a30411d9.pdf", "url_for_landing_page": "https://doi.org/10.21608/bjas.2020.136128", "repository_institution": null}, "journal_is_in_doaj": false, "has_repository_copy": false, "oa_locations_embargoed": []} +{"doi": "10.1002/psp.2296", "year": 2020, "genre": "journal-article", "is_oa": false, "title": "Trap or opportunity—What role does geography play in the use of cash for childcare?", "doi_url": "https://doi.org/10.1002/psp.2296", "updated": "2021-04-02T00:47:21.884997", "oa_status": "closed", "publisher": "Wiley", "z_authors": [{"ORCID": "http://orcid.org/0000-0002-4877-2961", "given": "Lena", "family": "Magnusson Turner", "sequence": "first", "affiliation": [{"name": "Norwegian Social Research Oslo Metropolitan University Oslo Norway"}], "authenticated-orcid": false}, {"ORCID": "http://orcid.org/0000-0002-4536-9229", "given": "John", "family": "Östh", "sequence": "additional", "affiliation": [{"name": "Department of Social and Economic Geography Uppsala University Uppsala Sweden"}], "authenticated-orcid": false}], "is_paratext": true, "journal_name": "Population, Space and Place", "oa_locations": [], "data_standard": 2, "journal_is_oa": false, "journal_issns": "1544-8444,1544-8452", "journal_issn_l": "1544-8444", "published_date": "2020-01-07", "best_oa_location": null, "first_oa_location": null, "journal_is_in_doaj": false, "has_repository_copy": false, "oa_locations_embargoed": []} +{"doi": "10.1093/dote/doab014", "year": 2021, "genre": "journal-article", "is_oa": false, "title": "Population trends in achalasia diagnosis and management: a changing paradigm", "doi_url": "https://doi.org/10.1093/dote/doab014", "updated": "2021-03-17T21:05:16.450507", "oa_status": "closed", "publisher": "Oxford University Press (OUP)", "z_authors": [{"given": "Judy A", "family": "Trieu", "sequence": "first", "affiliation": [{"name": "Division of Gastroenterology and Nutrition, Loyola University Medical Center, Maywood, IL, USA"}]}, {"ORCID": "http://orcid.org/0000-0002-1870-9881", "given": "Arshish", "family": "Dua", "sequence": "additional", "affiliation": [{"name": "Division of Gastroenterology and Nutrition, Loyola University Medical Center, Maywood, IL, USA"}], "authenticated-orcid": false}, {"given": "Ikponmwosa", "family": "Enofe", "sequence": "additional", "affiliation": [{"name": "Division of Gastroenterology and Nutrition, Loyola University Medical Center, Maywood, IL, USA"}]}, {"given": "Nikhil", "family": "Shastri", "sequence": "additional", "affiliation": [{"name": "Division of Gastroenterology and Nutrition, Loyola University Medical Center, Maywood, IL, USA"}]}, {"given": "Mukund", "family": "Venu", "sequence": "additional", "affiliation": [{"name": "Division of Gastroenterology and Nutrition, Loyola University Medical Center, Maywood, IL, USA"}]}], "is_paratext": false, "journal_name": "Diseases of the Esophagus", "oa_locations": [], "data_standard": 2, "journal_is_oa": false, "journal_issns": "1120-8694,1442-2050", "journal_issn_l": "1120-8694", "published_date": "2021-03-17", "best_oa_location": null, "first_oa_location": null, "journal_is_in_doaj": false, "has_repository_copy": false, "oa_locations_embargoed": []} +{"doi": "10.1080/01430750.2019.1708791", "year": 2020, "genre": "journal-article", "is_oa": false, "title": "Techno-economic study of hybrid renewable energy system of Metropolitan Cities in India", "doi_url": "https://doi.org/10.1080/01430750.2019.1708791", "updated": "2021-03-30T01:23:35.505209", "oa_status": "closed", "publisher": "Informa UK Limited", "z_authors": [{"ORCID": "http://orcid.org/0000-0001-6059-6326", "given": "Balachander", "family": "Kalappan", "sequence": "first", "affiliation": [{"name": "Department of Electrical and Electronics Engineering, Faculty of Engineering, Karpagam Academy of Higher Education, Coimbatore, India"}], "authenticated-orcid": false}, {"ORCID": "http://orcid.org/0000-0001-5138-716X", "given": "A.", "family": "Amudha", "sequence": "additional", "affiliation": [{"name": "Department of Electrical and Electronics Engineering, Faculty of Engineering, Karpagam Academy of Higher Education, Coimbatore, India"}], "authenticated-orcid": false}, {"ORCID": "http://orcid.org/0000-0003-1370-1140", "given": "K.", "family": "Keerthivasan", "sequence": "additional", "affiliation": [{"name": "Higher College of Technology, Muscat, Oman"}], "authenticated-orcid": false}], "is_paratext": false, "journal_name": "International Journal of Ambient Energy", "oa_locations": [], "data_standard": 2, "journal_is_oa": false, "journal_issns": "0143-0750,2162-8246", "journal_issn_l": "0143-0750", "published_date": "2020-01-06", "best_oa_location": null, "first_oa_location": null, "journal_is_in_doaj": false, "has_repository_copy": false, "oa_locations_embargoed": []} \ No newline at end of file From 772d8b840c6fe4d27bde751e3b1ab152ce0556f1 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Tue, 19 Jul 2022 20:01:59 -0300 Subject: [PATCH 19/41] Modifica ScholarlyArticlesAdmin --- scholarly_articles/wagtail_hooks.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/scholarly_articles/wagtail_hooks.py b/scholarly_articles/wagtail_hooks.py index 965646c4..62d43fbf 100644 --- a/scholarly_articles/wagtail_hooks.py +++ b/scholarly_articles/wagtail_hooks.py @@ -2,28 +2,31 @@ from wagtail.contrib.modeladmin.options import (ModelAdmin, modeladmin_register, ModelAdminGroup) -from .models import (ScholarlyArticles, Contributors, Affiliations) +from .models import (ScholarlyArticles, Contributors, Affiliations, Journals, RawUnpaywall) class ScholarlyArticlesAdmin(ModelAdmin): model = ScholarlyArticles menu_label = _('Scholarly Articles') # ditch this to use verbose_name_plural from model menu_icon = 'folder-open-inverse' # change as required - menu_order = 000 # will put in 3rd place (000 being 1st, 100 2nd) + #menu_order = 100 # will put in 3rd place (000 being 1st, 100 2nd) add_to_settings_menu = False # or True to add your model to the Settings sub-menu exclude_from_explorer = False # or True to exclude pages of this type from Wagtail's explorer view def all_contributors(self, obj): - return "\n".join([str(c) for c in obj.contributors.all()]) + return ", ".join([str(c) for c in obj.contributors.all()]) list_display = ( 'doi', - 'doi_url', - 'resource_type', + 'year', 'all_contributors', - 'is_oa', - 'journal_is_in_doaj', - 'journal_issns', + 'journal', + ) + + list_filter = ('year',) + search_fields = ('doi',) + + 'journal_issn_l', 'journal_name', 'oa_status', From 942480fa05747f3839794f0211dfc9d6ecd9f589 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Tue, 19 Jul 2022 20:02:31 -0300 Subject: [PATCH 20/41] Adiciona RawUnpaywallAdmin --- scholarly_articles/wagtail_hooks.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scholarly_articles/wagtail_hooks.py b/scholarly_articles/wagtail_hooks.py index 62d43fbf..00607639 100644 --- a/scholarly_articles/wagtail_hooks.py +++ b/scholarly_articles/wagtail_hooks.py @@ -27,6 +27,28 @@ def all_contributors(self, obj): search_fields = ('doi',) +class RawUnpaywallAdmin(ModelAdmin): + model = RawUnpaywall + menu_label = _('RawUnpaywall') # ditch this to use verbose_name_plural from model + menu_icon = 'folder-open-inverse' # change as required + #menu_order = 100 # will put in 3rd place (000 being 1st, 100 2nd) + add_to_settings_menu = False # or True to add your model to the Settings sub-menu + exclude_from_explorer = False # or True to exclude pages of this type from Wagtail's explorer view + + list_display = ( + 'doi', + 'harvesting_creation', + 'is_paratext', + 'year', + 'resource_type', + 'update', + 'json', + ) + + list_filter = (_('year'),) + search_fields = ('doi',) + + 'journal_issn_l', 'journal_name', 'oa_status', From 0352f37eea1f4bdf50a9c8c8b2088f6c31866b21 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Tue, 19 Jul 2022 20:03:19 -0300 Subject: [PATCH 21/41] Adiciona JournalsAdmin --- scholarly_articles/wagtail_hooks.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/scholarly_articles/wagtail_hooks.py b/scholarly_articles/wagtail_hooks.py index 00607639..7f9991eb 100644 --- a/scholarly_articles/wagtail_hooks.py +++ b/scholarly_articles/wagtail_hooks.py @@ -49,19 +49,24 @@ class RawUnpaywallAdmin(ModelAdmin): search_fields = ('doi',) +class JournalsAdmin(ModelAdmin): + model = Journals + menu_label = _('Journals') # ditch this to use verbose_name_plural from model + menu_icon = 'folder-open-inverse' # change as required + #menu_order = 000 # will put in 3rd place (000 being 1st, 100 2nd) + add_to_settings_menu = False # or True to add your model to the Settings sub-menu + exclude_from_explorer = False # or True to exclude pages of this type from Wagtail's explorer view + + list_display = ( 'journal_issn_l', + 'journal_issns', 'journal_name', - 'oa_status', - 'published_date', 'publisher', - 'title', - 'update', - 'year', - #'article_json', + 'journal_is_in_doaj', ) - list_filter = ('journal_issn_l',) - search_fields = ('doi', 'journal_issn_l') + list_filter = (_('journal_issn_l'),) + search_fields = (_('journal_issn_l)'),) class ContributorsAdmin(ModelAdmin): From d4a4acddbb681e6dc8e2fb647da4af2059502fc3 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Tue, 19 Jul 2022 20:04:00 -0300 Subject: [PATCH 22/41] Corrige Contributors --- scholarly_articles/wagtail_hooks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scholarly_articles/wagtail_hooks.py b/scholarly_articles/wagtail_hooks.py index 7f9991eb..c57211b9 100644 --- a/scholarly_articles/wagtail_hooks.py +++ b/scholarly_articles/wagtail_hooks.py @@ -73,9 +73,10 @@ class ContributorsAdmin(ModelAdmin): model = Contributors menu_label = _('Contributors') menu_icon = 'folder-open-inverse' - menu_order = 100 + #menu_order = 200 add_to_settings_menu = False # or True to add your model to the Settings sub-menu exclude_from_explorer = False # or True to exclude pages of this type from Wagtail's explorer view + list_display = ( 'family', 'given', From 9f905453bf9756ad9fa8384b7538d8032cfe3105 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Tue, 19 Jul 2022 20:04:37 -0300 Subject: [PATCH 23/41] Corrige AffiliationsAdmin --- scholarly_articles/wagtail_hooks.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/scholarly_articles/wagtail_hooks.py b/scholarly_articles/wagtail_hooks.py index c57211b9..05091e46 100644 --- a/scholarly_articles/wagtail_hooks.py +++ b/scholarly_articles/wagtail_hooks.py @@ -92,15 +92,13 @@ class AffiliationsAdmin(ModelAdmin): model = Affiliations menu_label = _('Affiliations') menu_icon = 'folder-open-inverse' - menu_order = 200 + add_to_settings_menu = False # or True to add your model to the Settings sub-menu + exclude_from_explorer = False # or True to exclude pages of this type from Wagtail's explorer view list_display = ( - 'institution_name', - 'institution_acronym', - 'institution_place', - 'institution_department', + 'name', ) - list_filter = ('institution_place',) - search_fields = ('institution_name',) + list_filter = ('name',) + search_fields = ('name',) class ScholarlyArticlesAdminGroup(ModelAdminGroup): From d5a5c3bd16d49b841ee027bedd60da64fbe9ea12 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Tue, 19 Jul 2022 20:04:59 -0300 Subject: [PATCH 24/41] Corrige ScholarlyArticlesAdminGroup --- scholarly_articles/wagtail_hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scholarly_articles/wagtail_hooks.py b/scholarly_articles/wagtail_hooks.py index 05091e46..d9aa65db 100644 --- a/scholarly_articles/wagtail_hooks.py +++ b/scholarly_articles/wagtail_hooks.py @@ -105,7 +105,7 @@ class ScholarlyArticlesAdminGroup(ModelAdminGroup): menu_label = _('Articles Directory') menu_icon = 'folder-open-inverse' # change as required menu_order = 200 # will put in 3rd place (000 being 1st, 100 2nd) - items = (ScholarlyArticlesAdmin, ContributorsAdmin, AffiliationsAdmin,) + items = (JournalsAdmin, ScholarlyArticlesAdmin, ContributorsAdmin, AffiliationsAdmin, RawUnpaywallAdmin,) modeladmin_register(ScholarlyArticlesAdminGroup) From 3a91f3bce63e46bf4611d531ccd1d7a7c5a89681 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Tue, 19 Jul 2022 20:06:42 -0300 Subject: [PATCH 25/41] Adiciona script para carregar RawUnpaywall --- .../scripts/load_raw_unpaywall.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 scholarly_articles/scripts/load_raw_unpaywall.py diff --git a/scholarly_articles/scripts/load_raw_unpaywall.py b/scholarly_articles/scripts/load_raw_unpaywall.py new file mode 100644 index 00000000..ac142d23 --- /dev/null +++ b/scholarly_articles/scripts/load_raw_unpaywall.py @@ -0,0 +1,34 @@ +from scholarly_articles import models + +import json +from datetime import date + + +def load(row): + try: + if row.get('doi'): + rawunpaywall = models.RawUnpaywall.objects.filter(doi=row['doi']) + if len(rawunpaywall) == 0: + rawunpaywall = models.RawUnpaywall() + rawunpaywall.doi = row['doi'] + rawunpaywall.harvesting_creation = date.today() + else: + return + if row.get('is_paratext'): + rawunpaywall.is_paratext = row['is_paratext'] + if row.get('year'): + rawunpaywall.year = row['year'] + if row.get('genre'): + rawunpaywall.resource_type = row['genre'] + if row.get('updated'): + rawunpaywall.update = row['updated'][:10] + rawunpaywall.json = row + rawunpaywall.save() + except KeyError: + pass + + +def run(): + data = (list(json.loads(x) for x in open('scholarly_articles/scripts/examples.json'))) + for row in data: + load(row) From 554c2b49629d819c970ee1920b7ba6dd665f195c Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Tue, 19 Jul 2022 20:07:25 -0300 Subject: [PATCH 26/41] Adiciona script para carregar demais modelos --- .../scripts/load_data_example.py | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 scholarly_articles/scripts/load_data_example.py diff --git a/scholarly_articles/scripts/load_data_example.py b/scholarly_articles/scripts/load_data_example.py new file mode 100644 index 00000000..b81319d3 --- /dev/null +++ b/scholarly_articles/scripts/load_data_example.py @@ -0,0 +1,108 @@ +from scholarly_articles import models + + +def load_article(row): + articles = models.ScholarlyArticles.objects.filter(doi=row.get('doi')) + try: + article = articles[0] + except IndexError: + article = models.ScholarlyArticles() + if row.get('doi'): + article.doi = row.get('doi') + if row.get('year'): + article.year = row.get('year') + article.save() + return article + + +def load_journals(row): + attribs = ['journal_issns', 'journal_issn_l', 'journal_name'] + params = {} + + for att in attribs: + if row.get(att): + params[att] = row.get(att) + journals = models.Journals.objects.filter(**params) + try: + journal = journals[0] + except IndexError: + journal = models.Journals() + if row.get('journal_is_in_doaj'): + journal.journal_is_in_doaj = row.get('journal_is_in_doaj') + if row.get('journal_issns'): + journal.journal_issns = row.get('journal_issns') + if row.get('journal_issn_l'): + journal.journal_issn_l = row.get('journal_issn_l') + if row.get('journal_name'): + journal.journal_name = row.get('journal_name') + if row.get('publisher'): + journal.publisher = row.get('publisher') + journal.save() + + article = load_article(row) + article.journal = journal + article.save() + + +def get_one_contributor(author): + params = {} + if author.get('family'): + params['family'] = author.get('family') + if author.get('given'): + params['given'] = author.get('given') + if author.get('ORCID'): + params['orcid'] = author.get('ORCID') + contributors = models.Contributors.objects.filter(**params) + try: + contributor = contributors[0] + except IndexError: + contributor = models.Contributors() + if author.get('family'): + contributor.family = author.get('family') + if author.get('given'): + contributor.given = author.get('given') + if author.get('ORCID'): + contributor.orcid = author.get('ORCID') + if author.get('authenticated_orcid'): + contributor.authenticated_orcid = author.get('authenticated_orcid') + contributor.save() + return contributor + + +def load_contributors(row): + article = load_article(row) + + for author in row['z_authors']: + contributor = get_one_contributor(author) + article.contributors.add(contributor) + + +def load_affiliation(row): + for author in row['z_authors']: + if author.get('affiliation')[0].get('name'): + affiliations = models.Affiliations.objects.filter(name=author.get('affiliation')[0].get('name')) + try: + affiliation = affiliations[0] + except IndexError: + affiliation = models.Affiliations() + if author.get('affiliation')[0].get('name'): + affiliation.name = author.get('affiliation')[0].get('name') + affiliation.save() + contributor = get_one_contributor(author) + contributor.affiliation = affiliation + contributor.save() + + +def run(from_year=1900, resource_type='journal-article'): + #pagination + rawunpaywall = models.RawUnpaywall.objects.filter(year__gte=from_year, resource_type=resource_type) + for item in rawunpaywall: + if not item.is_paratext: + load_article(item.json) + load_journals(item.json) + load_contributors(item.json) + load_affiliation(item.json) + + +if __name__ == '__main__': + run() From 50ad4470154538ed905fd12a6261718c16d63d78 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 20 Jul 2022 14:46:19 -0300 Subject: [PATCH 27/41] Modificado o retorno de Contributors --- scholarly_articles/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scholarly_articles/models.py b/scholarly_articles/models.py index 87630a90..aa235572 100755 --- a/scholarly_articles/models.py +++ b/scholarly_articles/models.py @@ -57,10 +57,10 @@ class Contributors(models.Model): affiliation = models.ForeignKey(_("Affiliations"), on_delete=models.SET_NULL, max_length=255, null=True, blank=True) def __unicode__(self): - return self.family + return f"{self.family}, {self.given} ({self.orcid})" def __str__(self): - return self.family + return f"{self.family}, {self.given} ({self.orcid})" panels = [ FieldPanel('family'), From 0e744a225470e267a56b2acccc06139ba0de05bc Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 20 Jul 2022 14:47:03 -0300 Subject: [PATCH 28/41] Altera o nome do atributo "Harvesting date" --- scholarly_articles/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scholarly_articles/models.py b/scholarly_articles/models.py index aa235572..afa529f0 100755 --- a/scholarly_articles/models.py +++ b/scholarly_articles/models.py @@ -87,7 +87,7 @@ def __str__(self): class RawUnpaywall(models.Model): doi = models.CharField(_("DOI"), max_length=255, null=False, blank=False) - harvesting_creation = models.CharField(_("Harvesting"), max_length=255, null=False, blank=False) + harvesting_creation = models.CharField(_("Harvesting date"), max_length=255, null=False, blank=False) is_paratext = models.BooleanField(_("Paratext"), default=False, null=True, blank=True) year = models.CharField(_("Year"), max_length=255, null=True, blank=True) # unpaywall genre From 555f00639df97273656c0ef90c416f46cba4edb7 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 20 Jul 2022 14:47:32 -0300 Subject: [PATCH 29/41] Altera o separador de contributors --- scholarly_articles/wagtail_hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scholarly_articles/wagtail_hooks.py b/scholarly_articles/wagtail_hooks.py index d9aa65db..39db5a70 100644 --- a/scholarly_articles/wagtail_hooks.py +++ b/scholarly_articles/wagtail_hooks.py @@ -14,7 +14,7 @@ class ScholarlyArticlesAdmin(ModelAdmin): exclude_from_explorer = False # or True to exclude pages of this type from Wagtail's explorer view def all_contributors(self, obj): - return ", ".join([str(c) for c in obj.contributors.all()]) + return " | ".join([str(c) for c in obj.contributors.all()]) list_display = ( 'doi', From 7f40c2ce28ccf66cfcb3734f5face178df0cfae5 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 20 Jul 2022 14:48:10 -0300 Subject: [PATCH 30/41] =?UTF-8?q?Elimina=20"if's"=20desnecess=C3=A1rios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scholarly_articles/scripts/load_raw_unpaywall.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/scholarly_articles/scripts/load_raw_unpaywall.py b/scholarly_articles/scripts/load_raw_unpaywall.py index ac142d23..98f36726 100644 --- a/scholarly_articles/scripts/load_raw_unpaywall.py +++ b/scholarly_articles/scripts/load_raw_unpaywall.py @@ -14,14 +14,11 @@ def load(row): rawunpaywall.harvesting_creation = date.today() else: return - if row.get('is_paratext'): - rawunpaywall.is_paratext = row['is_paratext'] - if row.get('year'): - rawunpaywall.year = row['year'] - if row.get('genre'): - rawunpaywall.resource_type = row['genre'] - if row.get('updated'): - rawunpaywall.update = row['updated'][:10] + + rawunpaywall.is_paratext = row.get('is_paratext') + rawunpaywall.year = row.get('year') + rawunpaywall.resource_type = row.get('genre') + rawunpaywall.update = row.get('updated')[:10] rawunpaywall.json = row rawunpaywall.save() except KeyError: From 5b12fa6b47e28f2a3b8083e06334066f4cde8232 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 20 Jul 2022 14:48:46 -0300 Subject: [PATCH 31/41] =?UTF-8?q?Adiciona=20fun=C3=A7=C3=A3o=20para=20gera?= =?UTF-8?q?r=20dicion=C3=A1rio=20de=20par=C3=A2metros?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scholarly_articles/scripts/load_data_example.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scholarly_articles/scripts/load_data_example.py b/scholarly_articles/scripts/load_data_example.py index b81319d3..eac1657d 100644 --- a/scholarly_articles/scripts/load_data_example.py +++ b/scholarly_articles/scripts/load_data_example.py @@ -1,6 +1,14 @@ from scholarly_articles import models +def get_params(row, attribs): + params = {} + for att in attribs: + if row.get(att): + params[att] = row.get(att) + return params + + def load_article(row): articles = models.ScholarlyArticles.objects.filter(doi=row.get('doi')) try: From 64abcc1d0d257e432fbc3ee2a699f0acb1ef4e3d Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 20 Jul 2022 14:49:34 -0300 Subject: [PATCH 32/41] =?UTF-8?q?Modifica=20fun=C3=A7=C3=A3o=20load=5Farti?= =?UTF-8?q?cle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/load_data_example.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/scholarly_articles/scripts/load_data_example.py b/scholarly_articles/scripts/load_data_example.py index eac1657d..1bf6f165 100644 --- a/scholarly_articles/scripts/load_data_example.py +++ b/scholarly_articles/scripts/load_data_example.py @@ -15,12 +15,21 @@ def load_article(row): article = articles[0] except IndexError: article = models.ScholarlyArticles() - if row.get('doi'): - article.doi = row.get('doi') - if row.get('year'): - article.year = row.get('year') + article.doi = row.get('doi') + article.year = row.get('year') + article.journal = load_journals(row) + article.save() + for author in row['z_authors']: + contributor = get_one_contributor(author) + if author.get('affiliation'): + try: + aff = load_affiliation(author['affiliation'][0]['name']) + contributor.affiliation = aff + contributor.save() + except KeyError: + pass + article.contributors.add(contributor) article.save() - return article def load_journals(row): From d3d603126efd2e25c8256ad2405cd70498dd5ec8 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 20 Jul 2022 14:51:52 -0300 Subject: [PATCH 33/41] =?UTF-8?q?Modifica=20fun=C3=A7=C3=A3o=20load=5Farti?= =?UTF-8?q?cle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adiciona chamada para função get_params, elimina "if's" desnecessários e adiciona o retorno do objeto "journal". --- .../scripts/load_data_example.py | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/scholarly_articles/scripts/load_data_example.py b/scholarly_articles/scripts/load_data_example.py index 1bf6f165..0315280e 100644 --- a/scholarly_articles/scripts/load_data_example.py +++ b/scholarly_articles/scripts/load_data_example.py @@ -34,31 +34,20 @@ def load_article(row): def load_journals(row): attribs = ['journal_issns', 'journal_issn_l', 'journal_name'] - params = {} + params = get_params(row, attribs) - for att in attribs: - if row.get(att): - params[att] = row.get(att) journals = models.Journals.objects.filter(**params) try: journal = journals[0] except IndexError: journal = models.Journals() - if row.get('journal_is_in_doaj'): - journal.journal_is_in_doaj = row.get('journal_is_in_doaj') - if row.get('journal_issns'): - journal.journal_issns = row.get('journal_issns') - if row.get('journal_issn_l'): - journal.journal_issn_l = row.get('journal_issn_l') - if row.get('journal_name'): - journal.journal_name = row.get('journal_name') - if row.get('publisher'): - journal.publisher = row.get('publisher') + journal.journal_is_in_doaj = row.get('journal_is_in_doaj') + journal.journal_issns = row.get('journal_issns') + journal.journal_issn_l = row.get('journal_issn_l') + journal.journal_name = row.get('journal_name') + journal.publisher = row.get('publisher') journal.save() - - article = load_article(row) - article.journal = journal - article.save() + return journal def get_one_contributor(author): From 75a62fd6bbb4fb9db78e8827fbe0cc3ed531129e Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 20 Jul 2022 14:54:56 -0300 Subject: [PATCH 34/41] =?UTF-8?q?Modifica=20fun=C3=A7=C3=A3o=20get=5Fone?= =?UTF-8?q?=5Fcontributor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adiciona chamada para função get_params, adiciona o parâmetro 'affiliation' quando 'ORCID' não é disponível e elimina "if's" desnecessários. --- .../scripts/load_data_example.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/scholarly_articles/scripts/load_data_example.py b/scholarly_articles/scripts/load_data_example.py index 0315280e..d72951f7 100644 --- a/scholarly_articles/scripts/load_data_example.py +++ b/scholarly_articles/scripts/load_data_example.py @@ -51,26 +51,26 @@ def load_journals(row): def get_one_contributor(author): - params = {} - if author.get('family'): - params['family'] = author.get('family') - if author.get('given'): - params['given'] = author.get('given') + attribs = ['family', 'given'] + params = get_params(author, attribs) if author.get('ORCID'): params['orcid'] = author.get('ORCID') + elif author.get('affiliation')[0].get('name'): + try: + aff = models.Affiliations.objects.filter(name=author.get('affiliation')[0].get('name')) + params['affiliation'] = aff[0] + except IndexError: + pass + contributors = models.Contributors.objects.filter(**params) try: contributor = contributors[0] except IndexError: contributor = models.Contributors() - if author.get('family'): - contributor.family = author.get('family') - if author.get('given'): - contributor.given = author.get('given') - if author.get('ORCID'): - contributor.orcid = author.get('ORCID') - if author.get('authenticated_orcid'): - contributor.authenticated_orcid = author.get('authenticated_orcid') + contributor.family = author.get('family') + contributor.given = author.get('given') + contributor.orcid = author.get('ORCID') + contributor.authenticated_orcid = author.get('authenticated-orcid') contributor.save() return contributor From 222d897d063299f78a2938141a403f6fa5d82dfe Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 20 Jul 2022 14:55:35 -0300 Subject: [PATCH 35/41] =?UTF-8?q?Elimina=20fun=C3=A7=C3=A3o=20load=5Fcontr?= =?UTF-8?q?ibutors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scholarly_articles/scripts/load_data_example.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/scholarly_articles/scripts/load_data_example.py b/scholarly_articles/scripts/load_data_example.py index d72951f7..f7bed602 100644 --- a/scholarly_articles/scripts/load_data_example.py +++ b/scholarly_articles/scripts/load_data_example.py @@ -75,14 +75,6 @@ def get_one_contributor(author): return contributor -def load_contributors(row): - article = load_article(row) - - for author in row['z_authors']: - contributor = get_one_contributor(author) - article.contributors.add(contributor) - - def load_affiliation(row): for author in row['z_authors']: if author.get('affiliation')[0].get('name'): From a652c034ea940fa897a410bcbe810855e2b940fc Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 20 Jul 2022 14:56:46 -0300 Subject: [PATCH 36/41] =?UTF-8?q?Corrige=20fun=C3=A7=C3=A3o=20load=5Faffil?= =?UTF-8?q?iation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/load_data_example.py | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/scholarly_articles/scripts/load_data_example.py b/scholarly_articles/scripts/load_data_example.py index f7bed602..2ad8b73c 100644 --- a/scholarly_articles/scripts/load_data_example.py +++ b/scholarly_articles/scripts/load_data_example.py @@ -75,20 +75,17 @@ def get_one_contributor(author): return contributor -def load_affiliation(row): - for author in row['z_authors']: - if author.get('affiliation')[0].get('name'): - affiliations = models.Affiliations.objects.filter(name=author.get('affiliation')[0].get('name')) - try: - affiliation = affiliations[0] - except IndexError: - affiliation = models.Affiliations() - if author.get('affiliation')[0].get('name'): - affiliation.name = author.get('affiliation')[0].get('name') - affiliation.save() - contributor = get_one_contributor(author) - contributor.affiliation = affiliation - contributor.save() +def load_affiliation(affiliation_name): + if affiliation_name: + affiliations = models.Affiliations.objects.filter(name=affiliation_name) + try: + affiliation = affiliations[0] + except IndexError: + affiliation = models.Affiliations() + if affiliation_name: + affiliation.name = affiliation_name + affiliation.save() + return affiliation def run(from_year=1900, resource_type='journal-article'): From 0067d7e1d8c1d85a55ee2cb9045fdbc6c1882a89 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 20 Jul 2022 14:57:07 -0300 Subject: [PATCH 37/41] Elimina chamadas obsoletas --- scholarly_articles/scripts/load_data_example.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/scholarly_articles/scripts/load_data_example.py b/scholarly_articles/scripts/load_data_example.py index 2ad8b73c..bab86b06 100644 --- a/scholarly_articles/scripts/load_data_example.py +++ b/scholarly_articles/scripts/load_data_example.py @@ -94,9 +94,6 @@ def run(from_year=1900, resource_type='journal-article'): for item in rawunpaywall: if not item.is_paratext: load_article(item.json) - load_journals(item.json) - load_contributors(item.json) - load_affiliation(item.json) if __name__ == '__main__': From 6feaff3a44cc5b1ab680edc3e944292a2a7fa0c9 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 20 Jul 2022 16:09:59 -0300 Subject: [PATCH 38/41] Remove load_data_to_scholarly_articles.py --- .../{load_data_example.py => load_data.py} | 0 .../load_data_to_scholarly_articles.py | 27 ------------------- 2 files changed, 27 deletions(-) rename scholarly_articles/scripts/{load_data_example.py => load_data.py} (100%) delete mode 100644 scholarly_articles/scripts/load_data_to_scholarly_articles.py diff --git a/scholarly_articles/scripts/load_data_example.py b/scholarly_articles/scripts/load_data.py similarity index 100% rename from scholarly_articles/scripts/load_data_example.py rename to scholarly_articles/scripts/load_data.py diff --git a/scholarly_articles/scripts/load_data_to_scholarly_articles.py b/scholarly_articles/scripts/load_data_to_scholarly_articles.py deleted file mode 100644 index f14ec1a1..00000000 --- a/scholarly_articles/scripts/load_data_to_scholarly_articles.py +++ /dev/null @@ -1,27 +0,0 @@ -from scholarly_articles import models - -import json - - -def run(): - data = (list(json.loads(x) for x in open('scholarly_articles/scripts/examples.json'))) - for row in data: - contributor = models.Contributors.objects.get(orcid='0000-0002-4313-1997') - message = models.ScholarlyArticles.objects.create( - doi=row['doi'], - doi_url=row['doi_url'], - resource_type=row['genre'], - is_oa=row['is_oa'], - journal_is_in_doaj=row['journal_is_in_doaj'], - journal_issns=row['journal_issns'], - journal_issn_l=row['journal_issn_l'], - journal_name=row['journal_name'], - oa_status=row['oa_status'], - published_date=row['published_date'], - publisher=row['publisher'], - title=row['title'], - update=row['updated'], - year=row['year'], - article_json=str(row), - ) - message.contributors.add(contributor) From 60a321bbea077ca5172a8052440d438dd9731f91 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 20 Jul 2022 16:10:46 -0300 Subject: [PATCH 39/41] =?UTF-8?q?Trata=20exce=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scholarly_articles/scripts/load_raw_unpaywall.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scholarly_articles/scripts/load_raw_unpaywall.py b/scholarly_articles/scripts/load_raw_unpaywall.py index 98f36726..a67304e5 100644 --- a/scholarly_articles/scripts/load_raw_unpaywall.py +++ b/scholarly_articles/scripts/load_raw_unpaywall.py @@ -18,7 +18,10 @@ def load(row): rawunpaywall.is_paratext = row.get('is_paratext') rawunpaywall.year = row.get('year') rawunpaywall.resource_type = row.get('genre') - rawunpaywall.update = row.get('updated')[:10] + try: + rawunpaywall.update = row.get('updated')[:10] + except TypeError: + pass rawunpaywall.json = row rawunpaywall.save() except KeyError: From 79926f11c40cd615d0498832fe035b94c3c5e05c Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Wed, 20 Jul 2022 16:11:10 -0300 Subject: [PATCH 40/41] =?UTF-8?q?Altera=20nome=20da=20fun=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scholarly_articles/scripts/load_data.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scholarly_articles/scripts/load_data.py b/scholarly_articles/scripts/load_data.py index bab86b06..10d883e6 100644 --- a/scholarly_articles/scripts/load_data.py +++ b/scholarly_articles/scripts/load_data.py @@ -17,7 +17,7 @@ def load_article(row): article = models.ScholarlyArticles() article.doi = row.get('doi') article.year = row.get('year') - article.journal = load_journals(row) + article.journal = load_journal(row) article.save() for author in row['z_authors']: contributor = get_one_contributor(author) @@ -30,9 +30,10 @@ def load_article(row): pass article.contributors.add(contributor) article.save() + return article -def load_journals(row): +def load_journal(row): attribs = ['journal_issns', 'journal_issn_l', 'journal_name'] params = get_params(row, attribs) @@ -55,7 +56,7 @@ def get_one_contributor(author): params = get_params(author, attribs) if author.get('ORCID'): params['orcid'] = author.get('ORCID') - elif author.get('affiliation')[0].get('name'): + elif author.get('affiliation'): try: aff = models.Affiliations.objects.filter(name=author.get('affiliation')[0].get('name')) params['affiliation'] = aff[0] From 7be2ba33674c63d7ec95996b91e0f3b2b5a04953 Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Thu, 21 Jul 2022 09:13:52 -0300 Subject: [PATCH 41/41] =?UTF-8?q?Modifica=20a=20atribui=C3=A7=C3=A3o=20de?= =?UTF-8?q?=20afilia=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A atribuição é removida de load_article e inserida em get_one_contributor --- scholarly_articles/scripts/load_data.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scholarly_articles/scripts/load_data.py b/scholarly_articles/scripts/load_data.py index 10d883e6..5c717795 100644 --- a/scholarly_articles/scripts/load_data.py +++ b/scholarly_articles/scripts/load_data.py @@ -21,13 +21,6 @@ def load_article(row): article.save() for author in row['z_authors']: contributor = get_one_contributor(author) - if author.get('affiliation'): - try: - aff = load_affiliation(author['affiliation'][0]['name']) - contributor.affiliation = aff - contributor.save() - except KeyError: - pass article.contributors.add(contributor) article.save() return article @@ -72,6 +65,12 @@ def get_one_contributor(author): contributor.given = author.get('given') contributor.orcid = author.get('ORCID') contributor.authenticated_orcid = author.get('authenticated-orcid') + if author.get('affiliation'): + try: + aff = load_affiliation(author['affiliation'][0]['name']) + contributor.affiliation = aff + except KeyError: + pass contributor.save() return contributor