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.
Status: Knowledge Graph extraction is currently in development. The API endpoints below represent the planned implementation.
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.
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
- LLM processes article content
- Identifies entities (subjects) and relationships (predicates)
- Generates RDF triples
- Stores triples linked to Walrus blob ID
Request
curl https://api.zing.protocol/v1/kg/extract \
-H "Authorization: Bearer {jwt_token}" \
-d article_id="walrus_blob_abc123"
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
curl https://api.zing.protocol/v1/kg/triples/walrus_blob_abc123 \
-H "Authorization: Bearer {jwt_token}"
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
curl "https://api.zing.protocol/v1/kg/search?predicate=discusses&object=AI" \
-H "Authorization: Bearer {jwt_token}"
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
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 Case | Description |
|---|---|
| Research | AI agents query facts across multiple creators |
| Recommendations | Suggest articles based on knowledge overlap |
| Trend Analysis | Track topics discussed across the platform |
| Plagiarism Detection | Identify copied content via similar triples |
| Sponsorship Matching | Match 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
| Component | Technology |
|---|---|
| Graph Database | Neo4j or SurrealDB |
| Extraction | LLM-based (configurable) |
| Storage | Linked to Walrus blob IDs |
| Access | Via 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
- Pay-Per-Query API - Learn how to access triples
- Attribution Ledger - Track AI usage
- Synthesis - Multi-source research