Skip to content

Commit

Permalink
Remap oai_dc fields dc:type, dc:date, and dc:rights #8129.
Browse files Browse the repository at this point in the history
The `oai_dc` export and harvesting format has had the following fields remapped:

- dc:type was mapped to the field "Kind of Data". Now it is hard-coded to the word "Dataset".
- dc:date was mapped to the field "Production Date" when available and otherwise to "Publication Date". Now it is mapped only to the field "Publication Date".
- dc:rights was not mapped to anything. Now it is mapped (when available) to terms of use, restrictions, and license.
  • Loading branch information
pdurbin committed Aug 1, 2024
1 parent 0d27957 commit b3e4635
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 6 deletions.
11 changes: 11 additions & 0 deletions doc/release-notes/8129-harvesting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Remap oai_dc export and harvesting format fields: dc:type, dc:date, and dc:rights

The `oai_dc` export and harvesting format has had the following fields remapped:

- dc:type was mapped to the field "Kind of Data". Now it is hard-coded to the word "Dataset".
- dc:date was mapped to the field "Production Date" when available and otherwise to "Publication Date". Now it is mapped only to the field "Publication Date".
- dc:rights was not mapped to anything. Now it is mapped (when available) to terms of use, restrictions, and license.

As these are backward incompatible changes, they have been noted in the [API changelog](https://guides.dataverse.org/en/latest/api/changelog.html).

For more information, please see issue #8129.
9 changes: 9 additions & 0 deletions doc/sphinx-guides/source/api/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ This API changelog is experimental and we would love feedback on its usefulness.
:local:
:depth: 1

v6.4
----

- For the ``oai_dc`` metadata export and harvesting (OAI-PMH) format:

- dc:type was mapped to the field "Kind of Data". Now it is hard-coded to the word "Dataset".
- dc:date was mapped to the field "Production Date" when available and otherwise to "Publication Date". Now it is mapped only to the field "Publication Date".
- dc:rights was not mapped to anything. Now it is mapped (when available) to terms of use, restrictions, and license.

v6.3
----

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,21 +176,55 @@ private static void createOAIDC(XMLStreamWriter xmlw, DatasetDTO datasetDto, Str

writeFullElementList(xmlw, dcFlavor+":"+"language", dto2PrimitiveList(version, DatasetFieldConstant.language));

String date = dto2Primitive(version, DatasetFieldConstant.productionDate);
if (date == null) {
date = datasetDto.getPublicationDate();
}
writeFullElement(xmlw, dcFlavor+":"+"date", date);
/**
* dc:date. "I suggest changing the Dataverse / DC Element (oai_dc)
* mapping, so that dc:date is mapped with Publication Date. This is
* also in line with citation recommendations. The publication date is
* the preferred date when citing research data; see, e.g., page 12 in
* The Tromsø Recommendations for Citation of Research Data in
* Linguistics; https://doi.org/10.15497/rda00040 ." --
* https://github.com/IQSS/dataverse/issues/8129
*/
writeFullElement(xmlw, dcFlavor+":"+"date", datasetDto.getPublicationDate());

writeFullElement(xmlw, dcFlavor+":"+"contributor", dto2Primitive(version, DatasetFieldConstant.depositor));

writeContributorElement(xmlw, version, dcFlavor);

writeFullElementList(xmlw, dcFlavor+":"+"relation", dto2PrimitiveList(version, DatasetFieldConstant.relatedDatasets));

writeFullElementList(xmlw, dcFlavor+":"+"type", dto2PrimitiveList(version, DatasetFieldConstant.kindOfData));
/**
* dc:type. "Dublin Core (see
* https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/terms/type
* ) recommends “to use a controlled vocabulary such as the DCMI Type
* Vocabulary” for dc:type." So we hard-coded it to "Dataset". See
* https://github.com/IQSS/dataverse/issues/8129
*/
writeFullElement(xmlw, dcFlavor+":"+"type", "Dataset");

writeFullElementList(xmlw, dcFlavor+":"+"source", dto2PrimitiveList(version, DatasetFieldConstant.dataSources));

/**
* dc:rights. As stated in https://github.com/IQSS/dataverse/issues/8129
* "A correct value in this field would enable BASE to indicate the
* degree of Open Access (see more information at
* https://www.base-search.net/about/en/faq_oai.php#dc-rights ). For
* datasets without access restriction, the dc:rights field could look
* like this: info:eu-repo/semantics/openAccess (see more information at
* https://guidelines.openaire.eu/en/latest/data/field_rights.html#rightsuri-ma)
* ."
*
* Instead of a single instance of dc:rights, we are including multiple.
* We borrow logic from the `createDC` (dcterms) method but we are using
* only dc:rights rather than also using dc:license because dc:license
* is not one of the 15 fields defined by Simple Dublin Core.
*/
LicenseDTO licDTO = version.getLicense();
if(licDTO != null) {
writeFullElement(xmlw, dcFlavor+":"+"rights", licDTO.getName());
}
writeFullElement(xmlw, dcFlavor+":"+"rights", version.getTermsOfUse());
writeFullElement(xmlw, dcFlavor+":"+"rights", version.getRestrictions());


}
Expand Down

0 comments on commit b3e4635

Please sign in to comment.