Graphlit Platform
Developer PortalChangelogPlatform StatusMore InformationJoin Discord
  • Graphlit Platform
    • What is Graphlit?
    • Key Concepts
  • Getting Started
    • Sign up for Graphlit
    • Create Graphlit Project
    • For Python Developers
    • For Node.js Developers
    • For .NET Developers
  • 🚀Quickstart
    • Next.js applications
      • GitHub Code
    • Python applications
      • GitHub Code
  • Graphlit Data API
    • API Usage
      • API Endpoints
      • API Authentication
      • API Explorer
      • GraphQL 101
    • API Reference
      • Content
        • Ingest With Workflow
        • Ingest File
        • Ingest Encoded File
        • Ingest Web Page
        • Ingest Text
        • Semantic Search
          • Query All Content
          • Query Facets
          • Query By Name
          • Filter By Contents
        • Metadata Filtering
          • Filter By Observations
          • Filter By Feeds
          • Filter By Collections
          • Filter By Content Type
          • Filter By File Type
          • Filter By File Size Range
          • Filter By Date Range
        • Summarize Contents
        • Extract Contents
        • Publish Contents
      • Knowledge Graph
        • Labels
        • Categories
        • Persons
        • Organizations
        • Places
        • Events
        • Products
        • Repos
        • Software
      • Collections
      • Feeds
        • Create Feed With Workflow
        • Create RSS Feed
        • Create Podcast Feed
        • Create Web Feed
        • Create Web Search Feed
        • Create Reddit Feed
        • Create Notion Feed
        • Create YouTube Feed
        • User Storage Feeds
          • Create OneDrive Feed
          • Create Google Drive Feed
          • Create SharePoint Feed
        • Cloud Storage Feeds
          • Create Amazon S3 Feed
          • Create Azure Blob Feed
          • Create Azure File Feed
          • Create Google Blob Feed
        • Messaging Feeds
          • Create Slack Feed
          • Create Microsoft Teams Feed
          • Create Discord Feed
        • Email Feeds
          • Create Google Mail Feed
          • Create Microsoft Outlook Feed
        • Issue Feeds
          • Create Linear Feed
          • Create Jira Feed
          • Create GitHub Issues Feed
        • Configuration Options
      • Workflows
        • Ingestion
        • Indexing
        • Preparation
        • Extraction
        • Enrichment
        • Actions
      • Conversations
      • Specifications
        • Azure OpenAI
        • OpenAI
        • Anthropic
        • Mistral
        • Groq
        • Deepseek
        • Replicate
        • Configuration Options
      • Alerts
        • Create Slack Audio Alert
        • Create Slack Text Alert
      • Projects
    • API Changelog
    • Multi-tenant Applications
  • JSON Mode
    • Overview
    • Document JSON
    • Transcript JSON
  • Content Types
    • Files
      • Documents
      • Audio
      • Video
      • Images
      • Animations
      • Data
      • Emails
      • Code
      • Packages
      • Other
    • Web Pages
    • Text
    • Posts
    • Messages
    • Emails
    • Issues
  • Data Sources
    • Feeds
  • Platform
    • Developer Portal
      • Projects
    • Cloud Platform
      • Security
      • Subprocessors
  • Resources
    • Community
Powered by GitBook
On this page

Was this helpful?

  1. Graphlit Data API
  2. API Reference

Knowledge Graph

Create, manage and query observed entities in the knowledge graph.

Last updated 8 months ago

Was this helpful?

As Google presented in their classic , the structure of a knowledge graph is based on entities and the relationships between them.

... a “graph”—that understands real-world entities and their relationships to one another: things, not strings.

Graphlit automatically creates a knowledge graph from the entities found in your content, by using Machine Learning (ML) models to identify people, places and things.

Entity extraction is supported as an optional stage of content workflows. Using ML models such as Azure Cognitive Services, Graphlit analyzes text or images and extracts entities observed in your Content entities.

The data model for the knowledge graph adheres to the standard for entity properties.

The knowledge graph adds context to the text found in documents, audio transcripts or Slack messages, which enhances the search and discovery of the knowledge.

