Skip to content

Commit

Permalink
names: add ORCiD public data sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Romero Caatro authored and ntarocco committed Aug 27, 2024
1 parent 8537722 commit df8b0ef
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions docs/customize/vocabularies/names.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,81 @@ invenio vocabularies import \
--vocabulary names \
--origin /path/to/ORCID_2021_10_summaries.tar.gz
```

### Using ORCiD Public Data Sync

*Introduced in InvenioRDM v13*

#### Installing Required Dependencies

First, you should install the required `s3fs` dependency. This can be achieved by adding the following to the `Pipfile` in your instance:

```toml
[packages]
...
invenio-vocabularies = {extras = ["s3fs"]}
...
```

#### Configuring ORCiD Public Data Sync

InvenioRDM supports loading names using the ORCiD Public Data Sync. To set this up, you need to create a definition file named `names-orcid.yaml` with the following content:

```yaml
names:
readers:
- type: orcid-data-sync
- type: xml
transformers:
- type: orcid
writers:
- type: async
args:
writer:
type: names-service
batch_size: 1000
write_many: true
```

#### Customizing the Sync Interval

Optionally, you can specify the sync interval for the orcid-data-sync reader by adding arguments. If not specified, the default sync interval is one day. The supported arguments for defining the interval are:

• years
• months
• weeks
• days
• hours
• minutes
• seconds
• microseconds

Here is an example of how to set a custom sync interval of 10 days:

```yaml
names:
readers:
- type: orcid-data-sync
args:
since:
days: 10
- type: xml
transformers:
- type: orcid
writers:
- type: async
args:
writer:
type: names-service
batch_size: 1000
write_many: true
```
#### Running the Import Command

To run an import using the names-orcid.yaml file, use the vocabularies import command as shown below:

```shell
invenio vocabularies import \
--vocabulary names \
--filepath ./names-orcid.yaml
```

0 comments on commit df8b0ef

Please sign in to comment.