Update an existing schema document

Sometimes there are some typos in the registered schema or you want to extend it with optional fields the schema may be updated. Therefor its version will be incremented. Nevertheless all metadata documents already linked to the old version are still valid as the version is part of the reference. The metadata documents and their metadata stayed untouched.


Target Audience

  • Data Scientists

Ingredients

  • (local) MetaStore instance
  • Web Browser
  • Updated schema stored on local disc

Work Steps (Summary)

Update an existing schema document

  • Step 1: Download existing schema
  • Step 2: Update existing schema locally
  • Step 3: Upload updated schema

Step 1: Download schema

Right now editing schemas online is not supported. If the schema is no longer locally available it has to be downloaded from MetaStore. To do so you have to do the following steps:

  1. Press the 'View' icon of the wanted schema in the schema list.
  2. Copy 'Schema Document Uri' to the address bar of your browser.
  3. Right click page and select 'Save page as...' in the context menu.
List of Schema Records

Step 2: Update existing schema locally

Extend the existing schema by an optional field containing notes. The updated schema will look like this: This example results in the following schema using the first link given above:

{
    "$schema": "http://json-schema.org/draft-07/schema",
    "$id": "http://example.com/example.json",
    "type": "object",
    "title": "The root schema",
    "description": "The root schema comprises the entire JSON document.",
    "default": {},
    "examples": [
        {
            "author": "Last Name, First Name",
            "title": "My first document",
            "creation_date": "2022-04-11"
        }
    ],
    "required": [
        "author",
        "title",
        "creation_date"
    ],
    "properties": {
        "author": {
            "$id": "#/properties/author",
            "type": "string",
            "title": "Author:",
            "description": "The person who wrote the document.",
            "default": "",
            "examples": [
                "Last Name, First Name"
            ]
        },
        "title": {
            "$id": "#/properties/title",
            "type": "string",
            "title": "Title:",
            "description": "The title of the document.",
            "default": "",
            "examples": [
                "My first document"
            ]
        },
        "creation_date": {
            "$id": "#/properties/creation_date",
            "type": "string",
            "title": "Creation Date:",
            "description": "Creation date in the format 'YYYY-MM-DD'.",
            "default": "2022-01-01",
            "examples": [
                "2022-04-11"
            ]
        },
        "note": {
            "$id": "#/properties/note",
            "type": "string",
            "title": "Additional note:",
            "description": "Add some additional notes here. (optional)",
            "default": ""
        }
    },
    "additionalProperties": false
}

As the entry 'notes' is not defined in the 'required' array this entry may be optional. Store the new schema in a file named 'my_first_json_schema_version_2.json'.

Step 3: Upload updated schema

Click the pencil of the appropriate schema and a form will open

Update Schema Record Form

After selecting updated schema press 'Update Schema'. Now the version of the schema was increased.

Updated Schema List

The new form for the metadata documents now looks like this:

New Schema Record Form

Congratulations, you successfully updated your schema!