Skip to content

Commit

Permalink
Merge pull request #177 from GaziYucel/dev-3_4_0
Browse files Browse the repository at this point in the history
Dev 3 4 0
  • Loading branch information
GaziYucel authored Apr 30, 2024
2 parents 00985da + b130ba2 commit f3b386e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 28 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

.
Expand Down
26 changes: 13 additions & 13 deletions classes/External/OpenAlex/DataModels/Mappings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, ... ]
];
}
Expand All @@ -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']
];
}
}
4 changes: 2 additions & 2 deletions classes/External/Orcid/DataModels/Mappings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']
];
}
}
7 changes: 4 additions & 3 deletions classes/External/Wikidata/Inbound.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f3b386e

Please sign in to comment.