Skip to content

Commit

Permalink
Merge branch 'refs/heads/develop' into feat/10171-versions-smaller-re…
Browse files Browse the repository at this point in the history
…sponse

# Conflicts:
#	src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java
  • Loading branch information
johannes-darms committed Aug 19, 2024
2 parents 408172c + cf174b2 commit 29b30c2
Show file tree
Hide file tree
Showing 75 changed files with 1,344 additions and 303 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/shellspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
run: |
cd tests/shell
shellspec
shellspec-rocky8:
name: "RockyLinux 8"
shellspec-rocky9:
name: "RockyLinux 9"
runs-on: ubuntu-latest
container:
image: rockylinux/rockylinux:8
image: rockylinux/rockylinux:9
steps:
- uses: actions/checkout@v2
- name: Install shellspec
Expand Down
3 changes: 3 additions & 0 deletions doc/release-notes/10169-JSON-schema-validation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Improved JSON Schema validation for datasets

Enhanced JSON schema validation with checks for required and allowed child objects, type checking for field types including `primitive`, `compound` and `controlledVocabulary`. More user-friendly error messages to help pinpoint the issues in the dataset JSON. See [Retrieve a Dataset JSON Schema for a Collection](https://guides.dataverse.org/en/6.3/api/native-api.html#retrieve-a-dataset-json-schema-for-a-collection) in the API Guide and PR #10543.
3 changes: 3 additions & 0 deletions doc/release-notes/10726-dataverse-facets-api-extension.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
New optional query parameter "returnDetails" added to "dataverses/{identifier}/facets/" endpoint to include detailed information of each DataverseFacet.

New endpoint "datasetfields/facetables" that lists all facetable dataset fields defined in the installation.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Search API (/api/search) response will now include publicationStatuses in the Json response as long as the list is not empty

Example:
```javascript
"items": [
{
"name": "Darwin's Finches",
...
"publicationStatuses": [
"Unpublished",
"Draft"
],
(etc, etc)
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
New API endpoint "dataverses/{identifier}/userPermissions" for obtaining the user permissions on a dataverse.
3 changes: 3 additions & 0 deletions doc/release-notes/10758-rust-client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Rust API client library

An API client library for the Rust programming language is now available at https://github.com/gdcc/rust-dataverse and has been added to the [list of client libraries](https://dataverse-guide--10758.org.readthedocs.build/en/10758/api/client-libraries.html) in the API Guide. See also #10758.
9 changes: 9 additions & 0 deletions doc/release-notes/7068-reserve-file-pids.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Release Highlights

### Pre-Publish File DOI Reservation with DataCite

Dataverse installations using DataCite (or other persistent identifier (PID) Providers that support reserving PIDs) will be able to reserve PIDs for files when they are uploaded (rather than at publication time). Note that reserving file DOIs can slow uploads with large numbers of files so administrators may need to adjust timeouts (specifically any Apache "``ProxyPass / ajp://localhost:8009/ timeout=``" setting in the recommended Dataverse configuration).

## Major Use Cases

- Users will have DOIs/PIDs reserved for their files as part of file upload instead of at publication time. (Issue #7068, PR #7334)
3 changes: 3 additions & 0 deletions doc/release-notes/make-data-count-.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Counter Processor 1.05 Support

This release includes support for counter-processor-1.05 for processing Make Data Count metrics. If you are running Make Data Counts support, you should reinstall/reconfigure counter-processor as described in the latest Guides. (For existing installations, note that counter-processor-1.05 requires a Python3, so you will need to follow the full counter-processor install. Also note that if you configure the new version the same way, it will reprocess the days in the current month when it is first run. This is normal and will not affect the metrics in Dataverse.)
2 changes: 1 addition & 1 deletion doc/sphinx-guides/source/_static/util/counter_daily.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/bash

COUNTER_PROCESSOR_DIRECTORY="/usr/local/counter-processor-0.1.04"
COUNTER_PROCESSOR_DIRECTORY="/usr/local/counter-processor-1.05"
MDC_LOG_DIRECTORY="/usr/local/payara6/glassfish/domains/domain1/logs/mdc"

# counter_daily.sh
Expand Down
8 changes: 4 additions & 4 deletions doc/sphinx-guides/source/admin/make-data-count.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Architecture

Dataverse installations who would like support for Make Data Count must install `Counter Processor`_, a Python project created by California Digital Library (CDL) which is part of the Make Data Count project and which runs the software in production as part of their `DASH`_ data sharing platform.

.. _Counter Processor: https://github.com/CDLUC3/counter-processor
.. _Counter Processor: https://github.com/gdcc/counter-processor
.. _DASH: https://cdluc3.github.io/dash/

The diagram below shows how Counter Processor interacts with your Dataverse installation and the DataCite hub, once configured. Dataverse installations using Handles rather than DOIs should note the limitations in the next section of this page.
Expand Down Expand Up @@ -84,9 +84,9 @@ Configure Counter Processor

* Change to the directory where you installed Counter Processor.

* ``cd /usr/local/counter-processor-0.1.04``
* ``cd /usr/local/counter-processor-1.05``

* Download :download:`counter-processor-config.yaml <../_static/admin/counter-processor-config.yaml>` to ``/usr/local/counter-processor-0.1.04``.
* Download :download:`counter-processor-config.yaml <../_static/admin/counter-processor-config.yaml>` to ``/usr/local/counter-processor-1.05``.

* Edit the config file and pay particular attention to the FIXME lines.

Expand All @@ -99,7 +99,7 @@ Soon we will be setting up a cron job to run nightly but we start with a single

* Change to the directory where you installed Counter Processor.

* ``cd /usr/local/counter-processor-0.1.04``
* ``cd /usr/local/counter-processor-1.05``

* If you are running Counter Processor for the first time in the middle of a month, you will need create blank log files for the previous days. e.g.:

Expand Down
7 changes: 7 additions & 0 deletions doc/sphinx-guides/source/api/client-libraries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,10 @@ Ruby
https://github.com/libis/dataverse_api is a Ruby gem for Dataverse APIs. It is registered as a library on Rubygems (https://rubygems.org/search?query=dataverse).

The gem is created and maintained by the LIBIS team (https://www.libis.be) at the University of Leuven (https://www.kuleuven.be).

Rust
----

https://github.com/gdcc/rust-dataverse

The Rust Dataverse client is a comprehensive crate designed for seamless interaction with the Dataverse API. It facilitates essential operations such as collection, dataset, and file management. Additionally, the crate includes a user-friendly command-line interface (CLI) that brings the full functionality of the library to the command line. This project is actively maintained by `Jan Range <https://github.com/jr-1991>`_.
85 changes: 79 additions & 6 deletions doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,22 @@ The fully expanded example above (without environment variables) looks like this
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" "https://demo.dataverse.org/api/dataverses/root/facets"
By default, this endpoint will return an array including the facet names. If more detailed information is needed, we can set the query parameter ``returnDetails`` to ``true``, which will return the display name and id in addition to the name for each facet:

.. code-block:: bash
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export SERVER_URL=https://demo.dataverse.org
export ID=root
curl -H "X-Dataverse-key:$API_TOKEN" "$SERVER_URL/api/dataverses/$ID/facets?returnDetails=true"
The fully expanded example above (without environment variables) looks like this:

.. code-block:: bash
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" "https://demo.dataverse.org/api/dataverses/root/facets?returnDetails=true"
Set Facets for a Dataverse Collection
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -566,9 +582,7 @@ The fully expanded example above (without environment variables) looks like this
Retrieve a Dataset JSON Schema for a Collection
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Retrieves a JSON schema customized for a given collection in order to validate a dataset JSON file prior to creating the dataset. This
first version of the schema only includes required elements and fields. In the future we plan to improve the schema by adding controlled
vocabulary and more robust dataset field format testing:
Retrieves a JSON schema customized for a given collection in order to validate a dataset JSON file prior to creating the dataset:

.. code-block:: bash
Expand All @@ -593,8 +607,22 @@ While it is recommended to download a copy of the JSON Schema from the collectio
Validate Dataset JSON File for a Collection
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Validates a dataset JSON file customized for a given collection prior to creating the dataset. The validation only tests for json formatting
and the presence of required elements:
Validates a dataset JSON file customized for a given collection prior to creating the dataset.

The validation tests for:

- JSON formatting
- required fields
- typeClass must follow these rules:

- if multiple = true then value must be a list
- if typeClass = ``primitive`` the value object is a String or a List of Strings depending on the multiple flag
- if typeClass = ``compound`` the value object is a FieldDTO or a List of FieldDTOs depending on the multiple flag
- if typeClass = ``controlledVocabulary`` the values are checked against the list of allowed values stored in the database
- typeName validations (child objects with their required and allowed typeNames are configured automatically by the database schema). Examples include:

- dsDescription validation includes checks for typeName = ``dsDescriptionValue`` (required) and ``dsDescriptionDate`` (optional)
- datasetContact validation includes checks for typeName = ``datasetContactName`` (required) and ``datasetContactEmail``; ``datasetContactAffiliation`` (optional)

.. code-block:: bash
Expand Down Expand Up @@ -678,6 +706,29 @@ The fully expanded example above (without environment variables) looks like this
Note: You must have "Edit Dataverse" permission in the given Dataverse to invoke this endpoint.

Get User Permissions on a Dataverse
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This API call returns the permissions that the calling user has on a particular dataverse.

In particular, the user permissions that this API call checks, returned as booleans, are the following:

* Can add a dataverse
* Can add a dataset
* Can view the unpublished dataverse
* Can edit the dataverse
* Can manage the dataverse permissions
* Can publish the dataverse
* Can delete the dataverse

.. code-block:: bash
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export SERVER_URL=https://demo.dataverse.org
export ID=root
curl -H "X-Dataverse-key: $API_TOKEN" -X GET "$SERVER_URL/api/dataverses/$ID/userPermissions"
.. _create-dataset-command:

Create a Dataset in a Dataverse Collection
Expand Down Expand Up @@ -4690,6 +4741,28 @@ The fully expanded example above (without environment variables) looks like this
curl "https://demo.dataverse.org/api/metadatablocks/citation"
.. _dataset-fields-api:
Dataset Fields
--------------
List All Facetable Dataset Fields
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
List all facetable dataset fields defined in the installation.
.. code-block:: bash
export SERVER_URL=https://demo.dataverse.org
curl "$SERVER_URL/api/datasetfields/facetables"
The fully expanded example above (without environment variables) looks like this:
.. code-block:: bash
curl "https://demo.dataverse.org/api/datasetfields/facetables"
.. _Notifications:
Notifications
Expand Down Expand Up @@ -5106,7 +5179,7 @@ The fully expanded example above (without environment variables) looks like this
Reserve a PID
~~~~~~~~~~~~~
Reserved a PID for a dataset. A superuser API token is required.
Reserve a PID for a dataset if not yet registered, and, if FilePIDs are enabled, reserve any file PIDs that are not yet registered. A superuser API token is required.
.. note:: See :ref:`curl-examples-and-environment-variables` if you are unfamiliar with the use of export below.
Expand Down
16 changes: 16 additions & 0 deletions doc/sphinx-guides/source/api/search.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ https://demo.dataverse.org/api/search?q=trees
"identifier_of_dataverse":"dvbe69f5e1",
"name_of_dataverse":"dvbe69f5e1",
"citation":"Finch, Fiona; Spruce, Sabrina; Poe, Edgar Allen; Mulligan, Hercules, 2019, \"Darwin's Finches\", https://doi.org/10.70122/FK2/MB5VGR, Root, V3",
"publicationStatuses": [
"Published"
],
"storageIdentifier":"file://10.70122/FK2/MB5VGR",
"subjects":[
"Astronomy and Astrophysics",
Expand Down Expand Up @@ -207,6 +210,9 @@ In this example, ``show_relevance=true`` matches per field are shown. Available
"published_at":"2016-05-10T12:57:45Z",
"citationHtml":"Finch, Fiona, 2016, \"Darwin's Finches\", <a href=\"http://dx.doi.org/10.5072/FK2/G2VPE7\" target=\"_blank\">http://dx.doi.org/10.5072/FK2/G2VPE7</a>, Root Dataverse, V1",
"citation":"Finch, Fiona, 2016, \"Darwin's Finches\", http://dx.doi.org/10.5072/FK2/G2VPE7, Root Dataverse, V1",
"publicationStatuses": [
"Published"
],
"matches":[
{
"authorName":{
Expand Down Expand Up @@ -297,6 +303,9 @@ The above example ``fq=publicationStatus:Published`` retrieves only "RELEASED" v
"identifier_of_dataverse": "rahman",
"name_of_dataverse": "mdmizanur rahman Dataverse collection",
"citation": "Finch, Fiona, 2019, \"Darwin's Finches\", https://doi.org/10.70122/FK2/GUAS41, Demo Dataverse, V1",
"publicationStatuses": [
"Published"
],
"storageIdentifier": "file://10.70122/FK2/GUAS41",
"subjects": [
"Medicine, Health and Life Sciences"
Expand Down Expand Up @@ -330,6 +339,9 @@ The above example ``fq=publicationStatus:Published`` retrieves only "RELEASED" v
"identifier_of_dataverse": "demo",
"name_of_dataverse": "Demo Dataverse",
"citation": "Finch, Fiona, 2020, \"Darwin's Finches\", https://doi.org/10.70122/FK2/7ZXYRH, Demo Dataverse, V1",
"publicationStatuses": [
"Published"
],
"storageIdentifier": "file://10.70122/FK2/7ZXYRH",
"subjects": [
"Medicine, Health and Life Sciences"
Expand Down Expand Up @@ -386,6 +398,10 @@ The above example ``metadata_fields=citation:*`` returns under "metadataBlocks"
"identifier_of_dataverse": "Sample_data",
"name_of_dataverse": "Sample Data",
"citation": "Métropole, 2021, \"JDD avec GeoJson 2021-07-13T10:23:46.409Z\", https://doi.org/10.5072/FK2/GIWCKB, Root, DRAFT VERSION",
"publicationStatuses": [
"Unpublished",
"Draft"
],
"storageIdentifier": "file://10.5072/FK2/GIWCKB",
"subjects": [
"Other"
Expand Down
1 change: 1 addition & 0 deletions doc/sphinx-guides/source/contributor/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The primary codebase and issue tracker for Dataverse is <https://github.com/IQSS
- <https://github.com/IQSS/dataverse-client-javascript> (TypeScript)
- <https://github.com/gdcc/dataverse-previewers> (Javascript)
- <https://github.com/gdcc/pyDataverse> (Python)
- <https://github.com/gdcc/rust-dataverse> (Rust)
- <https://github.com/gdcc/dataverse-ansible> (Ansible)
- <https://github.com/gdcc/dv-metrics> (Javascript)

Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx-guides/source/contributor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ If you speak multiple languages, you are very welcome to help us translate Datav

## Code

Dataverse is open source and we love code contributions. Developers are not limited to the main Dataverse code in this git repo. We have projects in C, C++, Go, Java, Javascript, Julia, PHP, Python, R, Ruby, TypeScript and more. To get started, please see the following pages:
Dataverse is open source and we love code contributions. Developers are not limited to the main Dataverse code in this git repo. We have projects in C, C++, Go, Java, Javascript, Julia, PHP, Python, R, Ruby, Rust, TypeScript and more. To get started, please see the following pages:

```{toctree}
:maxdepth: 1
Expand Down
6 changes: 3 additions & 3 deletions doc/sphinx-guides/source/developers/make-data-count.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Make Data Count
===============

Support for Make Data Count is a feature of the Dataverse Software that is described in the :doc:`/admin/make-data-count` section of the Admin Guide. In order for developers to work on the feature, they must install Counter Processor, a Python 3 application, as described below. Counter Processor can be found at https://github.com/CDLUC3/counter-processor
Support for Make Data Count is a feature of the Dataverse Software that is described in the :doc:`/admin/make-data-count` section of the Admin Guide. In order for developers to work on the feature, they must install Counter Processor, a Python 3 application, as described below. Counter Processor can be found at https://github.com/gdcc/counter-processor

.. contents:: |toctitle|
:local:
Expand Down Expand Up @@ -49,7 +49,7 @@ Once you are done with your configuration, you can run Counter Processor like th

``su - counter``

``cd /usr/local/counter-processor-0.1.04``
``cd /usr/local/counter-processor-1.05``

``CONFIG_FILE=counter-processor-config.yaml python39 main.py``

Expand Down Expand Up @@ -82,7 +82,7 @@ Second, if you are also sending your SUSHI report to Make Data Count, you will n

``curl -H "Authorization: Bearer $JSON_WEB_TOKEN" -X DELETE https://$MDC_SERVER/reports/$REPORT_ID``

To get the ``REPORT_ID``, look at the logs generated in ``/usr/local/counter-processor-0.1.04/tmp/datacite_response_body.txt``
To get the ``REPORT_ID``, look at the logs generated in ``/usr/local/counter-processor-1.05/tmp/datacite_response_body.txt``

To read more about the Make Data Count api, see https://github.com/datacite/sashimi

Expand Down
Loading

0 comments on commit 29b30c2

Please sign in to comment.