KnowledgeFlowDB supports standard SQL queries over the graph data model, providing a familiar interface for relational-style queries.
Basic Query Structure
SELECT columns
FROM table
[WHERE condition]
[ORDER BY field [ASC|DESC]]
[LIMIT n]
[OFFSET m]
Querying Nodes
Simple Node Queries
Count all nodes in the database:
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Find all files:
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Get specific properties:
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Filtering by Properties
Find nodes with specific labels:
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Querying Edges
Simple Edge Queries
Count all relationships:
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Find all relationships by type:
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Get edge details:
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Joins Between Nodes and Edges
Find Connected Nodes
Get source nodes with their relationships:
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Find files that contain other entities:
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
WHERE Clauses
Label Filtering
Find specific node types:
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Combined Conditions
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Aggregations
Count by Label
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Edge Type Statistics
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
ORDER BY and LIMIT
Get first 10 nodes:
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Skip first 10, get next 10:
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Order by label:
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Complex Queries
Multi-Table Joins
Find all relationships with full node details:
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Nested Aggregations
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Try Your Own Queries!
Experiment with your own SQL queries:
Sign in with Privy to open a live bearer session and sign-to-derive key for your database. The playground will attach the correct auth headers automatically.
Press Ctrl+Enter to run
Available Tables
The SQL interface provides access to:
Comparing SQL and KQL
Both query languages access the same underlying graph data:
SQL is great for:
- Relational-style queries
- Aggregations and statistics
- Joins across nodes and edges
- Familiar syntax for SQL users
KQL is great for:
- Graph pattern matching
- Multi-hop traversals
- Relationship-centric queries
- Cypher-like graph exploration
Try switching between SQL and KQL in the playground to see the difference!
Next Steps