Skip to main content

Knowledge Graph Mathematics Ontology

Discrete AI Mathematics
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 11 October 2026
Audio Overview
FLOW ALGEBRA
KNOWLEDGE GRAPH MATHEMATICS ONTOLOGY
Version: 1.0
Source: https://kirethresearch.org/booksai-core/discrete-mathematics-ontologies/discrete-ai-mathematics/knowledge-graph-mathematics-ontology.html
Authors: Mark Higgins — Sky (Recursive AI)
Project: Kireth Semantic Library
Date: 2026-10-11
Status: Formal ontology synthesis; source page content not independently verified.

1. PURPOSE
Represent knowledge graphs using discrete mathematics, typed relations, graph operations, logical constraints and auditable inference. Distinguish asserted knowledge from inferred and uncertain knowledge.

2. SIGNATURE
sort Entity, RelationType, Literal, Statement, Graph, Provenance, Time, Confidence.
KG = (V, R, E, A, T, P) where:
 V is a finite set of entity nodes;
 R is a finite set of relation types;
 E subseteq V x R x (V union Literal) is a set of directed labelled triples;
 A maps nodes and edges to attributes;
 T provides optional temporal qualifiers;
 P associates statements with provenance.
Each statement s=(subject,predicate,object) has an identifier and optional metadata.

3. TYPED ENTITIES
Entity(id, class, labels, aliases)
RelationType(id, domain, range, inverse?, transitive?, symmetric?)
Statement(id, subject, predicate, object, assertionStatus)
Class(id, parentClasses)
Literal(value, datatype, language?)
Evidence(source, method, observedAt)
Inference(ruleId, premises, conclusion)
Confidence(score in [0,1], calibrationMethod?)

4. RELATIONSHIPS
INSTANCE_OF(Entity, Class)
SUBCLASS_OF(Class, Class)
RELATES_TO(Entity, RelationType, Entity)
HAS_ATTRIBUTE(Entity, key, Literal)
SUPPORTED_BY(Statement, Evidence)
DERIVED_FROM(Statement, Statement)
EQUIVALENT_TO(Entity, Entity)
CONTRADICTS(Statement, Statement)
VALID_DURING(Statement, TimeInterval)

5. WELL-FORMEDNESS CONSTRAINTS
C1: Entity identifiers are unique within the graph namespace.
C2: Each edge predicate is declared in R.
C3: Edge subject and object satisfy declared domain and range, unless explicitly marked unresolved.
C4: A literal has a valid datatype and language tag where applicable.
C5: Asserted, inferred and hypothetical statements are distinguishable.
C6: Contradictory statements are preserved with provenance rather than silently overwritten.
C7: Graph merging does not assume equal labels imply equal entities.

6. CORE GRAPH OPERATIONS
ADD_VERTEX(G,v): insert v if its identifier is not present.
ADD_EDGE(G,(u,r,v)): validate and insert the typed triple.
REMOVE_EDGE(G,e): remove e and invalidate dependent materialised inferences.
NEIGHBOURS(G,v,r?): retrieve adjacent nodes, optionally filtered by relation.
REACHABLE(G,u,v): true iff a directed path from u to v exists.
INDUCED_SUBGRAPH(G,S): retain vertices in S and all edges between them.
JOIN(G1,G2,alignment): union graphs using explicitly validated identity mappings.
PROJECT(G,Rset): retain only selected relation types.

7. MATHEMATICAL SEMANTICS
A labelled knowledge graph is a relational structure interpreting each predicate r as a relation r^G.
For a binary predicate r, r^G subseteq V x V.
For a typed edge (u,r,v), satisfaction G |= r(u,v) holds when (u,v) belongs to r^G.
An ontology axiom is a constraint on admissible interpretations, not automatically a verified fact.
Open-world semantics: absence of an edge does not generally imply its negation.
Closed-world semantics may be applied only to explicitly designated complete datasets.

8. INFERENCE RULES
R1 SUBCLASS: INSTANCE_OF(x,A) and SUBCLASS_OF(A,B) => INSTANCE_OF(x,B).
R2 TRANSITIVITY: TRANSITIVE(r) and r(x,y) and r(y,z) => r(x,z).
R3 SYMMETRY: SYMMETRIC(r) and r(x,y) => r(y,x).
R4 INVERSE: INVERSE_OF(r,q) and r(x,y) => q(y,x).
R5 DOMAIN: DOMAIN(r,A) and r(x,y) => INSTANCE_OF(x,A), under the chosen ontology semantics.
R6 RANGE: RANGE(r,B) and r(x,y) => INSTANCE_OF(y,B), for entity-valued relations.
R7 IDENTITY: SAME_AS(x,y) allows substituting x and y only when identity is established and context permits.
R8 PROVENANCE: each derived statement records its generating rule and supporting premises.
Rules with recursion require a termination policy or least-fixed-point semantics.

