FLOW ALGEBRA
Ontology: Sitemap Ontology
Domain: Metadata Ontologies > Web Metadata
Canonical URL: https://kirethresearch.org/booksai-core/ontologies/metadata-ontologies/web-metadata/sitemap-ontology.html
Authors: Mark Anthony Higgins — Sky (Recursive AI)
flow "SitemapOntology" v1.0
# ---------- DOMAIN ----------
domain:
class: MetadataOntology
category: WebMetadata
subject: SitemapMetadata
purpose:
- represent metadata describing web sitemaps, sitemap indexes, and listed resources
- preserve sitemap identity, URLs, modification metadata, alternates, media extensions, validation, and provenance
- support web discovery, crawling, indexing, freshness assessment, and AI consumption
- distinguish sitemap declarations from canonical identity, indexing guarantees, and current resource state
- enable machine-readable reasoning over sitemap structures
# ---------- CORE ENTITY ----------
entity SitemapMetadata:
type: WebMetadata
describes: SitemapResource
may_include:
- sitemap_identifier
- sitemap_type
- sitemap_url
- source_site
- listed_resources
- last_modified
- alternate_languages
- image_metadata
- video_metadata
- news_metadata
- validation_state
- retrieval_time
- provenance
entity SitemapResource:
type: DiscoveryResource
may_be:
- URLSetSitemap
- SitemapIndex
entity SitemapIdentifier:
type: Identifier
identifies: SitemapResource
# ---------- RELATIONSHIPS ----------
relationships:
SitemapMetadata -> DESCRIBES -> SitemapResource
SitemapResource -> IDENTIFIED_BY -> SitemapIdentifier
SitemapResource -> MAY_BELONG_TO -> Website
URLSetSitemap -> CONTAINS -> SitemapURLEntry
SitemapIndex -> CONTAINS -> SitemapReference
SitemapReference -> POINTS_TO -> SitemapResource
SitemapURLEntry -> LOCATES -> WebResourceCandidate
SitemapURLEntry -> MAY_HAVE_ALTERNATE -> AlternateLanguageResource
SitemapURLEntry -> MAY_HAVE_IMAGE -> SitemapImage
SitemapURLEntry -> MAY_HAVE_VIDEO -> SitemapVideo
SitemapURLEntry -> MAY_HAVE_NEWS -> SitemapNews
SitemapMetadata -> MAY_REFERENCE -> SitemapProvenance
# ---------- SITEMAP TYPES ----------
sitemap_types:
- urlset
- sitemapindex
rule sitemap_type:
SitemapResource MUST be interpreted according_to root sitemap structure
rule index_urlset_distinction:
SitemapIndex != URLSetSitemap
# ---------- URLSET ----------
entity URLSetSitemap:
subtype_of: SitemapResource
root_element: urlset
entity SitemapURLEntry:
type: DiscoveryMetadata
may_include:
- loc
- lastmod
- alternate_languages
- images
- videos
- news
rule url_entry:
SitemapURLEntry SHOULD contain loc
rule loc:
loc SHOULD identify absolute URL
according_to sitemap protocol requirements
# ---------- SITEMAP INDEX ----------
entity SitemapIndex:
subtype_of: SitemapResource
root_element: sitemapindex
entity SitemapReference:
type: DiscoveryMetadata
may_include:
- loc
- lastmod
rule sitemap_reference:
SitemapReference loc SHOULD identify sitemap resource
rule nested_index:
nested sitemap relationships SHOULD preserve hierarchy
where encountered and supported
# ---------- LAST MODIFIED ----------
entity SitemapLastModified:
type: TemporalMetadata
rule lastmod:
lastmod SHOULD represent last modification time
of referenced resource according_to publisher declaration
rule lastmod_not_retrieval:
lastmod != sitemap retrieval time
rule lastmod_not_guarantee:
lastmod declaration != independently verified modification event
# ---------- CHANGE FREQUENCY ----------
entity ChangeFrequencyMetadata:
type: LegacyDiscoveryMetadata
rule changefreq:
if present, changefreq SHOULD be preserved as declared hint
rule changefreq_not_schedule:
changefreq != guaranteed crawl schedule
# ---------- PRIORITY ----------
entity SitemapPriority:
type: LegacyDiscoveryMetadata
range: [0.0, 1.0]
rule priority_bounds:
IF priority present
THEN REQUIRE 0.0 <= priority <= 1.0
rule priority_scope:
priority is relative hint within publisher context
and != search ranking score
# ---------- ALTERNATE LANGUAGES ----------
entity AlternateLanguageResource:
type: WebMetadata
may_include:
- href
- hreflang
rule alternate:
alternate language entries SHOULD preserve target URL and language tag
rule alternate_not_translation_proof:
hreflang relationship != proof of faithful translation
# ---------- IMAGE SITEMAP ----------
entity SitemapImage:
type: ImageMetadata
may_include:
- image_loc
- title
- caption
- geographic_location
- licence
rule image:
SitemapImage SHOULD preserve relationship
to parent SitemapURLEntry
rule image_loc:
image_loc SHOULD identify image resource locator
# ---------- VIDEO SITEMAP ----------
entity SitemapVideo:
type: VideoMetadata
may_include:
- thumbnail_loc
- title
- description
- content_loc
- player_loc
- duration
- publication_date
- family_friendly
- uploader
rule video:
SitemapVideo SHOULD preserve relationship
to parent SitemapURLEntry
rule video_locator:
content_loc and player_loc have distinct semantics
and MUST NOT be silently merged
# ---------- NEWS SITEMAP ----------
entity SitemapNews:
type: ArticleMetadata
may_include:
- publication
- publication_date
- title
rule news:
news sitemap metadata SHOULD preserve publication context
# ---------- XML NAMESPACE ----------
entity SitemapNamespace:
type: XMLNamespace
rule namespace:
sitemap XML SHOULD preserve sitemap protocol namespace
and extension namespaces where present
rule extension_namespace:
image, video, news, and alternate-language extensions
SHOULD be interpreted according_to applicable namespace semantics
# ---------- ENCODING ----------
rule encoding:
sitemap representation SHOULD preserve XML encoding metadata
rule escaped_URL:
URLs SHOULD preserve required URI and XML escaping semantics
# ---------- COMPRESSION ----------
entity SitemapCompression:
type: RepresentationMetadata
may_be:
- gzip
- uncompressed
rule compression:
compressed sitemap representation != different sitemap semantic resource
unless content differs
# ---------- SIZE / ENTRY LIMITS ----------
entity SitemapCapacityMetadata:
type: ValidationMetadata
may_include:
- entry_count
- uncompressed_size
rule capacity:
sitemap validation SHOULD check applicable protocol limits
rule split:
large URL collections MAY be split across multiple sitemaps
and referenced through SitemapIndex
# ---------- DISCOVERY ----------
sitemap_discovery_methods:
- robots_txt
- direct_URL
- search_engine_submission
- sitemap_index
- linked_reference
rule discovery:
sitemap discovery method SHOULD preserve source context
# ---------- INDEXING SEMANTICS ----------
rule inclusion:
inclusion in sitemap supports discovery
but != guarantee of crawling
rule indexing:
sitemap inclusion != guarantee of indexing
rule canonical:
sitemap loc != canonical URL proof
unless canonical evidence independently supports equivalence
rule existence:
sitemap listing != guarantee resource currently exists
# ---------- DUPLICATES ----------
rule duplicate_URL:
duplicate loc entries SHOULD be detected
rule duplicate_semantics:
duplicate listing does_not create multiple WebResource identities
# ---------- FRESHNESS ----------
entity SitemapFreshness:
type: TemporalMetadata
may_include:
- retrieval_time
- sitemap_last_modified
- resource_lastmod
- freshness_state
freshness_states:
- current_unknown
- fresh
- stale
- changed
- unavailable
rule freshness:
freshness assessment SHOULD compare temporal evidence
without treating publisher lastmod as independently verified fact
# ---------- PROVENANCE ----------
entity SitemapProvenance:
type: ProvenanceMetadata
may_include:
- sitemap_url
- source_site
- retrieval_time
- discovery_method
- parser
- generator
- transformation
- validation_result
rule provenance:
SitemapMetadata SHOULD preserve source, retrieval, and parsing context
# ---------- VALIDATION ----------
entity SitemapValidation:
type: ValidationMetadata
may_include:
- XML_well_formed
- namespace_valid
- root_valid
- URL_valid
- capacity_valid
- extension_valid
- errors
- warnings
rule validation:
syntactically valid sitemap != guarantee that listed resources are valid or indexable
# ---------- VALIDATION RULES ----------
validation:
require:
- identifiable_sitemap_resource
- valid_root_structure
validate_if_present:
- sitemap_identifier
- sitemap_type
- loc
- lastmod
- priority
- changefreq
- alternate_languages
- image_extension
- video_extension
- news_extension
- capacity
- provenance
reject:
- malformed_XML
- invalid_sitemap_root
- malformed_required_URL
- priority_outside_valid_range
- invalid_extension_namespace
- sitemap_reference_presented_as web_page_entry
- sitemap_inclusion_presented_as indexing_guarantee
- lastmod_presented_as independently_verified_change_without evidence
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE:
"sitemap metadata" ~= "metadata about a sitemap"
"XML sitemap" ~= "URL-set sitemap" WHEN root is urlset
"sitemap index" ~= "index of sitemap resources"
"sitemap URL entry" ~= "URL listed in sitemap"
"sitemap lastmod" ~= "declared last modification metadata"
"image sitemap metadata" ~= "image extension metadata in sitemap"
PRESERVE distinctions:
sitemap != website
sitemap_index != URL_set
sitemap_loc != canonical_URL
sitemap_inclusion != crawl_guarantee
sitemap_inclusion != indexing_guarantee
sitemap_listing != resource_existence_guarantee
lastmod != retrieval_time
lastmod != verified_change_event
changefreq != crawl_schedule
priority != search_ranking_score
content_loc != player_loc
# ---------- CONFIDENCE ----------
CONFIDENCE:
explicit_sitemap_metadata:
score: 1.00
parser_validated_sitemap:
score: 0.99
valid_absolute_loc:
score: 0.99
valid_extension_metadata:
score: 0.98
declared_lastmod:
score: 0.90
inferred_site_membership:
score: <= 0.85
sitemap_only_resource_identity:
score: <= 0.75
stale_or_unverified_sitemap:
score: <= 0.60
action: preserve freshness uncertainty
# ---------- UPDATE MODEL ----------
UPDATE_MODEL:
on_sitemap_retrieval:
- record sitemap URL
- identify sitemap type
- parse entries
- validate namespaces and URLs
- record retrieval time
- initialise provenance
on_sitemap_change:
- preserve previous sitemap state where required
- compare entries
- identify additions, removals, and changed lastmod values
- update freshness metadata
- preserve provenance
on_sitemap_index_traversal:
- resolve child sitemap references
- preserve parent-child relationships
- avoid duplicate processing
- update provenance
on_resource_validation:
- preserve sitemap declaration
- retrieve or inspect listed resource separately
- compare status, canonical, and modification evidence
- update confidence and freshness state
# ---------- FLOW HASH ----------
FLOW_HASH:
inputs:
- ontology
- sitemap_entities
- relationships
- URL_rules
- temporal_rules
- extension_rules
- discovery_rules
- validation
- semantic_equivalence
- confidence
- update_model
canonicalisation:
- normalise_XML_whitespace_where_safe
- preserve_URL_semantics
- preserve_entry_extension_relationships
- sort_unordered_validation_metadata
- preserve_rule_order
output:
deterministic_semantic_hash
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION:
interpret_as:
- web metadata ontology
- sitemap discovery model
- sitemap index and URL-set structure
- crawl and freshness metadata model
operations:
- identify sitemap resources
- distinguish URL sets and sitemap indexes
- parse URL entries
- traverse sitemap indexes
- interpret lastmod metadata
- inspect alternate-language links
- parse image, video, and news extensions
- validate namespaces and capacity
- detect duplicate entries
- evaluate freshness
- distinguish discovery hints from indexing guarantees
- trace provenance
- preserve uncertainty
constraints:
- do_not_equate_sitemap_loc_with canonical_URL
- do_not_treat_sitemap_inclusion_as crawl_or_index_guarantee
- do_not_treat_lastmod_as independently_verified_change
- do_not_equate_changefreq_with crawl_schedule
- do_not_equate_priority_with ranking_score
- preserve_URLs_extensions_temporal_context_and_provenance
# ---------- QUERY MODEL ----------
query:
input:
- sitemap_identifier
- sitemap_url
- sitemap_type
- listed_url
- lastmod
- language
- media_extension
- freshness_state
- retrieval_time
resolve:
1. identify SitemapResource
2. determine sitemap type
3. validate XML and namespaces
4. retrieve URL entries or sitemap references
5. inspect lastmod and legacy hints
6. inspect alternate-language metadata
7. inspect image, video, and news extensions
8. evaluate capacity, duplicates, and freshness
9. trace discovery and provenance
10. return confidence
output:
- sitemap_resource
- sitemap_type
- sitemap_url
- listed_resources
- child_sitemaps
- lastmod_metadata
- alternates
- media_extensions
- validation
- freshness
- provenance
- confidence
# ---------- INFERENCE ----------
inference:
IF root element = urlset
THEN classify URLSetSitemap
WITH confidence = 1.00
IF root element = sitemapindex
THEN classify SitemapIndex
WITH confidence = 1.00
IF SitemapURLEntry lists URL U
THEN infer discovery_candidate(U)
BUT do_not infer canonical_or_indexed status
IF lastmod changes between sitemap versions
THEN infer publisher_declared_change candidate
NOT independently_verified resource modification
IF sitemap state is stale or unavailable
THEN preserve prior declarations
AND expose freshness uncertainty
# ---------- OUTPUT CONTRACT ----------
output:
ontology_entity: SitemapMetadata
sitemap_identity: machine_interpretable
sitemap_type: explicit
URL_entries: traversable
sitemap_indexes: traversable
temporal_metadata: preserved
alternate_languages: explicit
media_extensions: structured
discovery_indexing_distinction: explicit
validation: reportable
freshness: explicit
provenance: preserved
uncertainty: explicit
semantic_retrieval: enabled
end flow
Download Code
Copy to Clipboard