Data schema

Required Permission: Settings management (Read more about Permissions)

Table of Contents

Data schema setting represents global common dictionary for analysts working on specific use case. It is used to set how to represent or format data from Neo4j database in GUI or to define globally used virtual properties. Every property defined in Data schema is "locked" in GUI which means that users without Settings management are not allowed to change the title of these properties or to change the formula in virtual properties.

Configuration

  1. In the "Application menu" (top right) choose page "Settings"

  2. In the "Application Settings" panel click on the "DATA_SCHEMA" row.

  3. Enter JSON configuration and confirm by pressing "Save" button.

Default configuration

Default configuration contains no property definitions.

  1. Main menu (top right) - Page Settings

  2. In panel "Settings list" use icon "Update" for setting "DATA_SCHEMA".

  3. Press button "Default" and store by pressing button "Save".

Automatic configuration

Automatic configuration can be used to generate configuration automatically with some logic based on data of first 1000 nodes and first 1000 relationships in database. This automatically generated configuration can be used as a good starting point to create your own configuration.

  1. Main menu (top right) - Page Settings

  2. In panel "Settings list" use icon "Update" for setting "DATA_SCHEMA".

  3. Pres button "Automatic", wait for generator to generate JSON and store by pressing button "Save".

Description of configuration

Configuration is entered in JSON format. Example:

{
"nodeProperties":{
"database":[
{
"property":"title",
"title":"Title",
"dataType":"text",
"dataRole":null,
"formatString":null,
"inputRestrictions":{
"mandatory":true,
"readOnly":false,
"strict":false,
"multiple":false,
"values":null,
"groups":null
}
},
{
"property":"type",
"title":"Type",
"dataType":"text",
"dataRole":"dimension",
"formatString":null,
"inputRestrictions":{
"mandatory":false,
"readOnly":false,
"strict":true,
"multiple":false,
"values":[
"TYPE 1.1",
"TYPE 1.2",
"TYPE 2.1",
"TYPE 2.2"
],
"groups":[
{
"label":"TYPE 1",
"values":[
"TYPE 1.1",
"TYPE 1.2"
]
},
{
"label":"TYPE 2",
"values":[
"TYPE 2.1",
"TYPE 2.2"
]
}
]
}
}
],
"virtual":[
{
"property":"title",
"title":"Title",
"dataType":"text",
"dataRole":null,
"formatString":null,
"formula":"return 'value';"
}
]
},
"relProperties":{
"database":[
{
"property":"type",
"title":"Type",
"dataType":"text",
"dataRole":"dimension",
"formatString":null,
"inputRestrictions":{
"mandatory":false,
"readOnly":false,
"strict":false,
"multiple":false,
"values":null,
"groups":null
}
},
{
"property":"subtype",
"title":"Subtype",
"dataType":"number",
"dataRole":"dimension",
"formatString":null,
"inputRestrictions":{
"mandatory":false,
"readOnly":false,
"strict":true,
"multiple":false,
"values":[
"TYPE 1.1",
"TYPE 1.2",
"TYPE 2.1",
"TYPE 2.2"
],
"groups":[
{
"label":"TYPE 1",
"values":[
"TYPE 1.1",
"TYPE 1.2"
]
},
{
"label":"TYPE 2",
"values":[
"TYPE 2.1",
"TYPE 2.2"
]
}
]
}
}
],
"virtual":[
{
"property":"title",
"title":"Title",
"dataType":"text",
"dataRole":null,
"formatString":null,
"formula":"return 'value';"
}
]
},
"mergedRelProperties":[
{
"property":"title",
"title":"Title",
"dataType":"text",
"dataRole":null,
"formatString":null,
"formula":"return edge.data.property_name;"
}
],
"dirMergedRelProperties":[
{
"property":"title",
"title":"Title",
"dataType":"text",
"dataRole":null,
"formatString":null,
"formula":"return edges.length;"
}
],
"nodePropertyGroups":[
{
"title":"Main",
"properties":[
{
"property":"title"
},
{
"property":"type"
}
]
}
]
}

Explanation of JSON properties:

Property

Values

Default

Description

Usage

nodeProperties

MANDATORY

List of DPD and list of VPD

Contains a list of node Database Property Definitions (DPD) and node Virtual Property Definitions (VPD) used in GUI.

Search page, Visualization

nodeProperties.database

Array of DPD objects

List of node DB properties used in GUI. Every DB property is defined as a JSON Object called DPD (Database Property Definition).

Search page, Visualization

nodeProperties.virtual

Array of VPD objects

List of node virtual properties used in GUI. Every virtual property is defined as a JSON Object called VPD (Virtual Property Definition).

Visualization

relProperties

MANDATORY

List of DPD and list of VPD

Contains a list of relationship Database Property Definitions (DPD) and relationship Virtual Property Definitions (VPD) used in GUI.

Search page, Visualization

relProperties.database

Array of DPD objects

List of relationship DB properties used in GUI. Every DB property is defined as a JSON Object called DPD (Database Property Definition).

Search page, Visualization

relProperties.virtual

Array of VPD objects

List of relationship virtual properties used in GUI. Every virtual property is defined as a JSON Object called VPD (Virtual Property Definition).

Visualization

mergedRelProperties

MANDATORY

Array of VPD objects

List of merged relationship virtual properties used in GUI. Every virtual property is defined as a JSON Object called VPD (Virtual Property Definition).

Visualization

dirMergedRelProperties

MANDATORY

Array of VPD objects

List of direction merged relationship virtual properties used in GUI. Every virtual property is defined as a JSON Object called VPD (Virtual Property Definition).

Visualization

VPD.property

MANDATORY

