FLOW ALGEBRA
Ontology: Relationship Metadata Ontology
Domain: Metadata Ontologies > Knowledge Metadata
Canonical URL: https://kirethresearch.org/booksai-core/ontologies/metadata-ontologies/knowledge-metadata/relationship-metadata-ontology.html
Authors: Mark Anthony Higgins — Sky (Recursive AI)
flow "RelationshipMetadataOntology" v1.0
# ---------- DOMAIN ----------
domain:
class: MetadataOntology
category: KnowledgeMetadata
subject: RelationshipMetadata
purpose:
- represent metadata describing semantic relationships between entities
- preserve relationship identity, type, direction, scope, context, and provenance
- support relationship validation, traversal, inference, integration, and retrieval
- distinguish relationship definitions from relationship assertions
- enable machine-readable reasoning over connected knowledge
# ---------- CORE ENTITY ----------
entity RelationshipMetadata:
type: KnowledgeMetadata
describes: RelationshipAssertion
may_include:
- relationship_identifier
- relationship_type
- source_entity
- target_entity
- direction
- inverse_relationship
- domain
- range
- cardinality
- symmetry
- transitivity
- functionality
- temporal_context
- spatial_context
- semantic_context
- confidence
- evidence
- status
- provenance
- version
entity RelationshipAssertion:
type: SemanticStatement
structure:
- source_entity
- relationship_type
- target_entity
entity RelationshipType:
type: SemanticRelationshipDefinition
defines: RelationshipSemantics
entity RelationshipIdentifier:
type: Identifier
identifies: RelationshipAssertionOrType
# ---------- RELATIONSHIP CATEGORIES ----------
relationship_categories:
- HierarchicalRelationship
- AssociativeRelationship
- PartWholeRelationship
- CausalRelationship
- TemporalRelationship
- SpatialRelationship
- DependencyRelationship
- OwnershipRelationship
- MembershipRelationship
- EquivalenceRelationship
- ProvenanceRelationship
# ---------- RELATIONSHIPS ----------
relationships:
RelationshipMetadata -> DESCRIBES -> RelationshipAssertion
RelationshipAssertion -> HAS_SOURCE -> Entity
RelationshipAssertion -> HAS_TARGET -> Entity
RelationshipAssertion -> HAS_TYPE -> RelationshipType
RelationshipAssertion -> MAY_HAVE_IDENTIFIER -> RelationshipIdentifier
RelationshipType -> MAY_HAVE_INVERSE -> RelationshipType
RelationshipType -> MAY_HAVE_DOMAIN -> EntityType
RelationshipType -> MAY_HAVE_RANGE -> EntityType
RelationshipType -> MAY_HAVE_CARDINALITY -> CardinalityConstraint
RelationshipAssertion -> MAY_HAVE_CONTEXT -> ContextMetadata
RelationshipAssertion -> MAY_HAVE_CONFIDENCE -> Confidence
RelationshipAssertion -> MAY_HAVE_EVIDENCE -> Evidence
RelationshipMetadata -> MAY_REFERENCE -> Provenance
# ---------- RELATIONSHIP IDENTITY ----------
rule relationship_identity:
RelationshipAssertion SHOULD have stable identifier
where assertion-level provenance or versioning is required
rule type_identity:
RelationshipType SHOULD have stable semantic identifier
where shared interpretation is required
rule assertion_definition_distinction:
RelationshipAssertion != RelationshipType
# ---------- SOURCE / TARGET ----------
rule endpoints:
RelationshipAssertion MUST identify:
- source_entity
- target_entity
- relationship_type
rule direction:
directed RelationshipType MUST preserve source and target orientation
rule endpoint_identity:
source and target SHOULD resolve to identifiable entities
where deterministic graph traversal is required
# ---------- DOMAIN / RANGE ----------
rule domain:
IF RelationshipType declares domain
THEN source_entity SHOULD have compatible EntityType
rule range:
IF RelationshipType declares range
THEN target_entity SHOULD have compatible EntityType
rule domain_range_not_identity:
domain and range constrain relationship applicability
but do_not uniquely identify endpoint entities
# ---------- INVERSE ----------
rule inverse:
IF RelationshipType R has inverse R_inv
AND A R B
THEN infer B R_inv A
rule inverse_consistency:
inverse_of(inverse_of(R)) SHOULD equal R
where inverse semantics are exact
# ---------- SYMMETRY ----------
rule symmetric:
IF RelationshipType R is symmetric
AND A R B
THEN infer B R A
rule asymmetric:
IF R is asymmetric
AND A R B
THEN B R A MUST NOT hold
under same context
rule antisymmetric:
IF R is antisymmetric
AND A R B
AND B R A
THEN A and B MAY require identity
according_to relation semantics
# ---------- TRANSITIVITY ----------
rule transitive:
IF RelationshipType R is transitive
AND A R B
AND B R C
THEN infer A R C
rule nontransitive:
Relationship MUST NOT be treated as transitive
unless declared or logically established
# ---------- FUNCTIONALITY ----------
rule functional:
IF RelationshipType is functional
THEN each source_entity has at most one target
within declared context
rule inverse_functional:
IF RelationshipType is inverse_functional
THEN each target_entity has at most one source
within declared context
# ---------- CARDINALITY ----------
entity CardinalityConstraint:
type: SemanticConstraint
may_include:
- minimum
- maximum
- exact
rule cardinality:
RelationshipAssertion set SHOULD satisfy declared cardinality
rule minimum:
IF observed_relationship_count < minimum
THEN relationship_constraint_violation
rule maximum:
IF maximum exists
AND observed_relationship_count > maximum
THEN relationship_constraint_violation
# ---------- HIERARCHICAL RELATIONSHIPS ----------
hierarchical_relationships:
- broader_than
- narrower_than
- superclass_of
- subclass_of
- parent_of
- child_of
rule hierarchy_inverse:
broader_than inverse narrower_than
superclass_of inverse subclass_of
parent_of inverse child_of
rule hierarchy_cycle:
hierarchical relation SHOULD avoid unsupported cycles
where semantics require acyclic hierarchy
# ---------- PART-WHOLE ----------
part_whole_relationships:
- part_of
- has_part
- component_of
- contains_component
rule part_inverse:
part_of inverse has_part
rule part_transitivity:
part_of MAY be transitive
only when domain semantics support transitive composition
# ---------- CAUSAL ----------
causal_relationships:
- causes
- caused_by
- contributes_to
- prevents
- enables
rule causal_evidence:
causal relationship SHOULD preserve evidence or provenance
where causal status is not axiomatic
rule correlation_not_causation:
association != causation
# ---------- TEMPORAL ----------
temporal_relationships:
- before
- after
- during
- overlaps
- starts
- finishes
rule temporal_inverse:
before inverse after
rule temporal_context:
temporal relationship MUST preserve relevant temporal reference
where interpretation depends on time
# ---------- SPATIAL ----------
spatial_relationships:
- within
- contains
- intersects
- overlaps
- adjacent_to
- north_of
- south_of
- east_of
- west_of
rule spatial_inverse:
within inverse contains
north_of inverse south_of
east_of inverse west_of
# ---------- EQUIVALENCE ----------
equivalence_relationships:
- same_as
- equivalent_to
- close_match
- related_match
rule exact_identity:
same_as SHOULD require strong identity evidence
rule equivalence_distinction:
same_as != close_match
exact_equivalence != relatedness
# ---------- CONTEXT ----------
rule contextual_relationship:
RelationshipAssertion MAY be valid only within:
- temporal_context
- spatial_context
- domain_context
- jurisdiction
- semantic_context
rule context_preservation:
context-dependent relationship MUST NOT be generalised beyond scope
without explicit inference rule
# ---------- CONFIDENCE / EVIDENCE ----------
entity RelationshipConfidence:
type: EpistemicMetadata
range: [0.0, 1.0]
rule confidence_bounds:
REQUIRE 0.0 <= confidence <= 1.0
rule evidence:
inferred or uncertain relationship SHOULD preserve supporting Evidence
rule source_assertion:
explicit source relationship MUST remain distinguishable
from inferred relationship
# ---------- STATUS ----------
relationship_status:
- asserted
- verified
- inferred
- disputed
- deprecated
- superseded
rule status:
RelationshipAssertion status SHOULD remain explicit
# ---------- PROVENANCE ----------
rule provenance:
RelationshipMetadata SHOULD preserve:
- source
- creator_or_agent
- creation_time
- extraction_method
- inference_method
- revision_history
rule inferred_provenance:
inferred RelationshipAssertion SHOULD preserve derivation path
# ---------- VERSION ----------
entity RelationshipVersion:
type: VersionMetadata
may_include:
- version_identifier
- predecessor
- successor
- creation_time
- change_description
rule version:
material change to relationship assertion or semantics
SHOULD create distinguishable version where history is required
# ---------- VALIDATION ----------
validation:
require:
- relationship_type
- source_entity
- target_entity
validate_if_present:
- identifier
- direction
- inverse
- domain
- range
- cardinality
- symmetry
- transitivity
- context
- confidence
- evidence
- provenance
reject:
- missing_source_or_target
- domain_constraint_violation
- range_constraint_violation
- cardinality_violation
- asymmetric_relationship_asserted_both_directions
- unsupported_exact_identity
- confidence_outside_valid_range
- invalid_relationship_version_chain
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE:
"relationship metadata" ~= "metadata about relationships"
"relationship type" ~= "semantic relation type"
"relationship assertion" ~= "relation assertion"
"source entity" ~= "relationship subject" WHEN subject-predicate-object semantics apply
"target entity" ~= "relationship object" WHEN object is entity
"inverse relationship" ~= "inverse property" WHEN ontology property semantics apply
PRESERVE distinctions:
relationship_type != relationship_assertion
source != target
symmetric != inverse
transitive != symmetric
same_as != close_match
association != causation
part_of != subclass_of
asserted_relationship != inferred_relationship
relationship_label != relationship_identifier
# ---------- CONFIDENCE ----------
CONFIDENCE:
explicit_relationship_assertion:
score: 1.00
authoritative_relationship_identifier:
score: 1.00
ontology_derived_inverse:
score: 0.98
ontology_derived_transitive_relation:
score: 0.95
evidence_supported_causal_relation:
score: 0.90
inferred_relationship:
score: <= 0.85
lexical_relationship_guess:
score: <= 0.65
ambiguous_relationship:
score: <= 0.60
action: preserve alternatives
# ---------- UPDATE MODEL ----------
UPDATE_MODEL:
on_relationship_add:
- validate source and target
- validate RelationshipType
- apply domain and range rules
- derive inverse where applicable
- evaluate cardinality
- record provenance
on_relationship_remove:
- preserve historical assertion where required
- remove or deactivate current relationship
- reassess inferred relationships
- update provenance
on_relationship_type_change:
- preserve previous semantics
- revalidate affected assertions
- recompute inverses and inferences
- update provenance
on_context_change:
- preserve previous contextual state
- reassess applicability
- update confidence
- preserve provenance
# ---------- FLOW HASH ----------
FLOW_HASH:
inputs:
- ontology
- relationship_entities
- relationship_categories
- relationships
- inverse_rules
- symmetry_rules
- transitivity_rules
- cardinality_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
- semantic relationship model
- graph edge reasoning structure
- relationship validation model
operations:
- identify relationship assertions
- resolve relationship types
- validate source and target entities
- apply domain and range
- derive inverse relationships
- apply symmetry and transitivity
- validate cardinality
- evaluate context
- distinguish asserted and inferred relationships
- trace provenance
- preserve uncertainty
constraints:
- do_not_equate_relationship_type_with_assertion
- do_not_reverse_directed_relationship_without_inverse_rule
- do_not_assume_transitivity
- do_not_equate_association_with_causation
- do_not_assert_same_as_without strong evidence
- preserve_context_status_evidence_and_provenance
# ---------- QUERY MODEL ----------
query:
input:
- source_entity
- relationship_type
- target_entity
- relationship_category
- context
- confidence_threshold
- status
- time_constraint
resolve:
1. identify RelationshipAssertion
2. resolve source and target entities
3. resolve RelationshipType
4. validate domain and range
5. apply context
6. inspect inverse, symmetry, and transitivity
7. evaluate cardinality
8. distinguish asserted and inferred relationships
9. inspect evidence and provenance
10. rank by confidence
output:
- relationship_assertion
- source_entity
- relationship_type
- target_entity
- context
- status
- evidence
- provenance
- confidence
# ---------- INFERENCE ----------
inference:
IF A R B
AND R has_inverse R_inv
THEN infer B R_inv A
WITH confidence according_to relationship semantics
IF R symmetric
AND A R B
THEN infer B R A
IF R transitive
AND A R B
AND B R C
THEN infer A R C
IF domain or range constraints fail
THEN flag RelationshipAssertion as invalid_or_inconsistent
IF relationship semantics remain ambiguous
THEN preserve candidate RelationshipTypes
AND reduce confidence
# ---------- OUTPUT CONTRACT ----------
output:
ontology_entity: RelationshipMetadata
relationship_structure: machine_interpretable
source_target: explicit
relationship_types: semantically_defined
inverse_semantics: preserved
cardinality: machine_validatable
context: preserved
asserted_inferred_distinction: explicit
evidence: traceable
provenance: preserved
uncertainty: explicit
semantic_retrieval: enabled
end flow
Download Code
Copy to Clipboard