Select AI for Property Graphs
Select AI generates Property Graph
Query (PGQ) on Oracle Property Graphs using natural language. It enables users to query
graph data through the GRAPH_TABLE operator with minimal SQL
knowledge.
Select AI extends its natural language to SQL (NL2SQL) capability to graph
structures enabling you to query SQL Property Graphs using natural language. Select AI
applies the GRAPH_TABLE operator to interpret relationships and
attributes in graph-structured data. It generates SQL or PGQ graph queries based on the
data objects defined in the AI profile. When a property graph is included in the AI
profile, Select AI uses generative AI to build a PGQ query that references the graph
through the GRAPH_TABLE operator. The LLM automatically receives the
graph object's metadata such as CREATE PROPERTY GRAPH statements to
generate accurate queries. When a table, view, or relational object is specified, Select
AI generates a SQL query. This capability simplifies pattern-matching queries on graph
data stored in Oracle AI Database and reduces dependency on manually constructing SQL
queries.
object_list attribute, the LLM defined in AI profile interprets
prompts by using the context of the specified property graphs. Select AI builds an
augmented prompt that includes:
-
Instructions to construct PGQ queries.
-
Metadata describing the provided property graphs (from their
CREATE PROPERTY GRAPHstatements).
This augmented prompt is sent to the LLM. Select AI runs the query and returns results. If a property graph is specified along with other object types such as tables, schema, or views in the AI profile, Select AI raises an error.
SQL vs PGQ
object_list attribute of your AI profile.
-
SQL Query: uses relational data such as schema, tables, or views.
-
PGQ Query: uses property graphs and applies the
GRAPH_TABLEoperator for pattern matching.
See SQL Property Graph and SQL GRAPH Queries for more details.
Topics
- Benefits of Using Select AI on Property Graphs
Database users can query property graphs using Select AI to generate graph queries from natural language, reducing manual work and improving understanding of graph relationships. - How to Use Select AI on Property Graphs
Select AI enables you to explore graph data by using theDBMS_CLOUD_AI.GENERATEfunction or by usingSelect AI <action> <prompt>.
Parent topic: Select AI Features
Benefits of Using Select AI on Property Graphs
Database users can query property graphs using Select AI to generate graph queries from natural language, reducing manual work and improving understanding of graph relationships.
-
NL2SQL: Select AI’s NL2SQL capability now extends to graph queries enabling users to write natural language prompts such as “Find customers who bought a dress”.
-
SQL or PGQ: Depending on the data object, Select AI automatically generates SQL or PGQ query.
-
Productivity: Reduces time and effort in building graph queries using the
GRAPH_TABLEoperator. -
Conversations: Retains conversation context and queries a property graph.
Limitations
Select AI for Property Graphs does not support the following capabilities:
-
Synthetic data generation
-
Mixing of property graphs with other object types in the AI profile
-
Unsupported and intermittent queries. See Example: Sample Prompts for Property Graphs for more details.
Parent topic: Select AI for Property Graphs
How to Use Select AI on Property Graphs
Select AI enables you to explore graph
data by using the DBMS_CLOUD_AI.GENERATE function or by using
Select AI <action> <prompt>.
object_list
attribute of your AI profile, you can use:
-
SELECT AI <ACTION> <PROMPT>in the SQL command line to generate an output. -
DBMS_CLOUD_AI.GENERATEfunction and supply your prompt within the function.
The following are the supported actions: runsql,
showsql, explainsql, narrate, and
showpropmt. Select AI for Property Graph also supports
session-based short-term and customizable long-term conversations.
See Example: Select AI for Property Graphs and Example: Sample Prompts for Property Graphs to learn more.
Parent topic: Select AI for Property Graphs