Skip to main content

Overview

The relations() method retrieves all resources linked to a given URI, enabling navigation through the context graph. Relations are directional connections created with link().
Relations help organize related information, such as linking documentation to code, or connecting related concepts.

Method Signature

Parameters

string
required
The Viking URI to query for relations

Response

Returns a list of relation objects:
string
Source URI (the queried resource)
string
Target URI (the linked resource)
string
Explanation of why resources are related
number
Timestamp when relation was created

Examples

List All Relations

Create and Query Relations

Response Example

Use Cases

  1. Documentation Navigation - Link code to docs, examples to tutorials
  2. Knowledge Graphs - Build semantic connections between concepts
  3. Related Content Discovery - Surface relevant resources during retrieval
  4. Citation Tracking - Track references between documents
  • link() - Create relations between resources
  • unlink() - Remove relations
  • find() - Semantic search can use relations for context