bigquery-graph

Generates GQL queries and property graph DDL for BigQuery graph analytics.

Updated Jul 7, 2026
One-click install
npx skills add https://github.com/ricardolui/gcp-custom-agent-skills --skill bigquery-graph-ricardolui
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bigquery-graph
Source: https://github.com/ricardolui/gcp-custom-agent-skills/tree/main/bigquery-graph
Command: npx skills add https://github.com/ricardolui/gcp-custom-agent-skills --skill bigquery-graph-ricardolui

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing correct BigQuery graph queries and property graph schemas requires deep knowledge of GQL syntax, GRAPH_TABLE integration, GRAPH_EXPAND semantics, and schema design pitfalls. This Skill provides the reference guidelines needed to generate valid GQL queries and well-formed CREATE PROPERTY GRAPH DDL without syntax errors or performance anti-patterns. ## Core Features & Use Cases - GQL Query Generation: Produces BigQuery GoogleSQL GQL queries with correct pattern matching, path variables, quantifiers, and output formatting (TO_JSON for visualization vs. tabular results). - Semantic Graph Querying: Guides use of the GRAPH_EXPAND TVF and the mandatory AGG() function for measure columns. - Schema DDL Advisory: Assists in designing CREATE PROPERTY GRAPH statements with scoped properties, safe aliases, PK/FK constraints, and topology pre-flight audits. - Use Case: A data engineer needs to model an account-transfer network as a property graph and query multi-hop fraud patterns; the Skill supplies the DDL structure and GQL traversal syntax with optimization rules. ## Quick Start Ask the assistant to write a GQL query that finds the shortest transfer path between two accounts in your BigQuery property graph.

Frequently Asked Questions about bigquery-graph

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a GQL graph query in BigQuery?

Use the GRAPH clause followed by MATCH patterns with node and edge labels, then RETURN the results. BigQuery supports only the GoogleSQL GQL standard, never Cypher, and path variables should be assigned for traversal queries.

How do I create a property graph in BigQuery?

Use CREATE PROPERTY GRAPH DDL with NODE TABLES and EDGE TABLES blocks mapping existing BigQuery tables. Define KEY columns, SOURCE KEY and DESTINATION KEY references, and scope properties explicitly rather than using PROPERTIES ALL COLUMNS.

When should I use GRAPH_TABLE instead of standalone GQL?

Use GRAPH_TABLE only when you need SQL integration such as aggregations, joins with relational tables, or advanced filtering. For pure graph pattern matching, prefer standalone GQL with native RETURN statements.

Why does my GRAPH_EXPAND query fail on a measure column?

Measure columns cannot be selected directly and must be wrapped in the AGG() function. SELECT * also fails on graphs with measures, so explicitly list non-measure columns or use EXCEPT to exclude measures.

What graph topologies does GRAPH_EXPAND support?

GRAPH_EXPAND requires a tree structure and does not support disconnected graphs, directed cycles, self-loops, or convergent diamond paths. For cyclic graphs, use standard GQL pattern matching instead of the flattened view.

Why is my BigQuery graph query slow?

Common causes include starting traversals from high-cardinality nodes, omitting explicit labels, and using bidirectional edge patterns. Filter early, specify labels, and replace undirected patterns with directional queries combined via UNION ALL.