Unify and manage your data

Create Reltio object type views in Snowflake

Learn how to create a views for each Reltio object type in Snowflake.

Before you create Reltio object type views, you must have created staging tables. For more information, see topic Create Reltio object type staging tables in Snowflake.
A Snowflake view allows the result of a query to be accessed as if it were a table. Create a view for each Reltio object type: entities, relationships, interactions, matches, merges, and links. For more information on object types, see topic Reltio object types.
Important: Consume data from these views rather than from the Reltio object type staging tables in Snowflake.
To create Reltio object type views in your Snowflake environment:
  1. In the Snowflake application worksheet area, create a new SQL worksheet.
  2. In the SQL worksheet, run these commands to create a view for each Reltio object type. Run each command individually and then check the result in step 3 before creating a view for the next object type:
    Entities view All values
    CREATE VIEW "<database_name>"."<schema_name>"."entity_<entityType>"
    AS SELECT *
        FROM "entities"
        WHERE "type" = 'configuration/entityTypes/<entityType>' AND "active" = TRUE;
    OV values only (optional)
    CREATE VIEW "<database_name>"."<schema_name>"."entity_<entityType>_ov"
    AS SELECT "uri", "timestamp", "type", ATTRIBUTES_MULTI_VALUE_TRANSFORMATION("attributes") as "attributes", CROSSWALKS_TRANSFORMATION("crosswalks") as "crosswalks", "analyticsAttributes", "createdBy", "createdTime", "updatedBy", "updatedTime", "startDate", "endDate", "version"
        FROM "entities"
        WHERE "type" = 'configuration/entityTypes/<entityType>' AND "active" = TRUE;
    Relations view All values
    CREATE VIEW "<database_name>"."<schema_name>"."relation_<relationType>"
    AS SELECT *
        FROM "relations"
        WHERE "type" = 'configuration/relationTypes/<relationType>' AND "active" = TRUE; 
    OV values only (optional)
    CREATE VIEW "<database_name>"."<schema_name>"."relation_<relationType>_ov"
    AS SELECT "uri", "timestamp", "type", ATTRIBUTES_MULTI_VALUE_TRANSFORMATION("attributes") as "attributes", CROSSWALKS_TRANSFORMATION("crosswalks") as "crosswalks", "startObject", "endObject", "startRefPinned", "startRefIgnored", "endRefPinned", "endRefIgnored", "createdBy", "createdTime", "updatedBy", "updatedTime", "startDate", "endDate", "version"
        FROM "relations"
        WHERE "type" = 'configuration/relationTypes/<relationType>' AND "active" = TRUE;
    Interactions view
    CREATE VIEW "<database_name>"."<schema_name>"."interaction_<interactionType>"
    AS SELECT *
        FROM "interactions"
        WHERE "type" = 'configuration/interactionTypes/<interactionType>' AND "active" = TRUE;
    
    Matches view
    CREATE VIEW "<database_name>"."<schema_name>"."activeMatches"
    AS SELECT *
        FROM "matches"
        WHERE "active" = TRUE;
    
    Merges view
    CREATE VIEW "<database_name>"."<schema_name>"."activeMerges"
    AS SELECT *
        FROM "merges"
        WHERE "active" = TRUE;
    
    Links view
    CREATE VIEW "<database_name>"."<schema_name>"."activeLinks"
    AS SELECT *
       FROM "links"
       WHERE "active" = TRUE;
    
    where:
    • <database_name>: Is the name of the database you created in Create a Snowflake database.

    • <schema_name>: Is the name of the schema you created in Create a Snowflake schema.

    • <entityType>: Is the Reltio entity type you want to create a view for.

    • <relationshipType>: Is the Reltio relationship type you want to create a view for.

    • <interactionType>: Is the Reltio interaction type you want to create a view for.

  3. In the SQL worksheet, view the Successfully created notification message.
  4. Ensure you complete steps 2 and 3 for each individual object type in your data model.

    For example, if if you have 6 entity types defined in your data model, run the command to create an entities view and confirm it's been successfully created 6 times. If you're creating both All values and OV values only views, run the command and check that it's successful 12 times.

For general information, see Create view in the Snowflake SQL command reference.