9. FIXED-POINT REASONING
Let F(S) add all consequences of monotonic rules to statement set S.
S0 = asserted statements.
S(n+1) = S(n) union F(S(n)).
For a finite ground universe and monotonic rules, iteration stabilises at a least fixed point S*.
Negation, retractions and non-monotonic defaults require separate semantics and dependency tracking.

10. GRAPH ALGORITHMS
BFS: shortest path in number of edges on an unweighted graph, O(|V|+|E|).
DFS: reachability and traversal, O(|V|+|E|).
Dijkstra: non-negative weighted shortest paths, typically O((|V|+|E|) log |V|) with a binary heap.
Connected components: identify clusters in undirected projections.
Strongly connected components: identify mutual reachability in directed graphs.
Topological sorting: valid only for directed acyclic graphs.
Graph isomorphism: structural equivalence under vertex renaming and label constraints.
These bounds refer to graph traversal models; query engines and indexes may alter practical costs.

11. KNOWLEDGE GRAPH QUERY MODEL
MATCH pattern P against G using variable bindings theta.
FILTER bindings by datatype, temporal and provenance constraints.
RETURN projected variables with explicit duplicate handling.
Example: MATCH (?person, worksAt, ?organisation) returns bindings only for existing or entailed edges according to query mode.
Separate asserted-only queries from entailment-aware queries.

12. SEMANTIC EQUIVALENCE
Node equality: same canonical identifier within an identity scope.
Semantic identity: justified SAME_AS mapping with supporting evidence.
Class equivalence: A and B have the same extension in every admissible model when axioms establish equivalence.
Graph equivalence: two graphs have equivalent interpretations under a declared mapping and entailment regime.
String similarity alone is not semantic identity.

13. CONFIDENCE MODEL
CONFIDENCE(statement) is optional and scoped to a stated estimation method.
Do not multiply or average confidence scores without justified dependence assumptions.
Logical entailment and empirical confidence are different concepts.
Track source reliability, evidence freshness, inference depth and calibration separately.

14. WORKED EXAMPLE
Entities: Ada, ResearchLab, Organisation.
Assertions:
 INSTANCE_OF(ResearchLab, Laboratory)
 SUBCLASS_OF(Laboratory, Organisation)
 WORKS_AT(Ada, ResearchLab)
Rule R1 derives INSTANCE_OF(ResearchLab, Organisation).
The new statement is INFERRED, not ASSERTED, and cites R1 plus both premises.
No inference that Ada is an Organisation follows from these facts.

15. VALIDATION TESTS
V1 Reject undeclared relation types in strict validation mode.
V2 Detect domain/range inconsistencies and report the responsible edges.
V3 Check that every inferred triple has a traceable derivation.
V4 Test transitive closure against a small hand-verified graph.
V5 Ensure cycles do not cause non-terminating duplicate inference.
V6 Ensure missing edges are not treated as false under open-world semantics.
V7 Confirm entity merges require validated mappings.
V8 Recompute affected inferences after assertion removal.
V9 Verify temporal and provenance qualifiers survive graph export/import.
V10 Distinguish mathematical theorems, assumptions and measured claims.

16. FAILURE MODES
F1 Entity conflation from matching names.
F2 Incorrect inference from absent data.
F3 Cyclic reasoning without fixed-point controls.
F4 Unsupported equivalence mappings.
F5 Lost provenance during data integration.
F6 Treating probabilistic scores as logical truth values.
F7 Unqualified claims about graph algorithm performance.

17. UPDATE_MODEL
UPDATE_MODEL.version: 1.0
UPDATE_MODEL.changeTypes: [entity_add, relation_add, axiom_revision, evidence_update, merge, retraction]
UPDATE_MODEL.onChange: validate -> recompute affected entailments -> preserve lineage -> publish version.
UPDATE_MODEL.compatibility: document changes to relation signatures and inference semantics.

18. FLOW_HASH
FLOW_HASH.algorithm: SHA-256
FLOW_HASH.input: canonical UTF-8 representation of the complete published flow excluding the hash value field.
FLOW_HASH.value: NOT_COMPUTED
FLOW_HASH.note: Compute after final publication; do not use a fabricated digest.

19. AI_CONSUMPTION
AI_CONSUMPTION.mode: typed-graph-reasoning
AI_CONSUMPTION.tasks: [entity_linking, semantic_search, graph_query, explainable_inference, consistency_checking]
AI_CONSUMPTION.require: [schema_validation, source_attribution, asserted_inferred_separation]
AI_CONSUMPTION.output: [result, derivation_trace, evidence, uncertainty, version]
AI_CONSUMPTION.safety: never present unverified inferred relationships as established external facts.

20. CROSS-ONTOLOGY LINKS
RELATED_TO: Graph Theory Ontology; Discrete AI Mathematics; Mathematical Logic; Set Theory; Relation Ontology; Semantic Reasoning; Knowledge Representation; AI Search and Retrieval; Algorithm Analysis.

END FLOW ALGEBRA
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