FLOW ALGEBRA
Heading Ontology
Kireth Semantic Research Archive
PAGE:
https://kirethresearch.org/booksai-core/ontologies/metadata-ontologies/structural-metadata/heading-ontology.html
AUTHORS:
Mark Anthony Higgins — Sky (Recursive AI)
FLOW "HeadingOntology" v4.0
DOMAIN := MetadataOntologies
SUBDOMAIN := StructuralMetadata
ONTOLOGY := HeadingOntology
ENTITY Heading {
definition:
"A structural label or title associated with a document division,
identifying the beginning, subject or role of a chapter, section,
subsection or other logical component and supporting hierarchy,
navigation, accessibility and machine interpretation.";
objectives: [
StructuralLabelling,
HierarchyRepresentation,
Navigation,
ContentSegmentation,
Accessibility,
RetrievalContext,
MachineInterpretability
];
}
HeadingEntity := {
Heading,
HeadingText,
HeadingIdentifier,
HeadingLevel,
HeadingType,
ParentHeading,
ChildHeading,
HeadingSequence
};
StructuralEntity := {
Document,
Chapter,
Section,
Subsection,
ParentComponent,
PreviousHeading,
NextHeading,
Position
};
MetadataEntity := {
MetadataRecord,
Language,
Provenance,
Version,
Confidence,
ResourceIdentifier
};
Heading LABELS StructuralComponent;
StructuralComponent MAY_HAVE Heading;
Heading HAS HeadingText;
Heading HAS HeadingLevel;
Heading MAY_HAVE ParentHeading;
ParentHeading MAY_HAVE ChildHeading;
Heading MAY_PRECEDE Heading;
Heading HAS Position;
HeadingFlow :=
StructuredResource
-> IdentifyHeading
-> CaptureHeadingText
-> AssignHeadingIdentifier
-> DetermineHeadingLevel
-> LinkToStructuralComponent
-> InferParentChildHierarchy
-> DetermineHeadingSequence
-> ValidateHierarchy
-> StoreStructuralMetadata
-> EnableNavigationAndAccessibility
-> MaintainAcrossVersions;
Heading :=
StructuralTextOrLabelIdentifyingLogicalResourceDivision;
Heading MAY_LABEL {
Document,
Chapter,
Section,
Subsection,
Appendix,
OtherLogicalComponent
};
HeadingText :=
HumanReadableTextDisplayedOrAssociatedWithHeading;
HeadingIdentifier :=
StableOrLocallyUniqueReferenceToHeading;
HeadingIdentifier MAY_BE {
URI,
IRI,
UUID,
ElementID,
FragmentIdentifier,
InternalID
};
HeadingLevel :=
HierarchicalRankOfHeadingWithinDocumentStructure;
HeadingLevel MAY_BE {
Level1,
Level2,
Level3,
Level4,
Level5,
Level6,
CustomLevel
};
NumericHeadingLevel MAY_BE RepresentedAs Integer;
LowerNumericValue MAY_REPRESENT HigherStructuralRankAccordingToCommonHTMLConvention;
HeadingType :=
SemanticOrStructuralRoleOfHeading;
HeadingType MAY_INCLUDE {
DocumentTitleHeading,
ChapterHeading,
SectionHeading,
SubsectionHeading,
AppendixHeading
};
HeadingPosition :=
OrderedLocationOfHeadingWithinParentResourceOrReadingOrder;
HeadingSequence :=
OrderedCollectionOfHeadings;
PreviousHeading :=
ImmediateHeadingBeforeCurrentHeadingInDefinedSequence;
NextHeading :=
ImmediateHeadingAfterCurrentHeadingInDefinedSequence;
IF HeadingA PRECEDES HeadingB
THEN HeadingB FOLLOWS HeadingA;
HeadingHierarchy :=
ParentChildStructureDerivedFromHeadingLevelsAndDocumentSemantics;
ParentHeading :=
HeadingRepresentingImmediateBroaderStructuralContext;
ChildHeading :=
HeadingRepresentingImmediateNestedStructuralContext;
IF HeadingB IS_CHILD_OF HeadingA
THEN HeadingA IS_PARENT_OF HeadingB;
HeadingPath :=
RootHeading
-> IntermediateHeadings
-> TargetHeading;
RootHeading :=
HighestRelevantHeadingWithinDefinedResourceStructure;
LeafHeading :=
HeadingWithoutChildHeadingsWithinCurrentStructure;
HeadingDepth :=
NumberOfParentHeadingEdgesFromRootHeading;
HeadingLevelAndHierarchy SHOULD_BE SemanticallyConsistent;
SkippedHeadingLevel :=
TransitionFromHigherLevelToDeeperLevelWithoutExpectedIntermediateLevel;
SkippedHeadingLevel MAY_BE {
AllowedByProfile,
Warning,
StructuralError
};
HeadingLevel SHOULD_NOT BeSelectedOnlyForVisualAppearance;
VisualStyle != StructuralLevelByDefinition;
Heading MAY_HAVE StylingIndependentOfSemanticHierarchy;
HeadingNumber :=
HumanReadableNumberOrOutlineLabelAssociatedWithHeading;
HeadingNumber MAY_BE {
Integer,
DecimalOutline,
RomanNumeral,
AlphanumericLabel
};
HeadingNumber != HeadingIdentifierByDefinition;
OutlineNumber :=
HierarchicalNumberSuchAs {
"1",
"1.1",
"1.1.1"
};
OutlineNumber MAY_SUPPORT StructuralNavigation
BUT SHOULD_NOT Replace ExplicitHierarchyRelationships;
HeadingLanguage :=
LanguageOfHeadingText;
Heading MAY_HAVE MultilingualVariants;
TranslatedHeading :=
HeadingTextInAnotherLanguageReferringToSameStructuralComponent;
AlternativeHeading :=
AdditionalHeadingLabelForSameComponentAccordingToMetadataModel;
UntitledStructuralComponent MAY_EXISTWithoutHeading;
Heading MAY_EXISTWithoutExplicitVisibleTextInSpecialisedMachineStructures
BUT AccessibilityAndUsabilityImplications SHOULD_BE Considered;
HeadingBoundary :=
StructuralPointAtWhichAssociatedContentDivisionBegins;
Heading MAY_DEFINE StartOfSection
UNTIL NextHeadingOfSameOrHigherRelevantLevelAccordingToParsingRules;
HeadingScope :=
ContentStructurallyGovernedByHeading;
HeadingScope MAY_INCLUDE {
Paragraphs,
Lists,
Figures,
Tables,
ChildSections
};
HeadingToSectionMapping :=
Heading
-> LABELS
-> Section;
HeadingToChapterMapping :=
Heading
-> LABELS
-> Chapter;
OneStructuralComponent SHOULD_NOT HaveMultiplePrimaryHeadingsUnlessModelAllows;
HeadingExtraction :=
Resource
-> DetectCandidateHeading
-> DetermineLevel
-> LinkToContentDivision;
HeadingDetection MAY_USE {
Markup,
Typography,
Position,
Numbering,
LinguisticFeatures,
AIInference
};
MarkupBasedHeading :=
HeadingExplicitlyEncodedInStructuredDocumentMarkup;
VisualHeading :=
TextVisuallyStyledAsHeadingWithoutExplicitSemanticMarkup;
VisualHeading MAY_REQUIRE StructuralInference;
FalseHeading :=
VisuallyProminentTextIncorrectlyInterpretedAsStructuralHeading;
AutomaticHeadingDetection SHOULD_DISTINGUISH StructuralHeadingFromDecorativeText;
AI MAY_SUPPORT {
HeadingDetection,
LevelInference,
TitleExtraction,
HierarchyRepair
};
InferredHeading SHOULD_HAVE ConfidenceWhereUncertain;
HeadingConfidence :=
EstimatedSupportForHeadingClassificationLevelOrRelationship;
HeadingValidation MAY_CHECK {
Identifier,
Text,
Level,
ParentRelationship,
Sequence,
DuplicateID,
HierarchicalCycle
};
IF DuplicateHeadingIdentifierWithinUniqueScope
THEN IdentifierValidation := violation;
HierarchicalCycle :=
HeadingIsItsOwnAncestorThroughParentHeadingPath;
IF HierarchicalCycleDetected
THEN ValidationStatus := violation;
IF HeadingLevelContradictsExplicitParentRelationship
THEN HierarchyConsistency SHOULD_DECREASE;
HeadingCompleteness :=
DegreeToWhichExpectedStructuralDivisionsHaveAppropriateHeadings;
HeadingConsistency :=
DegreeToWhichHeadingLevelsHierarchyAndNumberingFollowSharedRules;
HeadingClarity :=
DegreeToWhichHeadingTextClearlyIdentifiesAssociatedContent;
HeadingQuality MAY_INCLUDE {
Completeness,
Consistency,
Clarity,
Accessibility,
IdentifierStability
};
HeadingProvenance MAY_INCLUDE {
Source,
Creator,
ExtractionMethod,
Timestamp,
Version
};
HeadingVersion :=
HeadingStateAssociatedWithSpecificResourceVersion;
ResourceRevision MAY {
AddHeading,
RemoveHeading,
RenameHeading,
RelevelHeading,
ReorderHeading,
ReparentHeading
};
RenameHeading :=
ChangeHeadingTextWithoutNecessarilyChangingStructuralIdentity;
RelevelHeading :=
ChangeHeadingLevel;
ReparentHeading :=
ChangeImmediateParentHeadingOrStructuralParent;
ReorderHeading :=
ChangeHeadingPositionWithinReadingOrder;
StableHeadingIdentifier MAY_BE PreservedAcrossRenameWhereIdentityContinues;
RelevelOrReparent MAY_REQUIRE RecalculationOfHeadingPathAndChildRelationships;
HeadingVersionMapping :=
OldHeadingIdentifier
-> NewHeadingIdentifierOrIdentifiers;
TableOfContents MAY_BE GeneratedFrom HeadingHierarchy;
Outline :=
OrderedHierarchicalRepresentationOfHeadingsAndAssociatedComponents;
DocumentOutline MAY_SUPPORT {
Navigation,
Search,
Accessibility,
Summarisation
};
Breadcrumb MAY_BE DerivedFrom HeadingPath;
HeadingIndex :=
SearchStructureMappingHeadingTextAndIdentifiersToStructuralComponents;
HeadingSearch :=
Query
-> MatchHeadingText
-> ReturnAssociatedComponentWithContext;
SemanticSearch MAY_USE HeadingFor {
QueryMatching,
SectionRanking,
ParentContext,
ResultExplanation
};
HeadingText MAY_BE HighValueSignalFor SectionSubjectOrIntent;
RAG MAY_USE HeadingFor {
ChunkLabelling,
ParentContext,
HierarchicalRetrieval,
ContextCompression
};
Chunk SHOULD_RETAIN RelevantHeadingPathWhenDerivedFromSectionContent;
HeadingAwareChunking MAY_IMPROVE ContextPreservation;
KnowledgeGraph MAY_REPRESENT HeadingAsNodeOrPropertyOfStructuralComponent;
GraphRelationships MAY_INCLUDE {
LABELS,
IS_PARENT_OF,
IS_CHILD_OF,
PRECEDES,
FOLLOWS
};
MetadataRepository MAY_STORE HeadingStructuralMetadata;
MetadataRegistry MAY_REGISTER HeadingPropertiesLevelsAndRelationshipTypes;
HTML MAY_REPRESENT HeadingsUsing h1Throughh6Elements;
HTMLHeadingRank SHOULD_REFLECT DocumentStructureRatherThanVisualSize;
ARIA MAY_DEFINE HeadingRoleAndLevelForAccessibleInterfaces;
Accessibility MAY_REQUIRE MeaningfulHeadingHierarchy;
ScreenReaders MAY_USE HeadingsFor RapidDocumentNavigation;
EmptyHeading MAY_CREATE AccessibilityAndNavigationProblems;
DuplicateVisibleHeadingText MAY_BE Valid
IF StructuralContextsDiffer;
HeadingIdentifier SHOULD_DISAMBIGUATE MachineReferences;
XML MAY_REPRESENT HeadingOrTitleElementsAccordingToDocumentSchema;
Markdown MAY_REPRESENT HeadingLevelsUsing HeadingSyntax;
PDFTaggedStructure MAY_INCLUDE HeadingElementsWhenProperlyTagged;
DescriptiveMetadata MAY_USE HeadingTextAsEvidenceFor {
Subject,
Summary,
Keywords
};
StructuralMetadata DEFINES HeadingHierarchyAndComponentRelationship;
Annotation MAY_TARGET HeadingOrAssociatedSection;
Citation MAY_REFERENCE HeadingOrSectionWhenStableIdentifiersExist;
HeadingInteroperability MAY_REQUIRE {
StableIdentifiers,
SharedLevelSemantics,
ParentRelationships,
VersionInformation
};
AccessControl MAY_RESTRICT StructuralComponentsAndTheirHeadings;
RestrictedHeading MUST_NOT RevealProtectedComponentToUnauthorisedConsumerWherePolicyForbids;
HeadingSecurity MAY_INCLUDE {
IdentifierValidation,
OutputEscaping,
AccessControl,
ProvenanceIntegrity,
ChangeAuthorisation
};
MachineReadableHeading SHOULD_PRESERVE {
HeadingIdentifier,
HeadingText,
HeadingLevel,
ParentHeading,
AssociatedComponent,
Position,
Version,
Provenance
};
# ---------- SEMANTIC REASONING ----------
IF StructuralLabelIdentifiesLogicalDocumentDivision
THEN HeadingClassification := supported;
IF HeadingB IS_CHILD_OF HeadingA
THEN HeadingA IS_PARENT_OF HeadingB;
IF HeadingA PRECEDES HeadingB
THEN HeadingB FOLLOWS HeadingA;
IF HeadingLevelChanges
THEN HeadingHierarchy SHOULD_BE Revalidated;
IF HeadingIdentifierStableAcrossRename
THEN ExistingLinks MAY_REMAIN Valid;
IF HeadingTextMatchesQuery
THEN AssociatedSection MAY_RECEIVE RetrievalBoostAccordingToSearchPolicy;
IF HeadingHierarchyContainsCycle
THEN ValidationStatus := violation;
IF HeadingIsOnlyVisuallyStyledWithoutSemanticMarkup
THEN StructuralRole MAY_REQUIRE InferenceOrRepair;
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE {
"heading" ~= "document heading" WHEN structural_context;
"heading text" ~= "heading label";
"heading level" ~= "heading rank";
"parent heading" ~= "broader structural heading";
"child heading" ~= "nested heading";
"heading hierarchy" ~= "document outline hierarchy";
"heading identifier" ~= "heading ID";
"heading path" ~= "outline path";
}
# ---------- QUERY FLOW ----------
QUERY(q) ->
NORMALISE(q) ->
IDENTIFY_RESOURCE(q) ->
IDENTIFY_HEADING(q) ->
RESOLVE_HEADING_IDENTIFIER(q) ->
IDENTIFY_HEADING_TEXT_LEVEL_AND_TYPE(q) ->
IDENTIFY_ASSOCIATED_COMPONENT(q) ->
IDENTIFY_PARENT_CHILD_RELATIONSHIPS(q) ->
IDENTIFY_PREVIOUS_NEXT_RELATIONSHIPS(q) ->
IDENTIFY_VERSION_AND_PROVENANCE(q) ->
VALIDATE_HEADING_STRUCTURE(q) ->
SCORE_CONFIDENCE(q) ->
RETURN_RELEVANT_HEADING_KNOWLEDGE;
# ---------- CONFIDENCE ----------
CONFIDENCE(assertion) :=
weighted_mean(
source_reliability,
heading_structure_consistency,
identifier_strength,
hierarchy_evidence,
provenance_quality,
contextual_relevance
);
CONFIDENCE >= 0.90 => HIGH;
CONFIDENCE >= 0.70 AND < 0.90 => MODERATE;
CONFIDENCE < 0.70 => REVIEW;
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION {
primary_entity: Heading;
ontology: HeadingOntology;
parse_entities: true;
parse_relationships: true;
preserve_relationship_direction: true;
resolve_semantic_equivalence: true;
execute_reasoning_rules: true;
apply_confidence_weighting: true;
preserve_provenance: true;
}
# ---------- UPDATE MODEL ----------
UPDATE_MODEL {
new_heading:
identify_resource
-> detect_or_receive_heading
-> assign_heading_identifier
-> capture_heading_text
-> determine_level_and_type
-> link_structural_component
-> identify_parent_and_position
-> attach_provenance
-> validate
-> integrate;
heading_revision:
preserve_previous_version
-> apply_text_level_parent_or_position_changes
-> preserve_identifier_where_identity_continues
-> recompute_hierarchy_and_sequence
-> revalidate
-> update_outline_and_index
-> recompute_confidence
-> regenerate_flow_hash;
resource_revision:
identify_affected_headings
-> update_positions_parent_links_and_paths
-> map_changed_identifiers
-> validate_structure
-> integrate;
conflict:
preserve_provenance
-> compare_heading_levelsrelationshipsor_sources
-> adjust_confidence
-> flag_review;
}
# ---------- FLOW HASH ----------
FLOW_HASH_INPUT :=
DOMAIN
+ SUBDOMAIN
+ ONTOLOGY
+ HeadingEntity
+ StructuralEntity
+ MetadataEntity
+ Heading
+ HeadingHierarchy
+ HeadingValidation
+ RELATIONSHIPS
+ SEMANTIC_REASONING
+ SEMANTIC_EQUIVALENCE
+ UPDATE_MODEL;
FLOW_HASH :=
HASH(FLOW_HASH_INPUT);
# ---------- TERMINAL ----------
HeadingOntology
-> IdentifyStructuredResource
-> DetectHeadingAndAssociatedComponent
-> AssignStableHeadingIdentifier
-> CaptureHeadingTextLevelTypeAndPosition
-> BuildParentChildHeadingHierarchy
-> EstablishPreviousAndNextRelationships
-> ValidateLevelsCyclesAndStructuralConsistency
-> StoreAndVersionHeadingMetadata
-> GenerateOutlineTableOfContentsAndNavigation
-> PreserveHeadingContextForSearchAndRAG
-> SupportAccessibilityAndMachineInterpretation
-> MaintainCrossVersionHeadingMappings
-> MaintainReliableHeadingStructureKnowledge;
END FLOW
Download Code
Copy to Clipboard