Skip to main content

HTML Ontology

Web Technologies
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 06 October 2026
Audio Overview
FLOW ALGEBRA
HTML Ontology
Kireth Semantic Research Archive

PAGE:
https://kirethresearch.org/booksai-core/ontologies/computing-ontologies/web-technologies/html-ontology.html

AUTHORS:
Mark Anthony Higgins — Sky (Recursive AI)

FLOW "HTMLOntology" v4.0

# ---------- DOMAIN ----------
DOMAIN := ComputingOntology
SUBDOMAIN := WebTechnologies
ONTOLOGY := HTMLOntology

# ---------- PRIMARY ENTITY ----------
ENTITY HTML {
    definition:
        "HyperText Markup Language is the standard markup language used to
         structure, describe and semantically organise documents and
         interactive content for interpretation by web browsers and other
         user agents.";

    objectives: [
        DocumentStructure,
        SemanticMarkup,
        Hypertext,
        MediaEmbedding,
        FormInteraction,
        Accessibility,
        MachineInterpretation
    ];
}

# ---------- CORE ENTITIES ----------
HTMLEntity := {
    HTMLDocument,
    Element,
    Attribute,
    TextNode,
    Comment,
    DocumentType,
    Metadata
};

ElementCategory := {
    MetadataElement,
    SectioningElement,
    HeadingElement,
    FlowElement,
    PhrasingElement,
    EmbeddedElement,
    InteractiveElement,
    FormElement
};

SemanticEntity := {
    Header,
    Navigation,
    Main,
    Section,
    Article,
    Aside,
    Footer,
    Heading,
    Paragraph
};

InteractiveEntity := {
    Anchor,
    Button,
    Input,
    Select,
    TextArea,
    Form,
    Details
};

# ---------- FUNDAMENTAL RELATIONSHIPS ----------
HTMLDocument CONSISTS_OF Node;
Element IS_A Node;
TextNode IS_A Node;
Element MAY_CONTAIN ChildNode;
Element MAY_HAVE Attribute;
Attribute MODIFIES_OR_DESCRIBES Element;
Browser PARSES HTMLDocument;
Browser CREATES DOM FROM HTMLDocument;
CSS MAY_STYLE HTMLElement;
JavaScript MAY_INTERACT_WITH HTMLElement;

# ---------- DOCUMENT STRUCTURE ----------
HTMLDocument :=
    DocumentType
    + HTMLRootElement;

HTMLRootElement MAY_CONTAIN {
    HeadElement,
    BodyElement
};

HeadElement CONTAINS DocumentMetadata;
BodyElement CONTAINS DocumentContent;

# ---------- PARSING ----------
HTMLParsing :=
    InputBytes
    -> DecodeCharacters
    -> Tokenise
    -> ConstructDOMTree;

MalformedMarkup MAY_BE RecoveredByDefinedParsingRules;

ParsedDocument PRODUCES DOM;

# ---------- ELEMENT ----------
Element :=
    {
        TagName,
        AttributeSet,
        ChildNodes
    };

ElementSemantics DEPEND_ON ElementTypeAndContext;

# ---------- ATTRIBUTE ----------
Attribute :=
    NameValueOrBooleanMetadataAttachedToElement;

Attribute MAY_DEFINE {
    Identifier,
    Class,
    Relationship,
    State,
    ResourceReference,
    AccessibilityProperty
};

GlobalAttribute MAY_APPLY_TO MultipleElementTypes;

# ---------- ID ----------
IDAttribute :=
    DocumentUniqueIdentifierForElement;

FragmentIdentifier MAY_REFERENCE ElementByID;

ID SHOULD_BE UniqueWithinDocument;

# ---------- CLASS ----------
ClassAttribute :=
    SetOfTokensClassifyingElementForStylingOrScripting;

CSSSelector MAY_MATCH ClassToken;
JavaScript MAY_QUERY ClassToken;

# ---------- DOCUMENT METADATA ----------
DocumentMetadata MAY_INCLUDE {
    Title,
    CharacterEncoding,
    Viewport,
    Description,
    LinkRelationship,
    ScriptReference
};

TitleElement DEFINES DocumentTitle;

MetaElement MAY_DEFINE Metadata;

