Schema

Schema #

This page provides an overview of the property types of the concept language and their parameters.

"boolean" Property Type #

A Boolean property type that can have the values true or false.

Default Value: false

Parameters:

Parameter Description
"default" Allows to overwrite the default value.
"derive" Allows to derive the value using an action chain (see Derived Properties).

Example:

{
    "schema": {
        "mySimpleProperty": "boolean",
        "myFullProperty": { "boolean": { "default": true }}
    }
}

Related Actions: "get", "set", "toggle"

"string" Property Type #

A simple string property type.

Default Value: ""

Parameters:

Parameter Description
"default" Allows to overwrite the default value.
"derive" Allows to derive the value using an action chain (see Derived Properties).
"enum" Defines an array of values the property can have like in an enumerated type. When setting the property only the values in the enum array are accepted.
"matches" Defines a regular expression the value has to match. When setting the property only values matching the expression are accepted.

Example:

{
    "schema": {
        "mySimpleProperty": "string",
        "myFullProperty": { "string": {
            "default": "Hello",
            "enum": [ "Hello", "World", "Varv" ],
            "matches": "^([A-Z])+$"
        }}
    }
}

Related Actions: "get", "set", "concat", "enums", "length", "split", "testTransform"

"number" Property Type #

A simple number property type that supports float values.

Default Value: 0

Parameters:

Parameter Description
"default" Allows to overwrite the default value.
"derive" Allows to derive the value using an action chain (see Derived Properties).
"max" Defines the maximum value the number can have. When setting the property only the values lower or equal than the maximum value are accepted.
"min" Defines the minimum value the number can have. When setting the property only the values higher or equal than the minimum value are accepted.

Example:

{
    "schema": {
        "mySimpleProperty": "number",
        "myFullProperty": { "number": {
            "default": 50,
            "max": 100,
            "min": 0
        }}
    }
}

Related Actions: "get", "set", "calculate", "decrement", "increment", "random"

"array" Property Type #

An array property type that can hold values of other property types including other concepts

Default Value: []

Shorthand Parameter: "items"

Parameters:

Parameter Description
"derive" Allows to derive the value using an action chain (see Derived Properties).
"items" Defines the property type of items in an array (required).
"max" Defines the maximum count of items in the array.

Example:

{
    "schema": {
        "myShorthandProperty": { "array": "string" },
        "myFullProperty": { "array": {
            "items": "string",
            "max": 5
        }}
    }
}

Related Actions: "get", "set", "append", "items", "length", "prepend", "removeFirst", "removeItem", "removeLast"

"anotherConceptName" Property Type #

A property type that refers to other concepts. Names of other concepts can be used either directly ("newestTodo" in the example) or in arrays ("todos" in the example).

Default Value: null

Parameters:

Parameter Description
"derive" Allows to derive the value using an action chain (see Derived Properties).

Example:

{
    "concepts": {
        "todo": {
            // ...
        },
        "todoList": {
            "schema": {
                "todos": { "array": "todo" },
                "newestTodo": "todo"
            }
        }
    }
}

Related Actions: "get", "set"


© 2022 Aarhus University | Made by cavi.au.dk | Contact Person: Clemens Nylandsted Klokmose