A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

[Proposal] Document Element Metadata

AdamSobieski
2018-09-09

Introduction

This proposal broaches document element metadata which can be implemented via a combination of a <metadata> element and a metadata attribute. The <metadata> elements can each be identified by id attributes and thusly referenced via metadata attributes of other document elements. The <metadata> elements can contain <meta> and <link> elements and noteworthy is an extension to the <meta> element so that it can contain XML markup.

<metadata id="metadata1">
  <meta name="..." content="..." />
  <meta name="..."><xml>...</xml></meta>
  <link rel="..." href="..." />
</metadata>

<element metadata="metadata1">...</element>

Examples

Some illustrative examples are provided with respect to document element metadata in hypertext documents.

Accessibility

Document element metadata can provide new expressiveness for accessibility scenarios.

Hyperlinks

In addition to cryptographic hashes indicated on hyperlinks, we can (see also: .NET assembly linking and strongly named assemblies) consider the titles, versions, cultures/languages and the public keys or public key tokens, if linked-to resources are digitally signed. We could attach to hyperlinks the expected metadata of linked-to resources.

<metadata id="resource1">
  <meta name="title" content="Example Resource" />
  <meta name="version" content="1.0.0.0" />
  <meta name="language" content="en-US" />
  ...
</metadata>

<a href="http://example.com/resource.html" metadata="resource1" />

Articles and Sections

Document element metadata can provide metadata for <article> and <section> elements.

<metadata id="article1">
  ...
</metadata>

<article metadata="article1">
  ...
</article>
<metadata id="section1">
  ...
</metadata>

<section metadata="section1">
  ...
</section>

Hypertext

Document element metadata can provide metadata for document hypertext.

<metadata id="txt1">
  ...
</metadata>

<span metadata="txt1">This is a sentence of hypertext.</span>

Tables

Document element metadata can provide metadata for tables.

<metadata id="table1">
  ...
</metadata>

<table metadata="table1">
  ...
</table>

Multimedia

Document element metadata can provide metadata for document multimedia resources. As multimedia resources can contain embedded metadata, the <metadata> elements attached to multimedia document elements could, in addition to being specified, be populated when content is loaded.

<metadata id="img1">
  ...
</metadata>

<img src="image.jpg" metadata="img1" />

Mathematics

Document element metadata can provide metadata for mathematics expressions.

<metadata id="equation1">
  ...
</metadata>

<math metadata="equation1">
  <mi>i</mi>
  <mi>ℏ</mi>
  <mfrac>
    <mo>∂</mo>
    <mrow>
      <mo>∂</mo>
      <mi>t</mi>
    </mrow>
  </mfrac>
  <mn>Ψ</mn>
  <mo>=</mo>
  <mfrac>
    <mrow>
      <mo>-</mo>
      <msup>
        <mi>h</mi>
        <mn>2</mn>
      </msup>
    </mrow>
    <mrow>
      <mn>2</mn>
      <mi>m</mi>
    </mrow>
  </mfrac>
  <msup>
    <mo>∇</mo>
    <mn>2</mn>
  </msup>
  <mn>Ψ</mn>
  <mo>+</mo>
  <mi>V</mi>
  <mn>Ψ</mn>
</math>

Mathematical and Notational User Input

Document element metadata can be utilized to provide hints for mathematical and notational handwriting and speech recognition.

<metadata id="hints1">
  <meta name="subject" content="msc2010:12D05" />
  <meta name="symbol" content="x" />
  <meta name="symbol" content="y" />
  <meta name="hint">
    <math>
      <msup>
        <mi>x</mi>
        <mn>2</mn>
      </msup>
      <mo>+</mo>
      <msup>
        <mi>y</mi>
        <mn>2</mn>
      </msup>
    </math>
  </meta>
  <meta name="hint">
    <math>
      <msup>
        <mi>x</mi>
        <mn>2</mn>
      </msup>
      <mo>-</mo>
      <msup>
        <mi>y</mi>
        <mn>2</mn>
      </msup>
    </math>
  </meta>
</metadata>

<input type="math" metadata="hints1" />

<matharea metadata="hints1" />
<metadata id="hints1">
  <meta name="subject" content="chemistry" />
  <meta name="symbol" content="C" />
  <meta name="symbol" content="H" />
  <meta name="symbol" content="N" />
  <meta name="symbol" content="O" />
  <meta name="hint">
    <math>
      <msub>
        <mi>C</mi>
        <mn>8</mn>
      </msub>
      <msub>
        <mi>H</mi>
        <mn>10</mn>
      </msub>
      <msub>
        <mi>N</mi>
        <mn>4</mn>
      </msub>
      <msub>
        <mi>O</mi>
        <mn>2</mn>
      </msub>
    </math>
  </meta>
</metadata>

<input type="math" metadata="hints1" />

<matharea metadata="hints1" />

Speech Recognition

Document element metadata can be utilized to provide lexicons and grammars for input elements for speech recognition scenarios.

<metadata id="speech1">
  <link rel="lexicon" type="application/pls+xml" href="lexicon-file.pls" />
</metadata>

<input type="text" metadata="speech1" />
<metadata id="speech1">
  <link rel="grammar" type="application/srgs+xml" href="grammar-file.srgs" />
</metadata>

<input type="text" metadata="speech1" />

Hyperlinks

https://www.w3.org/community/exercises-and-activities/wiki/User_Input_of_Mathematics

myakura
2018-09-11

Those use cases can be addressed by Microdata/RDFa or JSON-LD, aren’t they?

AdamSobieski
2018-09-12

@myakura,

The use cases can be addressed with the expressiveness of JSON-LD but not entirely with that of Microdata/RDFa.