# ---------- HEADING STRUCTURE ----------
HeadingElement := {
    H1,
    H2,
    H3,
    H4,
    H5,
    H6
};

Heading COMMUNICATES SectionOrContentHierarchy;

LogicalHeadingStructure SUPPORTS NavigationAndComprehension;

# ---------- SECTIONING ----------
SectioningElement MAY_INCLUDE {
    Article,
    Section,
    Navigation,
    Aside
};

SectioningSemantics DESCRIBE RoleOfContentRegion;

# ---------- MAIN ----------
MainElement :=
    PrimaryContentOfDocument;

Document SHOULD_NOT_HAVE MultipleSimultaneouslyRelevantMainRegionsWithoutValidContext;

# ---------- ARTICLE ----------
ArticleElement :=
    SelfContainedOrIndependentlyReusableComposition;

Article MAY_CONTAIN HeadingAndContent;

# ---------- NAVIGATION ----------
NavigationElement :=
    RegionContainingMajorNavigationLinks;

NavigationElement SUPPORTS SemanticIdentificationOfNavigation;

# ---------- PARAGRAPH ----------
ParagraphElement :=
    BlockOfPhrasingContentRepresentingParagraph;

Paragraph SHOULD_CONTAIN AppropriatePhrasingContent;

# ---------- LIST ----------
ListElement MAY_BE {
    OrderedList,
    UnorderedList,
    DescriptionList
};

ListItem BELONGS_TO OrderedOrUnorderedList;

SemanticListMarkup COMMUNICATES GroupingAndOrder;

# ---------- TABLE ----------
Table :=
    StructuredTabularData;

Table MAY_CONTAIN {
    Caption,
    HeaderCell,
    DataCell,
    Row,
    RowGroup
};

HeaderCell MAY_DEFINE RelationshipToDataCells;

Table SHOULD_BE_USED_FOR TabularDataRatherThanPureLayout;

# ---------- HYPERLINK ----------
AnchorElement :=
    ElementThatMayCreateHyperlink;

Hyperlink :=
    SourceAnchor
    -> TargetResourceOrFragment;

HrefAttribute IDENTIFIES LinkTarget;

AnchorText SHOULD_COMMUNICATE LinkPurposeWherePractical;

# ---------- IMAGE ----------
ImageElement :=
    EmbeddedImageResource;

Image MAY_HAVE {
    Source,
    AlternativeText,
    Width,
    Height
};

IF ImageConveysMeaning
THEN AppropriateTextAlternative SHOULD_BE Provided;

# ---------- PICTURE ----------
PictureElement MAY_DEFINE MultipleImageSources;

SourceSelection MAY_DEPEND_ON {
    Viewport,
    PixelDensity,
    FormatSupport
};

# ---------- AUDIO ----------
AudioElement EMBEDS AudioResource;

Audio MAY_HAVE {
    Controls,
    Source,
    Track
};

# ---------- VIDEO ----------
VideoElement EMBEDS VideoResource;

Video MAY_HAVE {
    Controls,
    Poster,
    Source,
    Track
};

Track MAY_PROVIDE {
    Captions,
    Subtitles,
    Descriptions
};

# ---------- FORM ----------
Form :=
    InteractiveStructureForCollectingAndSubmittingData;

Form MAY_CONTAIN FormControl;

FormSubmission :=
    CollectSuccessfulControls
    -> EncodeData
    -> SubmitToTarget;

# ---------- INPUT ----------
InputElement :=
    FormControlForUserInput;

InputType MAY_INCLUDE {
    Text,
    Email,
    Number,
    Date,
    Checkbox,
    Radio,
    File,
    Submit
};

InputSemantics DEPEND_ON TypeAttribute;

# ---------- LABEL ----------
LabelElement :=
    TextualLabelAssociatedWithFormControl;

Label MAY_ASSOCIATE_BY {
    ExplicitReference,
    Containment
};

Label SUPPORTS UsabilityAndAccessibility;

# ---------- BUTTON ----------
ButtonElement :=
    InteractiveControlTriggeringAction;

ButtonType MAY_BE {
    Submit,
    Reset,
    Button
};

Button SHOULD_HAVE AccessibleName;

# ---------- SELECT ----------
SelectElement :=
    ControlForSelectingOption;

