Required Permission: Project Settings management (Read more about permissions in User Groups)

Table of Contents


Data schema setting represents a global common dictionary for analysts working on a specific use case. It is used to set how to represent or format data from the graph database in GUI or to define virtual properties in the project. Every property defined in the 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.

Data Schema setting is also used to set which node labels and which relationship types are used in the project. Nodes and relationships that are not listed in this setting are not visible in the project in any way. This setting can be used to distinguish between data for analysis and other data in the graph that can be hidden for all users. If you want to view all nodes or all relationships use "*" in configuration.

Another usage of Data Schema is to set up UID values as long-term ID's for saving of visualizations when using Neo4j graph DB. For more information see UID in Saved Visualizations.

Configuration

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

  2. In the "Project Settings" panel click on the "Data Schema" row.

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

Description of configuration

Configuration is entered in JSON format. Example:

{
"nodeLabels":["Company", "Person"],
"relationshipTypes":["*"],
"calculateNumOfRelatedNodes":false,
"calculateNumOfRelations":true,
"nodeUid":{
"labels":["Company","Person"],
"property":"uuid",
"manageIndex":true
},
"relationshipUid":{
"types":[ ],
"property":"uuid",
"manageIndex":true
},
"nodeProperties":{
"database":[
{
"property":"title",
"title":"Title",
"dataType":"text",
"dataRole":null,
"formatString":null,
"hidden":false,
"inputRestrictions":{
"mandatory":true,
"readOnly":false,
"strict":false,
"multiple":false,
"values":null,
"groups":null,
"trimming":false
}
},
{
"property":"incidents",
"dataType":"number",
"dataRole":"metric",
"inputRestrictions":{
"min":0,
"max":100000,
"range":true
}
},
{
"property":"type",
"title":"Type",
"dataType":"text",
"dataRole":"dimension",
"formatString":null,
"inputRestrictions":{
"mandatory":false,
"readOnly":false,
"strict":true,
"multiple":false,
"trimming":true,
"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

nodeLabels

mandatory

Array of strings

[ "*" ]

An array of node labels visible in the project. Nodes that are not listed are not visible in the project. The "*" value means all existing labels are visible. An empty array is not a valid value for this setting.

relationshipTypes

mandatory

Array of strings

[ "*" ]

An array of relationship types visible in the project. Relationships types that are not listed are not visible in the project. The "*" value means all existing relationships are visible. An empty array is not a valid value for this setting.

calculateNumOfRelatedNodes

Boolean

false

If set to false the "_numOfRelatedNodes" system property is not calculated in visualization. This leads to more performant queries in bigger graphs, especially in graphs with high degree nodes.

calculateNumOfRelations

Boolean

true

(warning) Gremlin connections only!

If set to false the "_numOfRelations" system property is not calculated in visualization. This leads to more performant queries in bigger graphs, especially in graphs with high degree nodes. With this feature disabled you won't be able to see if a node is expandable or not (but it still will be expanded when using the expand function).

nodeUid

Object

If present, this object defines the configuration for UID usage in saved visualizations. For more information see UID in Saved Visualizations.

nodeUid.labels

Array of strings


An array of strings representing node labels that are used for UID functionality. All nodes have to be covered with these labels. If your graph model is changing and it's not feasible to have always all node labels listed here then please use a general node label that will be added to all nodes, like "uuid" and list only this one here.

If the array is empty then all labels in the database are used (updated on config save or during opening any saved visualization).

Also, an index should be created for every combination of nodeUid.labels and nodeUid.property to ensure optimal performance on visualization loading (use manageIndex:true to create the indexes automatically).

nodeUid.property

String

Property key name where the UIDs are stored on nodes.

nodeUid.manageIndex

Boolean

false

(warning) Neo4j connections only!

If set to true the node UNIQUE SCHEMA indexes are automatically created in Neo4j. This ensures that the visualization loading will be as fast as possible.

relationshipUid

Object

If present, this object defines the configuration for UID usage in saved visualizations. For more information see UID in Saved Visualizations.

relationshipUid.types

Array

Empty array

An array of strings representing relationship types that are used for UID functionality.

If the array is empty then all labels in the database are used (updated on config save or during opening any saved visualization).

relationshipUid.property

String

Property key name where the UIDs are stored on relationships.

relationshipUid.manageIndex

Boolean

false

(warning) Neo4j connections only!

For UID to be working with relationships a fulltext index is needed (because Neo4j before version 4.3 doesn't have implicit indexes for relationships).

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.

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).

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).

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.

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).

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).

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).

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).

VPD.property

mandatory

String

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

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.

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).

VPD.dataType

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

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

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: 

  • Date and time:

    • "DD.MM.YYYY hh:mm:ss"

    • "DD.MM.YY hh:mm:ss"

    • "YYYY.MM.DD hh:mm:ss"

    • "YYYY-MM-DD hh:mm:ss"

    • "YYYY-MM-DD hh:mm:ss.ms"

  • Date only:

    • "DD.MM.YYYY"

    • "DD.MM.YY"

    • "D.M.YYYY"

    • "D.M.YY"

    • "YYYYMMDD"

    • "YYYY-MM-DD"

    • "YY-MM-DD"

    • "YYYY-M-D"

    • "YY-M-D"

    • "MM/DD/YYYY"

    • "M/D/YYYY"

    • "MM/DD/YY"

    • "M/D/YY"

    • "DD/MM/YYYY"

    • "D/M/YYYY"

    • "DD/MM/YY"

    • "D/M/YY"

  • Time only:

    • "hh:mm:ss"

    • "h:m:s"

    • "hh:mm:ss.ms"

    • "h:m:s.ms"

VPD.dataRole

undefined, null, "dimension", "metric"

null

Defines how to use virtual property in GUI.

  • null or undefined - no special meaning. Usually, most of the 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.

VPD.hidden

true, false

false

If true then the property is by default hidden on the tab Detail in visualization. Users can unhide the property.

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.

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).

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

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.

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

DPD.hidden

true, false

false

If true then the property is by default hidden on the tab Detail in visualization. User can unhide the property.

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.

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).

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.

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".

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 data type of the stored values can be defined with the DPD.dataType setting.

DPD.inputRestrictions.values

Array of plain values

Values available in the suggestions list.

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).

DPD.inputRestrictions.trimming

true, false

true

If set to true or not defined then every property value entered through the UI is trimmed before saving (leading and trailing spaces are removed).

DPD.inputRestrictions.range

true, false

false

When set to true the property will be handled as an interval value in the UI.

For instance, in all filters, a number range selector will be used as the input element. When “min” and “max” are also defined then a Slider input element will be used in the UI.

DPD.inputRestrictions.min

Number

Defines minimal value that can be set by the user when the property is edited using the UI.

The “max” and “range” attributes have to be defined as well.

DPD.inputRestrictions.max

Number

Defines maximal value that can be set by the user when the property is edited using the UI.

The “min” and “range” attributes have to be defined as well.

GDO.title

mandatory

String

Title of a group of values shown in the suggestions list in the 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.

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).

NTDO.title

mandatory

String

Label (or title) of the group used as tab label in view, 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"}