Reporting
Human-readable provenance reports over a generic knowledge graph.
This module turns a research-profile :class:~ideagraph.kg.graph.KnowledgeGraph
into prose a researcher can read: for a claim it shows the statement text, its
stored status, and the evidence that supports or refutes it, followed by a
whole-graph summary. It is pure presentation — it does not mutate the graph or
re-derive validation logic. The split of evidence into supporting and refuting
reuses :func:ideagraph.kg.profiles.research_ops.validate_node, so the report
and the validation engine can never disagree about which evidence backs a claim.
render_node_report(graph, node_id)
¶
Render a Markdown report for a single assertion node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph
|
KnowledgeGraph
|
The graph holding the node and its evidence. |
required |
node_id
|
str
|
The id of the node to report on. |
required |
Returns:
| Type | Description |
|---|---|
str
|
A Markdown string. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If |
Source code in src/ideagraph/kg/reporting.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
render_report(graph)
¶
Render a Markdown report for every assertion in the graph.
Assertions are the statement types that carry a validation status (claim / finding / result); background, methods, and the like are not reported here.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph
|
KnowledgeGraph
|
The graph to report on. |
required |
Returns:
| Type | Description |
|---|---|
str
|
A Markdown string. |
Source code in src/ideagraph/kg/reporting.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |