Curiosity for Developers
  • Overview
  • Getting Started
    • Introduction
    • System Overview
      • Workspace
      • Connectors
      • Front End
    • Requirements
    • Installation
      • Deploying on Windows
        • Download Curiosity Workspace for Windows
      • Deploying on Docker
        • Deploying using Docker Desktop App
        • Docker Hub
      • Deploying on Kubernetes
      • Deploying on OpenShift
      • Configuration
    • Configure your Workspace
    • Connecting to a Workspace
      • Download App
    • Built-in Templates
  • Security
    • Introduction
    • Hosting
    • Encryption
    • Users and Access
      • User Invitations
      • Single Sign-On (SSO)
        • Google Sign-In
        • Microsoft / Azure AD
        • Okta
        • Auth0
    • Permissions Management
    • Auditing
    • Teams management
    • Configuring Backup
      • Restoring a backup
    • Activate a workspace license
  • Data Sources
    • Introduction
    • User Apps
    • Workspace Integrations
    • API Integrations
      • Introduction
      • Data Modeling
      • Writing a Connector
      • Access Control
      • API Tokens
      • API Overview
      • Tips
    • Supported File Types
    • Curiosity CLI
      • Installation
      • Authentication
      • Commands
  • Search
    • Introduction
    • Languages
    • Synonyms
    • Ranking
    • Filters
    • Search Permissions and Access Control
  • Endpoints
    • Introduction
    • Creating an endpoint
    • Calling an endpoint
    • Endpoint Tokens
    • Endpoints API
  • Interfaces
    • Introduction
    • Local Development
    • Deploying a new interface
    • Routing
    • Node Renderers
    • Sidebar
    • Views
  • Artificial Intelligence
    • Introduction
    • Embeddings Search
    • AI Assistant
      • Enabling AI Assistant
    • Large Language Models
      • LLMs Models Configuration
      • Self-Hosted Models
    • Image Search
    • Audio and Video Search
  • Sample Workspaces
    • Introduction
    • HackerNews
    • Aviation Incidents
    • Covid Papers
    • NASA Public Library
    • Suggest a Recipe
  • Basic Concepts
    • Graph database
    • Search Engine
  • Troubleshooting
    • FAQs
      • How long does it take to set up?
      • How does Curiosity keep my data safe?
      • Can we get Curiosity on-premises?
      • Can I connect custom data?
      • How does Workspace pricing work?
      • Which LLM does Curiosity use?
      • What's special about Curiosity?
      • How are access permissions handled?
      • What enterprise tools can I connect?
      • How to access a workspace?
      • How do I hard refresh my browser?
      • How do I report bugs?
      • How do I solve connectivity issues?
      • How do I contact support?
  • Policies
    • Terms of Service
    • Privacy Policy
Powered by GitBook
On this page
  1. Data Sources
  2. API Integrations

Data Modeling

PreviousIntroductionNextWriting a Connector

Last updated 1 year ago

The first step of creating a data connector is to design a graph data model for your source data. A graph data model consists of two main components: Nodes and Edges.

To create a graph data model for your source data, you need to identify which entities and relationships are relevant for your use case and how they should be represented as nodes and edges with properties. When modelling your data in a graph, it is useful to think in terms of pairs of edges (such as HasAuthor + AuthorOf, or HasReview + ReviewOf), as relationships are unidirectional in a Curiosity graph.

For example, suppose you want to create a graph database for an online bookstore. You might decide to model your data as follows:

Nodes:

  • Book: A book entity with properties such as title, genre, price, rating, etc.

  • Author: A person that has written a book, with properties such as name, website, etc.

  • Customer: A customer entity with properties such as name, email, address, phone, etc.

  • Order: An order entity with properties such as date, total amount, status, etc.

Edges:

  • HasAuthor, AuthorOf: A relationship between books and their authors.

  • HasOrder, OrderOf: A relationship between a customer and his/her orders.

  • InOrder, HasItem: A relationship between a book and the order that purchased it.

  • HasReview, ReviewOf: A relationship between a book and a review.

  • ReviewBy, WroteReview: A relationship between a review and the customer who wrote it.

You need to define your schema before you can ingest any data. You can do so in two ways: in the user interface, under Manage > Schema, or via the data connector APIs.

You can always change your data types by adding or removing fields, but there are some limitations on what changes you can do. For example, you cannot change the Key field from a data type, nor the data type of a field. If you need to do these changes, you'll need to first delete your data schema, which will also delete all data of the type.

Once you have designed your graph data model for your source data, you need to write code that extracts the relevant information from the source location and creates nodes and edges in your Curiosity Workspace using the Curiosity APIs. Curiosity provides two data-connection libraries, one for writing data connectors in C# and another for connectors in Python code. The includes examples using C# code, but most methods are also available in the Python package.

following section