FLOW ALGEBRA
Ontology: Open Graph Ontology
Domain: Metadata Ontologies > Web Metadata
Canonical URL: https://kirethresearch.org/booksai-core/ontologies/metadata-ontologies/web-metadata/open-graph-ontology.html
Authors: Mark Anthony Higgins — Sky (Recursive AI)
flow "OpenGraphOntology" v1.0
# ---------- DOMAIN ----------
domain:
class: MetadataOntology
category: WebMetadata
subject: OpenGraphMetadata
purpose:
- represent metadata expressed using the Open Graph protocol
- preserve object identity, title, type, URL, image, description, locale, site, media, and provenance
- support social previews, link sharing, semantic extraction, validation, and AI consumption
- distinguish Open Graph declarations from canonical document metadata and verified facts
- enable machine-readable reasoning over Open Graph objects
# ---------- CORE ENTITY ----------
entity OpenGraphMetadata:
type: WebMetadata
describes: OpenGraphObject
may_include:
- og_title
- og_type
- og_url
- og_image
- og_description
- og_site_name
- og_locale
- og_locale_alternate
- og_audio
- og_video
- object_specific_properties
- source_document
- provenance
entity OpenGraphObject:
type: SemanticWebObject
described_by: OpenGraphProperty
entity OpenGraphProperty:
type: PropertyMetaTag
vocabulary: OpenGraph
# ---------- REQUIRED CORE PROPERTIES ----------
core_properties:
- og:title
- og:type
- og:image
- og:url
# ---------- OPTIONAL COMMON PROPERTIES ----------
common_properties:
- og:description
- og:site_name
- og:locale
- og:locale:alternate
- og:audio
- og:video
# ---------- RELATIONSHIPS ----------
relationships:
OpenGraphMetadata -> DESCRIBES -> OpenGraphObject
OpenGraphObject -> HAS_TITLE -> OGTitle
OpenGraphObject -> HAS_TYPE -> OGType
OpenGraphObject -> HAS_URL -> OGURL
OpenGraphObject -> HAS_IMAGE -> OGImage
OpenGraphObject -> MAY_HAVE_DESCRIPTION -> OGDescription
OpenGraphObject -> MAY_HAVE_SITE_NAME -> OGSiteName
OpenGraphObject -> MAY_HAVE_LOCALE -> OGLocale
OpenGraphObject -> MAY_HAVE_ALTERNATE_LOCALE -> OGAlternateLocale
OpenGraphObject -> MAY_HAVE_AUDIO -> OGAudio
OpenGraphObject -> MAY_HAVE_VIDEO -> OGVideo
OpenGraphMetadata -> EXTRACTED_FROM -> HTMLDocument
OpenGraphMetadata -> MAY_REFERENCE -> OpenGraphProvenance
# ---------- PROPERTY SYNTAX ----------
rule property_syntax:
OpenGraph property SHOULD be represented through metadata declaration
using property name and content value
rule prefix:
property namespace SHOULD preserve OpenGraph vocabulary semantics
rule unknown_property:
unknown or extension properties SHOULD be preserved
without inventing semantics
# ---------- OG TITLE ----------
entity OGTitle:
type: LexicalMetadata
property: og:title
rule title:
OGTitle describes OpenGraphObject title
rule title_distinction:
og:title != HTML title element
unless values and intended semantics align
# ---------- OG TYPE ----------
entity OGType:
type: Classification
property: og:type
common_types:
- website
- article
- book
- profile
- music.song
- music.album
- video.movie
- video.episode
rule type:
OGType SHOULD be interpreted according_to OpenGraph type vocabulary
rule type_not_document_type:
OGType != HTMLDocumentType
# ---------- OG URL ----------
entity OGURL:
type: URLMetadata
property: og:url
rule og_url:
OGURL identifies preferred URL of OpenGraphObject
according_to OpenGraph semantics
rule og_url_canonical:
OGURL != HTML canonical URL
unless canonical relationship is independently established
rule url_validation:
OGURL SHOULD be valid absolute URL
where protocol semantics require
# ---------- OG IMAGE ----------
entity OGImage:
type: ImageMetadata
property: og:image
may_include:
- url
- secure_url
- media_type
- width
- height
- alternative_text
image_properties:
- og:image
- og:image:url
- og:image:secure_url
- og:image:type
- og:image:width
- og:image:height
- og:image:alt
rule image:
OGImage SHOULD preserve structured image properties
rule image_dimensions:
width and height MUST be positive when present
rule image_alt:
og:image:alt SHOULD describe image
where available
rule structured_property_order:
structured image properties SHOULD attach
to applicable preceding root image property
according_to OpenGraph parsing semantics
# ---------- OG DESCRIPTION ----------
entity OGDescription:
type: DescriptiveMetadata
property: og:description
rule description:
OGDescription is preview-oriented descriptive metadata
and != full page content
rule description_meta:
og:description != meta name=description
unless explicitly aligned
# ---------- OG SITE NAME ----------
entity OGSiteName:
type: WebMetadata
property: og:site_name
rule site_name:
OGSiteName is lexical site label
and != WebsiteIdentifier
# ---------- OG LOCALE ----------
entity OGLocale:
type: LocaleMetadata
property: og:locale
entity OGAlternateLocale:
type: LocaleMetadata
property: og:locale:alternate
rule locale:
OpenGraph locale SHOULD preserve protocol-specific locale notation
rule locale_language:
OGLocale != HTML document language
# ---------- OG AUDIO ----------
entity OGAudio:
type: AudioMetadata
property: og:audio
may_include:
- url
- secure_url
- media_type
audio_properties:
- og:audio
- og:audio:secure_url
- og:audio:type
rule audio:
OGAudio SHOULD preserve structured media properties
# ---------- OG VIDEO ----------
entity OGVideo:
type: VideoMetadata
property: og:video
may_include:
- url
- secure_url
- media_type
- width
- height
video_properties:
- og:video
- og:video:secure_url
- og:video:type
- og:video:width
- og:video:height
rule video:
OGVideo SHOULD preserve structured media properties
# ---------- ARTICLE EXTENSIONS ----------
entity OGArticleMetadata:
type: OpenGraphMetadata
applies_when: og:type = article
may_include:
- article:published_time
- article:modified_time
- article:expiration_time
- article:author
- article:section
- article:tag
rule article:
article extension properties SHOULD be interpreted
only within applicable vocabulary semantics
# ---------- BOOK EXTENSIONS ----------
entity OGBookMetadata:
type: OpenGraphMetadata
applies_when: og:type = book
may_include:
- book:author
- book:isbn
- book:release_date
- book:tag
rule book:
book extension properties SHOULD preserve identifier semantics
# ---------- PROFILE EXTENSIONS ----------
entity OGProfileMetadata:
type: OpenGraphMetadata
applies_when: og:type = profile
may_include:
- profile:first_name
- profile:last_name
- profile:username
- profile:gender
rule profile:
profile metadata describes declared OpenGraph profile object
and MUST NOT be treated as independently verified identity
# ---------- MULTIPLE VALUES ----------
rule repeated_property:
repeated OpenGraph properties MAY represent multiple values
rule first_root:
where parser semantics use first root property preferentially
preserve source order
rule structured_attachment:
structured subproperties MUST remain attached
to correct root property instance
# ---------- SOURCE ORDER ----------
rule source_order:
OpenGraph property order SHOULD be preserved
where parsing semantics depend on order
# ---------- SOCIAL PREVIEW ----------
entity SocialPreview:
type: DerivedRepresentation
derived_from: OpenGraphMetadata
rule preview:
social platform preview MAY use OpenGraphMetadata
but final rendered preview MAY differ due to platform processing
rule preview_not_metadata:
rendered social preview != raw OpenGraphMetadata
# ---------- CONFLICTS ----------
rule metadata_conflict:
conflicting OpenGraph values SHOULD remain traceable
rather_than silently overwritten
rule HTML_conflict:
conflicts between OpenGraph and HTML metadata
SHOULD preserve both sources and semantics
# ---------- PROVENANCE ----------
entity OpenGraphProvenance:
type: ProvenanceMetadata
may_include:
- source_document
- source_url
- extraction_time
- extraction_method
- runtime_generation
- generator
rule provenance:
OpenGraphMetadata SHOULD preserve source and extraction context
rule runtime_OG:
script-generated OpenGraph metadata SHOULD remain distinguishable
from original source HTML metadata
# ---------- VALIDATION ----------
validation:
require:
- identifiable_OpenGraph_object_or_property_set
validate_if_present:
- og:title
- og:type
- og:url
- og:image
- og:description
- og:site_name
- og:locale
- og:audio
- og:video
- extension_properties
- provenance
reject:
- malformed_required_URL
- invalid_image_dimensions
- invalid_video_dimensions
- structured_property_without_applicable_root
- og_url_presented_as canonical_without evidence
- OpenGraph_assertion_presented_as verified_fact_without evidence
- runtime_generated_OG_presented_as source_metadata_without provenance
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE:
"Open Graph metadata" ~= "Open Graph protocol metadata"
"OG title" ~= "og:title"
"OG type" ~= "og:type"
"OG URL" ~= "og:url"
"OG image" ~= "og:image"
"OG description" ~= "og:description"
"OG site name" ~= "og:site_name"
PRESERVE distinctions:
og:title != HTML_title
og:type != HTML_document_type
og:url != canonical_URL
og:description != meta_description
og:site_name != website_identifier
og:locale != document_language
OpenGraph_assertion != verified_fact
social_preview != raw_OpenGraph_metadata
runtime_OG != source_OG
# ---------- CONFIDENCE ----------
CONFIDENCE:
explicit_OpenGraph_metadata:
score: 1.00
parser_validated_core_properties:
score: 0.99
valid_absolute_og_url:
score: 0.98
structured_media_metadata:
score: 0.98
recognised_type_extension:
score: 0.95
runtime_generated_OpenGraph:
score: 0.90
inferred_property_association:
score: <= 0.80
ambiguous_OpenGraph_semantics:
score: <= 0.60
action: preserve_raw_properties
# ---------- UPDATE MODEL ----------
UPDATE_MODEL:
on_OpenGraph_parse:
- preserve raw property order
- identify core properties
- resolve structured properties
- classify object type
- validate URLs and dimensions
- initialise provenance
on_property_update:
- preserve previous value where auditability requires
- validate new value
- maintain structured-property attachment
- update provenance
on_type_change:
- preserve previous OGType
- reassess extension properties
- validate applicable vocabulary
- update provenance
on_runtime_generation:
- preserve source OpenGraph state
- record runtime-generated properties
- record generating process
- update provenance
# ---------- FLOW HASH ----------
FLOW_HASH:
inputs:
- ontology
- OpenGraph_entities
- relationships
- core_property_rules
- media_rules
- extension_rules
- ordering_rules
- validation
- semantic_equivalence
- confidence
- update_model
canonicalisation:
- normalise_whitespace
- preserve_property_names
- preserve_URL_case_semantics
- preserve_source_order_where_required
- preserve_rule_order
output:
deterministic_semantic_hash
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION:
interpret_as:
- web metadata ontology
- Open Graph object model
- social preview metadata structure
- structured media metadata model
operations:
- identify OpenGraph property sets
- resolve core OG properties
- classify OG object type
- parse structured image metadata
- parse structured audio and video metadata
- resolve article, book, and profile extensions
- preserve repeated property order
- detect metadata conflicts
- distinguish OpenGraph from canonical HTML metadata
- distinguish source and runtime metadata
- trace provenance
- preserve uncertainty
constraints:
- do_not_equate_og_title_with HTML_title
- do_not_equate_og_url_with canonical_URL_without evidence
- do_not_equate_og_description_with meta_description
- do_not_treat_OpenGraph_assertions_as verified_facts
- do_not_equate_social_preview_with raw_metadata
- preserve_property_order_structured_media_source_and_provenance
# ---------- QUERY MODEL ----------
query:
input:
- source_document
- og_property
- og_type
- og_url
- og_image
- locale
- extension_property
- source_state
resolve:
1. identify OpenGraph property set
2. preserve source order
3. resolve core properties
4. classify OpenGraphObject type
5. attach structured media properties
6. resolve applicable extensions
7. validate URLs, dimensions, and locale
8. detect conflicts
9. trace source and provenance
10. return confidence
output:
- OpenGraph_object
- title
- type
- url
- images
- description
- site_name
- locale
- audio
- video
- extension_properties
- provenance
- confidence
# ---------- INFERENCE ----------
inference:
IF property = og:title
THEN classify OGTitle
WITH confidence = 1.00
IF property = og:type
THEN classify OGType
AND resolve applicable extension vocabulary
IF property = og:image
THEN create OGImage root
AND attach subsequent structured image properties
according_to source order
IF og:url exists
THEN record OpenGraph preferred URL
BUT do_not infer HTML canonical equivalence automatically
IF property semantics remain unknown
THEN preserve raw property
AND do_not invent interpretation
# ---------- OUTPUT CONTRACT ----------
output:
ontology_entity: OpenGraphMetadata
OpenGraph_object: machine_interpretable
core_properties: explicit
object_type: resolvable
images_audio_video: structurally_linked
extensions: vocabulary_aware
source_order: preserved
conflicts: reportable
canonical_distinction: explicit
source_runtime_distinction: explicit
provenance: preserved
uncertainty: explicit
semantic_retrieval: enabled
end flow
Download Code
Copy to Clipboard