FLOW ALGEBRA
Chapter Ontology
Kireth Semantic Research Archive
PAGE:
https://kirethresearch.org/booksai-core/ontologies/metadata-ontologies/structural-metadata/chapter-ontology.html
AUTHORS:
Mark Anthony Higgins — Sky (Recursive AI)
FLOW "ChapterOntology" v4.0
DOMAIN := MetadataOntologies
SUBDOMAIN := StructuralMetadata
ONTOLOGY := ChapterOntology
ENTITY Chapter {
definition:
"A major logical division of a structured document or work, identified
by its position, title, parent resource, internal components and
relationships to preceding, following and subordinate content.";
objectives: [
DocumentOrganisation,
LogicalSegmentation,
HierarchicalNavigation,
ReadingOrder,
Addressability,
RetrievalContext,
MachineInterpretability
];
}
ChapterEntity := {
Chapter,
Document,
ChapterTitle,
ChapterIdentifier,
ChapterNumber,
ChapterContent,
ChapterSection,
ChapterFragment
};
StructuralEntity := {
ParentDocument,
PreviousChapter,
NextChapter,
Section,
Subsection,
Sequence,
Position,
StructureMap
};
MetadataEntity := {
MetadataRecord,
ResourceIdentifier,
Language,
Provenance,
Version,
Confidence
};
Chapter IS_PART_OF Document;
Document HAS_PART Chapter;
Chapter MAY_CONTAIN Section;
Chapter MAY_PRECEDE Chapter;
Chapter MAY_FOLLOW Chapter;
Chapter HAS ChapterIdentifier;
Chapter MAY_HAVE ChapterTitle;
Chapter HAS Position;
ChapterFlow :=
Document
-> IdentifyChapterBoundary
-> AssignChapterIdentifier
-> DetermineChapterNumberAndPosition
-> CaptureChapterTitle
-> IdentifyContainedSections
-> LinkPreviousAndNextChapters
-> AttachParentDocument
-> ValidateChapterStructure
-> StoreStructuralMetadata
-> IndexForNavigationAndRetrieval
-> MaintainAcrossVersions;
Chapter :=
MajorLogicalDivisionOfDocumentOrStructuredWork;
Document :=
ParentResourceContainingChapter;
Chapter MAY_BE {
NumberedChapter,
UnnumberedChapter,
IntroductoryChapter,
MainChapter,
ConcludingChapter
};
ChapterIdentifier :=
StableOrLocallyUniqueReferenceToChapter;
ChapterIdentifier MAY_BE {
URI,
IRI,
UUID,
FragmentIdentifier,
InternalID
};
StableChapterIdentifier SHOULD_BE PreferredOverChapterNumberForMachineLinking;
ChapterNumber :=
HumanReadableOrStructuralOrdinalAssignedToChapter;
ChapterNumber MAY_BE {
Integer,
RomanNumeral,
TextualNumber,
HierarchicalNumber
};
ChapterNumber != ChapterIdentifierByDefinition;
ChapterPosition :=
OrderedLocationOfChapterWithinParentDocument;
ChapterPosition MAY_BE NumericOrSequenceBased;
ChapterTitle :=
HumanReadableTitleOfChapter;
ChapterTitle MAY_HAVE {
PreferredTitle,
AlternativeTitle,
Language
};
UntitledChapter MAY_EXIST;
MissingChapterTitle DOES_NOT NecessarilyInvalidate ChapterIfStructureAllows;
ChapterContent :=
ContentContainedWithinChapterBoundary;
ChapterContent MAY_INCLUDE {
Heading,
Paragraph,
Section,
Figure,
Table,
List,
Citation,
Footnote
};
ChapterSection :=
LogicalSubdivisionOfChapter;
Section IS_PART_OF Chapter;
Chapter MAY_CONTAIN MultipleSections;
Section MAY_CONTAIN Subsection;
ChapterHierarchy :=
Document
-> Chapter
-> Section
-> Subsection
-> Fragment;
ChapterPath :=
ParentDocument
-> Chapter
-> OptionalSection
-> TargetFragment;
ParentDocument :=
DocumentOrWorkContainingChapter;
IF Document HAS_PART Chapter
THEN Chapter IS_PART_OF Document;
PreviousChapter :=
ImmediateChapterBeforeCurrentChapterInDefinedReadingOrder;
NextChapter :=
ImmediateChapterAfterCurrentChapterInDefinedReadingOrder;
IF ChapterA PRECEDES ChapterB
AND NoChapterExistsBetweenAAndB
THEN ChapterA MAY_BE PreviousChapterOf ChapterB;
IF ChapterA IS_PREVIOUS_OF ChapterB
THEN ChapterB IS_NEXT_OF ChapterA;
ReadingOrder :=
IntendedSequenceForConsumingChapters;
ReadingOrder MAY_DIFFER_FROM FileStorageOrder;
ChapterSequence :=
OrderedCollectionOfChaptersWithinDocument;
Sequence MAY_DEFINE {
FirstChapter,
PreviousChapter,
CurrentChapter,
NextChapter,
LastChapter
};
FirstChapter :=
EarliestChapterInDefinedChapterSequence;
LastChapter :=
FinalChapterInDefinedChapterSequence;
ChapterBoundary :=
StartAndEndExtentOfChapterWithinDocumentRepresentation;
Boundary MAY_BE IdentifiedBy {
Markup,
Heading,
PageRange,
TextOffsets,
FileBoundary,
StructuralParser
};
ChapterFragment :=
AddressableSubpartOfChapter;
Fragment MAY_BE {
Section,
Paragraph,
Figure,
Table,
TextSpan
};
Chapter MAY_SPAN MultiplePages;
PageRange MAY_DESCRIBE PhysicalExtentOfChapter;
LogicalChapterStructure MAY_DIFFER_FROM PhysicalPageStructure;
ChapterToPageMapping :=
Chapter
-> OneOrMorePages;
Page MAY_CONTAIN ContentFromMultipleLogicalComponents;
ChapterFileMapping :=
Chapter
-> OneOrMoreDigitalFiles;
SingleFile MAY_CONTAIN MultipleChapters;
ChapterStructureMap :=
ExplicitRepresentationOfChapterAndContainedComponents;
StructureMap MAY_INCLUDE {
ChapterIdentifier,
Title,
Position,
Sections,
References,
PageMapping
};
TableOfContents MAY_REFERENCE ChapterIdentifierAndTitle;
ChapterMetadata MAY_SUPPORT AutomaticTableOfContentsGeneration;
ChapterHeading :=
HeadingRepresentingChapterBoundaryOrTitle;
HeadingLevel SHOULD_BE ConsistentWithDocumentStructureAccordingToProfile;
ChapterReference :=
InternalOrExternalReferenceAssociatedWithChapter;
CrossReference MAY_TARGET {
Chapter,
Section,
Figure,
Table,
ExternalResource
};
Citation MAY_ORIGINATE_FROM ChapterOrContainedComponent;
ChapterStructuralValidation MAY_CHECK {
ParentDocument,
Identifier,
DuplicatePosition,
Boundary,
ReadingOrder,
BrokenReference
};
IF ChapterHasNoResolvableParentDocument
THEN Chapter MAY_BE OrphanChapter;
OrphanChapter :=
ChapterExpectedWithinDocumentButWithoutResolvableParentRelationship;
IF DuplicateChapterIdentifierWithinUniqueScope
THEN IdentifierValidation := violation;
IF TwoChaptersOccupySameExclusiveSequencePosition
THEN ReadingOrderConflict MAY_EXIST;
IF ChapterBoundaryOverlapsAnotherChapterUnexpectedly
THEN StructuralValidation MAY_REQUIRE Review;
ChapterCompleteness :=
DegreeToWhichRequiredChapterStructuralMetadataIsPresent;
ChapterConsistency :=
DegreeToWhichChapterPositionHierarchyAndReferencesAgreeWithDocumentStructure;
ChapterIntegrity :=
PreservationOfValidIdentifierBoundaryRelationshipsAndOrder;
ChapterQuality MAY_INCLUDE {
Completeness,
Consistency,
Integrity,
Navigability,
IdentifierStability
};
ChapterProvenance MAY_INCLUDE {
Source,
Creator,
ExtractionMethod,
Timestamp,
Version
};
Chapter MAY_BE {
ManuallyAuthored,
ExtractedFromMarkup,
AutomaticallyDetected,
AIAssisted
};
AutomaticChapterDetection :=
Document
-> DetectChapterHeadingsAndBoundaries
-> InferSequence
-> GenerateChapterMetadata;
AI MAY_SUPPORT {
ChapterBoundaryDetection,
ChapterTitleExtraction,
SectionDetection,
ReadingOrderInference
};
InferredChapter SHOULD_HAVE ConfidenceWhereDetectionIsUncertain;
ChapterConfidence :=
EstimatedSupportForInferredChapterStructureOrMetadata;
ChapterVersion :=
ChapterStateAssociatedWithSpecificDocumentVersion;
DocumentRevision MAY {
AddChapter,
RemoveChapter,
ReorderChapter,
RenameChapter,
SplitChapter,
MergeChapters
};
ReorderChapter :=
MoveChapterToDifferentSequencePosition;
RenameChapter :=
ChangeChapterTitleWithoutNecessarilyChangingChapterIdentity;
SplitChapter :=
ExistingChapter
-> MultipleNewChapters;
MergeChapters :=
MultipleExistingChapters
-> SingleChapter;
StableChapterIdentifier MAY_BE PreservedAcrossRenameOrReorder;
SplitOrMerge MAY_REQUIRE IdentifierMappingAndMigration;
ChapterVersionMapping :=
OldChapterIdentifier
-> NewChapterIdentifierOrIdentifiers;
PreviousChapterVersion SHOULD_BE PreservedWhereHistoricalTraceabilityRequired;
ChapterAnnotation MAY_TARGET ChapterOrChapterFragment;
StableChapterIdentifier MAY_IMPROVE AnnotationPersistence;
ChapterCitation MAY_REFERENCE SpecificChapterWithinLargerWork;
Citation SHOULD_INCLUDE ParentDocumentContextWhereRequired;
Chapter MAY_HAVE DescriptiveMetadataSuchAs {
Title,
Subject,
Summary,
Keywords,
Language
};
StructuralMetadata DEFINES ChapterPositionHierarchyAndContainment;
DescriptiveMetadata DESCRIBES ChapterContentAndIdentity;
TechnicalMetadata MAY_DESCRIBE DigitalFilesContainingChapter;
PreservationMetadata MAY_USE ChapterStructureForLongTermReconstruction;
ChapterIndex :=
SearchStructureMappingChapterMetadataAndContentToParentDocument;
ChapterIndex MAY_INCLUDE {
ChapterTitle,
ChapterIdentifier,
ParentDocumentIdentifier,
Position,
FullText
};
ChapterSearch :=
Query
-> MatchChapterMetadataOrContent
-> ReturnChapterWithParentContext;
SemanticSearch MAY_USE ChapterFor {
SectionScopedRetrieval,
ParentContext,
NeighbourRetrieval,
Ranking
};
IF SearchMatchOccursWithinChapter
THEN Result SHOULD_PRESERVE ParentDocumentAndChapterContextWhereUseful;
RAG MAY_USE ChapterAs {
RetrievalUnit,
ChunkParent,
ContextBoundary
};
StructureAwareChunking MAY_SPLIT ChapterIntoSectionsOrFragments
WHILE Preserving ChapterIdentifierAndPosition;
NeighbourRetrieval MAY_USE PreviousChapterAndNextChapterRelationships;
KnowledgeGraph MAY_REPRESENT ChapterAsNode;
GraphRelationships MAY_INCLUDE {
IS_PART_OF,
HAS_PART,
PRECEDES,
FOLLOWS,
REFERENCES
};
MetadataRepository MAY_STORE ChapterStructuralMetadata;
MetadataRegistry MAY_REGISTER ChapterPropertiesAndRelationshipTypes;
ChapterInteroperability MAY_REQUIRE {
StableIdentifiers,
SharedStructuralSemantics,
ParentDocumentReference,
VersionInformation
};
RDF MAY_REPRESENT:
Chapter
-> isPartOf
-> Document;
JSONLD MAY_SERIALISE ChapterAndStructuralRelationships;
HTML MAY_REPRESENT ChapterLikeStructureUsing SectioningElementsAndHeadings;
XML MAY_REPRESENT ChapterAsExplicitElementInDocumentSchemas;
Accessibility MAY_USE ChapterHeadingAndHierarchyForNavigation;
CorrectHeadingStructure MAY_IMPROVE ScreenReaderNavigation;
ChapterAccessControl MAY_DIFFER_FROM ParentDocumentAccessInSomeSystems;
RestrictedChapter MUST_NOT_BE ExposedToUnauthorisedConsumer;
ChapterSecurity MAY_INCLUDE {
IdentifierValidation,
AccessControl,
ReferenceIntegrity,
ProvenanceIntegrity,
ChangeAuthorisation
};
MachineReadableChapter SHOULD_PRESERVE {
ChapterIdentifier,
ParentDocumentIdentifier,
Title,
Position,
Sections,
ReadingOrder,
Version,
Provenance
};
# ---------- SEMANTIC REASONING ----------
IF ResourceComponentIsMajorLogicalDivisionOfDocument
THEN ChapterClassification := supported;
IF Document HAS_PART Chapter
THEN Chapter IS_PART_OF Document;
IF ChapterA PRECEDES ChapterB
THEN ChapterB FOLLOWS ChapterA;
IF Chapter CONTAINS Section
THEN Section IS_PART_OF Chapter;
IF ChapterIdentifierStableAcrossRename
THEN ExistingLinks MAY_REMAIN Valid;
IF ChapterPositionChanges
THEN PreviousNextRelationships SHOULD_BE Recomputed;
IF ChapterSplitOccurs
THEN OldIdentifier SHOULD_BE MappedToSuccessorChaptersWherePossible;
IF ParentDocumentAccessDenied
THEN ChapterAccess SHOULD_FOLLOW ApplicablePolicy;
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE {
"chapter" ~= "document chapter" WHEN structural_context;
"chapter identifier" ~= "chapter ID";
"chapter number" ~= "chapter ordinal" WHEN sequence_context;
"chapter title" ~= "chapter heading" WHEN heading_is_title;
"chapter sequence" ~= "chapter reading order" WHEN linear_document_context;
"chapter path" ~= "document hierarchy path to chapter";
"chapter fragment" ~= "chapter subcomponent";
"parent document" ~= "containing document";
}
# ---------- QUERY FLOW ----------
QUERY(q) ->
NORMALISE(q) ->
IDENTIFY_PARENT_DOCUMENT(q) ->
IDENTIFY_CHAPTER(q) ->
RESOLVE_CHAPTER_IDENTIFIER(q) ->
IDENTIFY_TITLE_NUMBER_AND_POSITION(q) ->
IDENTIFY_SECTIONS_AND_FRAGMENTS(q) ->
IDENTIFY_PREVIOUS_NEXT_RELATIONSHIPS(q) ->
IDENTIFY_VERSION_AND_PROVENANCE(q) ->
VALIDATE_CHAPTER_STRUCTURE(q) ->
SCORE_CONFIDENCE(q) ->
RETURN_RELEVANT_CHAPTER_KNOWLEDGE;
# ---------- CONFIDENCE ----------
CONFIDENCE(assertion) :=
weighted_mean(
source_reliability,
chapter_structure_consistency,
identifier_strength,
boundary_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: Chapter;
ontology: ChapterOntology;
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_chapter:
identify_parent_document
-> detect_or_receive_boundary
-> assign_chapter_identifier
-> determine_position
-> capture_title
-> identify_sections
-> attach_provenance
-> validate
-> integrate;
chapter_revision:
preserve_previous_version
-> apply_title_boundary_or_content_changes
-> preserve_identifier_where_identity_continues
-> recompute_sequence_relationships
-> revalidate
-> update_index
-> recompute_confidence
-> regenerate_flow_hash;
document_revision:
identify_affected_chapters
-> update_positions_and_parent_links
-> map_changed_identifiers
-> validate_structure
-> integrate;
conflict:
preserve_provenance
-> compare_chapter_boundaries_positions_or_sources
-> adjust_confidence
-> flag_review;
}
# ---------- FLOW HASH ----------
FLOW_HASH_INPUT :=
DOMAIN
+ SUBDOMAIN
+ ONTOLOGY
+ ChapterEntity
+ StructuralEntity
+ MetadataEntity
+ Chapter
+ ChapterHierarchy
+ ChapterStructureMap
+ RELATIONSHIPS
+ SEMANTIC_REASONING
+ SEMANTIC_EQUIVALENCE
+ UPDATE_MODEL;
FLOW_HASH :=
HASH(FLOW_HASH_INPUT);
# ---------- TERMINAL ----------
ChapterOntology
-> IdentifyParentDocument
-> DetectChapterBoundaryAndIdentity
-> AssignStableChapterIdentifier
-> CaptureChapterNumberTitleAndPosition
-> ModelContainedSectionsAndFragments
-> EstablishPreviousAndNextRelationships
-> MapChapterToPagesAndFiles
-> ValidateHierarchyBoundaryAndReadingOrder
-> StoreAndVersionChapterMetadata
-> IndexForNavigationSearchAndRetrieval
-> PreserveParentContextForRAGAndSemanticSearch
-> MaintainCrossVersionChapterMappings
-> MaintainReliableChapterStructureKnowledge;
END FLOW
Download Code
Copy to Clipboard