FLOW ALGEBRA
Entity Relationship Ontology
Version: 4.0
Source: https://kirethresearch.org/booksai-core/ontologies/relationship-ontologies/foundations-of-relationships/entity-relationship-ontology.html
Authors: Mark Higgins — Sky (Recursive AI)
PURPOSE
Formalise entities, attributes, identifiers, and typed relationships for semantic knowledge representation, integrity checking, and AI reasoning.
ENTITY_TYPES
Entity := {id: IRI, type: Class, labels: Set[String], attributes: Map[Property, Value], provenance: Source}
Class := {id: IRI, parent_classes: Set[Class], constraints: Set[Constraint]}
Relationship := {id: IRI, predicate: Property, subject: Entity, object: Entity|Literal, qualifiers: Map, provenance: Source}
RELATIONSHIP_TYPES
is_a: Class -> Class
instance_of: Entity -> Class
part_of: Entity -> Entity
has_part: Entity -> Entity
related_to: Entity -> Entity
depends_on: Entity -> Entity
causes: Event -> Event
precedes: Event -> Event
located_in: Entity -> Place
created_by: Artifact -> Agent
FLOW_RULES
R1: instance_of(x,C) AND is_a(C,D) => instance_of(x,D)
R2: part_of(x,y) AND part_of(y,z) => part_of(x,z) [when transitivity is declared]
R3: has_part(x,y) <=> part_of(y,x)
R4: predicate(x,y) => domain(predicate)(x) AND range(predicate)(y) [type-check; do not infer without declared semantics]
R5: same_as(x,y) => merge identity only after verified equivalence and provenance review
R6: disjoint(C,D) AND instance_of(x,C) AND instance_of(x,D) => validation_conflict(x)
CARDINALITY_AND_INTEGRITY
Each entity has exactly one stable identifier within its namespace.
Relationship endpoints must satisfy declared domain/range constraints.
Cardinality rules: minCount, maxCount, exactlyCount, uniqueKey.
Do not assume a missing relation is false under open-world semantics.
SEMANTIC_EQUIVALENCE
exact_match(x,y): equivalent meaning and scope under explicit mapping.
close_match(x,y): overlapping meaning without identity assertion.
related_match(x,y): meaningful association without equivalence.
Keep same_as distinct from lexical similarity and close_match.
CONFIDENCE
confidence(assertion) in [0,1].
Aggregate evidence with source reliability, independence, temporal relevance, and conflict penalties.
Do not treat confidence as logical truth or convert uncertain claims into facts.
INFERENCE
Input: typed entities, declared predicates, axioms, and provenance.
Process: normalise identifiers -> validate types -> apply sound rules -> detect contradictions -> annotate derived edges.
Output: entailed triples with derivation traces and confidence annotations.
VALIDATION
Check identifiers, duplicate entities, dangling references, domain/range, inverse consistency, cardinality, disjointness, provenance, and temporal validity.
Record warnings separately from hard violations; specify closed-world assumptions when used.
FLOW_HASH
FLOW_HASH := SHA256(canonicalise(ontology_version, entities, predicates, axioms, provenance, update_timestamp))
Use deterministic ordering and normalised UTF-8 for reproducibility.
UPDATE_MODEL
1. Ingest new assertions with timestamps and source identifiers.
2. Compare against current canonical graph.
3. Resolve identity candidates without automatic destructive merging.
4. Revalidate affected constraints and recompute derived relationships.
5. Preserve change history and regenerate FLOW_HASH.
AI_CONSUMPTION
Expose machine-readable entities and typed edges with stable IRIs, human-readable labels, confidence, provenance, inference traces, and validation status.
Support graph traversal, retrieval, question answering, and explainable reasoning.
Never present a generated inference as a directly observed fact.
END FLOW ALGEBRA
Download Code
Copy to Clipboard