Part of the WebMEM Protocol
Location: /specification/sdt/yaml-in-html/attributes/
Last Updated: 2025-07-28
HTML Container Attribute Reference
The <template> element serves as the outer container for every Semantic Data Template (SDT) fragment. To support agentic discovery, DOM parsing, and metadata extraction, a specific set of data-* attributes are used to encode fragment-level identity, class, and scope.
Required Attributes
| Attribute | Description |
|---|---|
data-visibility-fragment |
Declares the template as an SDT fragment. Required on all fragments. |
data-type="text/yaml" |
Signals the format of the template body (YAML-in-HTML). Required. |
data-sdt-class |
The SDT fragment class (e.g., DataFragment, FAQFragment). Must match the data-sdt-class: in the YAML body. |
data-entity |
Defines the real-world subject the fragment describes (e.g., plan:H5521-290-0). Required for entity-scoped classes like DataFragment, DefinedTermFragment, etc. |
data-digest |
Declares the digest group this fragment belongs to. Used for retrieval, export, and clustering. |
data-fragment-scope |
Declares the publishing domain or retrieval layer (e.g., semantic-digest, gtp). Enables AI agents to cluster fragments by trust layer. |
Example Usage of data-fragment-scope
<template data-fragment-scope="sdt-core-protocols">
Recommended Attributes
| Attribute | Description |
|---|---|
data-glossary-scope |
Namespace governing glossary: and related_terms: inside YAML. Strongly recommended. |
data-fragment-id |
Canonical ID for internal references, citation anchoring, and export metadata. Optional if id="..." is resolvable. |
Note: All data-* values must match their equivalents in the YAML fragment header.
Reserved ID Conventions
The id attribute on <template> and <div> plays a crucial role in linking, citation, and trust propagation.
Reserved Patterns
| Pattern | Applies To | Purpose |
|---|---|---|
id="provenance-meta" |
<div> or YAML block |
Declares the ProvenanceMeta trust anchor. Must be unique per page. |
id="fragment-*" |
<template> |
Standard prefix for SDT containers. Required for machine-resolution and export. |
Examples
<!-- SDT Fragment -->
<template id="fragment-h5521-290-0-primary-care" ... >
<!-- Provenance Block -->
<div id="provenance-meta" ... >
Best Practices
- Prefix all SDT containers with
fragment- - Never reuse fragment IDs across entities or digests
- Only use
provenance-metaonce unless composing for multiple children