Skip to content

For Administrators#


B2SHARE is designed to be easy to use and currently supports access restrictions, registration of PIDs for any uploaded data object or file, additions of checksums and transition of all metadata information to the EUDAT metadata search. Importantly, B2SHARE enforces the inclusion of metadata accompanying the deposited data, so as to increase the value and facilitate sharing of your assets. Metadata is defined in metadata schemas and includes default mandatory fields as well as fields defined by the community under which the deposit is made. As a default, uploaded materials are published with Open Access. Although access can be restricted at the time of upload, EUDAT strongly encourages Open Access to research data in accordance with the policy of the European Commission. B2SHARE hosts a tool to help the user choose the correct licence for their data.

How to access the B2SHARE service#

B2SHARE is available from the following URL:


B2SHARE enforces the grouping of dataset publications and users through communities. Communities act as an organisation within the service to contain the datasets of a specific European community’s researchers and their members and to regulate publications through various policies.

Communities are easily identified on the landing pages of dataset publications in B2SHARE which provide a link to the community landing page itself. This landing page provides an overview of the community, the latest publications and the community metadata schema.

Metadata schema#

A community can define its own metadata schema fields on top of the default metadata schema defined by B2SHARE. This way a community is able to enforce any researcher that publishes data under that community to include additional information about the dataset uploaded.


Community policies enable a community to limit the access for users and enforce workflows. Policies can be changed at all times, but modifications to communities must be done by the B2SHARE administrators. Please contact EUDAT through the webform if your community wants to make changes.

Currently the following community policies are supported:

Members-only dataset publications
A community can make sure that only members of that community within B2SHARE can create new deposits that will be part of the community. This ensures that a select group of users is able to publish new datasets and enables for example data stewardship workflows. If this policy is disabled all users of a B2SHARE instance are able to publish under that community. For example, the EUDAT community is open to any user.
Publication review workflows
If required, a community can enable the publication review workflow to include a quality control step before a dataset becomes publicly findable after submitting it. If enabled, the community administrator(s) will be able to approve a publication based on its current metadata and included files. If declined, the original creator of the publication can make edits and resubmit it.

Known issues#

Although the review workflow policy can be enabled, it is currently not fully implemented and therefore not supported. In future updates of B2SHARE this will become available.



The superadministrator right allows a particular user to run any B2SHARE operation. Please be careful in assigning it.

All operations below will try to identify the user based on the email address. The user must have logged in into B2SHARE at least once, otherwise the email address will not be found in the database.

Add superadministrator rights:

$ b2share access allow -e superuser-access

Revoke superadministrator rights:

$ b2share access remove -e superuser-access

List existing rights:

$ b2share access show -e


B2SHARE has special command-line interface (CLI) commands to create and edit communities.

To list all communities, run:

$ b2share communities list

To create a community, make sure that B2SHARE_UI_PATH is defined in your environment and points to the b2share …/webui/app folder, and then run:

$ b2share communities create

The parameter must be the filename of an image file, already located in the $B2SHARE_UI_PATH/img/communities/ directory.

To edit a community, use the b2share communities edit command, with the necessary arguments. For more information run:

$ b2share communities edit –help

After a community name or description is updated, please make sure to also run the following command, which synchronizes the list of communities with the OAI-PMH declared sets:

$ b2share oai update_sets

Community Admin#

Each B2SHARE record is assigned to a community. A community administrator has certain special rights, like the right to edit a published record’s metadata and the right to add members to the community.

To assign the community administrator role for a user, do the following:

  1. Find the unique ID of the community, using the HTTP API, by going to https://YOUR_B2SHARE/api/communities (for example, the community id can be 8d963a295e19492b8cfe97da4f54fad2). The administrator role for this community will be com:COMMUNITY_ID:admin (please use the actual community id between colons).

    Run the following b2share command:

$ b2share roles add com:COMMUNITY_ID:admin

CLI for community management#

Create a community

$ b2share communities create NAME DESCRIPTION FILE

File can be some webformat logo.

Create a schema (look in demo/b2share_demo/data/communities for inspiration) $ b2share communities set_schema COMMUNITY SCHEMAFILE

Note: you can also look in tests/b2share_functional_tests/data/ Note: you can also do

$ b2share schemas block_schema list #to obtain ID $ b2share schemas block_schema_version_generate_json BLOCK_SCHEMA_ID

The last command generates a schema that you can adapt according to the rules of json_schema.

Fine-grained access controls#

Warning: Please only run the following commands if instructed to do so by a B2SHARE representative:

  1. Allow the community administrator role to update record metadata (this is enabled by default when a community is created):

$ b2share access allow -r com:COMMUNITY_ID:admin update-record-metadata -a ‘{“community”:”COMMUNITY_ID_WITH_DASHES”}’

For example:

$ b2share access allow -r com:8d963a295e19492b8cfe97da4f54fad2:admin update-record-metadata -a ‘{“community”:”8d963a29-5e19-492b-8cfe-97da4f54fad2”}’


Delete a published Record#

The Command Line Interface is currently missing a way to delete a record while leaving a tombstone. This will be fixed shortly but in the mean time here is how to delete a record. Note that the following method just marks the record as deleted, it still keeps it in the database just in case we want to revert the deletion. If a user access the record page after that he will see a 410 Gone error code meaning that a record existed before but was deleted.

First go to the page of the record you want to delete. Look at the URL, it should have the form https:///records/, where is a UUID. Note this UUID, it is the persistent identifier of this record, we will need it later.

Next we open the b2share shell. This shell executes python code as B2SHARE. Be careful as any action is performed directly on the database.

$ b2share shell

In the shell we will start by retrieving the record using the persistent identifier.

from invenio_pidstore.models import PersistentIdentifier from invenio_records_files.api import Record pid = PersistentIdentifier.get(‘b2rec’, ‘‘) record = Record.get_record(pid.object_uuid)

Where should be replaced with the record persistent identifier.

Now we retrieve all the other persistent identifiers attached to that record

pids = PersistentIdentifier.query.filter_by(object_type=’rec’, object_uuid=pid.object_uuid).all()

Now we mark the record as deleted.


We also need to mark all the persistent identifier as deleted so that the proper error message is returned to users. As this is python code you must keep the indentation as shown bellow.

for pid in pids: … pid.unassign() … pid.delete()

Finally we commit our changes to the database.

from invenio_db import db db.session.commit()

If you go the record webpage you should now see the 410 error message.

Note that we didn’t delete the deposit. Everything is kept in the database and can be reverted if need be. The files are not removed either.

Upgrade B2SHARE#

From version 2.1.0 on, B2SHARE can be upgraded by running

$ b2share upgrade run


Please visit our training site on GitHub for B2SHARE and other hands-on training material.

Our B2SHARE presentations offer training material for the service.

Support for B2SHARE is available via the EUDAT ticketing system through the webform.

If you have comments on this page, please submit them through the EUDAT support request system.

Under construction#