Skip to main content

Data sets


Data sets

A data set is used when you need to define a subset of the data store to use somewhere in the UI components. Could be related to some other specific data or global, automatically picking up the context it is applied to.

It is common to use statements to filter by some specific property. Data sets uses cytoscape.js#selectors selectors and cytoscape.js#collection/traversing traversing API's, the selector statements are directly used by administrators in configuration and is good to refer to for detail (API's are used internally and only of interest when writing Extending with plugin code).

Example use:

  • When expanding a table row, what related data should display as child rows? (e.g. product structure)
  • In a related data column, which nodes should be presented? (e.g. specifications)
  • Loading the root nodes of a table, should all data nodes go there or just with a certain state or type?

Chaining data sets

dataset adataset Bdataset C

Data sets could be chained together (e.g. give me all project nodes related to me ? out of those fully expand their folder structures ? out of that result give me all in work documentation). To chain simply use the datasets property and point out the data sets to apply on the result set of the first data set before returning.

"datasets":{
"user-projects": {
"type": "filter",
"statement": "[type='Project'][owner='currentUser']",
"datasets": ["expand-folders"]
},
"expand-folders" : {
"type": "expand",
"edgeStatement": "[type='FolderLink']",
"nodeStatement": "[type='Folder']"
}
}

Common data set properties

The following properties applies to all data set configuration

PropertyDescriptionData TypeRequired
datasetsData set identifier references to chain. Applies to the result set.array stringno
typeData set type (listed below e.g. expand)stringyes

Expand

Traverses the graph (similar to mql expand) the given number of levels applying the edge and node statements (selectors) on each every level independently (it require match for each level and not the result set, which cold give a different result). You can control the number of levels, the direction and what selectors to apply for edges and for nodes. There is an option to retain leaf nodes of that expand only.

warning

Note that the node statements also apply to the starting nodes (a difference compared to mql). Node statements need to match root nodes for expansion as well.

"ups-roots-example" : {
"type": "expand",
"edgeStatement": "[type='VPMInstance']",
"nodeStatement": "[type='VPMReference']",
"predecessors": true,
"leavesOnly": true,
"levels": 100
}
PropertyDescriptionDefaultData TypeRequired
edgeStatementcytoscape.js#selector validated with all edges, retains matching onlystringno
edgeEdgeNavigationInclude rel-to-rel edge (excluded when false)falsebooleanno
edgeEdgeReturnApplicable when edgeEdgeNavigation=true. Control which edge to return, available values source/target/selftargetstringno
edgeEdgeDirectionApplicable when edgeEdgeNavigation=true. Control the direction to navigate edge-to-edge, available values source / targettargetstringno
leavesOnlyRemoves all eles from the result set that is not a leaf according to the applied node and edge statements, default falsefalsebooleanno
levelsThe number of levels to expand, if left out all levels is expanded (there is a max value to prevent issues, explicitly state a high value to override)numberno
nodeStatementcytoscape.js#selector validated with all nodes, retains matching onlystringno
predecessorsExpand direction, true expands upwards (where used), default is falsefalsebooleanno

Filter

Filters out all eles matching a given cytoscape selector statement.

"vpm-structure-example" : {
"type": "filter",
"statement": "[type='VPMInstance'],[type='VPMReference']"
}
PropertyDescriptionData TypeRequired
statementcytoscape.js#selector validated with all edges and nodes in the collection, returns matching eles onlystringyes

Nodes

Filters out all nodes matching a given cytoscape selector statement.

"vpm-instances-example" : {
"type": "nodes",
"statement": "[type='VPMInstance']"
}
PropertyDescriptionData TypeRequired
statementcytoscape.js#selector validated with all nodes in the collection, returns matching nodes onlystringno

Edges

Filters out all edges matching a given cytoscape selector statement.

"vpm-references-example" : {
"type": "edges",
"statement": "[type='VPMReference']"
}
PropertyDescriptionData TypeRequired
statementcytoscape.js#selector validated with all edges in the collection, returns matching edges onlystringno

Successors

Fully expands all eles in the collection recursively then applies a given cytoscape selector statement on the result set of both edges and nodes.

warning

Note that the cytoscape selector statement is applied on the result set and that intermediate expansions getting there do not have to match the statement. See #Expand .

"vpm-structure-example" : {
"type": "successors",
"statement": "[type='VPMReference'],[type='VPMInstance']"
}
PropertyDescriptionData TypeRequired
statementcytoscape.js#selectors validated with all eles in the result set collection, returns matching eles onlystringno

Predecessors

Fully expands all eles in the collection recursively in the upwards direction (where used) then applies a given cytoscape selector statement on the result set of both edges and nodes.

warning

Note that the cytoscape selector statement is applied on the result set and that intermediate expansions getting there do not have to match the statement. See #Expand

"vpm-parent-structure-example" : {
"type": "predecessors",
"statement": "[type='VPMReference'],[type='VPMInstance']"
}
PropertyDescriptionData TypeRequired
statementA cytoscape.js#selector validated with all eles in the result set collection, returns matching eles onlystringno

Sources

Gets the source nodes connected with the edges of the collection then applies a given cytoscape selector statement on the result set.

"vpm-parent-nodes-example" : {
"type": "sources",
"statement": "[type='VPMReference']"
}
PropertyDescriptionData TypeRequired
statementA cytoscape.js#selector validated with all nodes in the result set collection, returns matching nodes onlystringno

Targets

Gets the target nodes connected with the edges of the collection then applies a given cytoscape selector statement on the result set.

"vpm-child-nodes-example" : {
"type": "targets",
"statement": "[type='VPMReference']"
}
PropertyDescriptionData TypeRequired
statementA cytoscape.js#selector validated with all nodes in the result set collection, returns matching nodes onlystringno

Outgoers

Get edges and their target nodes coming out of the nodes in the collection, then applies a given cytoscape selector statement on the result set.

"vpm-children-example" : {
"type": "outgoers",
"statement": "[type='VPMReference'],[type='VPMInstance']"
}
PropertyDescriptionData TypeRequired
statementA cytoscape.js#selector validated with all eles in the result set collection, returns matching eles onlystringno

Incomers

Get edges and their source nodes coming in to the nodes in the collection, then applies a given cytoscape selector statement on the result set.

"vpm-parents-example" : {
"type": "incomers",
"statement": "[type='VPMReference'],[type='VPMInstance']"
}
PropertyDescriptionData TypeRequired
statementA cytoscape.js#selector validated with all eles in the result set collection, returns matching eles onlystringno

Roots

Get nodes with no incoming edges in the collection, then applies a given cytoscape selector statement on the result set.

warning

Note that node have to be a true root and that the cytoscape selector statement do not affect the root validation (all incoming edges even if not matching the statement could prevent the node from validating as a root). See #Expand

"vpm-true-roots-example" : {
"type": "roots",
"statement": "[type='VPMReference']"
}
PropertyDescriptionData TypeRequired
statementA cytoscape.js#selector validated with all nodes in the result set collection, returns matching nodes onlystringno

Leaves

Get nodes with no outgoing edges in the collection, then applies a given cytoscape selector statement on the result set.

warning

Note that node have to be a true leaf and that the cytoscape selector statement do not affect the leaf validation (all outgoing edges even if not matching the statement could prevent the node from validating as a leaf). See #Expand

"vpm-true-leaves-example" : {
"type": "leaves",
"statement": "[type='VPMReference']"
}
PropertyDescriptionData TypeRequired
statementA cytoscape.js#selector validated with all nodes in the result set collection, returns matching nodes onlystringno