Link Search Menu Expand Document

Using the NFDI-MatWerk Metadata Repository

Just as with the NFDI-MatWerk Data Repository, without authentication only publically available metadata documents records and associated metadata can be accessed. The NFDI-MatWerk Metadata Repository also acts as a registry for an arbitrary number of Metadata Schemas. The metadata schemas are only accessible without authentication when they are published for all.

Browser based Graphical User Interface Method

  1. Open the homepage of the NFDI-MatWerk Metadata Repository by clicking on the Open Button on the box titled NFDI-MatWerk Metadata Repository. Hover the mouse pointer over the box to make the Open button to appear. dashboard

  2. The homepage of the NFDI-MatWerk Metadata Repository with all the publically available metadata schemas becomes visible. The repository hosts both schemas and metadata documents. By default, the Schema Management tab is opened, which lists the available metadata schemas. The Metadata Management tab next to it can be chosen to access the metadata documents on the repository. schema home page

Schema Management

  1. The schemas can be found on this tab by scrolling down the list or by using filters by clicking on the blue Show/Hide Filters button. See image above.

  2. There are two buttons to the right side of the schema listing. Click on the eye button to view the schema metadata. By default, the Schema Metadata tab is opened, which shows the administrative metadata of the schema according to the Datacite metadata schema. schema metadata tab

  3. Click on the Schema Document tab to see the JSON or XML Schema document in an interactive viewer. Older schema versions can be compared with the latest version by selecting the older schema version and by loading it in the interactive viewer. schema metadata doc

Metadata Management

  1. Switch to metadata management by clicking on the blue Metadata Management button on the top. metadata management

  2. Access individual metadata document records by clicking on the eye button on the right side. Similarly the edit button can be used to edit the record when logged in.

  3. Click on the eye button to access the record metadata. By default, the administrative metadata as per the DataCite metadata schema is displayed under the tab Record Metadata. record metadata

  4. Click on the Metadata Document tab to view the metadata document. The option to select the document version allows comparison between multiple verisons of the same metadata document through the interactive reader. metadata viewer

REST-API Method

REST-API calls can be made using the browser or the Command Line Interface (CLI).

Browser Method

List all the Schemas or Metadata Documents

List of all publically available schemas can be opened in the browser with the link https://matwerk.datamanager.kit.edu/api/v1/schemas.

Similarly list of all publically available metadata documents can be opened in the browser with the link https://matwerk.datamanager.kit.edu/api/v1/metadata.

List Specific Documents or Schemas

Each metadata document record and each schema record has a unique identifier (UID). If this UID is known, the record can be directly opened in the browser via the REST-API using its link. The link is of the format https://matwerk.datamanager.kit.edu/api/v1/metadata/<UID> for metadata records and https://matwerk.datamanager.kit.edu/api/v1/schemas/<UID> for schema records. For e.g., https://matwerk.datamanager.kit.edu/api/v1/metadata/5dbc874b-af11-4738-80cd-a4703d1f0333?version=1 yields a metadata record and https://matwerk.datamanager.kit.edu/api/v1/schemas/pp18_file?version=1 yields a schema record.

For better formatting of the JSON output, a plugin like JSON Peep for Safari is recommended.

Command Line Usage

Similarly, using the REST-API on the command line, either all the records can be listed or a single record can be accessed using its UID.

To begin, open the command prompt.

Install jq Command Line JSON Processor

The jq command line processor is a pre-requisite for many of the operations in this manual using the REST-API. It is used for working with the json outputs from the repositories from the command line itself. Please install jq for your system based on the instructions on the jq website, if not already installed. Normally this process involves just executing a single statement from the command line.

List all the Records
  1. Type curl -s 'https://matwerk.datamanager.kit.edu/api/v1/metadata'| jq for public metadata documents or curl -s 'https://matwerk.datamanager.kit.edu/api/v1/schemas'| jq for all public schemas and press enter

  2. Now all the records which are publically available will be visible. To view records for which you have special access, follow the instructions under the section Authenticate using the Command Line Interface

Access Specific records

To access specific records, their UIDs and version numbers need to be known. If this record or schema is not publically available, then the authorised users need to authenticate with an access token to access the particular metadata record or metadata schema.

Access Specific Metadata Schemas

It is possible to recall metadata schemas by using the command curl -s 'https://matwerk.datamanager.kit.edu/api/v1/schemas/<UID>?version=<version-number>', where <UID> and <version-number> are replaced by the required values. For e.g., curl -s 'https://matwerk.datamanager.kit.edu/api/v1/schemas/pp18_file?version=1' gives a metadata schema.

curl -s 'https://matwerk.datamanager.kit.edu/api/v1/schemas/pp18_file?version=1'
{
	"$schema": "https://json-schema.org/draft/2019-09/schema",
	"$id": "https://github.com/kit-data-manager/Metadata-Schemas-for-Materials-Science/blob/faeeb3856a267e10bd94c904a5e763ba3ad1e9fe/Reference_Dataset_Zenodo/pp18_file_schema.json",
	"type": "object",
	"description": "This JSON Schema describes the metadata of a single file in the reference dataset by BAM on Zenodo",
	"title": "Metadata Schema of BAM reference data (individual files)",
	"properties": {
		"links": {
			"type": "object",
			"properties": {
				"self": {
					"type": "string",
					"description": "(Required) - URL/ link to the document"
				}
			},
			"required": [
				"self"
			]
		},
		"checksum": {
			"type": "string",
			"description": "(Required) - checksum of the document"
		},
		"bucket": {
			"type": "string",
			"description": "(Required) - string indicating the dataset in which the document is contained"
		},
		"key": {
			"type": "string",
			"description": "(Required) - key of the document (File name)"
		},
		"type": {
			"type": "string",
			"description": "(Required) - File type of the document"
		},
		"size": {
			"type": "number",
			"description": "(Required) - Size of the document in bytes"
		}
	},
	"required": [
		"links",
		"checksum",
		"bucket",
		"key",
		"type",
		"size"
	]
}%
Access Specific Metadata Documents

It is possible to recall metadata records by using the command curl -s 'https://matwerk.datamanager.kit.edu/api/v1/metadata/<UID>?version=<version-number>', where <UID> and <version-number> are replaced by the required values. For e.g., curl -s 'https://matwerk.datamanager.kit.edu/api/v1/metadata/5dbc874b-af11-4738-80cd-a4703d1f0333?version=1' gives a metadata document.

curl -s 'https://matwerk.datamanager.kit.edu/api/v1/metadata/5dbc874b-af11-4738-80cd-a4703d1f0333?version=1'
{
    "links": {
      "self": "https://zenodo.org/api/files/2e8ca55b-dfe8-45fd-93a1-d79d5500528f/BCR-425_cert.pdf"
    },
    "checksum": "md5:6353de153830c0a28b3ffafedf59ec23",
    "bucket": "2e8ca55b-dfe8-45fd-93a1-d79d5500528f",
    "key": "BCR-425_cert.pdf",
    "type": "pdf",
    "size": 37659
  }%

Tipp

For power users, more documentation is available at the website of the MetaStore.