ontocast.agent.render_facts¶
Fact rendering agent for OntoCast.
This module provides functionality for rendering facts from RDF graphs into human-readable formats, making the extracted knowledge more accessible and understandable.
render_facts(state, tools)
async
¶
Structured hybrid facts renderer with Turtle/SPARQL decision logic.
This function decides between generating bare Turtle for fresh facts and SPARQL operations for updates based on whether facts exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
AgentState
|
The current agent state |
required |
tools
|
ToolBox
|
The toolbox containing necessary tools |
required |
Returns:
| Name | Type | Description |
|---|---|---|
AgentState |
AgentState
|
Updated state with rendered facts |
Source code in ontocast/agent/render_facts.py
render_facts_fresh(state, tools)
async
¶
Render fresh facts from the current chunk into Turtle format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
AgentState
|
The current agent state containing the chunk to render. |
required |
tools
|
ToolBox
|
The toolbox instance providing utility functions. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
AgentState |
AgentState
|
Updated state with rendered facts. |
Source code in ontocast/agent/render_facts.py
render_facts_update(state, tools)
async
¶
Render facts updates using SPARQL operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
AgentState
|
The current agent state containing the chunk to render. |
required |
tools
|
ToolBox
|
The toolbox instance providing utility functions. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
AgentState |
AgentState
|
Updated state with rendered facts. |