Additionally, these entities can be enriched via external data sources to provide even more context. For example, if an ML model found the place 'Seattle' in a document, Graphlit can enrich the 'Seattle' place entity with information from a Google Maps, a weather API, or a customer's database. (This enrichment process can be done on any entity type, not just places.)

When an entity is found in a piece of content, we call this an observation, as in, we are observing the entity in the content.

In addition to observations being automatically created via entity extraction, you can create your own observations on previously-ingested content.

An observation requires an observable entity (specified by name or ID), one or more occurrences within the content, and a content reference. Occurrences can be time-based - for audio or video content, text-based - for web pages or documents, or bounding box-based - for images or video.

Create Observation

Mutation:

mutation CreateObservation($observation: ObservationInput!) {
  createObservation(observation: $observation) {
    id
  }
}

Variables:

{
  "observation": {
    "type": "LABEL",
    "observable": {
      "name": "Sentiment"
    },
    "occurrences": [
      {
        "type": "TIME",
        "confidence": 1.25,
        "startTime": "PT1M",
        "endTime": "PT1M30S"
      },
      {
        "type": "TIME",
        "confidence": -0.75,
        "startTime": "PT3M30S",
        "endTime": "PT4M"
      }
    ],
    "content": {
      "id": "2ea78934-506b-4f0b-81c7-e4771f06557d"
    }
  }
}

Response:

{
  "id": "13d84a2d-3a79-4533-95b2-4fb6ae61db5a"
}
Update Observation

Mutation:

mutation UpdateObservation($observation: ObservationUpdateInput!) {
  updateObservation(observation: $observation) {
    id
  }
}

Variables:

{
  "observation": {
    "type": "LABEL",
    "observable": {
      "name": "Sentiment"
    },
    "occurrences": [
      {
        "type": "TIME",
        "confidence": 1.1,
        "startTime": "PT10M",
        "endTime": "PT10M30S"
      }
    ],
    "content": {
      "id": "2ea78934-506b-4f0b-81c7-e4771f06557d"
    },
    "id": "13d84a2d-3a79-4533-95b2-4fb6ae61db5a"
  }
}

Response:

{
  "id": "13d84a2d-3a79-4533-95b2-4fb6ae61db5a"
}
Delete Observation

Mutation:

mutation DeleteObservation($id: ID!) {
  deleteObservation(id: $id) {
    id
    state
  }
}

Variables:

{
  "id": "13d84a2d-3a79-4533-95b2-4fb6ae61db5a"
}

Response:

{
  "id": "13d84a2d-3a79-4533-95b2-4fb6ae61db5a",
  "state": "DELETED"
}
Get Observation

Query:

query GetObservation($id: ID!) {
  observation(id: $id) {
    id
    creationDate
    owner {
      id
    }
    type
    observable {
      id
      name
    }
    occurrences {
      type
      confidence
      startTime
      endTime
      pageIndex
      boundingBox {
        left
        top
        width
        height
      }
    }
  }
}

Variables:

{
  "id": "13d84a2d-3a79-4533-95b2-4fb6ae61db5a"
}

Response:

{
  "type": "LABEL",
  "observable": {
    "name": "Sentiment",
    "id": "6f810022-9e7a-4f38-9984-89e2179d9a50"
  },
  "occurrences": [
    {
      "type": "TIME",
      "confidence": 1.25,
      "startTime": "PT1M",
      "endTime": "PT1M30S"
    },
    {
      "type": "TIME",
      "confidence": -0.75,
      "startTime": "PT3M30S",
      "endTime": "PT4M"
    }
  ],
  "id": "13d84a2d-3a79-4533-95b2-4fb6ae61db5a",
  "creationDate": "2023-09-06T20:53:39Z",
  "owner": {
    "id": "530a3721-3273-44b4-bff4-e87218143164"
  }
}

Pick an Observable entity type below to learn more:

"Things, Not Strings" article
Schema.org

Labels

Categories

Persons

Organizations

Places

Events

Products

Repos

Software