String

The technical name of a virtual property defined by this VPD.

Visualization

VPD.title

String

VPD.property

Property title used in GUI. You can define a custom title for every property. This is useful when you want to use user-friendly and formatted names in GUI instead of technical names of properties. When not defined or set to null then the value of VPD.property is used.

Visualization

VPD.formula

String

Body of a javascript function used to calculate the value of this virtual property (be sure to escape special characters like newline or tab).

Visualization

VPD.dataType

undefined, null, "text", "number", "url"

null

Type of formatting for values in GUI of this virtual property.

  • "text", undefined, or null - no formatting, values are shown exactly as are returned from VPD.formula

  • "number" - number formatted based on rules defined with "formatString"

  • "datetime" - epoch time numbers will be formated as a human-readable string. See "formatString" for possible formatting options.

  • "url" - value is formatted as clickable URL

Visualization

VPD.formatString

Numeral.js format string

"0.00"

If dataType is set to "number" then for formatString is used with the Numeral.js library to format numbers in GUI. Note: language-dependent formatting is set according to the user's locale set in the profile.

If dataType is set to "datetime" then these formatString values can be used: "DD.MM.YYYY", "DD.MM.YY", "D.M.YYYY", "D.M.YY", "YYYY-MM-DD", "YY-MM-DD", "YYYY-M-D", "YY-M-D", "DD.MM.YYYY hh:mm:ss", "DD.MM.YY hh:mm:ss", "YYYY-MM-DD hh:mm:ss", "YYYY-MM-DD hh:mm:ss.ms", "hh:mm:ss", "h:m:s", "hh:mm:ss.ms", "h:m:s.ms"

Visualization

VPD.dataRole

undefined, null, "dimension", "metric"

null

Defines how to use virtual property in GUI.

  • null or undefined - no special meaning. Usually most of properties have dataRole set to null or not defined at all.

  • "dimension" - means that this property is a code list and can be used in this way (e.g. filtering on values, counting of values)

  • "metric" - means that this property is a numeric value that can be used in mathematical operations

Note: for properties with defined "dataRole" the property charts on tab Stat in visualization are automatically added.

Visualization

DPD.property

MANDATORY

String

The technical name of DB property defined by this DPD. Value is used for reference purposes, e.g. in Style mappers.

Search page, Visualization

DPD.title

String

DPD.property

Property title used in GUI. You can define a custom title for every property. This is useful when you want to use user-friendly and formatted names in GUI instead of DB model names of properties. When not defined or set to null then the DB name (technical name) of the property is used (DPD.property).

Search page, Visualization

DPD.dataType

undefined, null, "text", "number", "url"

null

Type of formatting for values in GUI of this DB property.

  • "text", undefined, or null - no formatting, values are shown exactly as they are stored in DB

  • "number" - number formatted based on rules defined with "formatString"

  • "url" - value is formatted as clickable URL

  • "boolean" - only true or false values are allowed

Search page, Visualization

DPD.formatString

Numeral.js format string

"0.00"

If dataType is set to "number" then for formatString is used with the Numeral.js library to format numbers in GUI. Note: language-dependent formatting is set according to the user's locale set in the profile.

Search page, Visualization

DPD.dataRole

undefined, null, "dimension", "metric"

null

Defines how to use DB property in GUI.

  • null or undefined - no special meaning. Usually, most DB properties have dataRole set to null or not defined at all.

  • "dimension" - means that this property is a code list and can be used in this way (e.g. filtering on values, counting of values)

  • "metric" - means that this property is a numeric value that can be used in mathematical operations

Visualization filters

DPD.inputRestrictions

Object

Defines restrictions for the input field in the create and update forms. See Input Restrictions for all types of input fields that can be created with this setting.

Create and Update forms

DPD.inputRestrictions.mandatory

true, false

false

If set to true then it's mandatory to enter some value in the create and update forms (user can't save the change without any value entered for this property).

Create and Update forms

DPD.inputRestrictions.readOnly

true, false

false

If set to true then the value of this property is read-only in the create and update forms.

Create and Update forms

DPD.inputRestrictions.strict

true, false

false

If strict is set to true then the user can choose only values defined in values or groups when editing DB data via the create or update form.

The strict values functionality is available only if dataType is set to "text" and dataRole to "dimension".

Create and Update forms

DPD.inputRestrictions.multiple

true, false

false

If multiple is set to true then the user can choose multiple values (defined in values or groups ) as a property value when editing DB data via the create or update form. These values are then stored as an array of values in DB property. The d ata type of the stored values can be defined with the DPD.dataType setting.

Create and Update forms

DPD.inputRestrictions.values

Array of plain values

Values available in the suggestions list.

Create and Update forms

DPD.inputRestrictions.groups

Array of GDO objects

Values available in the suggestions list divided into groups for better user orientation. Every group is defined by GDO (Group Definition Object).

Create and Update forms

GDO.title

MANDATORY

String

Title of a group of values shown in the suggestions list in the create and update forms.

Create and Update forms

GDO.values

MANDATORY

Array of plain values

Values used in this specific group in the suggestions list in the create and update forms.

Create and Update forms

nodePropertyGroups

Array of NTDO objects

Set how to group node properties to tabs in view, create and update forms. Every tab is defined by NTDO (Node Tab Definition Object).

Create and Update forms

NTDO.title

MANDATORY

String

Label (or title) of the group used as tab label in view, create and update forms.

Create and Update forms

NTDO.properties

MANDATORY

Array of objects

Referenced DB properties used in this tab. Every reference is done with a simple object which has only one property called "property" where the value is the name of referenced DB property (property key). For example: {"property":"type"}

Create and Update forms