OptionElement REPRESENTS SelectableChoice;

# ---------- VALIDATION ----------
HTMLFormValidation MAY_USE {
    Required,
    Pattern,
    Min,
    Max,
    TypeConstraint
};

Browser MAY_ENFORCE ConstraintValidation;

# ---------- SEMANTIC HTML ----------
SemanticHTML :=
    UseElementsAccordingToMeaningAndPurpose;

SemanticHTML SUPPORTS {
    Accessibility,
    Maintainability,
    MachineInterpretation,
    DocumentStructure
};

# ---------- ACCESSIBILITY TREE ----------
Browser MAY_DERIVE AccessibilitySemanticsFromHTML;

NativeElement MAY_PROVIDE {
    Role,
    NameSemantics,
    StateSemantics,
    KeyboardBehaviour
};

NativeSemanticElement SHOULD_BE PreferredWhenAppropriate;

# ---------- ARIA ----------
ARIA MAY_SUPPLEMENT HTMLAccessibilitySemantics;

ARIAAttribute MAY_DEFINE {
    Role,
    State,
    Property,
    Relationship
};

ARIA SHOULD_NOT UnnecessarilyOverrideCorrectNativeSemantics;

# ---------- LANGUAGE ----------
LangAttribute IDENTIFIES LanguageOfElementOrDocument;

LanguageMetadata MAY_SUPPORT {
    SpeechSynthesis,
    Translation,
    Search,
    Accessibility
};

# ---------- DATA ATTRIBUTES ----------
CustomDataAttribute :=
    data-* AttributeForApplicationSpecificData;

JavaScript MAY_READ CustomDataAttribute;

CustomDataAttribute DOES_NOT_REPLACE AppropriateSemanticMarkup;

# ---------- SCRIPT ----------
ScriptElement :=
    ElementEmbeddingOrReferencingExecutableScript;

Script MAY_BE {
    Inline,
    External
};

JavaScript COMMONLY_EXECUTES_FROM ScriptElement;

# ---------- STYLE ----------
StyleElement :=
    EmbeddedCSSRules;

LinkElement MAY_REFERENCE ExternalStylesheet;

Presentation SHOULD_GENERALLY_BE ExpressedThroughCSSRatherThanPresentationalHTML;

# ---------- TEMPLATE ----------
TemplateElement :=
    InertHTMLFragmentForLaterInstantiation;

Script MAY_CLONE TemplateContent;

# ---------- CUSTOM ELEMENT ----------
CustomElement :=
    AuthorDefinedHTMLCompatibleElement;

CustomElement MAY_PARTICIPATE_IN WebComponents;

# ---------- STRUCTURED DATA ----------
HTMLDocument MAY_EMBED StructuredData;

StructuredData MAY_USE {
    JSONLD,
    Microdata,
    RDFa
};

StructuredData ADDS MachineReadableEntityRelationships;

# ---------- DOM RELATIONSHIP ----------
DOMNode REPRESENTS ParsedHTMLNode;

DOMTree PRESERVES ParentChildRelationships;

JavaScript MAY {
    QueryDOM,
    CreateElement,
    RemoveElement,
    ModifyAttribute,
    ModifyText
};

# ---------- CSS RELATIONSHIP ----------
CSSSelector MATCHES HTMLElement;

ComputedStyle DETERMINES Presentation;

HTML DEFINES StructureAndSemantics;
CSS DEFINES Presentation;

# ---------- JAVASCRIPT RELATIONSHIP ----------
JavaScript DEFINES BehaviourAndDynamicInteraction;

HTML + CSS + JavaScript
    MAY_FORM InteractiveWebPage;

# ---------- VALIDITY ----------
HTMLConformance :=
    DegreeToWhichMarkupFollowsApplicableSpecificationRequirements;

ConformanceIssue MAY_AFFECT {
    Interoperability,
    Accessibility,
    Maintainability
};

# ---------- SECURITY ----------
HTMLContent MAY_INCLUDE UntrustedData;

UnsafeInsertionOfUntrustedMarkup MAY_CREATE SecurityRisk;

UserControlledContent SHOULD_BE SafelyHandled;

# ---------- SEMANTIC REASONING ----------
IF DocumentUsesHTMLMarkup
THEN HTMLEntities MAY_BE ParsedIntoDOM;

