Skip to content

Commit dc893bc

Browse files
committed
add "review" dataset type #11747
1 parent 111e091 commit dc893bc

File tree

8 files changed

+327
-7
lines changed

8 files changed

+327
-7
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### New Dataset Type: Review
2+
3+
A new, experimental dataset type called "review" has been added. When this type is published, it will be sent to DataCite as "Other" for resourceTypeGeneral. See #11747.

doc/sphinx-guides/source/api/native-api.rst

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -926,8 +926,8 @@ You should expect an HTTP 200 ("OK") response and JSON indicating the database I
926926

927927
.. _api-create-dataset-with-type:
928928

929-
Create a Dataset with a Dataset Type (Software, etc.)
930-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
929+
Create a Dataset with a Dataset Type (Software, Workflow, Review, etc.)
930+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
931931

932932
By default, datasets are given the type "dataset" but if your installation had added additional types (see :ref:`api-add-dataset-type`), you can specify the type.
933933

@@ -981,8 +981,8 @@ Before calling the API, make sure the data files referenced by the ``POST``\ ed
981981

982982
.. _import-dataset-with-type:
983983

984-
Import a Dataset with a Dataset Type (Software, etc.)
985-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
984+
Import a Dataset with a Dataset Type (Software, Workflow, Review, etc.)
985+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
986986

987987
By default, datasets are given the type "dataset" but if your installation had added additional types (see :ref:`api-add-dataset-type`), you can specify the type.
988988

@@ -3816,7 +3816,27 @@ The fully expanded example above (without environment variables) looks like this
38163816
Add Dataset Type
38173817
^^^^^^^^^^^^^^^^
38183818
3819-
Note: Before you add any types of your own, there should be a single type called "dataset". If you add "software" or "workflow", these types will be sent to DataCite (if you use DataCite). Otherwise, the only functionality you gain currently from adding types is an entry in the "Dataset Type" facet but be advised that if you add a type other than "software" or "workflow", you will need to add your new type to your Bundle.properties file for it to appear in Title Case rather than lower case in the "Dataset Type" facet.
3819+
Note: Before you add any types of your own, there should be a single type called "dataset".
3820+
3821+
Adding certain dataset types will result in a value other than "Dataset" being sent to DataCite (if you use DataCite) as shown in the table below.
3822+
3823+
.. list-table:: Values sent to DataCite for resourceTypeGeneral by Dataset Type
3824+
:header-rows: 1
3825+
:stub-columns: 1
3826+
:align: left
3827+
3828+
* - Dataset Type
3829+
- Value sent to DataCite
3830+
* - dataset
3831+
- Dataset
3832+
* - software
3833+
- Software
3834+
* - workflow
3835+
- Workflow
3836+
* - review
3837+
- Other
3838+
3839+
Other than sending a different resourceTypeGeneral to DataCite, the only functionality you gain currently from adding types is an entry in the "Dataset Type" facet but be advised that if you add a type other than "software", "workflow", or "review", you will need to add your new type to your Bundle.properties file for it to appear in Title Case rather than lower case in the "Dataset Type" facet.
38203840
38213841
With all that said, we'll add a "software" type in the example below. This API endpoint is superuser only. The "name" of a type cannot be only digits. Note that this endpoint also allows you to add metadata blocks and available licenses for your new dataset type by adding "linkedMetadataBlocks" and/or "availableLicenses" arrays to your JSON.
38223842

doc/sphinx-guides/source/user/dataset-management.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,11 +824,11 @@ Dataset Types
824824

825825
.. note:: Development of the dataset types feature is ongoing. Please see https://github.com/IQSS/dataverse-pm/issues/307 for details.
826826

827-
Out of the box, all datasets have a dataset type of "dataset". Superusers can add additional types such as "software" or "workflow" using the :ref:`api-add-dataset-type` API endpoint.
827+
Out of the box, all datasets have a dataset type of "dataset". Superusers can add additional types such as "software", "workflow", or "review" using the :ref:`api-add-dataset-type` API endpoint.
828828

829829
Once more than one type appears in search results, a facet called "Dataset Type" will appear allowing you to filter down to a certain type.
830830

831-
If your installation is configured to use DataCite as a persistent ID (PID) provider, the appropriate type ("Dataset", "Software", "Workflow") will be sent to DataCite when the dataset is published for those three types.
831+
If your installation is configured to use DataCite as a persistent ID (PID) provider, the appropriate type ("Dataset", "Software", "Workflow", "Review") will be sent to DataCite when the dataset is published for those types.
832832

833833
Currently, specifying a type for a dataset can only be done via API and only when the dataset is created. The type can't currently be changed afterward. For details, see the following sections of the API guide:
834834

src/main/java/edu/harvard/iq/dataverse/DataCitation.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,8 +740,11 @@ public Map<String, String> getDataCiteMetadata() {
740740

741741
public JsonObject getCSLJsonFormat() {
742742
CSLItemDataBuilder itemBuilder = new CSLItemDataBuilder();
743+
// TODO consider making this a switch
743744
if (type.equals(DatasetType.DATASET_TYPE_SOFTWARE)) {
744745
itemBuilder.type(CSLType.SOFTWARE);
746+
} else if (type.equals(DatasetType.DATASET_TYPE_REVIEW)) {
747+
itemBuilder.type(CSLType.REVIEW);
745748
} else {
746749
itemBuilder.type(CSLType.DATASET);
747750
}

src/main/java/edu/harvard/iq/dataverse/dataset/DatasetType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class DatasetType implements Serializable {
3939
public static final String DATASET_TYPE_DATASET = "dataset";
4040
public static final String DATASET_TYPE_SOFTWARE = "software";
4141
public static final String DATASET_TYPE_WORKFLOW = "workflow";
42+
public static final String DATASET_TYPE_REVIEW = "review";
4243
public static final String DEFAULT_DATASET_TYPE = DATASET_TYPE_DATASET;
4344

4445
@Id

src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/XmlMetadataTemplate.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,8 @@ private void writeResourceType(XMLStreamWriter xmlw, DvObject dvObject) throws X
835835
case DatasetType.DATASET_TYPE_DATASET -> "Dataset";
836836
case DatasetType.DATASET_TYPE_SOFTWARE -> "Software";
837837
case DatasetType.DATASET_TYPE_WORKFLOW -> "Workflow";
838+
// "Other" for now but we might ask DataCite to support https://schema.org/CriticReview
839+
case DatasetType.DATASET_TYPE_REVIEW -> "Other";
838840
default -> "Dataset";
839841
};
840842
}

src/main/java/propertyFiles/Bundle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ passwd=Password
1313
dataset=Dataset
1414
software=Software
1515
workflow=Workflow
16+
review=Review
1617
# END dataset types
1718
datasets=Datasets
1819
newDataset=New Dataset

0 commit comments

Comments
 (0)