Skip to content

Core Schema Types

The core schema types are classified into primitive and abstract outlined below.

Primitive

The primitive schemas are derived from the default JSON primitives and do not have physical meaning.

1D Data Series

Series is an array of arrays containing numbers or strings. It is used to store data

{
    "$id": "core/primitive/1d-data-series",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "1 dimension data series schema",
    "type": "array",
    "items": {
        "type": "array",
        "minItems": 1,
        "items": {
            "type": [
                "number",
                "string"
            ]
        }
    }
}
[
    [
        0,
        0.5,
        1
    ],
    [
        0,
        2.5,
        5
    ]
]

3D Lattice

Holds the information about the three-dimensional periodic lattice specified through lengths and angles between lattice vectors.

{
    "$id": "core/primitive/3d-lattice",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "3 dimensional lattice schema",
    "type": "object",
    "properties": {
        "a": {
            "description": "length of the first lattice vector",
            "type": "number"
        },
        "b": {
            "description": "length of the second lattice vector",
            "type": "number"
        },
        "c": {
            "description": "length of the third lattice vector",
            "type": "number"
        },
        "alpha": {
            "description": "angle between first and second lattice vector",
            "type": "number"
        },
        "beta": {
            "description": "angle between second and third lattice vector",
            "type": "number"
        },
        "gamma": {
            "description": "angle between first and third lattice vector",
            "type": "number"
        }
    },
    "required": [
        "a",
        "b",
        "c",
        "alpha",
        "beta",
        "gamma"
    ]
}
{
    "a": 5.14,
    "alpha": 90.0,
    "b": 5.14,
    "beta": 90.0,
    "c": 5.14,
    "gamma": 90.0
}

Axis

Used for plotting. It has a label to describe the type of data on the axis and units to describe the units of the data.

{
    "$id": "core/primitive/axis",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "axis schema",
    "type": "object",
    "properties": {
        "label": {
            "description": "label of an axis object",
            "type": "string"
        },
        "units": {
            "description": "units for an axis",
            "type": "string"
        }
    },
    "required": [
        "label"
    ]
}
{
    "label": "energy",
    "units": "eV"
}

Abstract

The abstract schemas outline the data structure of abstract concepts (e.g. a point) and are derived from the primitive schemas.

2D Data

Data prepared for a two-dimensional plot.

{
    "$id": "core/abstract/2d-data",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "2 dimension data schema",
    "type": "object",
    "properties": {
        "xDataArray": {
            "description": "array containing values of x Axis",
            "type": "array"
        },
        "yDataSeries": {
            "$ref": "../primitive/1d_data_series.json"
        }
    },
    "required": [
        "xDataArray",
        "yDataSeries"
    ]
}
{
    "xDataArray": [
        0,
        1,
        2
    ],
    "yDataSeries": [
        [
            0,
            0.5,
            1
        ],
        [
            0,
            2.5,
            5
        ]
    ]
}

2D Plot

Two-dimensional data object, defined in conjunction with two axes.

{
    "$id": "core/abstract/2d-plot",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "2 dimension plot schema",
    "type": "object",
    "allOf": [
        {
            "$ref": "2d_data.json"
        }
    ],
    "properties": {
        "xAxis": {
            "description": "x Axis object",
            "$ref": "../primitive/axis.json"
        },
        "yAxis": {
            "description": "y Axis object",
            "$ref": "../primitive/axis.json"
        },
        "legend": {
            "description": "Legend of y Axis data series",
            "minItems": 1,
            "type": "array"
        }
    },
    "required": [
        "xAxis",
        "yAxis"
    ]
}
{
    "xAxis": {
        "label": "kpoint index"
    },
    "xDataArray": [
        0,
        1,
        2
    ],
    "yAxis": {
        "label": "eigenvalues",
        "units": "eV"
    },
    "yDataSeries": [
        [
            0,
            0.5,
            1
        ],
        [
            0,
            2.5,
            5
        ]
    ]
}

3D Tensor

A tensor which can be represented as a 3x3 matrix (for example the stress tensor).

{
    "$id": "core/abstract/3d-tensor",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "3 dimensional tensor schema",
    "type": "array",
    "items": {
        "$ref": "../primitive/array_of_3_numbers.json"
    },
    "minItems": 3,
    "maxItems": 3
}
[
    [
        1,
        0,
        0
    ],
    [
        0,
        1,
        0
    ],
    [
        0,
        0,
        1
    ]
]

3D Vector Basis

Three non-collinear vectors in three-dimensional space that form a basis set.

{
    "$id": "core/abstract/3d-vector-basis",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "3 dimensional vector basis",
    "type": "object",
    "properties": {
        "a": {
            "description": "first vector",
            "$ref": "../primitive/array_of_3_numbers.json"
        },
        "b": {
            "description": "second vector",
            "$ref": "../primitive/array_of_3_numbers.json"
        },
        "c": {
            "description": "third vector",
            "$ref": "../primitive/array_of_3_numbers.json"
        }
    },
    "required": [
        "a",
        "b",
        "c"
    ]
}

=== "Example

{
    "a": [
        5.0,
        0.0,
        0.0
    ],
    "b": [
        0.0,
        5.0,
        0.0
    ],
    "c": [
        0.0,
        0.0,
        5.0
    ]
}

Point

Point is a generic data type that is expected to be used by many different aspects of the database. It is an array holding three numbers.

{
    "$id": "core/abstract/point",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "point schema",
    "allOf": [
        {
            "$ref": "../primitive/array_of_3_numbers.json"
        }
    ]
}
[
    0.0,
    5.5,
    0.0
]

Vector

Vector is a generic data type that is expected to be used by many different aspects of the database. It is an array holding three numbers.

{
    "$id": "core/abstract/vector",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "vector schema",
    "oneOf": [
        {
            "$ref": "../primitive/array_of_3_numbers.json"
        },
        {
            "$ref": "../primitive/array_of_3_booleans.json"
        }
    ]
}
[
    1.0,
    0.0,
    0.0
]