The Query Log connector parses a local query-log JSON file into the Neo4j semantic graph. Query log parsing reveals how users actually access your data — which tables and columns appear in queries, how they’re joined, and which common table expressions are used — without relying solely on declared schema metadata like foreign key constraints. This connector is distinct fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/neo4j-labs/neocarta/llms.txt
Use this file to discover all available pages before exploring further.
BigQueryLogsConnector, which reads live query history directly from the BigQuery Cloud Logging API. The Query Log connector reads a local JSON file you have already exported. Use it when you want to replay a historical export, process logs from a non-BigQuery source in the BigQuery export format, or work offline.
Currently only the BigQuery JSON export format is supported as
source. Logs from other databases stored in a compatible JSON structure can be ingested by passing source="bigquery".What It Ingests
| Node / Relationship | Properties |
|---|---|
Query | content (SQL text), query_id (hash) |
CTE | name, definition (SQL), query_id (parent query hash) |
(:Query)-[:USES_TABLE]->(:Table) | Derived from SQL parsing |
(:Query)-[:USES_COLUMN]->(:Column) | Derived from SQL parsing |
(:Query)-[:DEFINES]->(:CTE) | Inline CTEs parsed from each query |
(:Column)-[:REFERENCES]->(:Column) | Join criteria from SQL JOIN conditions, with criteria property |
Database, Schema, Table, Column) discovered during SQL parsing are also MERGEd into the graph with minimal properties (name only). If you have run a schema connector first, these MERGEs are no-ops against the existing enriched nodes.
Column nodes created solely from query log parsing do not have type, description, or key information — those come from a schema connector.
nullable is set to True, is_primary_key and is_foreign_key to False for query-log-only columns.Import
Parameters
Connected Neo4j driver instance.
Target Neo4j database name.
ingest() Parameters
Filesystem path to the query log JSON file.
Source format of the query log file. Currently
"bigquery" is the only supported value.Code Example
CLI
Required Environment Variables
| Variable | Purpose |
|---|---|
NEO4J_URI | Neo4j connection URI |
NEO4J_USERNAME | Neo4j username |
NEO4J_PASSWORD | Neo4j password |
NEO4J_DATABASE | Target Neo4j database (default: neo4j) |
Obtaining BigQuery Query Logs
To export query logs from BigQuery in the expected JSON format, use thegcloud CLI:
--query-log-file at it.
Difference from neocarta bigquery logs
- Query Log Connector
- BigQuery Logs Connector
- Reads a local JSON file you have already exported
- Works offline, with archived logs, or with logs pre-filtered before import
- CLI:
neocarta query-log ingest --query-log-file ./logs.json - Class:
QueryLogConnector