Knowledge Graph API

The Knowledge Graph API enables AI agents and researchers to query structured data extracted from creator content. Knowledge triples (Subject → Predicate → Object) are automatically extracted from articles and stored for semantic querying.

What is a Knowledge Triple?

Knowledge triples are the basic unit of the Knowledge Market:

Subject → Predicate → Object

Example:
"Creator Alice" → "published" → "Article about AI"

This structured format allows AI agents to:

  • Query specific facts across multiple articles
  • Build semantic understanding of content relationships
  • Perform complex reasoning over creator knowledge bases

The Knowledge Triple Model

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the triple.

  • Name
    subject
    Type
    string
    Description

    The subject entity (e.g., creator address, article ID).

  • Name
    predicate
    Type
    string
    Description

    The relationship (e.g., "published", "discussed", "analyzed").

  • Name
    object
    Type
    string
    Description

    The object entity (e.g., article ID, topic).

  • Name
    blob_id
    Type
    string
    Description

    The Walrus blob ID of the source content.

  • Name
    confidence
    Type
    number
    Description

    Extraction confidence score (0-1).

  • Name
    created_at
    Type
    timestamp
    Description

    When the triple was extracted.


POST/v1/kg/extract

Extract Triples

Extract knowledge triples from an article. This is automatically done when content is published, but can also be triggered manually.

Required attributes

  • Name
    article_id
    Type
    string
    Description

    The article to extract triples from.

How it works

  1. LLM processes article content
  2. Identifies entities (subjects) and relationships (predicates)
  3. Generates RDF triples
  4. Stores triples linked to Walrus blob ID

Request

POST
/v1/kg/extract
curl https://api.zing.protocol/v1/kg/extract \
  -H "Authorization: Bearer {jwt_token}" \
  -d article_id="walrus_blob_abc123"

GET/v1/kg/triples/:article_id

Get Article Triples

Retrieve all knowledge triples extracted from a specific article.

Path parameters

  • Name
    article_id
    Type
    string
    Description

    The article ID to get triples for.

Request

GET
/v1/kg/triples/walrus_blob_abc123
curl https://api.zing.protocol/v1/kg/triples/walrus_blob_abc123 \
  -H "Authorization: Bearer {jwt_token}"

GET/v1/kg/search

Search Triples

Search across all knowledge triples. Supports filtering by subject, predicate, object, and creator.

Query parameters

  • Name
    subject
    Type
    string
    Description

    Filter by subject entity.

  • Name
    predicate
    Type
    string
    Description

    Filter by predicate.

  • Name
    object
    Type
    string
    Description

    Filter by object entity.

  • Name
    creator
    Type
    string
    Description

    Filter by creator address.

  • Name
    query
    Type
    string
    Description

    Natural language query (when using AI search).

  • Name
    limit
    Type
    integer
    Description

    Number of results (default: 10).

Request

GET
/v1/kg/search
curl "https://api.zing.protocol/v1/kg/search?predicate=discusses&object=AI" \
  -H "Authorization: Bearer {jwt_token}"

GET/v1/kg/creators/:address

Creator Knowledge Graph

Get the aggregated knowledge graph for a specific creator. Shows all triples from their content.

Path parameters

  • Name
    address
    Type
    string
    Description

    The creator's Sui address.

Request

GET
/v1/kg/creators/0xcreator...alice
curl https://api.zing.protocol/v1/kg/creators/0xcreator...alice \
  -H "Authorization: Bearer {jwt_token}"

Extraction Process

Article Published

LLM Processing

┌─────────────────────────────────────────┐
│  Entity Recognition                      │
│  - Creators, Articles, Topics            │
└─────────────────────────────────────────┘

┌─────────────────────────────────────────┐
│  Relationship Detection                  │
│  - published, discusses, analyzes        │
│  - created, updated, referenced          │
└─────────────────────────────────────────┘

┌─────────────────────────────────────────┐
│  Triple Generation                       │
│  Subject → Predicate → Object            │
└─────────────────────────────────────────┘

┌─────────────────────────────────────────┐
│  Confidence Scoring                      │
│  - Based on extraction clarity           │
│  - Stored with each triple               │
└─────────────────────────────────────────┘

Stored in Graph Database
(Neo4j / SurrealDB)

Available for Query

Use Cases

Use CaseDescription
ResearchAI agents query facts across multiple creators
RecommendationsSuggest articles based on knowledge overlap
Trend AnalysisTrack topics discussed across the platform
Plagiarism DetectionIdentify copied content via similar triples
Sponsorship MatchingMatch brands to creators by topic alignment

Integration with Pay-Per-Query

Knowledge triples are the basis for the Pay-Per-Query system:

Query Request → Payment Verification → Triple Access

     ↓         (via PPQ Rails)

Locked until query fee paid

AI agent receives triple data

Technical Details

ComponentTechnology
Graph DatabaseNeo4j or SurrealDB
ExtractionLLM-based (configurable)
StorageLinked to Walrus blob IDs
AccessVia Pay-Per-Query rails

Coming Soon

  • Multi-modal extraction - Extract triples from images
  • Temporal knowledge - Time-series knowledge graphs
  • Cross-lingual KG - Multi-language support

Next Steps

Was this page helpful?