This specification defines the Escaped RDFa (eRDFa) namespace extension, an XML namespace that enables embedding RDFa metadata within HTML environments that do not natively support RDFa or extended markup tags. The eRDFa namespace provides a mechanism for escaping RDFa content so it can be preserved in constrained publishing platforms such as blogging systems.
This is a community specification under active development. Comments and contributions are welcome via the GitHub repository.
Many content management systems and blogging platforms strip or sanitize RDFa attributes from user-submitted HTML, preventing the publication of structured metadata. This specification addresses this limitation by defining a namespace and conventions for escaping RDFa content.
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.
The key words MAY, MUST, MUST NOT, SHOULD, and SHOULD NOT are to be interpreted as described in [[!RFC2119]].
The eRDFa namespace URI is:
https://escaped-rdfa.github.io/namespace/docs/1.0.html#
The recommended namespace prefix is eRDFa.
The namespace MUST be declared using the RDFa prefix attribute:
<div
xmlns="http://www.w3.org/1999/xhtml"
prefix="eRDFa: https://escaped-rdfa.github.io/namespace/docs/1.0.html#
other-namespace: http://example.com/namespace#">
<!-- content -->
</div>
When the hosting platform does not support RDFa attributes, the declaration MUST be HTML-entity escaped:
<div
xmlns="http://www.w3.org/1999/xhtml"
prefix="eRDFa: https://escaped-rdfa.github.io/namespace/docs/1.0.html#
other-namespace: http://example.com/namespace#">
<!-- content -->
</div>
exampleeRDFa:examplerel attribute on a container element.rel="eRDFa:example".
<div
xmlns="http://www.w3.org/1999/xhtml"
prefix="eRDFa: https://escaped-rdfa.github.io/namespace/docs/1.0.html#">
<div rel="eRDFa:example">
<div about="#me" vocab="http://xmlns.com/foaf/0.1/">
<p property="name">Gregg Kellogg</p>
</div>
</div>
</div>
<div
xmlns="http://www.w3.org/1999/xhtml"
prefix="eRDFa: https://escaped-rdfa.github.io/namespace/docs/1.0.html#">
<div rel="eRDFa:example">
<div about="#me" vocab="http://xmlns.com/foaf/0.1/">
<p property="name">Gregg Kellogg</p>
</div>
</div>
</div>
embeddedeRDFa:embeddedrel attribute on a container element.rel="eRDFa:embedded" and process the resulting RDFa markup.
<div
xmlns="http://www.w3.org/1999/xhtml"
prefix="eRDFa: https://escaped-rdfa.github.io/namespace/docs/1.0.html#
rss: http://purl.org/rss/1.0/
itunes: http://www.itunes.com/dtds/podcast-1.0#">
<div rel="eRDFa:embedded">
<div typeof="rss:rss">
<div rel="rss:channel">
<div typeof="rss:item">
<div property="rss:title" content="Episode Title"></div>
<div property="rss:guid" content="1b593f7b-67e7-454c-bb80-32e8e32ada06"></div>
</div>
</div>
</div>
</div>
</div>
An eRDFa processor MUST follow these steps:
rel="eRDFa:example" or rel="eRDFa:embedded"eRDFa:example elements: Skip processing of contained RDFaeRDFa:embedded elements:
Content authors MUST escape the following characters using HTML entities:
| Character | Entity |
|---|---|
| < | < |
| > | > |
| " | " |
| & | & |
Platforms like Blogger and WordPress sanitize RDFa attributes. Authors can use eRDFa to embed podcast RSS metadata, FOAF profiles, or other structured data that survives the sanitization process.
Technical documentation can use eRDFa:example to show RDFa
markup examples without having them processed as actual metadata.
Processors MUST sanitize unescaped content to prevent XSS attacks. Script tags and event handlers within escaped content MUST be removed or neutralized before rendering.
Implementations SHOULD validate that unescaped content contains only valid RDFa markup and does not include malicious HTML or JavaScript.
Escaped RDFa may contain personal information. Publishers SHOULD be aware that escaped content, while not immediately visible, can be extracted and processed by eRDFa-aware tools.
<div
xmlns="http://www.w3.org/1999/xhtml"
prefix="eRDFa: https://escaped-rdfa.github.io/namespace/docs/1.0.html#
itunes: http://www.itunes.com/dtds/podcast-1.0#
rss: http://purl.org/rss/1.0/
dc: http://purl.org/dc/terms/">
<div rel="eRDFa:embedded">
<div typeof="rss:rss">
<div rel="rss:channel">
<div typeof="rss:item">
<div property="rss:guid"
content="1b593f7b-67e7-454c-bb80-32e8e32ada06"></div>
<div property="rss:pubDate"
content="Mon, 22 Jun 2020 01:02:15 GMT"></div>
<div property="rss:title"
content="StreamOfRandom S3 The Refinement EP1 Quality"></div>
<div property="dc:creator"
content="Jim Dupont"></div>
<div property="itunes:dtdepisode"
content="1"></div>
<div property="itunes:dtdseason"
content="3"></div>
<div property="itunes:dtdduration"
content="986"></div>
</div>
</div>
</div>
</div>
</div>
Thanks to the RDFa community and the developers of blogging platforms that inspired this work.