Ctrl + K
Website

Query Language

The select where command uses a built-in expression parser to filter nodes by their attribute values. Expressions are written in a C-like syntax and evaluated against every node in the graph.

Operators

OperatorMeaningExample
==Equalname == "Alice"
!=Not equalgroup != "admin"
<Less thanscore < 0.5
<=Less than or equalage <= 30
>Greater thanweight > 10
>=Greater than or equalrank >= 1
&&Logical ANDa > 1 && b < 5
||Logical ORx == 1 || y == 2
!Logical NOT!(active == 1)
( )Grouping(a > 1) && (b < 5)

Operator Precedence

From highest to lowest precedence:

  1. ( ) — Parenthesised groups
  2. ! — Logical NOT (unary)
  3. == != < <= > >= — Comparisons
  4. && — Logical AND
  5. || — Logical OR

Value Types

Attribute Type Matching

The right-hand value must match the attribute's declared type:

Attribute TypeExpected LiteralExample
floatNumericscore > 0.5
int32Integerrank >= 1
uint32IntegernodeID == 42
stringQuoted stringname == "Bob"
shared_stringQuoted stringgroup != "admin"

Examples

// Simple comparisons
select where (score > 0.8)
select where (name == "Bob")

// Compound expression with AND
select where (score >= 0.5 && group == "active")

// Nested logic with OR
select where ((age > 18 && age < 65) || role == "admin")

// Negation
select where !(status == "inactive")

// Using set operations with queries
select where (group == "engineering")
+select where (group == "design")
-select where (score < 0.3)
^select where (active == 1)

Script Files

Scripts are plain text files containing one command per line. They let you automate repetitive workflows such as loading data, applying selections, and styling the graph. Run a script with the execute command or via Script > Execute... in the menu bar.

Syntax Rules

Example Script

// Load the dataset
load data/social_network.csv target=(user_a, user_b, username)

// Import additional attributes
import data/user_scores.csv target=(username, user) attributes=[(score, float, score), (group, string, group)]

// Select all nodes and style them
select all
set node size 15
set node colour 58a6ff
set edge width 1
set edge colour 30363d

// Map node size by score
map node size score 0 1 8 40

// Map colour from blue to red by score
map node colour score 0 1 3b82f6 ef4444

// Show labels
set label content username
set label size 10
set label colour e6edf3

// Create a subset of high-scoring nodes
select where (score > 0.8)
create subset top_scorers

Running Scripts

There are three ways to run a script:

  1. Type execute path/to/script.txt in the console
  2. Use Script > Execute... from the menu bar to pick a file
  3. Click a recently-run script in the Script menu

Recently executed scripts are remembered across sessions and appear in the Script menu for quick re-execution.