FLOW ALGEBRA
Ontology: Knowledge Graph Metadata Ontology
Domain: Metadata Ontologies > Knowledge Metadata
Canonical URL: https://kirethresearch.org/booksai-core/ontologies/metadata-ontologies/knowledge-metadata/knowledge-graph-metadata-ontology.html
Authors: Mark Anthony Higgins — Sky (Recursive AI)
flow "KnowledgeGraphMetadataOntology" v1.0
# ---------- DOMAIN ----------
domain:
class: MetadataOntology
category: KnowledgeMetadata
subject: KnowledgeGraphMetadata
purpose:
- represent metadata describing knowledge graphs
- preserve graph identity, schema, entities, relationships, provenance, and versions
- support graph discovery, validation, integration, reasoning, and governance
- distinguish asserted graph content from inferred or derived graph content
- enable machine-readable reasoning over knowledge graph structures
# ---------- CORE ENTITY ----------
entity KnowledgeGraphMetadata:
type: KnowledgeMetadata
describes: KnowledgeGraph
may_include:
- graph_identifier
- graph_name
- description
- ontology
- schema
- entity_types
- relationship_types
- node_count
- edge_count
- named_graph
- namespace
- provenance
- source
- confidence
- quality
- version
- temporal_context
- access_metadata
- update_metadata
entity KnowledgeGraph:
type: SemanticGraph
composed_of:
- GraphNode
- GraphEdge
entity GraphNode:
type: SemanticEntity
may_represent:
- Entity
- Concept
- Literal
- Event
- Resource
entity GraphEdge:
type: SemanticRelationship
connects:
- source_node
- target_node
entity GraphIdentifier:
type: Identifier
identifies: KnowledgeGraph
# ---------- RELATIONSHIPS ----------
relationships:
KnowledgeGraphMetadata -> DESCRIBES -> KnowledgeGraph
KnowledgeGraph -> IDENTIFIED_BY -> GraphIdentifier
KnowledgeGraph -> CONTAINS -> GraphNode
KnowledgeGraph -> CONTAINS -> GraphEdge
GraphEdge -> HAS_SOURCE -> GraphNode
GraphEdge -> HAS_TARGET -> GraphNode
GraphEdge -> HAS_PREDICATE -> RelationshipType
GraphNode -> MAY_HAVE_TYPE -> EntityType
KnowledgeGraph -> MAY_CONFORM_TO -> GraphSchema
KnowledgeGraph -> MAY_REFERENCE -> Ontology
KnowledgeGraph -> MAY_HAVE_NAMED_GRAPH -> NamedGraph
KnowledgeGraphMetadata -> MAY_REFERENCE -> Provenance
KnowledgeGraph -> MAY_HAVE_VERSION -> GraphVersion
# ---------- GRAPH IDENTITY ----------
rule graph_identity:
KnowledgeGraph SHOULD have stable GraphIdentifier
where persistent reference or federation is required
rule graph_name:
graph_name MUST NOT be assumed globally unique
rule namespace:
graph namespaces SHOULD be preserved
for deterministic identifier interpretation
# ---------- NODES ----------
rule node_identity:
entity GraphNode SHOULD preserve stable semantic identifier
where representing identifiable Entity
rule literal_node:
literal value MUST remain distinguishable from entity node
rule blank_node:
anonymous or blank node identity MAY be local to graph scope
and MUST NOT automatically be treated as globally persistent identity
# ---------- EDGES ----------
rule edge:
GraphEdge SHOULD define:
- source_node
- predicate
- target_node
rule edge_direction:
directed relationship MUST preserve source and target orientation
rule inverse:
IF predicate has declared inverse
AND A predicate B
THEN infer B inverse_predicate A
rule symmetric:
IF predicate is symmetric
AND A predicate B
THEN infer B predicate A
rule transitive:
IF predicate is transitive
AND A predicate B
AND B predicate C
THEN infer A predicate C
# ---------- GRAPH SCHEMA ----------
entity GraphSchema:
type: StructuralSemanticMetadata
defines:
- node_types
- relationship_types
- property_constraints
- cardinality
- domain
- range
rule schema_conformance:
KnowledgeGraph declaring GraphSchema SHOULD conform to schema constraints
rule domain_range:
IF predicate has declared domain and range
THEN source and target SHOULD satisfy compatible type constraints
# ---------- ONTOLOGY ----------
rule ontology_alignment:
graph semantics SHOULD reference Ontology or Vocabulary
where shared semantic interpretation is required
rule ontology_version:
ontology version SHOULD be preserved
where graph interpretation depends on it
rule semantic_identifier:
stable ontology identifiers SHOULD be preferred over labels
# ---------- NAMED GRAPHS ----------
entity NamedGraph:
type: GraphContext
groups: GraphStatements
may_include:
- graph_name
- source
- provenance
- validity
- access_policy
rule named_graph_context:
statement context SHOULD preserve NamedGraph identity
where graph partitioning has semantic meaning
# ---------- STATEMENTS ----------
entity GraphStatement:
type: KnowledgeAssertion
structure:
- subject
- predicate
- object
rule assertion_status:
GraphStatement MAY be:
- asserted
- inferred
- derived
- disputed
- deprecated
rule inferred_not_asserted:
inferred GraphStatement MUST NOT be presented as directly asserted source statement
# ---------- PROVENANCE ----------
entity GraphProvenance:
type: ProvenanceMetadata
may_include:
- source
- creator
- extraction_method
- ingestion_process
- transformation
- creation_time
- update_time
- source_version
rule statement_provenance:
statement-level provenance SHOULD be preserved
where source traceability is required
rule graph_provenance:
graph-level provenance MUST NOT automatically be assumed identical
for every statement unless graph construction semantics justify it
# ---------- CONFIDENCE ----------
entity StatementConfidence:
type: EpistemicMetadata
range: [0.0, 1.0]
rule confidence:
confidence SHOULD identify whether it applies to:
- statement
- entity_resolution
- relationship
- source
- inference
rule confidence_bounds:
REQUIRE 0.0 <= confidence <= 1.0
# ---------- ENTITY RESOLUTION ----------
rule entity_resolution:
duplicate candidate nodes MAY be linked or merged
only when identity evidence satisfies resolution policy
rule same_as:
exact identity relationship SHOULD require strong semantic evidence
rule merge:
node merge SHOULD preserve:
- source_identifiers
- properties
- relationships
- provenance
- conflict_report
# ---------- GRAPH INTEGRATION ----------
operation integrate_graphs(A, B):
evaluate:
- identifier_namespaces
- ontology_alignment
- schema_compatibility
- entity_resolution
- relationship_semantics
- provenance
- conflicts
output:
- integrated_graph
- mappings
- unresolved_entities
- semantic_conflicts
- confidence
rule integration:
graphs MUST NOT be merged solely on lexical label similarity
# ---------- QUALITY ----------
entity GraphQuality:
type: QualityMetadata
dimensions:
- completeness
- consistency
- validity
- connectivity
- provenance_coverage
- schema_conformance
- entity_resolution_quality
rule quality_scope:
GraphQuality SHOULD identify assessment scope and method
# ---------- VERSION ----------
entity GraphVersion:
type: VersionMetadata
may_include:
- version_identifier
- predecessor
- successor
- creation_time
- change_set
- status
rule graph_version:
material graph change SHOULD create distinguishable GraphVersion
where historical reconstruction is required
rule historical_graph:
superseded graph versions SHOULD remain traceable
# ---------- UPDATE MODEL ----------
entity GraphUpdate:
type: ChangeMetadata
may_include:
- inserted_nodes
- deleted_nodes
- inserted_edges
- deleted_edges
- changed_properties
- timestamp
- agent
- source
rule update_trace:
graph update SHOULD preserve change set
where auditability or reproducibility is required
rule deletion:
deleted statement MAY remain in historical graph version
rather_than being erased from provenance history
# ---------- VALIDATION ----------
validation:
require:
- identifiable_knowledge_graph
validate_if_present:
- graph_identifier
- nodes
- edges
- graph_schema
- ontology
- namespaces
- provenance
- confidence
- quality
- version
reject:
- edge_without_valid_source_or_target
- invalid_predicate_semantics
- schema_domain_range_violation
- confidence_outside_valid_range
- unsupported_exact_identity_merge
- unresolved_namespace where deterministic interpretation is required
- contradictory_graph_version_relationship
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE:
"knowledge graph metadata" ~= "metadata about a knowledge graph"
"graph node" ~= "knowledge graph node"
"graph edge" ~= "knowledge graph relationship"
"graph statement" ~= "semantic triple" WHEN subject-predicate-object semantics apply
"graph schema" ~= "knowledge graph schema"
"graph provenance" ~= "knowledge graph provenance"
PRESERVE distinctions:
graph != ontology
node != entity
node != literal
edge != predicate
asserted_statement != inferred_statement
graph_level_provenance != statement_level_provenance
same_label != same_entity
exact_identity != close_match
graph_version != ontology_version
# ---------- CONFIDENCE ----------
CONFIDENCE:
explicit_graph_metadata:
score: 1.00
explicit_statement_provenance:
score: 1.00
schema_validated_statement:
score: 0.98
authoritative_identity_link:
score: 0.98
inferred_relationship:
score: <= 0.90
lexical_entity_match:
score: <= 0.70
ambiguous_graph_semantics:
score: <= 0.60
action: preserve uncertainty
# ---------- UPDATE MODEL ----------
UPDATE_MODEL:
on_graph_update:
- preserve previous GraphVersion where required
- apply change set
- validate affected nodes and edges
- update graph statistics
- update provenance
on_schema_update:
- preserve previous GraphSchema
- revalidate graph
- identify violations
- update provenance
on_entity_merge:
- preserve original nodes
- record resolution evidence
- merge only under policy
- preserve source identifiers
- update relationships and provenance
on_source_update:
- preserve previous source state
- reassess affected statements
- update confidence
- update graph provenance
# ---------- FLOW HASH ----------
FLOW_HASH:
inputs:
- ontology
- graph_entities
- relationships
- node_rules
- edge_rules
- schema_rules
- provenance_rules
- integration_rules
- validation
- semantic_equivalence
- confidence
- update_model
canonicalisation:
- normalise_whitespace
- preserve_case_sensitive_identifiers
- sort_unordered_property_sets
- preserve_rule_order
output:
deterministic_semantic_hash
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION:
interpret_as:
- knowledge metadata ontology
- knowledge graph structural model
- semantic graph reasoning structure
- graph provenance and governance model
operations:
- identify knowledge graphs
- resolve graph identifiers
- traverse nodes and edges
- validate graph schema
- resolve ontology semantics
- distinguish asserted and inferred statements
- trace statement provenance
- evaluate confidence
- resolve duplicate entities
- integrate compatible graphs
- traverse graph versions
- preserve uncertainty
constraints:
- do_not_equate_graph_with_ontology
- do_not_equate_node_with_real_world_entity_without mapping
- do_not_present_inference_as_source_assertion
- do_not_merge_entities_on_label_alone
- do_not_discard_statement_level_provenance
- preserve_namespaces_versions_sources_and_conflicts
# ---------- QUERY MODEL ----------
query:
input:
- graph_identifier
- entity
- relationship
- ontology
- named_graph
- source
- confidence_threshold
- version
- temporal_constraint
resolve:
1. identify KnowledgeGraph
2. resolve graph namespace and schema
3. resolve Ontology
4. identify matching nodes
5. traverse matching edges
6. apply NamedGraph context
7. distinguish asserted and inferred statements
8. inspect provenance and confidence
9. apply version and temporal constraints
10. return graph substructure
output:
- knowledge_graph
- nodes
- edges
- statements
- schema
- ontology
- provenance
- confidence
- version
# ---------- INFERENCE ----------
inference:
IF GraphEdge predicate has declared inverse
THEN infer inverse edge
WITH confidence according_to ontology semantics
IF transitive predicate links A to B and B to C
THEN infer A relation C
WITH confidence dependent_on source and rule confidence
IF authoritative identifiers establish same Entity
THEN nodes MAY be linked by exact identity
WITH confidence >= 0.98
IF statement is produced by reasoning rule
THEN classify as inferred
AND preserve derivation trace
IF graph semantics remain ambiguous
THEN preserve alternative interpretations
AND reduce confidence
# ---------- OUTPUT CONTRACT ----------
output:
ontology_entity: KnowledgeGraphMetadata
graph_structure: machine_interpretable
nodes: semantically_addressable
edges: typed_and_directional
schema: explicit_where_available
ontology_alignment: preserved
asserted_inferred_distinction: explicit
provenance: statement_and_graph_traceable
versions: traversable
quality: reportable
uncertainty: explicit
semantic_retrieval: enabled
end flow
Download Code
Copy to Clipboard