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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{
    "items": {
        "minItems": 1, 
        "items": {
            "type": [
                "number", 
                "string"
            ]
        }, 
        "type": "array"
    }, 
    "schemaId": "core-primitive-1d-data-series", 
    "type": "array", 
    "$schema": "http://json-schema.org/draft-04/schema#", 
    "title": "1 dimension data series schema"
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
[
    [
        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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
    "title": "3 dimensional lattice schema", 
    "schemaId": "core-primitive-3d-lattice", 
    "required": [
        "a", 
        "b", 
        "c", 
        "alpha", 
        "beta", 
        "gamma"
    ], 
    "$schema": "http://json-schema.org/draft-04/schema#", 
    "type": "object", 
    "properties": {
        "a": {
            "type": "number", 
            "description": "length of the first lattice vector"
        }, 
        "c": {
            "type": "number", 
            "description": "length of the third lattice vector"
        }, 
        "b": {
            "type": "number", 
            "description": "length of the second lattice vector"
        }, 
        "beta": {
            "type": "number", 
            "description": "angle between second and third lattice vector"
        }, 
        "alpha": {
            "type": "number", 
            "description": "angle between first and second lattice vector"
        }, 
        "gamma": {
            "type": "number", 
            "description": "angle between first and third lattice vector"
        }
    }
}
1
2
3
4
5
6
7
8
{
    "a": 5.14, 
    "c": 5.14, 
    "b": 5.14, 
    "beta": 90.0, 
    "alpha": 90.0, 
    "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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
{
    "schemaId": "core-primitive-axis", 
    "required": [
        "label"
    ], 
    "properties": {
        "units": {
            "type": "string", 
            "description": "units for an axis"
        }, 
        "label": {
            "type": "string", 
            "description": "label of an axis object"
        }
    }, 
    "$schema": "http://json-schema.org/draft-04/schema#", 
    "title": "axis schema"
}
1
2
3
4
{
    "units": "eV", 
    "label": "energy"
}

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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
{
    "title": "2 dimension data schema", 
    "schemaId": "core-abstract-2d-data", 
    "required": [
        "xDataArray", 
        "yDataSeries"
    ], 
    "$schema": "http://json-schema.org/draft-04/schema#", 
    "type": "object", 
    "properties": {
        "xDataArray": {
            "type": "array", 
            "description": "array containing values of x Axis"
        }, 
        "yDataSeries": {
            "$ref": "../primitive/1d_data_series.json"
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
{
    "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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
    "allOf": [
        {
            "$ref": "2d_data.json"
        }
    ], 
    "schemaId": "core-abstract-2d-plot", 
    "required": [
        "xAxis", 
        "yAxis"
    ], 
    "title": "2 dimension plot schema", 
    "$schema": "http://json-schema.org/draft-04/schema#", 
    "properties": {
        "legend": {
            "minItems": 1, 
            "type": "array", 
            "description": "Legend of y Axis data series"
        }, 
        "xAxis": {
            "description": "x Axis object", 
            "$ref": "../primitive/axis.json"
        }, 
        "yAxis": {
            "description": "y Axis object", 
            "$ref": "../primitive/axis.json"
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
    "yDataSeries": [
        [
            0, 
            0.5, 
            1
        ], 
        [
            0, 
            2.5, 
            5
        ]
    ], 
    "xDataArray": [
        0, 
        1, 
        2
    ], 
    "xAxis": {
        "label": "kpoint index"
    }, 
    "yAxis": {
        "units": "eV", 
        "label": "eigenvalues"
    }
}

3D Tensor

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
    "title": "3 dimensional tensor schema", 
    "minItems": 3, 
    "items": {
        "$ref": "../primitive/array_of_3_numbers.json"
    }, 
    "schemaId": "core-abstract-3d-tensor", 
    "maxItems": 3, 
    "$schema": "http://json-schema.org/draft-04/schema#", 
    "type": "array"
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
[
    [
        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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
    "title": "3 dimensional vector basis", 
    "schemaId": "core-abstract-3d-vector-basis", 
    "required": [
        "a", 
        "b", 
        "c"
    ], 
    "$schema": "http://json-schema.org/draft-04/schema#", 
    "type": "object", 
    "properties": {
        "a": {
            "description": "first vector", 
            "$ref": "../primitive/array_of_3_numbers.json"
        }, 
        "c": {
            "description": "third vector", 
            "$ref": "../primitive/array_of_3_numbers.json"
        }, 
        "b": {
            "description": "second vector", 
            "$ref": "../primitive/array_of_3_numbers.json"
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
{
    "a": [
        5.0, 
        0.0, 
        0.0
    ], 
    "c": [
        0.0, 
        0.0, 
        5.0
    ], 
    "b": [
        0.0, 
        5.0, 
        0.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.

1
2
3
4
5
6
{
    "schemaId": "core-abstract-point", 
    "$ref": "../primitive/array_of_3_numbers.json", 
    "$schema": "http://json-schema.org/draft-04/schema#", 
    "title": "point schema"
}
1
2
3
4
5
[
    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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
    "schemaId": "core-abstract-vector", 
    "anyOf": [
        {
            "$ref": "../primitive/array_of_3_numbers.json"
        }, 
        {
            "$ref": "../primitive/array_of_3_booleans.json"
        }
    ], 
    "$schema": "http://json-schema.org/draft-04/schema#", 
    "title": "vector schema"
}
1
2
3
4
5
[
    1.0, 
    0.0, 
    0.0
]