Integration Management: RAI Resources
Learn about RAI resources and how to manage them from Snowflake using the SQL Library for Snowflake.
There are two main RAI resources: RAI databases and RAI engines.
RAI databases are the core elements of the RAI Integration Services storage layer. RAI databases function very much like SQL databases because the Relational Knowledge Graph System (RKGS) is built with the same principles as a relational database management system (RDMS).
RAI engines are the computational heart of the RKGS, where graph algorithms and business rules are evaluated. They are analogous to warehouses (opens in a new tab) in Snowflake.
RAI resources are case-sensitive, unlike Snowflake resources.
A RAI data stream creates a change-data-capture (CDC) pipeline from a Snowflake data object (table or view) to a RAI data object (a base relation). This RAI data object has the same characteristics as a materialized view and you can think of it as such. Neither data objects are considered a resource, but rather are located in a storage resource: a database.
Similar to the RAI data stream, a graph is a RAI data object that “lives” inside a database. It is not considered a resource by itself.
CALL RAI.use_rai_database('<rai_database_name>'); CALL RAI.use_rai_engine('<rai_engine_name>');
In doing so, you’re setting a context for subsequent queries that require RAI resources.
This is analogous to the
USE (opens in a new tab) command in SQL.
You can check your RAI context by executing the following query:
SELECT RAI.current_rai_database(); SELECT RAI.current_rai_engine();
See RAI Context for more details.
Everyone with access to the SQL Library for Snowflake, and in particular
every member of the
<integration_user_role> role, which owns the SQL Library for Snowflake, can create, delete, and use RAI resources.
The permissions for whether or not a user can use or manage RAI resources depends solely on the permissions granted to the RAI OAuth client the SQL Library for Snowflake is using via the RAI integration.
The SQL Library for Snowflake includes functionality for managing RAI databases using the RAI Integration Services for Snowflake.
|Create||Create a RAI database.|
|Delete||Delete a RAI database.|
|Get info||Retrieve information about a RAI database.|
|Set context||Select a RAI database.|
|Get context||Return the current RAI database.|
The SQL Library for Snowflake includes functionality for managing RAI engines using the RAI Integration Services for Snowflake.
|Create||Create a RAI engine.|
|Delete||Delete a RAI engine.|
|Get info||Retrieve information about a RAI engine.|
|Set context||Select a RAI engine.|
|Get context||Return the current RAI engine.|
For more information on configuring and managing the RAI integration for Snowflake, check out the RAI Integration guide.