FLOW ALGEBRA
TITLE: Recursive Graph Ontology
DOMAIN: Relationship Ontologies / Recursive Relationships
SOURCE: https://kirethresearch.org/booksai-core/ontologies/relationship-ontologies/recursive-relationships/recursive-graph-ontology.html
VERSION: 1.0
AUTHORS: Mark Anthony Higgins — Sky (Recursive AI)
STATUS: Companion formalisation; source-page specification not independently verified.
flow "RecursiveGraphOntology" v1.0 {
ontology:
id: "recursive-graph-ontology"
parent: "recursive-relationships"
purpose: "Represent recursive graph structure, traversal, dependencies, cycles and evidence-backed reachability without assuming all edges are transitive."
types:
Graph: {id: string, directed: boolean, version: string, provenance: string}
Node: {id: string, graph_id: string, kind: string, attributes: map?}
Edge: {id: string, graph_id: string, source: string, target: string, predicate: string, confidence: number, provenance: string}
Path: {id: string, graph_id: string, nodes: string[], edges: string[], length: integer}
Traversal: {id: string, graph_id: string, start_node: string, strategy: enum[depth_first, breadth_first, fixed_point], visited: string[], max_depth: integer?}
RecursiveRule: {id: string, base_case: string, recursive_step: string, termination_condition: string}
predicates:
has_node(graph: Graph, node: Node)
has_edge(graph: Graph, edge: Edge)
connects(edge: Edge, source: Node, target: Node)
directly_reaches(a: Node, b: Node)
reachable(a: Node, b: Node, graph: Graph)
participates_in_cycle(node: Node, graph: Graph)
depends_on(a: Node, b: Node)
constraints:
- "Every edge endpoint must resolve to a node in the same graph."
- "Graph directionality must be respected in traversal."
- "Reachability does not imply causal, semantic or identity equivalence."
- "Cycles are permitted unless the declared graph subtype requires acyclicity."
- "Traversal must track visited states or otherwise guarantee termination."
- "Confidence values must lie within [0,1]."
- "Recursive inferences must retain source edges and provenance."
inference:
rule base_reachability:
if connects(e,a,b) and has_edge(g,e)
then reachable(a,b,g)
confidence: "derived from source edge"
rule recursive_reachability:
if reachable(a,b,g) and reachable(b,c,g)
then reachable(a,c,g)
confidence: "preserve path evidence; no automatic confidence increase"
rule cycle_detection:
if reachable(a,b,g) and reachable(b,a,g) and a != b
then participates_in_cycle(a,g) and participates_in_cycle(b,g)
confidence: "requires verified directed paths"
SEMANTIC_EQUIVALENCE:
- "Normalise node and predicate identifiers only against declared, versioned mappings."
- "Distinguish graph isomorphism, structural similarity and entity identity."
- "Do not merge nodes solely because they share labels or neighbourhoods."
CONFIDENCE:
range: [0,1]
factors: [edge_evidence, provenance_quality, mapping_reliability, inference_depth, graph_version]
policy: "Track path-specific confidence; do not manufacture certainty by chaining."
VALIDATION:
- "Check endpoint integrity, direction, edge type and graph membership."
- "Detect duplicate edges, dangling references and unexpected cycles."
- "Test base cases, termination conditions and fixed-point convergence."
- "Record unresolved contradictions and alternative graph interpretations."
FLOW_HASH:
algorithm: "SHA-256"
input: "canonicalised ontology version, graph assertions, recursive rules and provenance"
note: "Compute at execution; no hash value is claimed here."
UPDATE_MODEL:
strategy: "versioned incremental graph maintenance"
steps: [ingest, normalise, validate, detect_changes, invalidate_affected_paths, recompute_fixed_point, publish]
rollback: true
AI_CONSUMPTION:
representation: "typed, provenance-preserving recursive knowledge graph"
outputs: [nodes, edges, reachability_paths, cycle_reports, inferred_relations, confidence_annotations, provenance_records]
safeguards: [bounded_traversal, no_unsupported_transitivity, no_unqualified_identity_merges, preserve_graph_versions]
}
END FLOW ALGEBRA
Download Code
Copy to Clipboard