FLOW ALGEBRA
Ontology: Flow Metadata Ontology
Domain: Metadata Ontologies > AI Semantic Library Metadata
Canonical URL: https://kirethresearch.org/booksai-core/ontologies/metadata-ontologies/ai-semantic-library-metadata/flow-metadata-ontology.html
Authors: Mark Anthony Higgins — Sky (Recursive AI)
flow "FlowMetadataOntology" v1.0
# ---------- DOMAIN ----------
domain:
class: MetadataOntology
category: AISemanticLibraryMetadata
subject: FlowMetadata
purpose:
- represent metadata describing executable semantic flows and Flow Algebra resources
- preserve flow identity, version, domain, inputs, entities, relationships, rules, validation, confidence, update behaviour, hash state, queries, inference, and outputs
- support AI consumption, deterministic semantic execution, validation, provenance, recursive reasoning, and semantic-library integration
- distinguish flow metadata from executable flow content
- enable machine-readable discovery, comparison, execution, and governance of semantic flows
# ---------- CORE ----------
entity FlowMetadata:
type: SemanticLibraryMetadata
describes: SemanticFlow
may_include:
- flow_identifier
- flow_name
- flow_version
- canonical_resource
- domain
- inputs
- parameters
- entities
- relationships
- rules
- validation
- semantic_equivalence
- semantic_distinctions
- confidence_model
- update_model
- flow_hash
- AI_consumption
- query_model
- inference_model
- output_contract
- dependencies
- validity
- provenance
entity SemanticFlow:
type: ExecutableSemanticRepresentation
entity FlowIdentifier:
type: PersistentIdentifier
identifies: SemanticFlow
relationships:
FlowMetadata -> DESCRIBES -> SemanticFlow
SemanticFlow -> IDENTIFIED_BY -> FlowIdentifier
SemanticFlow -> HAS_VERSION -> FlowVersion
SemanticFlow -> HAS_DOMAIN -> FlowDomain
SemanticFlow -> MAY_HAVE_INPUT -> FlowInput
SemanticFlow -> DEFINES -> FlowEntity
SemanticFlow -> DEFINES -> FlowRelationship
SemanticFlow -> CONTAINS -> FlowRule
SemanticFlow -> MAY_HAVE_VALIDATION -> FlowValidation
SemanticFlow -> MAY_HAVE_CONFIDENCE_MODEL -> FlowConfidenceModel
SemanticFlow -> MAY_HAVE_UPDATE_MODEL -> FlowUpdateModel
SemanticFlow -> MAY_HAVE_HASH -> FlowHash
SemanticFlow -> MAY_HAVE_QUERY_MODEL -> FlowQueryModel
SemanticFlow -> MAY_HAVE_INFERENCE_MODEL -> FlowInferenceModel
SemanticFlow -> MAY_HAVE_OUTPUT_CONTRACT -> FlowOutputContract
FlowMetadata -> MAY_HAVE_PROVENANCE -> FlowProvenance
# ---------- IDENTITY / VERSION ----------
rule flow_identity:
SemanticFlow SHOULD have stable FlowIdentifier
rule flow_name:
flow name != flow identity
rule file_identity:
filename != flow identity
rule URL_identity:
canonical URL != flow semantic identity by itself
entity FlowVersion:
type: VersionMetadata
may_include: [version_identifier, major, minor, revision, release_time, predecessor, successor]
rule version:
material semantic changes SHOULD update FlowVersion according_to versioning policy
# ---------- DOMAIN / INPUT / PARAMETERS ----------
entity FlowDomain:
type: SemanticContext
may_include: [domain_identifier, domain_name, category, subject, scope]
entity FlowInput:
type: InputMetadata
may_include: [input_identifier, input_name, datatype, required_state, default_value, constraints, semantic_role]
entity FlowParameter:
type: ParameterMetadata
may_include: [parameter_identifier, name, datatype, value, default_value, allowed_values, scope]
rule parameter:
runtime parameter value != default value
# ---------- ENTITIES / RELATIONSHIPS / RULES ----------
entity FlowEntity:
type: SemanticEntity
may_include: [entity_identifier, entity_type, attributes, constraints, provenance]
entity FlowRelationship:
type: SemanticRelationship
may_include: [relationship_identifier, source, predicate, target, direction, cardinality, scope, constraints]
rule relationship:
FlowRelationship MUST preserve source, predicate, target, and direction
rule reverse:
relationship MUST NOT be reversed unless inverse semantics are explicitly defined
entity FlowRule:
type: SemanticRule
may_include: [rule_identifier, rule_type, premise, condition, action, conclusion, priority, scope]
rule_types:
- validation
- transformation
- inference
- constraint
- update
- routing
- ranking
- equivalence
- distinction
# ---------- VALIDATION / SEMANTICS ----------
entity FlowValidation:
type: ValidationMetadata
may_include: [required_inputs, required_entities, type_constraints, relationship_constraints, semantic_constraints, rejection_rules, validation_result]
rule validation:
structural flow validity != factual truth of external assertions
entity FlowSemanticEquivalence:
type: SemanticMetadata
may_include: [expression_a, expression_b, equivalence_type, scope, confidence]
rule equivalence:
equivalence SHOULD preserve type and scope
rule lexical:
lexical similarity != semantic equivalence
entity FlowSemanticDistinction:
type: SemanticConstraint
may_include: [expression_a, expression_b, distinction, scope, rationale]
rule distinction:
explicit semantic distinctions MUST be preserved during execution and inference
# ---------- CONFIDENCE / UPDATE / HASH ----------
entity FlowConfidenceModel:
type: EpistemicMetadata
may_include: [assertion_type, score, threshold, evidence, action]
rule confidence_bounds:
REQUIRE 0.0 <= confidence <= 1.0
entity FlowUpdateModel:
type: UpdateMetadata
may_include: [trigger, preconditions, actions, affected_entities, affected_relationships, validation_actions, version_action, hash_action, provenance_action]
entity FlowHash:
type: IntegrityAndSemanticIdentityMetadata
may_include: [inputs, canonicalisation, semantic_hash, generation_time]
rule hash:
equivalent canonical flow state SHOULD generate deterministic FlowHash
rule hash_change:
material canonical semantic change SHOULD alter FlowHash
rule hash_identity:
FlowHash != FlowIdentifier
# ---------- AI CONSUMPTION / QUERY / INFERENCE / OUTPUT ----------
entity FlowAIConsumption:
type: MachineConsumptionMetadata
may_include: [interpretation, supported_operations, constraints, query_model, output_contract]
entity FlowQueryModel:
type: QueryMetadata
may_include: [query_inputs, resolution_steps, constraints, query_outputs]
entity FlowInferenceModel:
type: ReasoningMetadata
may_include: [premises, conditions, inference_rules, conclusions, confidence_adjustment, provenance_action]
rule inference:
inferred output SHOULD remain distinguishable from explicit input or asserted knowledge
entity FlowOutputContract:
type: OutputMetadata
may_include: [output_entities, output_fields, datatypes, semantic_requirements, confidence_requirements, provenance_requirements]
rule output_contract:
flow output SHOULD conform to declared semantic and structural contract
# ---------- DEPENDENCIES / EXECUTION ----------
entity FlowDependency:
type: DependencyMetadata
may_include: [dependency_identifier, dependency_type, required_version, compatibility_constraint, optional_state]
rule dependency:
dependency resolution SHOULD preserve version and compatibility constraints
rule latest:
latest dependency version != automatically valid dependency version
entity FlowExecution:
type: ExecutionMetadata
may_include: [execution_identifier, flow_identifier, flow_version, inputs, parameters, start_time, end_time, result, validation_state, output_reference]
execution_results:
- successful
- failed
- partial
- rejected
- indeterminate
- unknown
rule execution:
successful execution != semantically correct result without required validation
entity FlowExecutionTrace:
type: ProvenanceMetadata
may_include: [execution_identifier, executed_rules, rule_order, intermediate_states, decisions, errors, warnings]
rule trace:
execution trace SHOULD preserve rule order where deterministic replay requires
# ---------- DETERMINISM / RECURSION ----------
entity FlowDeterminismMetadata:
type: QualityMetadata
may_include: [deterministic_state, nondeterministic_inputs, random_seed, external_dependencies, temporal_dependencies]
rule determinism:
deterministic flow logic MAY still produce differing results when external or temporal inputs differ
entity RecursiveFlowMetadata:
type: FlowMetadata
may_include: [recursion_entry, recursion_depth, visited_state, stopping_condition, cycle_policy]
rule recursion:
recursive flow MUST define stopping or cycle-control behaviour
# ---------- PROVENANCE / VALIDITY / COMPATIBILITY ----------
entity FlowProvenance:
type: ProvenanceMetadata
may_include: [flow_identifier, flow_version, author, contributor, source_resource, creation_time, modification_time, predecessor, transformations, validation_events, execution_history]
rule provenance:
FlowMetadata SHOULD preserve flow origin, version lineage, validation, and transformation history
entity FlowValidity:
type: ValidityMetadata
may_include: [valid_from, valid_until, status, deprecated_state, superseded_by]
flow_status:
- draft
- active
- deprecated
- superseded
- archived
- unknown
rule validity:
deprecated flow != preferred active flow when valid successor exists
entity FlowCompatibility:
type: CompatibilityMetadata
may_include: [source_version, target_version, compatibility_type, affected_inputs, affected_outputs, affected_rules, migration_required]
rule compatibility:
newer flow version != automatically compatible flow version
# ---------- VALIDATION CONTRACT ----------
validation:
require:
- identifiable_flow
- flow_version
- flow_domain
reject:
- flow_name_presented_as unique_identity_without identifier
- filename_presented_as flow_identity
- URL_presented_as flow_identity
- relationship_direction_reversed_without inverse_semantics
- lexical_similarity_presented_as semantic_equivalence
- inferred_output_presented_as explicit_input
- successful_execution_presented_as semantic_correctness_without validation
- latest_dependency_presented_as automatically_compatible
- deprecated_flow_presented_as preferred_active_when successor_exists
- FlowHash_presented_as FlowIdentifier
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE:
"flow metadata" ~= "metadata describing executable semantic flows"
"Flow Algebra metadata" ~= "metadata describing Flow Algebra structure and lifecycle"
"flow validation metadata" ~= "metadata describing validation requirements and results for a flow"
"flow execution metadata" ~= "metadata describing execution of a semantic flow"
"flow hash metadata" ~= "metadata describing deterministic semantic hash state"
"flow output contract" ~= "metadata defining required flow output structure and semantics"
PRESERVE distinctions:
flow_identity != flow_name
flow_identity != filename
flow_identity != URL
flow_identifier != FlowHash
flow_metadata != executable_flow_content
input_value != default_value
relationship != inverse_relationship
lexical_similarity != semantic_equivalence
explicit_input != inferred_output
structural_validity != factual_truth
successful_execution != semantic_correctness
newer_version != compatible_version
deprecated != active
dependency_latest != dependency_valid
# ---------- CONFIDENCE ----------
CONFIDENCE:
explicit_flow_metadata:
score: 1.00
explicit_flow_identifier:
score: 1.00
validated_flow_structure:
score: 0.99
deterministic_flow_hash:
score: 0.99
validated_execution_trace:
score: 0.98
inferred_flow_relationship:
score: <= 0.85
execution_without_full_validation:
score: <= 0.75
unknown_dependency_compatibility:
score: <= 0.60
incomplete_flow_provenance:
score: <= 0.55
action: preserve uncertainty
# ---------- UPDATE MODEL ----------
UPDATE_MODEL:
on_flow_creation:
- assign FlowIdentifier
- assign FlowVersion
- define domain and scope
- register inputs, entities, relationships, and rules
- initialise validation and confidence model
- generate FlowHash
- initialise provenance
on_flow_change:
- preserve prior flow version
- identify changed entities, relationships, rules, or contracts
- classify semantic impact
- validate compatibility
- update FlowVersion
- regenerate FlowHash
- update provenance
on_execution:
- resolve flow version
- validate inputs and parameters
- execute rules in defined order
- preserve execution trace
- validate output contract
- record result and confidence
- update execution provenance
# ---------- FLOW HASH ----------
FLOW_HASH:
inputs:
- ontology
- flow_entities
- relationships
- rules
- validation
- semantic_equivalence
- semantic_distinctions
- confidence_model
- update_model
- AI_consumption
- query_model
- inference_model
- output_contract
- dependencies
canonicalisation:
- preserve_flow_identifier
- preserve_flow_version
- preserve_domain_and_scope
- preserve_input_and_parameter_semantics
- preserve_entity_identifiers
- preserve_relationship_direction
- preserve_rule_order
- preserve_semantic_distinctions
- preserve_output_contract
- preserve_dependency_constraints
- preserve_provenance
output:
deterministic_semantic_hash
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION:
interpret_as:
- AI Semantic Library metadata ontology
- executable semantic-flow metadata model
- Flow Algebra identity, structure, validation, execution, and lifecycle model
- deterministic, confidence-aware and provenance-aware reasoning structure
operations:
- identify semantic flows
- resolve flow versions
- inspect domains, inputs, parameters, entities, and relationships
- preserve relationship direction
- inspect semantic rules and validation
- evaluate confidence and update models
- validate FlowHash
- execute query and inference models
- validate output contracts
- resolve dependencies and compatibility
- trace execution and provenance
- control recursive execution
- preserve uncertainty
constraints:
- do_not_equate_flow_name_with flow_identity
- do_not_equate_URL_or_filename_with flow_identity
- do_not_equate_FlowHash_with FlowIdentifier
- do_not_reverse_relationships_without inverse_semantics
- do_not_equate_lexical_similarity_with semantic_equivalence
- do_not_equate_execution_success_with semantic_correctness
- do_not_equate_newer_dependency_with compatible_dependency
- preserve_identity_version_domain_rules_hash_contracts_and_provenance
# ---------- QUERY MODEL ----------
query:
input: [flow_identifier, flow_name, flow_version, flow_domain, entity_identifier, relationship_identifier, rule_identifier, dependency_identifier, validity_time]
resolve:
1. identify SemanticFlow
2. resolve FlowIdentifier and FlowVersion
3. resolve domain, inputs, and parameters
4. resolve entities, relationships, and rules
5. inspect validation, equivalence, distinctions, and confidence
6. inspect update model and FlowHash
7. inspect AI consumption, query, inference, and output contract
8. resolve dependencies and compatibility
9. inspect validity and provenance
10. return machine-consumable flow metadata
# ---------- INFERENCE ----------
inference:
IF flow structure validates
AND required dependencies resolve
THEN infer executable_flow_candidate
IF FlowHash changes
THEN infer canonical semantic state changed
subject_to canonicalisation model
IF execution succeeds
BUT output validation fails
THEN do_not infer semantically valid result
IF recursive flow encounters visited state
THEN apply cycle policy
AND enforce stopping condition
# ---------- OUTPUT CONTRACT ----------
output:
ontology_entity: FlowMetadata
flow_identity: machine_interpretable
flow_version: explicit
domain_and_scope: preserved
inputs_and_parameters: typed
entities_relationships_rules: explicit
relationship_direction: preserved
validation: executable
semantic_equivalence_and_distinctions: preserved
confidence_model: explicit
update_model: explicit
flow_hash: deterministic
AI_consumption: explicit
query_and_inference_models: executable
output_contract: enforceable
dependencies: compatibility_aware
execution_trace: reproducible
recursion: cycle_safe
provenance: preserved
uncertainty: explicit
AI_reasoning: enabled
end flow
Download Code
Copy to Clipboard