Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev 3 4 0 #177

Merged
merged 3 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading