From 19a09a0c43f188b03c304ed9054d4c1f97267cb0 Mon Sep 17 00:00:00 2001 From: GaziYucel Date: Tue, 30 Apr 2024 10:48:17 +0200 Subject: [PATCH 1/3] skip citation if doi is empty (wikidata) --- classes/External/Wikidata/Inbound.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/classes/External/Wikidata/Inbound.php b/classes/External/Wikidata/Inbound.php index b35975f4..9012a942 100755 --- a/classes/External/Wikidata/Inbound.php +++ b/classes/External/Wikidata/Inbound.php @@ -83,9 +83,10 @@ public function execute(): bool if (!empty($citation->wikidataId)) continue; - $citation = $this->processCitation($citation); - - $citation->wikidataId = Wikidata::removePrefix($citation->wikidataId); + if(!empty($citation->doi)){ + $citation = $this->processCitation($citation); + $citation->wikidataId = Wikidata::removePrefix($citation->wikidataId); + } $citations[$i] = $citation; } From b2fd9ea175c2c0c1227847b2ece03a65eb9806ca Mon Sep 17 00:00:00 2001 From: GaziYucel Date: Tue, 30 Apr 2024 10:48:29 +0200 Subject: [PATCH 2/3] camelCase mappings --- .../External/OpenAlex/DataModels/Mappings.php | 26 +++++++++---------- .../External/Orcid/DataModels/Mappings.php | 4 +-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/classes/External/OpenAlex/DataModels/Mappings.php b/classes/External/OpenAlex/DataModels/Mappings.php index 7e0a4f5d..0f6759df 100755 --- a/classes/External/OpenAlex/DataModels/Mappings.php +++ b/classes/External/OpenAlex/DataModels/Mappings.php @@ -28,18 +28,18 @@ final class Mappings public static function getWork(): array { return [ - 'openalex_id' => 'id', + 'openAlexId' => 'id', 'title' => 'title', - 'publication_year' => 'publication_year', - 'publication_date' => 'publication_date', + 'publicationYear' => 'publication_year', + 'publicationDate' => 'publication_date', 'type' => 'type_crossref', 'volume' => ['biblio', 'volume'], 'issue' => ['biblio', 'issue'], - 'first_page' => ['biblio', 'first_page'], - 'last_page' => ['biblio', 'last_page'], - 'journal_name' => ['locations', 0,'source', 'display_name'], - 'journal_issn_l' => ['locations', 0,'source', 'issn_l'], - 'journal_publisher' => ['locations', 0,'source', 'host_organization_name'], + 'firstPage' => ['biblio', 'first_page'], + 'lastPage' => ['biblio', 'last_page'], + 'journalName' => ['locations', 0,'source', 'display_name'], + 'journalIssnL' => ['locations', 0,'source', 'issn_l'], + 'journalPublisher' => ['locations', 0,'source', 'host_organization_name'], 'authors' => null // [ AuthorModel, ... ] ]; } @@ -53,11 +53,11 @@ public static function getWork(): array public static function getAuthor(): array { return [ - 'orcid_id' => ['author', 'orcid'], - 'display_name' => ['author', 'display_name'], - 'given_name' => ['author', 'display_name'], - 'family_name' => ['author', 'display_name'], - 'openalex_id' => ['author', 'id'] + 'orcid' => ['author', 'orcid'], + 'displayName' => ['author', 'display_name'], + 'givenName' => ['author', 'display_name'], + 'familyName' => ['author', 'display_name'], + 'openAlexId' => ['author', 'id'] ]; } } diff --git a/classes/External/Orcid/DataModels/Mappings.php b/classes/External/Orcid/DataModels/Mappings.php index c6c7778d..5fb8b672 100755 --- a/classes/External/Orcid/DataModels/Mappings.php +++ b/classes/External/Orcid/DataModels/Mappings.php @@ -25,8 +25,8 @@ final class Mappings public static function getAuthor(): array { return [ - 'given_name' => ['person', 'name', 'given-names', 'value'], - 'family_name' => ['person', 'name', 'family-name', 'value'] + 'givenName' => ['person', 'name', 'given-names', 'value'], + 'familyName' => ['person', 'name', 'family-name', 'value'] ]; } } From b130ba2875a51837056d91ed9ec8f831b0c22780 Mon Sep 17 00:00:00 2001 From: GaziYucel Date: Tue, 30 Apr 2024 13:48:51 +0200 Subject: [PATCH 3/3] documentation updated --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b16fd356..1c732bec 100755 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Citation Manager for OJS - [Task scheduler](#task-scheduler) - [Deposit to OpenCitations](#deposit-to-opencitations) - [Deposit Wikidata.org](#deposit-wikidataorg) +- [Screenshot(s) / screen recording(s)](#screenshots--screen-recordings) - [Install and configure the plugin](#install-and-configure-the-plugin) - [Requirements](#requirements) - [Install with Git](#install-with-git) @@ -22,6 +23,9 @@ Citation Manager for OJS - [Notes](#notes) - [Debugging](#debugging) - [Tests](#tests) +- [Data Models](#data-models) + - [Models for citations](#models-for-citations) + - [Metadata of OJS models](#metadata-of-ojs-models) - [Contribute](#contribute) - [License](#license) @@ -127,6 +131,12 @@ Only items which have unique identifiers will be deposited to Wikidata. - published in ([P1433](https://www.wikidata.org/wiki/Property:P1433)) [2. journal] - cites work ([P2860](https://www.wikidata.org/wiki/Property:P2860)) [3. cited article] +# Screenshot(s) / screen recording(s) + +![screen recording workflowTab edit.gif](.project/screenrecordings/workflowTab-edit-ojs340.gif) +![screenshot settings](.project/screenshots/settings-ojs340.png) +![screenshot settings](.project/screenshots/frontend-ojs340.png) + # Install and configure the plugin ## Requirements @@ -201,18 +211,8 @@ If you have none please register one through https://www.wikidata.org/w/index.ph - At "Wikidata bot password", fill in the password which you have saved previously - Click Save -# Screenshot(s) / screen recording(s) - -![screen recording workflowTab edit.gif](.project/screenrecordings/workflowTab-edit-ojs340.gif) -![screenshot settings](.project/screenshots/settings-ojs340.png) -![screenshot settings](.project/screenshots/frontend-ojs340.png) - # Development -- Fork the repository -- Make your changes -- Open a PR with your changes - ## Structure .