From 5c847f12f1e852617d9b2a66fc19bbd7b456728b Mon Sep 17 00:00:00 2001 From: Eli Chadwick Date: Fri, 28 Jun 2024 15:57:10 +0100 Subject: [PATCH] rename mapping-notes and make its purpose clearer --- README.md | 4 +++- docs/{mapping-notes.md => all-mappings.md} | 8 ++++++-- docs/mapping.md | 8 ++++---- 3 files changed, 13 insertions(+), 7 deletions(-) rename docs/{mapping-notes.md => all-mappings.md} (87%) diff --git a/README.md b/README.md index e4cc0bc..cee61b6 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,9 @@ After verifying and adjusting the DataCite file, use the `-d` option to tell the The project aims at decoupling the definition of the mapping between RO-Crates and DataCite from code. This means, that users can quickly change/add/remove mapping rules without code changes. -For more information, see [Mapping](docs/mapping.md). +To find out how each piece of RO-Crate metadata is converted to DataCite, see [How RO-Crate metadata is mapped to DataCite](docs/all-mappings.md). + +For technical details on the implementation, see [Mapping](docs/mapping.md). ## Results diff --git a/docs/mapping-notes.md b/docs/all-mappings.md similarity index 87% rename from docs/mapping-notes.md rename to docs/all-mappings.md index 51319d0..6f0e733 100644 --- a/docs/mapping-notes.md +++ b/docs/all-mappings.md @@ -1,4 +1,8 @@ -# Notes on Mapping +# How RO-Crate metadata is mapped to DataCite + +DataCite is the data format used by InvenioRDM when uploading a record through the API. This document describes how different parts of the RO-Crate metadata are converted into the DataCite format. + +Note that RO-Crate and DataCite each contain features that the other does not have, so it is difficult to create a fully accurate mapping and some information may be lost along the way. You should always check the outputs to ensure their accuracy before publishing your record. ## Mapping of resource type @@ -23,7 +27,7 @@ - in case `name` does not exist, it falls back to using the value of `@alternativeName` - in case neither of those exist, `title` is assigned `:unkn` -## Mapping of additional title +## Mapping of additional title - `@alternativeName` is mapped to `additional_titles` - a new array entry in `additional_titles` is added diff --git a/docs/mapping.md b/docs/mapping.md index e5cd7f3..c0f7381 100644 --- a/docs/mapping.md +++ b/docs/mapping.md @@ -4,7 +4,7 @@ The project aims at decoupling the definition of the mapping between RO-Crates a Relative to the root folder of the package `src/rocrate_inveniordm/`, the mapping is implemented in `mapping/converter.py`. The mapping rules are defined in `mapping/mapping.json`. Processing functions and condition functions are defined in `mapping/processing_functions.py` and `condition_functions.py`, respectively. -A textual description including shortcomings and assumptions of the mapping can be found in [mapping-notes.md](./mapping-notes.md). +A human-friendly description of all mappings implemented, including shortcomings and assumptions, can be found in [all-mappings.md](./all-mappings.md). ## Mapping format @@ -89,7 +89,7 @@ Specifying the DataCite field is done in a similar fashion. ### Processing functions -Processing functions are functions that are applied to the raw source value extracted from the RO-Crates metadata file. When a processing function wants to be applied to a mapping rule, the `processing` entry is assigned the value `$`. The function then needs to be implemented in `/mapping/processing_functions.py`. +Processing functions are functions that are applied to the raw source value extracted from the RO-Crates metadata file. When a processing function wants to be applied to a mapping rule, the `processing` entry is assigned the value `$`. The function then needs to be implemented in `mapping/processing_functions.py`. **Example** @@ -103,7 +103,7 @@ Given is the following mapping of the author type: } ``` -The value `Person` in the RO-Crates metadata file should be mapped to the value `personal`. Also, the value `Organization` should be mapped to the value `organizational`. The function `authorProcessing` can now be implemented in `/mapping/processing_functions.py` to achieve this logic. Note that the value of the `processing` key in the mapping rule and the function name need to coincide: +The value `Person` in the RO-Crates metadata file should be mapped to the value `personal`. Also, the value `Organization` should be mapped to the value `organizational`. The function `authorProcessing` can now be implemented in `mapping/processing_functions.py` to achieve this logic. Note that the value of the `processing` key in the mapping rule and the function name need to coincide: ```py def authorProcessing(value): @@ -137,7 +137,7 @@ The mapping of DOI identifiers looks as follows: } ``` -The mapping should only be executed, if the value in the `identifier` field in the RO-Crates metadata file is indeed a DOI identifier. This check can be achieved by defining the `doi` function in `/mapping/condition_functions.py`. Note that the value of the `onlyIf` key in the mapping rule and the function name need to coincide: +The mapping should only be executed, if the value in the `identifier` field in the RO-Crates metadata file is indeed a DOI identifier. This check can be achieved by defining the `doi` function in `mapping/condition_functions.py`. Note that the value of the `onlyIf` key in the mapping rule and the function name need to coincide: ```py def doi(value):