How to import Logical Models into Ellie

In Ellie v4.6, we added a new API endpoint for importing models. Here we’ll explain how to use this capability to programmatically import new Logical Models.

General idea

In simple terms, the overall process is like this:

  1. You have a data model (or a definition of one) in an external source.

  2. You extract the metadata of this model from the external source, including its entities, attributes, and relationships.

  3. You transform the metadata of the model into the JSON format used by Ellie.

  4. You call the POST /models endpoint with the JSON payload.

  5. Ellie checks that the JSON is defined correctly.

  6. Ellie creates a new Logical Model in your Model List.

This results in a new Logical Model being created in Ellie with all the entities, attributes, and relationships defined in the JSON file. The model diagram is automatically drawn on the canvas. The model itself is just like any other Logical Model in Ellie - you can edit it as you see fit, and e.g. move the entities around if you don’t find the auto-drawn diagram clear enough.

Prerequisites for using the API

You can find detailed specifications on this and other API endpoints here: https://ellie.atlassian.net/wiki/spaces/ELLIE/pages/783745025

In general, you need two things to use the API endpoints:

  1. The API must be enabled for your Ellie instance. By default, the API is not enabled for e.g. trials, and in some organizations, it might be completely disabled e.g. in case your IT department doesn’t want to have API endpoints available. If you’re unsure, you can always ask support@ellie.ai! There is no extra cost on enabling the API.

  2. You need to have an API key to authenticate. The API key is a token you can create & regenerate in Ellie’s admin interface (admin-level access needed). No API calls will go through unless a valid token is included. Note that the tokens are organization-wide, meaning that once you as an admin create one, it can be used by anyone in your organization.

Using the API - examples

You can access the API from any application or piece of code that can send REST requests. We have provided a couple of examples in our GitHub code sample library here: https://github.com/ellieapi/ellie-connectors

The code samples include Python scripts for reading database metadata from Snowflake & PostgreSQL and importing those as new logical models to Ellie. You are free to use and copy these samples as you like (licensed under MIT license) - just let us know at support@ellie.ai if you have bug reports or improvements!