Overview
Therelations() 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
Navigate Related Content
Create and Query Relations
Response Example
Use Cases
- Documentation Navigation - Link code to docs, examples to tutorials
- Knowledge Graphs - Build semantic connections between concepts
- Related Content Discovery - Surface relevant resources during retrieval
- Citation Tracking - Track references between documents
