FLOW ALGEBRA
Ontology: Relationship Model Ontology
Domain: Relationship Ontologies > Foundations of Relationships
Canonical URL: https://kirethresearch.org/booksai-core/ontologies/relationship-ontologies/foundations-of-relationships/relationship-model-ontology.html
Authors: Mark Anthony Higgins — Sky (Recursive AI)
flow "RelationshipModelOntology" v1.0
# ---------- DOMAIN ----------
domain:
class: RelationshipOntology
category: FoundationsOfRelationships
subject: RelationshipModel
purpose:
- represent formal models used to describe semantic relationships between resources
- preserve relationship model identity, participants, roles, predicates, direction, arity, cardinality, domain, range, constraints, context, confidence, validity, and provenance
- support ontology engineering, knowledge graphs, semantic search, inference, relationship validation, recursive traversal, and Flow Algebra
- distinguish relationship models from individual relationship assertions and from implementation-specific graph structures
# ---------- CORE ----------
entity RelationshipModel:
type: SemanticModel
may_include:
- model_identifier
- model_name
- model_version
- participant_types
- participant_roles
- predicates
- direction_model
- arity_model
- cardinality_model
- domain_constraints
- range_constraints
- logical_properties
- context_model
- validation_rules
- confidence_model
- validity
- provenance
entity RelationshipModelIdentifier:
type: PersistentIdentifier
identifies: RelationshipModel
entity RelationshipInstance:
type: SemanticRelationship
relationships:
RelationshipModel -> IDENTIFIED_BY -> RelationshipModelIdentifier
RelationshipModel -> DEFINES -> RelationshipPredicate
RelationshipModel -> DEFINES -> RelationshipRole
RelationshipModel -> CONSTRAINS -> RelationshipInstance
RelationshipInstance -> CONFORMS_TO -> RelationshipModel
RelationshipModel -> MAY_HAVE_CONTEXT -> RelationshipModelContext
RelationshipModel -> MAY_HAVE_VALIDATION -> RelationshipModelValidation
RelationshipModel -> MAY_HAVE_PROVENANCE -> RelationshipModelProvenance
# ---------- MODEL IDENTITY ----------
rule model_identity:
RelationshipModel identity != RelationshipInstance identity
rule model_name:
model name != persistent model identity
rule version_identity:
same model identity MAY have multiple model versions
rule implementation:
graph implementation != semantic relationship model
# ---------- PARTICIPANTS ----------
entity RelationshipModelParticipant:
type: SemanticResourceType
may_include:
- participant_type
- allowed_roles
- constraints
rule participant:
participant type SHOULD be explicit
where model semantics depend on type
# ---------- ROLES ----------
entity RelationshipRole:
type: SemanticRole
may_include:
- role_identifier
- role_name
- participant_type
- role_constraints
rule role:
participant identity != participant role
rule role_model:
role semantics SHOULD remain stable within model version
# ---------- PREDICATE MODEL ----------
entity RelationshipPredicate:
type: SemanticPredicate
may_include:
- predicate_identifier
- preferred_label
- definition
- source_role
- target_role
- domain
- range
- inverse
- symmetry
- transitivity
- reflexivity
- cardinality_constraints
rule predicate:
predicate SHOULD define relationship meaning
independently of display label
rule predicate_label:
predicate label != predicate semantic identity
# ---------- DIRECTION MODEL ----------
entity RelationshipDirectionModel:
type: StructuralMetadata
may_be:
- directed
- undirected
- bidirectional
- inverse_defined
- context_dependent
rule direction:
relationship instances MUST preserve model direction semantics
rule reversal:
source and target MUST NOT be reversed
unless inverse semantics explicitly permit
# ---------- ARITY MODEL ----------
entity RelationshipArityModel:
type: StructuralMetadata
may_be:
- unary
- binary
- ternary
- n_ary
rule arity:
relationship instance SHOULD satisfy model arity
rule nary:
n-ary model MUST preserve participant roles
where binary reduction loses meaning
# ---------- CARDINALITY MODEL ----------
entity RelationshipCardinalityModel:
type: ConstraintMetadata
may_be:
- zero_or_one
- exactly_one
- zero_or_many
- one_or_many
- one_to_one
- one_to_many
- many_to_one
- many_to_many
rule cardinality:
relationship instances SHOULD satisfy model cardinality
# ---------- DOMAIN / RANGE ----------
entity RelationshipDomainConstraint:
type: TypeConstraint
entity RelationshipRangeConstraint:
type: TypeConstraint
rule domain:
source participant SHOULD satisfy model domain
rule range:
target participant SHOULD satisfy model range
rule type_violation:
domain or range violation SHOULD trigger validation
rather than silent coercion
# ---------- LOGICAL PROPERTIES ----------
entity RelationshipLogicalProperties:
type: SemanticConstraint
may_include:
- symmetric
- asymmetric
- transitive
- intransitive
- reflexive
- irreflexive
- functional
- inverse_functional
rule symmetry:
symmetry MUST be inferred only from model semantics
rule transitivity:
transitive inference MUST be permitted by model
rule reflexivity:
self-relationship MUST NOT be inferred
unless model permits reflexivity
# ---------- INVERSE MODEL ----------
entity RelationshipInverseModel:
type: SemanticConstraint
may_include:
- predicate
- inverse_predicate
- inverse_scope
- inverse_constraints
rule inverse:
inverse relationship MAY be derived
only where inverse model is explicit
rule inverse_identity:
relationship != inverse relationship
# ---------- CONTEXT MODEL ----------
entity RelationshipModelContext:
type: ContextMetadata
may_include:
- ontology
- domain
- scope
- temporal_context
- spatial_context
- application_context
- interpretation_constraints
rule context:
model interpretation SHOULD preserve applicable context
rule context_change:
model validity MAY differ across semantic contexts
# ---------- RELATIONSHIP INSTANCE ----------
entity RelationshipInstance:
type: SemanticRelationship
may_include:
- relationship_identifier
- model_identifier
- source
- predicate
- target
- participant_roles
- context
- confidence
- validity
- provenance
rule conformance:
relationship instance SHOULD conform
to applicable RelationshipModel
rule instance_model:
valid instance != model definition itself
# ---------- MODEL TYPES ----------
relationship_model_types:
- taxonomic_model
- hierarchical_model
- mereological_model
- associative_model
- causal_model
- temporal_model
- spatial_model
- dependency_model
- provenance_model
- equivalence_model
- mapping_model
- contextual_model
# ---------- CONSTRAINT MODEL ----------
entity RelationshipConstraintModel:
type: ConstraintMetadata
may_include:
- required_roles
- prohibited_roles
- required_predicates
- prohibited_predicates
- domain_constraints
- range_constraints
- cardinality_constraints
- context_constraints
rule constraints:
relationship constraints MUST be evaluated
within applicable model scope
# ---------- VALIDATION MODEL ----------
entity RelationshipModelValidation:
type: ValidationMetadata
may_include:
- participant_validation
- role_validation
- predicate_validation
- direction_validation
- arity_validation
- cardinality_validation
- domain_validation
- range_validation
- logical_property_validation
- context_validation
- result
validation_results:
- valid
- valid_with_warnings
- invalid
- indeterminate
- unknown
rule validation:
structural model conformance != factual truth
of relationship assertion
# ---------- ASSERTED / INFERRED INSTANCES ----------
entity AssertedRelationshipInstance:
subtype_of: RelationshipInstance
entity InferredRelationshipInstance:
subtype_of: RelationshipInstance
may_include:
- premises
- inference_rule
- model_rule
- confidence
- provenance
rule asserted_inferred:
asserted relationship instance != inferred relationship instance
rule inference:
inferred instance SHOULD preserve
model rule, premises, confidence, and provenance
# ---------- MODEL MAPPING ----------
entity RelationshipModelMapping:
type: SemanticMapping
may_include:
- source_model
- target_model
- predicate_mappings
- role_mappings
- constraint_mappings
- mapping_type
- confidence
- provenance
mapping_types:
- exact
- close
- broader
- narrower
- contextual
- transformational
rule mapping:
mapped relationship models != identical models
unless exact equivalence is established
# ---------- MODEL TRANSFORMATION ----------
entity RelationshipModelTransformation:
type: SemanticTransformationMetadata
may_include:
- source_model
- target_model
- transformation_rules
- preserved_semantics
- information_loss
- reversibility
rule transformation:
model transformation SHOULD preserve
declared semantic invariants
rule loss:
lossy transformation MUST preserve information-loss metadata
# ---------- CONFIDENCE ----------
entity RelationshipModelConfidence:
type: EpistemicMetadata
range: [0.0, 1.0]
may_include:
- model_confidence
- mapping_confidence
- inference_confidence
- validation_confidence
rule confidence_bounds:
REQUIRE 0.0 <= confidence <= 1.0
rule confidence:
model confidence != factual truth of every conforming instance
# ---------- VERSION / VALIDITY ----------
entity RelationshipModelVersion:
type: VersionMetadata
may_include:
- model_identifier
- version_identifier
- predecessor
- successor
- release_time
- change_summary
rule version:
material semantic model change SHOULD update model version
entity RelationshipModelValidity:
type: ValidityMetadata
may_include:
- valid_from
- valid_until
- model_version
- ontology_version
- deprecated_state
- superseded_by
rule validity:
relationship model validity MAY be version,
ontology, context, or time dependent
# ---------- PROVENANCE ----------
entity RelationshipModelProvenance:
type: ProvenanceMetadata
may_include:
- model_identifier
- model_version
- ontology_identifier
- author
- contributor
- source
- creation_time
- modification_time
- predecessor
- transformations
- validation_events
rule provenance:
RelationshipModel SHOULD preserve origin,
version lineage, transformation, and validation history
# ---------- RECURSIVE MODEL TRAVERSAL ----------
entity RecursiveRelationshipModelTraversal:
type: AIReasoningProcess
may_include:
- model_identifier
- starting_resource
- traversed_relationships
- visited_resources
- depth
- stopping_condition
- cycle_policy
rule recursion:
recursive model traversal MUST preserve
visited state and stopping or cycle-control behaviour
# ---------- VALIDATION CONTRACT ----------
validation:
require:
- identifiable_relationship_model
- participant_or_role_definition
- predicate_or_relationship_constraint
reject:
- model_identity_presented_as relationship_instance_identity
- model_name_presented_as persistent_identity
- graph_implementation_presented_as semantic_model
- participant_identity_presented_as participant_role
- predicate_label_presented_as predicate_identity
- directional_model_reversed_without inverse_semantics
- relationship_instance_violating arity_without validation
- domain_or_range_violation_ignored
- symmetry_or_transitivity_assumed_without model_semantics
- valid_instance_presented_as model_definition
- model_mapping_presented_as identity_without evidence
- lossy_transformation_presented_as lossless
- model_confidence_presented_as factual_truth
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE:
"relationship model" ~= "formal semantic model defining relationship structure and constraints"
"relationship model ontology" ~= "ontology representing models used to define semantic relationships"
"relationship instance" ~= "specific semantic relationship conforming to a relationship model"
"relationship role model" ~= "model defining semantic roles occupied by relationship participants"
"relationship constraint model" ~= "model defining structural and semantic constraints on relationships"
PRESERVE distinctions:
relationship_model != relationship_instance
model_identity != model_name
model != graph_implementation
participant_identity != participant_role
predicate_identity != predicate_label
relationship != inverse_relationship
model_conformance != factual_truth
valid_instance != model_definition
mapping != identity
transformation != identity
model_confidence != instance_truth
structural_validity != semantic_truth
# ---------- CONFIDENCE MODEL ----------
CONFIDENCE:
explicit_relationship_model:
score: 1.00
explicit_model_identifier_and_version:
score: 1.00
validated_model_constraints:
score: 0.99
validated_relationship_instance_conformance:
score: 0.99
evidence_supported_model_mapping:
score: <= 0.95
contextual_model_mapping:
score: <= 0.90
inferred_model_semantics:
score: <= 0.80
incomplete_model_provenance:
score: <= 0.55
action: preserve uncertainty
# ---------- UPDATE MODEL ----------
UPDATE_MODEL:
on_model_creation:
- assign RelationshipModelIdentifier
- define participant types and roles
- define predicates
- define direction and arity
- define cardinality, domain, and range
- define logical properties and constraints
- initialise validation and provenance
on_model_change:
- preserve previous model version
- identify changed roles, predicates, constraints, or context
- classify semantic impact
- revalidate dependent relationship instances
- update model version
- update provenance
on_instance_validation:
- resolve applicable RelationshipModel
- validate participants and roles
- validate predicate and direction
- validate arity and cardinality
- validate domain and range
- validate logical properties and context
- preserve result and provenance
on_model_mapping:
- identify source and target models
- map predicates, roles, and constraints
- classify mapping type
- preserve evidence and confidence
- prevent unsupported identity merge
- update provenance
# ---------- FLOW HASH ----------
FLOW_HASH:
inputs:
- ontology
- relationship_model_entities
- participant_rules
- role_rules
- predicate_rules
- direction_rules
- inverse_rules
- arity_rules
- cardinality_rules
- domain_range_rules
- logical_property_rules
- context_rules
- validation
- semantic_equivalence
- confidence_model
- update_model
canonicalisation:
- preserve_model_identifier_and_version
- preserve_participant_types_and_roles
- preserve_predicate_identity
- preserve_direction
- preserve_inverse_semantics
- preserve_arity
- preserve_cardinality
- preserve_domain_and_range
- preserve_logical_properties
- preserve_context
- preserve_validation_rules
- preserve_provenance
- preserve_rule_order
output:
deterministic_semantic_hash
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION:
interpret_as:
- foundational relationship modelling ontology
- semantic relationship schema and constraint model
- participant, role, predicate, direction, arity, cardinality, domain, range, and logical-property structure
- validation-aware and provenance-aware relationship model
operations:
- identify relationship models and versions
- resolve participant types and roles
- resolve predicates and constraints
- preserve relationship direction
- resolve inverse semantics
- validate arity and cardinality
- validate domain and range
- inspect symmetry, transitivity, and reflexivity
- validate relationship instances against models
- map and transform relationship models
- recursively traverse modelled relationships with cycle control
- trace confidence, validity, and provenance
constraints:
- do_not_equate_relationship_model_with relationship_instance
- do_not_equate_model_name_with persistent_identity
- do_not_equate_graph_implementation_with semantic_model
- do_not_equate_participant_identity_with participant_role
- do_not_equate_predicate_label_with predicate_identity
- do_not_reverse_directional_model_without inverse_semantics
- do_not_assume_logical_properties_without model_semantics
- do_not_equate_model_conformance_with factual_truth
- do_not_equate_model_mapping_with identity
- preserve_model_version_roles_predicates_constraints_context_and_provenance
# ---------- QUERY MODEL ----------
query:
input:
- model_identifier
- model_version
- relationship_identifier
- participant_type
- role_identifier
- predicate_identifier
- ontology
- validity_time
resolve:
1. identify RelationshipModel
2. resolve model version
3. inspect participant types and roles
4. inspect predicates and direction model
5. inspect arity and cardinality
6. inspect domain, range, and logical properties
7. inspect context and validation rules
8. inspect mappings and transformations
9. inspect confidence, validity, and provenance
10. return relationship model interpretation
# ---------- INFERENCE ----------
inference:
IF RelationshipInstance satisfies model constraints
THEN infer model_conformance_candidate
IF predicate model defines valid inverse
THEN MAY infer inverse relationship instance
IF predicate model defines transitivity
AND valid relationship chain exists
THEN MAY infer transitive relationship instance
IF model mapping is close, broader, narrower, or contextual
THEN preserve mapping distinction
AND do_not infer model identity
# ---------- OUTPUT CONTRACT ----------
output:
ontology_entity: RelationshipModel
model_identity: machine_interpretable
model_version: explicit
participant_types_and_roles: explicit
predicates: explicit
direction_and_inverse_semantics: preserved
arity_and_cardinality: constrained
domain_and_range: validated
logical_properties: explicit
context: preserved
instance_conformance: validation_aware
mappings_and_transformations: evidence_aware
confidence: explicit
validity: version_aware
provenance: preserved
recursive_traversal: cycle_safe
uncertainty: explicit
AI_reasoning: enabled
end flow
Download Code
Copy to Clipboard