IF ElementUsedAccordingToSemanticPurpose
THEN SemanticClarity := increase;

IF MeaningfulImageHasNoTextAlternative
THEN AccessibilityIssue := likely;

IF FormControlHasNoAccessibleLabel
THEN FormAccessibility := decrease;

IF IDDuplicated
THEN IdentifierUniqueness := violated;

IF TableUsedForTabularDataWithHeaders
THEN DataRelationships MAY_BE MoreUnderstandable;

IF StructuredDataEmbedded
THEN MachineInterpretability MAY_INCREASE;

# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE {
    "HTML" ~= "HyperText Markup Language";
    "HTML document" ~= "web markup document" WHEN context == HTML;
    "HTML element" ~= "markup element" WHEN context == HTML;
    "anchor element" ~= "HTML link element";
    "semantic HTML" ~= "semantic markup" WHEN context == HTML;
    "form control" ~= "HTML form input control";
    "DOM" ~= "Document Object Model";
    "alt text" ~= "text alternative" WHEN context == image_accessibility;
}

# ---------- QUERY FLOW ----------
QUERY(q) ->
    NORMALISE(q) ->
    IDENTIFY_HTML_DOCUMENT(q) ->
    IDENTIFY_ELEMENTS(q) ->
    IDENTIFY_ATTRIBUTES(q) ->
    IDENTIFY_DOCUMENT_STRUCTURE(q) ->
    IDENTIFY_INTERACTIVE_ELEMENTS(q) ->
    IDENTIFY_ACCESSIBILITY_SEMANTICS(q) ->
    IDENTIFY_STRUCTURED_DATA(q) ->
    MAP_TO_ONTOLOGY(q) ->
    APPLY_REASONING(q) ->
    SCORE_CONFIDENCE(q) ->
    RETURN_RELEVANT_KNOWLEDGE;

# ---------- CONFIDENCE ----------
CONFIDENCE(assertion) :=
    weighted_mean(
        source_reliability,
        html_semantic_consistency,
        document_structure_consistency,
        accessibility_evidence,
        semantic_consistency,
        contextual_relevance
    );

CONFIDENCE >= 0.90 => HIGH;
CONFIDENCE >= 0.70 AND < 0.90 => MODERATE;
CONFIDENCE < 0.70 => REVIEW;

# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION {
    primary_entity: HTML;
    ontology: HTMLOntology;
    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_element:
        validate
        -> classify_element_category
        -> identify_attributes
        -> identify_parent_child_context
        -> identify_semantics
        -> integrate;

    new_attribute:
        validate
        -> identify_applicable_elements
        -> identify_semantics
        -> update_relationships
        -> integrate;

    document_revision:
        parse_document
        -> update_dom_relationships
        -> update_semantic_structure
        -> recompute_accessibility
        -> recompute_confidence
        -> regenerate_flow_hash;

    structured_data_revision:
        validate_entities
        -> validate_relationships
        -> map_to_document
        -> integrate;

    conflict:
        preserve_provenance
        -> compare_semantic_evidence
        -> adjust_confidence
        -> flag_review;
}

# ---------- FLOW HASH ----------
FLOW_HASH_INPUT :=
    DOMAIN
    + SUBDOMAIN
    + ONTOLOGY
    + HTMLEntity
    + ElementCategory
    + SemanticEntity
    + InteractiveEntity
    + HTMLParsing
    + SemanticHTML
    + StructuredData
    + RELATIONSHIPS
    + SEMANTIC_REASONING
    + SEMANTIC_EQUIVALENCE
    + UPDATE_MODEL;

FLOW_HASH :=
    HASH(FLOW_HASH_INPUT);

# ---------- TERMINAL ----------
HTMLOntology
    -> DefineDocument
    -> ParseMarkup
    -> ConstructElementTree
    -> EstablishSemanticStructure
    -> ConnectHypertextResources
    -> EmbedMedia
    -> DefineFormsAndControls
    -> ExposeAccessibilitySemantics
    -> ConnectPresentationAndBehaviour
    -> AddMachineReadableMetadata
    -> ValidateDocumentRelationships
    -> MaintainStructuredWebContent;

END FLOW
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