1. 5 Microdata
    1. 5.1 導入
      1. 5.1.1 概要
      2. 5.1.2 基本構文
      3. 5.1.3 型付きアイテム
      4. 5.1.4 アイテムのためのグローバル識別子
      5. 5.1.5 語彙を定義するときに名前を選択する
    2. 5.2 microdataをエンコーディングする
      1. 5.2.1 microdataモデル
      2. 5.2.2 アイテム
      3. 5.2.3 名前:itemprop属性
      4. 5.2.4
      5. 5.2.5 Microdataと他の名前空間
    3. 5.3 サンプルmicrodata語彙
      1. 5.3.1 vCard
        1. 5.3.1.1 Conversion to vCard
        2. 5.3.1.2
      2. 5.3.2 vEvent
        1. 5.3.2.1 Conversion to iCalendar
        2. 5.3.2.2
      3. 5.3.3 ライセンス作品
        1. 5.3.3.1

5 Microdata

5.1 導入

5.1.1 概要

ときには、特定の機械可読なラベル付きコンテンツに注釈を付けることが望ましい。たとえば、ページに合わせてカスタマイズされる一般的なスクリプトを可能にするため、または一貫した方法で単一のスクリプトで処理されることをさまざまな協力する著者由来のコンテンツを可能にするため、など。

この目的に対して、著者は、この章で説明されるmicrodataの機能を使用することができる。Microdataは、既存のコンテンツと並行して、名前と値のペアのネストされたグループを文書に追加することを可能にする。

5.1.2 基本構文

高いレベルで、microdataは名前と値のペアのグループで構成される。グループはアイテムと呼ばれ、それぞれの名前-値のペアはプロパティとなる。アイテムおよびプロパティは、通常の要素によって表される。

アイテムを作成するために、itemscope属性が使用される。

アイテムにプロパティを追加するために、itemprop属性がアイテムの子孫のいずれかで使用される。

ここでは、プロパティ"name"をそれぞれ持つ、2つの項目がある:

<div itemscope>
 <p>My name is <span itemprop="name">Elizabeth</span>.</p>
</div>

<div itemscope>
 <p>My name is <span itemprop="name">Daniel</span>.</p>
</div>

microdata関連の属性なしのマークアップは、microdataモデルには影響しない。

次の2つの例は、前の2つの例とそれぞれ、microdataレベルで厳密に等価である:

<div itemscope>
 <p>My <em>name</em> is <span itemprop="name">E<strong>liz</strong>abeth</span>.</p>
</div>

<section>
 <div itemscope>
  <aside>
   <p>My name is <span itemprop="name"><a href="/?user=daniel">Daniel</a></span>.</p>
  </aside>
 </div>
</section>

プロパティは一般に、文字列である値を持つ。

ここではアイテムが3つのプロパティを持つ:

<div itemscope>
 <p>My name is <span itemprop="name">Neil</span>.</p>
 <p>My band is called <span itemprop="band">Four Parts Water</span>.</p>
 <p>I am <span itemprop="nationality">British</span>.</p>
</div>

文字列値がURLである場合、その値はa要素およびそのhref属性、img要素およびそのsrc属性または、リンクまたは埋め込み外部リソースへの他の要素を使用して表現される。

この例においてアイテムは、値がURLである、1つのプロパティ"image"を持つ:

<div itemscope>
 <img itemprop="image" src="google-logo.png" alt="Google">
</div>

文字列値が人間の消費に適さない何らかの機械読み取り可能な形式である場合、要素のコンテンツで与えられる人間可読なバージョンとともに、data要素のvalue属性を使用して表現される。

ここでは、値プロダクトIDであるプロパティを持つアイテムがある。IDは人に優しくないので、製品名がIDの代わりに人間可視のテキストを使用する。

<h1 itemscope>
 <data itemprop="product-id" value="9678AOU879">The Instigator 2000</data>
</h1>

数値データに関して、meter要素とそのvalue属性を代わりに使用することができる。

ここでは、評価がmeter要素を用いて与えられる。

<div itemscope itemtype="http://schema.org/Product">
 <span itemprop="name">Panasonic White 60L Refrigerator</span>
 <img src="panasonic-fridge-60l-white.jpg" alt="">
  <div itemprop="aggregateRating"
       itemscope itemtype="http://schema.org/AggregateRating">
   <meter itemprop="ratingValue" min=0 value=3.5 max=5>Rated 3.5/5</meter>
   (based on <span itemprop="reviewCount">11</span> customer reviews)
  </div>
</div>

同様に、日付および時刻関連データのために、time要素とそのdatetime属性を代わりに使用することができる。

この例において、アイテムは、値が日付である1つのプロパティ"birthday"を持つ:

<div itemscope>
 I was born on <time itemprop="birthday" datetime="2009-05-10">May 10th 2009</time>.
</div>

プロパティはまた、プロパティを宣言する要素にitemscope属性を置くことで、自身を名前-値ペアのグループとすることができる。

他の一部ではないアイテムは、トップレベルmicrodataアイテムと呼ばれる。

この例において、外側のアイテムは人であり、内側のアイテムはバンドを表す:

<div itemscope>
 <p>Name: <span itemprop="name">Amanda</span></p>
 <p>Band: <span itemprop="band" itemscope> <span itemprop="name">Jazz Band</span> (<span itemprop="size">12</span> players)</span></p>
</div>

ここで外側のアイテムは、2つのプロパティ"name"と"band"を持つ。"name"は"Amanda"であり、"band"は、2つのプロパティ"name"と"size"で、それ自体でアイテムである。バンドの"name"は"Jazz Band"であり、"size"は"12"である。

この例において外側のアイテムは、トップレベルのmicrodataアイテムである。

itemscope属性をもつ要素の子孫ではないプロパティは、itemref属性を使用するアイテムに関連付けることができる。この属性は、itemscope属性をもつ要素の子をクロールすることに加えて、クロールする要素のIDのリストを取る。

この例は前のものと同じであるが、すべてのプロパティは、プロパティのアイテムから分離される:

<div itemscope id="amanda" itemref="a b"></div>
<p id="a">Name: <span itemprop="name">Amanda</span></p>
<div id="b" itemprop="band" itemscope itemref="c"></div>
<div id="c">
 <p>Band: <span itemprop="name">Jazz Band</span></p>
 <p>Size: <span itemprop="size">12</span> players</p>
</div>

これは、前の例と同じ結果になる。最初のアイテムは"name"に"Amanda"を設定され、もう1つのアイテムに"band"を設定される2つのプロパティを持つ。2番目のアイテムはさらに、"Jazz Band"に設定される"name"、および"12"に設定される"size"の2つのプロパティを持つ。

アイテムは、同じ名前と異なる値をもつ複数のプロパティを持つことができる。

この例は、2つのフレーバーでアイスクリームを記述する:

<div itemscope>
 <p>Flavors in my favorite ice cream:</p>
 <ul>
  <li itemprop="flavor">Lemon sorbet</li>
  <li itemprop="flavor">Apricot sorbet</li>
 </ul>
</div>

よってこれは、2つのプロパティ値"Lemon sorbet"と"Apricot sorbet"と両方の"flavor"を持つアイテムとなる。

プロパティを導入する要素はまた、プロパティの一部が同じ値を持つ場合に重複を避けるため、一度に複数のプロパティを導入することができる。

ここでは、2つのプロパティ"favorite-color"と"favorite-fruit"の両方が値"orange"に設定されるアイテムを示す:

<div itemscope>
 <span itemprop="favorite-color favorite-fruit">orange</span>
</div>

microdataとmicrodataがマークアップされる文書のコンテンツとの間に関係がないことに注意することが重要である。

たとえば、次の2つの例の間に、セマンティックな違いはない:

<figure>
 <img src="castle.jpeg">
 <figcaption><span itemscope><span itemprop="name">The Castle</span></span> (1986)</figcaption>
</figure>
<span itemscope><meta itemprop="name" content="The Castle"></span>
<figure>
 <img src="castle.jpeg">
 <figcaption>The Castle (1986)</figcaption>
</figure>

両者はキャプションをもつ図を持ち、図とは全く無関係な、名前"name"と値"The Castle"の名前と値のペアをもつアイテムを持つ。唯一の違いは、前者の場合に、ユーザーが文書からキャプションをドラッグする場合、アイテムはドラッグアンドドロップデータに含まれることである。いずれの場合も、アイテムに関連付けられる任意の方法で画像ではない。

5.1.3 型付きアイテム

前節の例は、microdataを再使用することを期待しないページに情報がマークアップすることができる方法を示している。しかし、他の著者および読者がマークアップの新たな用途を作るために協力することができる場合にコンテキストで使用されるとき、Microdataは最も有用である。

この目的のために、 "https://example.com/person"や"https://example.org/cat"や"https://band.example.net/"のように、各アイテムに型を与える必要がある。型は、URLとして識別される。

アイテムの型は、itemscope属性と同じ要素上のitemtype属性の値として指定される。

ここでは、アイテムの型は"https://example.org/animals#cat"である:

<section itemscope itemtype="https://example.org/animals#cat">
 <h1 itemprop="name">Hedral</h1>
 <p itemprop="desc">Hedral is a male american domestic
 shorthair, with a fluffy black fur with white paws and belly.</p>
 <img itemprop="img" src="hedral.jpeg" alt="" title="Hedral, age 18 months">
</section>

この例において、"https://example.org/animals#cat"のアイテムは、"name" ("Hedral")、"desc" ("Hedral is...")、および"img" ("hedral.jpeg")の3つのプロパティを持つ。

型は、このように語彙を選択して、プロパティのコンテキストを与える:型"https://census.example/person"をもつアイテムのために与えられた"class"という名前のプロパティは、個々の経済クラスを参照するかもしれない一方で、型"https://example.com/school/teacher"をもつアイテムのために与えられた"class"という名前のプロパティは、教師が割り当てられている教室を参照するかもしれない。複数の型が語彙を共有することができる。たとえば、型"https://example.org/people/teacher"および"https://example.org/people/engineer"は、(おそらくいくつかのプロパティはいずれの場合においても特に有用ではないだろう。たとえば、おそらく"https://example.org/people/engineer"型は典型的に"classroom"プロパティで使用されないかもしれないが、)同じ語彙を使用するように定義することができる。同じ語彙を使用するように定義される複数の型は、属性の値で空白区切りのリストとしてURLをリスト化することによって1つのアイテムに付与することができる。しかし、URLが同じ語彙を使用しない場合、アイテムは2つの型を指定することはできない。

5.1.4 アイテムのためのグローバル識別子

時には、アイテムはグローバル識別子を持つトピックについての情報を与える。たとえば、本はそのISBN番号によって識別することができる。

itemtype属性によって識別されるような)語彙は、アイテムitemid属性で指定されるURLとしてグローバル識別子を表現することによって明白な方法でアイテムのグローバル識別子に関連付けられるように設計することができる。

itemid属性で指定されるURLの正確な意味は、使用される語彙に依存する。

ここでアイテムは、特定の本について話している:

<dl itemscope
    itemtype="https://vocab.example.net/book"
    itemid="urn:isbn:0-330-34032-8">
 <dt>Title
 <dd itemprop="title">The Reality Dysfunction
 <dt>Author
 <dd itemprop="author">Peter F. Hamilton
 <dt>Publication date
 <dd><time itemprop="pubdate" datetime="1996-01-26">26 January 1996</time>
</dl>

この例において"https://vocab.example.net/book"語彙は、itemid属性が本のISBNを指すurn: URLを取ることを定義する。

5.1.5 語彙を定義するときに名前を選択する

microdataを使用することは、語彙を使用することを意味する。いくつかの目的のために、アドホックな語彙が適切である。他の場合に、語彙を設計する必要がある。可能であれば、コンテンツを簡単に再利用するように、著者は既存の語彙を再利用することを勧める。

新しい語彙を設計する場合、識別子は、プロパティに、URLを使用するか、(ドットやコロンなしで)プレーンな単語としてのいずれかで作成することができる。URLの場合、他の語彙との競合は、著者が制御しているページに対応する識別子を使用することによってのみ回避することができる。

たとえば、JonとAdamの両者がそれぞれhttps://example.com/~jon/...https://example.com/~adam/...のようにexample.comでコンテンツを記述する場合、彼らはそれぞれ形式"https://example.com/~jon/name"と"https://example.com/~adam/name"の識別子を選択することができる。

名前が単にプレーンな単語であるプロパティは、プロパティが意図する型のコンテキスト内でのみ使用することができる。URLを使用する名前付きプロパティは、任意のタイプのアイテムで再利用することができる。アイテムが型を持たず、かつ他のアイテムの一部ではない場合、そしてそのプロパティが単にプレーンな名前を持つ場合、プロパティはグローバルに一意であることが意図されず、代わりに限定された用途のためのみに意図される。一般的にいえば、著者は、グローバルに一意な名前(URL)をもつプロパティ使用するか、プロパティのアイテムが型付けされていることを確認かのいずれかを勧める。

ここで、アイテムは"https://example.org/animals#cat"であり、プロパティのほとんどは、その型のコンテキストで定義される単語である名前を持つ。名前が他のボキャブラリに由来するいくつかの追加のプロパティもある。

<section itemscope itemtype="https://example.org/animals#cat">
 <h1 itemprop="name https://example.com/fn">Hedral</h1>
 <p itemprop="desc">Hedral is a male American domestic
 shorthair, with a fluffy <span
 itemprop="https://example.com/color">black</span> fur with <span
 itemprop="https://example.com/color">white</span> paws and belly.</p>
 <img itemprop="img" src="hedral.jpeg" alt="" title="Hedral, age 18 months">
</section>

この例は、型"https://example.org/animals#cat"をもつ1つのアイテムと次のプロパティを持つ:

プロパティ
nameHedral
https://example.com/fnHedral
descHedral is a male American domestic shorthair, with a fluffy black fur with white paws and belly.
https://example.com/colorblack
https://example.com/colorwhite
img.../hedral.jpeg

5.2 microdataをエンコーディングする

5.2.1 microdataモデル

microdataモデルはアイテムとして知られる名前-値ペアのグループで構成される。

各グループは、アイテムとして知られる。各アイテムは、アイテム型グローバル識別子アイテム型によって指定される語彙がアイテムのグローバル識別子をサポートする場合)、および名前-値ペアのリストを持つことができる。名前-値ペアのそれぞれの名前は、プロパティとして知られており、各プロパティは、1つ以上のを持つ。それぞれのは、文字列または自身の名前-値ペアのグループ(アイテム)のいずれかである。名前は互いに順不同の関係であるが、特定の名前が複数の値を持つ場合、名前は相対的な順序を持つ。

5.2.2 アイテム

Global_attributes/itemscope

Support in all current engines.

FirefoxYesSafariYesChromeYes
Opera?EdgeYes
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

すべてのHTML要素は、itemscope属性を指定させてもよい。itemscope属性は真偽属性である。

指定されたitemscope属性をもつ要素は、名前-値ペアのグループとなる新しいアイテムを作成する。


Global_attributes/itemtype

Support in all current engines.

FirefoxYesSafariYesChromeYes
Opera?EdgeYes
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

itemscope属性をもつ要素は、アイテムアイテム型を与えるために、itemtype属性を指定させてもよい。

itemtype属性が指定される場合、順不同の一意な空白区切りトークンの集合である値を持たなければならない。これは、別のトークンと同一でなく、それぞれが絶対URL妥当なURL文字列であり、かつこれらのすべては同じ語彙を使用するよう定義される。属性の値は、少なくとも1つのトークンを持たなければならない。

アイテムアイテム型は、ASCII空白文字で要素のitemtype属性の値を分割することで得られるトークンである。itemtype属性が欠損しているまたは解析によりこの方法でトークンが見つからない場合、アイテムアイテム型を持たないといわれる。

アイテム型は、すべて適用可能な仕様で定義される型でなければならず、すべて同じ語彙を使用するように定義されなければならない。

itemtype属性は、itemscope属性を指定されない要素で指定してはならない。


アイテムは、アイテムがアイテム型を持つ、またはアイテムが型付きアイテムプロパティであるかのいずれかの場合、型付きアイテムであるといわれる。型付きアイテム関連型は、アイテムがいずれかを持つ場合に、アイテムアイテム型であり、そうでなければ、アイテムはプロパティに対してアイテム関連型である。


Global_attributes/itemid

Support in all current engines.

FirefoxYesSafariYesChromeYes
Opera?EdgeYes
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

アイテムがウェブ上の他の場所でページ上の他のアイテムに関連することができるように、アイテムのグローバル識別子をサポートするために定義される語彙を参照するitemscope属性およびitemtype属性をもつ要素はまた、アイテムのグローバル識別子を与えるために、itemid属性も指定されてもよい。

itemid属性が指定される場合、潜在的にスペースで囲まれた妥当なURLである値を持たなければならない。

アイテムグローバル識別子を持つ場合、アイテムのグローバル識別子は、属性が指定される要素のノード文書に関連して解析される、その要素のitemid属性の値である。If the itemid attribute is missing or if parsing it returns failure, it is said to have no global identifier.

itemid属性は、itemscope属性と指定されたitemtype属性の両方を持たない要素で指定してはならず、その語彙の仕様で定義されるように、itemtype属性がアイテムのグローバル識別子をサポートしない語彙を指定するitemscope属性をもつ要素に指定してはならない。

グローバル識別子の正確な意味は、語彙の仕様によって決定される。(同じページ上にせよ異なるページ上にせよ)同一のグローバル識別子をもつ複数のアイテムが存在するために許可されるかどうかを定義するかどうかはそのような仕様次第であり、その語彙に対する処理規則は、同じIDをもつ複数のアイテムの扱うケースに対するものである。


Global_attributes/itemref

Support in all current engines.

FirefoxYesSafariYesChromeYes
Opera?EdgeYes
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

itemscope属性をもつ要素は、アイテムの名前-値ペアを見つけるためにクロールするための追加の要素のリストを与えるために、itemref属性を指定されてもよい。

itemref属性は、指定される場合、同じツリー内の要素のIDからなる、別のトークンと同一でない順不同の一意な空白区切りトークンの集合である値を持たなければならない。

itemref属性は、itemscope属性に指定されない要素で指定してはならない。

itemref属性は、microdataデータモデルの一部ではない。この属性は、注釈付けするデータが便利なツリー構造に従わないページに注釈を追加することで著者を支援するための単なる構文構造に過ぎない。この属性は、たとえば、セル内のプロパティを維持しながら、各列が個別のアイテムを定義するために、テーブルにおけるデータをマークアップすることを著者に可能にする。

この例は、鉄道模型メーカーの製品を記述するために使用される単純な語彙を示す。語彙は、ちょうど5つのプロパティ名を持つ:

product-code
メーカーのカタログに製品を記載する整数。
name
製品の簡単な説明。
scale
製品の規模を示す、"HO"、"1"または"Z"(潜在的に先頭または末尾の空白をもつ)のいずれか。
digital
存在する場合、特定の型のデジタルデコーダーを持つことを示す、"Digital"、"Delta"または"Systems"(潜在的に先頭または末尾の空白をもつ)のいずれか。
track-type
トラック固有の製品の場合、製品が意図されるトラックの型を示す、 "K"、"M"、"C"(潜在的に先頭または末尾の空白をもつ)のいずれか。

この語彙は、4つの定義されたアイテム型を持つ:

https://md.example.com/loco
エンジン付き車両
https://md.example.com/passengers
旅客鉄道車両
https://md.example.com/track
トラック部品
https://md.example.com/lighting
照明の設備

この語彙を使用する各アイテムは、製品が何であるかに応じて、これらの型の1つ以上を挙げることができる。

よって、機関車は、次のようにマークアップされるかもしれない:

<dl itemscope itemtype="https://md.example.com/loco
                        https://md.example.com/lighting">
 <dt>Name:
 <dd itemprop="name">Tank Locomotive (DB 80)
 <dt>Product code:
 <dd itemprop="product-code">33041
 <dt>Scale:
 <dd itemprop="scale">HO
 <dt>Digital:
 <dd itemprop="digital">Delta
</dl>

分岐ランタン改装キットは次のようにマークアップされるかもしれない:

<dl itemscope itemtype="https://md.example.com/track
                        https://md.example.com/lighting">
 <dt>Name:
 <dd itemprop="name">Turnout Lantern Kit
 <dt>Product code:
 <dd itemprop="product-code">74470
 <dt>Purpose:
 <dd>For retrofitting 2 <span itemprop="track-type">C</span> Track
 turnouts. <meta itemprop="scale" content="HO">
</dl>

無照明の乗用車は次のようにマークアップされるかもしれない:

<dl itemscope itemtype="https://md.example.com/passengers">
 <dt>Name:
 <dd itemprop="name">Express Train Passenger Car (DB Am 203)
 <dt>Product code:
 <dd itemprop="product-code">8710
 <dt>Scale:
 <dd itemprop="scale">Z
</dl>

新しい語彙を作成するときには細心の注意が必要である。多くの場合、型に階層的なアプローチをすることは、一般にはるかに簡単に管理することで、各アイテムが単一の型を持つ場合に、語彙をもたらす。

5.2.3 名前:itemprop属性

Global_attributes/itemprop

Support in all current engines.

FirefoxYesSafariYesChromeYes
Opera?EdgeYes
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

すべてのHTML要素は、指定されるものが(次に定義する)1つ以上のアイテム1つ以上のプロパティを追加する場合に、itemprop属性に指定されていてもよい。

itemprop属性は、指定される場合、属性が追加する名前-値ペアの名前を表す、別のトークンと同一ではない順不同の一意な空白区切りトークンの集合である値を持たなければならない。属性の値は、少なくとも1つのトークンを持たなければならない。

各トークンは、次のいずれかでなければならない:

定義されたプロパティ名を導入する仕様は、すべてのそのようなプロパティ名が一切U+002E FULL STOP文字(.)、U+003A COLON文字(:)、およびASCII空白文字を含まないことを保証しなければならない。

そうでなければ、規則はURLから区別することができないため、上記の規則は、非URL値でU+003A COLON文字(:)を禁止する。U+002E FULL STOP文字(.)をもつ値は、将来の拡張のために予約される。それ以外の場合は値が複数のトークンとして解析されるので、ASCII空白文字は許可されない。

itemprop属性をもつ要素が複数のアイテムプロパティを追加する場合、トークンに関する上記の要件は個別に各アイテムに適用される。

要素のプロパティ名は、要素のitemprop属性が、保存順だが(それぞれの名前の最初の出現のみ残して)重複が削除される、そのプロパティ名の値がASCII空白文字で分割されるときに含まれることが見出されているトークンである。

アイテムの中で、プロパティがアイテムのプロパティを定義するアルゴリズムによって与えられる順序で並べられるのと同じ名前をもつものを除いて、プロパティは互いに順不同である。

次の例において、"a"プロパティは、その順序で、値"1"と"2"を持つが、"a"プロパティが"b"プロパティの前に来るかどうかは重要ではない:

<div itemscope>
 <p itemprop="a">1</p>
 <p itemprop="a">2</p>
 <p itemprop="b">test</p>
</div>

したがって、次は等価である:

<div itemscope>
 <p itemprop="b">test</p>
 <p itemprop="a">1</p>
 <p itemprop="a">2</p>
</div>

次も同様である:

<div itemscope>
 <p itemprop="a">1</p>
 <p itemprop="b">test</p>
 <p itemprop="a">2</p>
</div>

次も同様である:

<div id="x">
 <p itemprop="a">1</p>
</div>
<div itemscope itemref="x">
 <p itemprop="b">test</p>
 <p itemprop="a">2</p>
</div>

5.2.4

itemprop属性をもつ要素によって追加された名前-値ペアのプロパティ値は、次のリストで最初に一致する場合に与えられるとおりである:

要素がitemscope属性も持つ場合

値は、要素によって作成されたアイテムである。

要素がmeta要素である場合

値はもしあれば、要素のcontent属性の値、該当する属性が存在しない場合には、空の文字列である。

要素がaudioembediframeimgsourcetrackまたはvideo要素である場合

The value is the result of encoding-parsing-and-serializing a URL given the element's src attribute's value, relative to the element's node document, at the time the attribute is set, or the empty string if there is no such attribute or the result is failure.

要素がaareaまたはlink要素である場合

The value is the result of encoding-parsing-and-serializing a URL given the element's href attribute's value, relative to the element's node document, at the time the attribute is set, or the empty string if there is no such attribute or the result is failure.

要素がobject要素である場合

The value is the result of encoding-parsing-and-serializing a URL given the element's data attribute's value, relative to the element's node document, at the time the attribute is set, or the empty string if there is no such attribute or the result is failure.

要素がdata要素である場合

要素のvalue属性を持つ場合、値はその値であり、そうでなければ、空文字列である。

要素がmeter要素である場合

要素のvalue属性を持つ場合、値はその値であり、そうでなければ、空文字列である。

要素がtime要素である場合

値は、要素のdatetime値である。

そうでなければ

値は、要素の子孫のテキストコンテンツである。

URLプロパティ要素aareaaudioembediframeimglinkobjectsourcetrack、およびvideo要素である。

プロパティの定義で定義されているとおりにプロパティの絶対URLである場合、プロパティはURLプロパティ要素を使用して指定されなければならない。

プロパティ値がたまたまURL構文と一致するという理由だけでこの要件は適用されない。プロパティが明示的にそのような値をとるように定義される場合にのみ要件は適用される。

たとえば、最初の月面着陸についての本は、"mission:moon"と呼ばれるかもしれない。文字列であるとしてタイトルを定義する語彙から"title"プロパティは、プロパティがURLのように見えるにもかかわらず、タイトルがa要素に与えられることに期待しない。一方、URLを取るために定義される"title"プロパティを持った"タイトルがURLのように見える本"のための(むしろより狭いスコープな)語彙があった場合、上記の要件のために、そのプロパティはa要素(または他のURLプロパティ要素のいずれか)でタイトルが与えられることに期待するだろう

5.2.5 Microdataと他の名前空間

現在、itemscopeitemprop、および他のmicrodata属性は、HTML要素のためにのみ定義される。これは、リテラルな名前"itemscope"、"itemprop"などの属性がmicrodata処理をSVGなどの他の名前空間における要素で発生させないことを意味する。

したがって、次の例において、2つでは1つのアイテムのみが存在する。

<p itemscope></p> <!-- this is an item (with no properties and no type) -->
<svg itemscope></svg> <!-- this is not, it's just an SVG svg element with an invalid unknown attribute -->

5.3 サンプルmicrodata語彙

語彙はまたそれ自体で使用可能であるものの、このセクションの語彙は主に、語彙が指定される方法を示すことを意図する。

5.3.1 vCard

アイテム型http://microformats.org/profile/hcardをもつアイテムは、人のまたは組織の連絡先情報を表す。

この語彙は、アイテムに対するグローバル識別子をサポートしない。

次は、型の定義されたプロパティ名である。これらは、値を解釈する方法についての詳細を見つけることができる、vCard Format Specification (vCard)およびその拡張で定義される語彙に基づく。[RFC6350]

kind

アイテムが表す接触の種類を説明する。

は、kind文字列のいずれかと同一であるテキストでなければならない。

名前kindをもつ単一のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

fn

個人または組織の名前に対応するフォーマット済みのテキストを与える。

はテキストでなければならない。

厳密に名前fnをもつ1つのプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在しなければならない。

n

個人または組織の構造化された名前を与える。

は、family-namegiven-nameadditional-namehonorific-prefixhonorific-suffixのそれぞれの0個以上のアイテムでなければならない。

厳密に名前nをもつ1つのプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在しなければならない。

family-namenの内部)

人の姓、または組織の完全な名前を与える。

はテキストでなければならない。

名前family-nameをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつアイテムnプロパティのを構成するアイテム内に存在してもよい。

given-namenの内部)

人の下の名前を指定する。

はテキストでなければならない。

名前given-nameをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつアイテムnプロパティのを構成するアイテム内に存在してもよい。

additional-namenの内部)

人の任意の追加の名前を提供する。

はテキストでなければならない。

名前additional-nameをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつアイテムnプロパティのを構成するアイテム内に存在してもよい。

honorific-prefixnの内部)

人の敬称接頭辞を与える。

はテキストでなければならない。

名前honorific-prefixをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつアイテムnプロパティのを構成するアイテム内に存在してもよい。

honorific-suffixnの内部)

人の敬称接尾辞を与える。

はテキストでなければならない。

名前honorific-suffixをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつアイテムnプロパティのを構成するアイテム内に存在してもよい。

nickname

個人または組織のニックネームを与える。

ニックネームは、与えられた記述名の代わり、または、人、場所、または物に属する名前に加えるものである。これはまた、fnまたはnプロパティによって指定される固有名詞のなじみのある形式を指定するために使用することができる。

はテキストでなければならない。

名前nicknameをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

photo

個人または組織の写真を与える。

絶対URLでなければならない。

名前photoをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

bday

個人または組織の誕生日を与える。

妥当な日付文字列でなければならない。

名前bdayをもつ単一のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

anniversary

個人または組織の誕生日を与える。

妥当な日付文字列でなければならない。

名前anniversaryをもつ単一のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

sex

人の生物学的性別を与える。

は、"女性"を意味するF、"男性"を意味するM、"該当なし"を意味するN、"その他"を意味するO、または"未確認"を意味するUのいずれかでなければならない。

名前sexをもつ単一のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

gender-identity

人の性同一性を与える。

はテキストでなければならない。

名前gender-identityをもつ単一のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

adr

個人または組織の配信アドレス(配達先住所)を与える。

は、0個以上のtypepost-office-boxextended-address、およびstreet-addressプロパティ、および任意のlocalityプロパティ、任意のregionプロパティ、任意のpostal-codeプロパティ、および任意のcountry-nameプロパティをもつアイテムでなければならない。

http://microformats.org/profile/hcardをもつアイテムadrプロパティのを構成するアイテム内に一切typeが存在しない場合、アドレス型文字列workが暗黙で指定される。

名前adrをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

typeadr内部)

配達先住所のタイプを与える。

は、address型文字列のいずれかと同一であるテキストでなければならない。

名前typeをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつアイテムadrプロパティのを構成するアイテムの中に存在してもよいが、そのような各adrプロパティアイテム内で個別の値ごとに1つのtypeプロパティのみが存在しなければならない。

post-office-boxadr内部)

個人または組織の配送先住所の私書箱コンポーネントを与える。

はテキストでなければならない。

名前post-office-boxをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつアイテムadrプロパティのを構成するアイテム内に存在してもよい。

vCardは、このフィールドを使用しないように著者に促す。

extended-addressadr内部)

個人または組織の配送先住所の追加コンポーネントを与える。

はテキストでなければならない。

名前extended-addressをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつアイテムadrプロパティのを構成するアイテム内に存在してもよい。

vCardは、このフィールドを使用しないように著者に促す。

street-addressadr内部)

個人または組織の配送先住所の追加コンポーネントを与える。

はテキストでなければならない。

名前street-addressをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつアイテムadrプロパティのを構成するアイテム内に存在してもよい。

localityadr内部)

個人または組織の配達先住所の地方コンポーネント(たとえば市)を与える。

はテキストでなければならない。

名前localityをもつ単一のプロパティは、型http://microformats.org/profile/hcardをもつアイテムadrプロパティのを構成するアイテム内に存在してもよい。

regionadr内部)

個人または組織の配達先住所の地域コンポーネント(たとえば州や省)を与える。

はテキストでなければならない。

名前regionをもつ単一のプロパティは、型http://microformats.org/profile/hcardをもつアイテムadrプロパティのを構成するアイテム内に存在してもよい。

postal-codeadr内部)

個人または組織の配達先住所の郵便番号コンポーネントを与える。

はテキストでなければならない。

名前postal-codeをもつ単一のプロパティは、型http://microformats.org/profile/hcardをもつアイテムadrプロパティのを構成するアイテム内に存在してもよい。

country-nameadr内部)

個人または組織の配送先住所の国名コンポーネントを与える。

はテキストでなければならない。

名前country-nameをもつ単一のプロパティは、型http://microformats.org/profile/hcardをもつアイテムadrプロパティのを構成するアイテム内に存在してもよい。

tel

人または組織の電話番号を与える。

は、CCITT仕様E.163およびX.121で定義されるとおりの電話番号として解釈することができるテキスト、または0個以上のtypeプロパティおよび厳密に1つのvalueプロパティをもつアイテムのいずれかでなければならない。[E163] [X121]

http://microformats.org/profile/hcardをもつアイテムtelプロパティのを構成するアイテム内に一切typeプロパティが存在しない場合、またはそのようなtelプロパティのがテキストである場合、電話型文字列voiceが暗黙で指定される。

名前telをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

typetel内部)

電話番号の種類を与える。

は、telephone型文字列のいずれかと同一であるテキストでなければならない。

名前typeをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつアイテムtelプロパティのを構成するアイテムの中に存在してもよいが、そのような各telプロパティアイテム内で個別の値ごとに1つのtypeプロパティのみが存在しなければならない。

valuetel内部)

人または組織の実際の電話番号を与える。

は、CCITT仕様E.163およびX.121で定義されるとおりの電話番号として解釈することができるテキストでなければならない。[E163] [X121]

名前valueをもつ厳密に1つのプロパティは、型http://microformats.org/profile/hcardをもつアイテムtelプロパティのを構成するアイテム内に存在しなければならない。

email

個人または組織の配信アドレス(配達先住所)を与える。

はテキストでなければならない。

名前emailをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

impp

人または組織とインスタントメッセージングおよびプレゼンスプロトコル通信のためのURLを与える。

絶対URLでなければならない。

名前imppをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

lang

人または組織が理解する言語を与える。

は、妥当なBCP 47言語タグでなければならない。[BCP47]

名前langをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

tz

個人または組織のタイムゾーンを与える。

はテキストでなければならず、次の構文と一致しなければならない:

  1. U+002B PLUS SIGN文字(+)またはU+002D HYPHEN-MINUS文字(-)のいずれか。
  2. 厳密に2桁の長さであり、かつ範囲00..23で数を表す妥当な非負整数
  3. U+003A COLON文字(:)。
  4. 厳密に2桁の長さであり、かつ範囲00..59で数を表す妥当な非負整数

名前tzをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

geo

個人または組織の地理的な位置を与える。

はテキストでなければならず、次の構文と一致しなければならない:

  1. 任意で、U+002B PLUS SIGN文字(+)またはU+002D HYPHEN-MINUS文字(-)のいずれか。
  2. 1つ以上のASCII数字
  3. 任意で*、U+002E FULL STOP文字(.)に続く1つ以上のASCII数字
  4. U+003B SEMICOLON文字(;)。
  5. 任意で、U+002B PLUS SIGN文字(+)またはU+002D HYPHEN-MINUS文字(-)のいずれか。
  6. 1つ以上のASCII数字
  7. 任意で*、U+002E FULL STOP文字(.)に続く1つ以上のASCII数字

アスタリスク(*)でマークされる任意のコンポーネントは含まれるべきであり、それぞれ6桁の数字を持つべきである。

値は、10進数の度で、その順序(すなわち、"LAT LON"の順序)で、緯度および経度を指定する。経度は、それぞれ、正または負の実数として本初子午線の東および西の位置を表す。緯度は、それぞれ、正または負の実数として赤道の北および南の位置を表す。

名前geoをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

title

個人または組織の役職、機能的位置または機能を与える。

はテキストでなければならない。

名前titleをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

ロール

個人または組織の任務、職業、または業種を与える。

はテキストでなければならない。

名前roleをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

個人または組織のロゴを与える。

絶対URLでなければならない。

名前をもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

agent

個人または組織を代表して行動する他の人の連絡先情報を与える。

は、型http://microformats.org/profile/hcardをもつアイテム、または絶対URL、またはテキストのいずれかでなければならない。

名前agentをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

org

組織の名前および単位を与える。

は、テキストまたは1つのorganization-nameプロパティおよび0個以上のorganization-unitプロパティをもつアイテムのいずれかでなければならない。

名前orgをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

organization-nameorgの内部)

組織の名前を与える。

はテキストでなければならない。

名前organization-nameをもつ厳密に1つのプロパティは、型http://microformats.org/profile/hcardをもつアイテムorgプロパティのを構成するアイテム内に存在しなければならない。

organization-unitorgの内部)

組織単位の名前を与える。

はテキストでなければならない。

名前organization-unitをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつアイテムorgプロパティのを構成するアイテム内に存在してもよい。

member

グループのメンバーを表すURLを与える。

絶対URLでなければならない。

アイテムが値"group"である名前kindをもつプロパティも持つ場合、名前memberをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

related

別のエンティティとの関係を与える。

は、1つのurlプロパティと1つのrelプロパティをもつアイテムでなければならない。

名前relatedをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

urlrelated内部)

関連するエンティティに対するURLを与える。

絶対URLでなければならない。

名前valueをもつ厳密に1つのプロパティは、型http://microformats.org/profile/hcardをもつアイテムrelatedプロパティのを構成するアイテム内に存在しなければならない。

relrelated内部)

エンティティと関連するエンティティとの間の関係を与える。

は、relationship文字列のいずれかと同一であるテキストでなければならない。

名前relをもつ厳密に1つのプロパティは、型http://microformats.org/profile/hcardをもつアイテムrelatedプロパティのを構成するアイテム内に存在しなければならない。

categories

個人または組織を分類することができるカテゴリーまたはタグの名前を与える。

はテキストでなければならない。

名前categoriesをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

note

人物または組織に関する補足情報またはコメントを与える。

はテキストでなければならない。

名前noteをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

rev

連絡先情報の改訂日時を与える。

は、妥当なグローバル日付および時刻文字列であるテキストでなければならない。

値は、他の情報のレンディションに対する現在の情報のリビジョンを区別する。

名前revをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

sound

個人または組織に関連する音声ファイルを与える。

絶対URLでなければならない。

名前soundをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

uid

個人または組織に対応するグローバルに一意な識別子を与える。

はテキストでなければならない。

名前uidをもつ単一のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

url

個人または組織に関連するURLを与える。

絶対URLでなければならない。

名前urlをもつ任意の数のプロパティは、型http://microformats.org/profile/hcardをもつ各アイテム内に存在してもよい。

kind文字列は次のとおり:

individual

単一のエンティティ(たとえば人)を示す。

group

複数のエンティティ(たとえばメーリングリスト)を示す。

org

人ではない(たとえば会社)単一のエンティティを示す。

ロケーション

地理的な場所(たとえばオフィスビル)を示す。

address型文字列は次のとおり:

home

住宅の配達先住所を示す。

work

職場の配達先住所を示す。

telephone型文字列は次のとおり:

home

住宅の番号を示す。

work

勤務先の電話番号を示す。

text

電話番号がテキストメッセージ(SMS)をサポートすることを示す。

voice

音声電話番号を示す。

fax

ファクシミリ電話番号を示す。

cell

携帯電話の番号を示す。

video

ビデオ会議の電話番号を示す。

pager

ページングデバイスの電話番号を示す。

textphone

聴覚や言語障害をもつ人のための通信装置を示す。

relationship文字列は次のとおりである:

emergency

緊急連絡。

agent

このエンティティの代わりに作用する別のエンティティ。

contact
acquaintance
friend
met
worker
colleague
resident
neighbor
child
parent
sibling
spouse
kin
muse
crush
date
sweetheart
me

XFNで定義された意味を持つ。[XFN]

5.3.1.1 Conversion to vCard

Given a list of nodes nodes in a Document, a user agent must run the following algorithm to extract any vCard data represented by those nodes (only the first vCard is returned):

  1. If none of the nodes in nodes are items with the item type http://microformats.org/profile/hcard, then there is no vCard. Abort the algorithm, returning nothing.

  2. Let node be the first node in nodes that is an item with the item type http://microformats.org/profile/hcard.

  3. Let output be an empty string.

  4. Add a vCard line with the type "BEGIN" and the value "VCARD" to output.

  5. Add a vCard line with the type "PROFILE" and the value "VCARD" to output.

  6. Add a vCard line with the type "VERSION" and the value "4.0" to output.

  7. Add a vCard line with the type "SOURCE" and the result of escaping the vCard text string that is the document's URL as the value to output.

  8. If the title element is not null, add a vCard line with the type "NAME" and with the result of escaping the vCard text string obtained from the title element's descendant text content as the value to output.

  9. Let sex be the empty string.

  10. Let gender-identity be the empty string.

  11. For each element element that is a property of the item node: for each name name in element's property names, run the following substeps:

    1. Let parameters be an empty set of name-value pairs.

    2. Run the appropriate set of substeps from the following list. The steps will set a variable value, which is used in the next step.

      If the property's value is an item subitem and name is n
      1. Let value be the empty string.

      2. Append to value the result of collecting the first vCard subproperty named family-name in subitem.

      3. Append a U+003B SEMICOLON character (;) to value.
      4. Append to value the result of collecting the first vCard subproperty named given-name in subitem.

      5. Append a U+003B SEMICOLON character (;) to value.
      6. Append to value the result of collecting the first vCard subproperty named additional-name in subitem.

      7. Append a U+003B SEMICOLON character (;) to value.
      8. Append to value the result of collecting the first vCard subproperty named honorific-prefix in subitem.

      9. Append a U+003B SEMICOLON character (;) to value.
      10. Append to value the result of collecting the first vCard subproperty named honorific-suffix in subitem.

      If the property's value is an item subitem and name is adr
      1. Let value be the empty string.

      2. Append to value the result of collecting vCard subproperties named post-office-box in subitem.

      3. Append a U+003B SEMICOLON character (;) to value.
      4. Append to value the result of collecting vCard subproperties named extended-address in subitem.

      5. Append a U+003B SEMICOLON character (;) to value.
      6. Append to value the result of collecting vCard subproperties named street-address in subitem.

      7. Append a U+003B SEMICOLON character (;) to value.
      8. Append to value the result of collecting the first vCard subproperty named locality in subitem.

      9. Append a U+003B SEMICOLON character (;) to value.
      10. Append to value the result of collecting the first vCard subproperty named region in subitem.

      11. Append a U+003B SEMICOLON character (;) to value.
      12. Append to value the result of collecting the first vCard subproperty named postal-code in subitem.

      13. Append a U+003B SEMICOLON character (;) to value.
      14. Append to value the result of collecting the first vCard subproperty named country-name in subitem.

      15. If there is a property named type in subitem, and the first such property has a value that is not an item and whose value consists only of ASCII alphanumerics, then add a parameter named "TYPE" whose value is the value of that property to parameters.

      If the property's value is an item subitem and name is org
      1. Let value be the empty string.

      2. Append to value the result of collecting the first vCard subproperty named organization-name in subitem.

      3. For each property named organization-unit in subitem, run the following steps:

        1. If the value of the property is an item, then skip this property.

        2. Append a U+003B SEMICOLON character (;) to value.

        3. Append the result of escaping the vCard text string given by the value of the property to value.

      If the property's value is an item subitem with the item type http://microformats.org/profile/hcard and name is related
      1. Let value be the empty string.

      2. If there is a property named url in subitem, and its element is a URL property element, then append the result of escaping the vCard text string given by the value of the first such property to value, and add a parameter with the name "VALUE" and the value "URI" to parameters.

      3. If there is a property named rel in subitem, and the first such property has a value that is not an item and whose value consists only of ASCII alphanumerics, then add a parameter named "RELATION" whose value is the value of that property to parameters.

      If the property's value is an item and name is none of the above
      1. Let value be the result of collecting the first vCard subproperty named value in subitem.

      2. If there is a property named type in subitem, and the first such property has a value that is not an item and whose value consists only of ASCII alphanumeric, then add a parameter named "TYPE" whose value is the value of that property to parameters.

      If the property's value is not an item and its name is sex

      If this is the first such property to be found, set sex to the property's value.

      If the property's value is not an item and its name is gender-identity

      If this is the first such property to be found, set gender-identity to the property's value.

      Otherwise (the property's value is not an item)
      1. Let value be the property's value.

      2. If element is one of the URL property elements, add a parameter with the name "VALUE" and the value "URI" to parameters.

      3. Otherwise, if name is bday or anniversary and the value is a valid date string, add a parameter with the name "VALUE" and the value "DATE" to parameters.

      4. Otherwise, if name is rev and the value is a valid global date and time string, add a parameter with the name "VALUE" and the value "DATE-TIME" to parameters.

      5. Prefix every U+005C REVERSE SOLIDUS character (\) in value with another U+005C REVERSE SOLIDUS character (\).

      6. Prefix every U+002C COMMA character (,) in value with a U+005C REVERSE SOLIDUS character (\).

      7. Unless name is geo, prefix every U+003B SEMICOLON character (;) in value with a U+005C REVERSE SOLIDUS character (\).

      8. Replace every U+000D CARRIAGE RETURN U+000A LINE FEED character pair (CRLF) in value with a U+005C REVERSE SOLIDUS character (\) followed by a U+006E LATIN SMALL LETTER N character (n).

      9. Replace every remaining U+000D CARRIAGE RETURN (CR) or U+000A LINE FEED (LF) character in value with a U+005C REVERSE SOLIDUS character (\) followed by a U+006E LATIN SMALL LETTER N character (n).

    3. Add a vCard line with the type name, the parameters parameters, and the value value to output.

  12. If either sex or gender-identity has a value that is not the empty string, add a vCard line with the type "GENDER" and the value consisting of the concatenation of sex, a U+003B SEMICOLON character (;), and gender-identity to output.

  13. Add a vCard line with the type "END" and the value "VCARD" to output.

When the above algorithm says that the user agent is to add a vCard line consisting of a type type, optionally some parameters, and a value value to a string output, it must run the following steps:

  1. Let line be an empty string.

  2. Append type, converted to ASCII uppercase, to line.

  3. If there are any parameters, then for each parameter, in the order that they were added, run these substeps:

    1. Append a U+003B SEMICOLON character (;) to line.

    2. Append the parameter's name to line.

    3. Append a U+003D EQUALS SIGN character (=) to line.

    4. Append the parameter's value to line.

  4. Append a U+003A COLON character (:) to line.

  5. Append value to line.

  6. Let maximum length be 75.

  7. While line's code point length is greater than maximum length:

    1. Append the first maximum length code points of line to output.

    2. Remove the first maximum length code points from line.

    3. Append a U+000D CARRIAGE RETURN character (CR) to output.

    4. Append a U+000A LINE FEED character (LF) to output.

    5. Append a U+0020 SPACE character to output.

    6. Let maximum length be 74.

  8. Append (what remains of) line to output.

  9. Append a U+000D CARRIAGE RETURN character (CR) to output.

  10. Append a U+000A LINE FEED character (LF) to output.

When the steps above require the user agent to obtain the result of collecting vCard subproperties named subname in subitem, the user agent must run the following steps:

  1. Let value be the empty string.

  2. For each property named subname in the item subitem, run the following substeps:

    1. If the value of the property is itself an item, then skip this property.

    2. If this is not the first property named subname in subitem (ignoring any that were skipped by the previous step), then append a U+002C COMMA character (,) to value.

    3. Append the result of escaping the vCard text string given by the value of the property to value.

  3. Return value.

When the steps above require the user agent to obtain the result of collecting the first vCard subproperty named subname in subitem, the user agent must run the following steps:

  1. If there are no properties named subname in subitem, then return the empty string.

  2. If the value of the first property named subname in subitem is an item, then return the empty string.

  3. Return the result of escaping the vCard text string given by the value of the first property named subname in subitem.

When the above algorithms say the user agent is to escape the vCard text string value, the user agent must use the following steps:

  1. Prefix every U+005C REVERSE SOLIDUS character (\) in value with another U+005C REVERSE SOLIDUS character (\).

  2. Prefix every U+002C COMMA character (,) in value with a U+005C REVERSE SOLIDUS character (\).

  3. Prefix every U+003B SEMICOLON character (;) in value with a U+005C REVERSE SOLIDUS character (\).

  4. Replace every U+000D CARRIAGE RETURN U+000A LINE FEED character pair (CRLF) in value with a U+005C REVERSE SOLIDUS character (\) followed by a U+006E LATIN SMALL LETTER N character (n).

  5. Replace every remaining U+000D CARRIAGE RETURN (CR) or U+000A LINE FEED (LF) character in value with a U+005C REVERSE SOLIDUS character (\) followed by a U+006E LATIN SMALL LETTER N character (n).

  6. Return the mutated value.

This algorithm can generate invalid vCard output, if the input does not conform to the rules described for the http://microformats.org/profile/hcard item type and defined property names.

5.3.1.2

これは、"Jack Bauer"と呼ばれる架空のキャラクターのための長いvCardの例である:

<section id="jack" itemscope itemtype="http://microformats.org/profile/hcard">
 <h1 itemprop="fn">
  <span itemprop="n" itemscope>
   <span itemprop="given-name">Jack</span>
   <span itemprop="family-name">Bauer</span>
  </span>
 </h1>
 <img itemprop="photo" alt="" src="jack-bauer.jpg">
 <p itemprop="org" itemscope>
  <span itemprop="organization-name">Counter-Terrorist Unit</span>
  (<span itemprop="organization-unit">Los Angeles Division</span>)
 </p>
 <p>
  <span itemprop="adr" itemscope>
   <span itemprop="street-address">10201 W. Pico Blvd.</span><br>
   <span itemprop="locality">Los Angeles</span>,
   <span itemprop="region">CA</span>
   <span itemprop="postal-code">90064</span><br>
   <span itemprop="country-name">United States</span><br>
  </span>
  <span itemprop="geo">34.052339;-118.410623</span>
 </p>
 <h2>Assorted Contact Methods</h2>
 <ul>
  <li itemprop="tel" itemscope>
   <span itemprop="value">+1 (310) 597 3781</span> <span itemprop="type">work</span>
   <meta itemprop="type" content="voice">
  </li>
  <li><a itemprop="url" href="https://en.wikipedia.org/wiki/Jack_Bauer">I'm on Wikipedia</a>
  so you can leave a message on my user talk page.</li>
  <li><a itemprop="url" href="http://www.jackbauerfacts.com/">Jack Bauer Facts</a></li>
  <li itemprop="email"><a href="mailto:j.bauer@la.ctu.gov.invalid">j.bauer@la.ctu.gov.invalid</a></li>
  <li itemprop="tel" itemscope>
   <span itemprop="value">+1 (310) 555 3781</span> <span>
   <meta itemprop="type" content="cell">mobile phone</span>
  </li>
 </ul>
 <ins datetime="2008-07-20 21:00:00+01:00">
  <meta itemprop="rev" content="2008-07-20 21:00:00+01:00">
  <p itemprop="tel" itemscope><strong>Update!</strong>
  My new <span itemprop="type">home</span> phone number is
  <span itemprop="value">01632 960 123</span>.</p>
 </ins>
</section>

改行はmicrodataで意味があるので、奇数行の折り返しが必要とされる。改行は、たとえばvCard形式に変換中に保存される。

この例は、2つのstreetコンポーネントとともにアドレスを含む(address要素を使用する)サイトの連絡先の詳細を示す:

<address itemscope itemtype="http://microformats.org/profile/hcard">
 <strong itemprop="fn"><span itemprop="n" itemscope><span itemprop="given-name">Alfred</span>
 <span itemprop="family-name">Person</span></span></strong> <br>
 <span itemprop="adr" itemscope>
  <span itemprop="street-address">1600 Amphitheatre Parkway</span> <br>
  <span itemprop="street-address">Building 43, Second Floor</span> <br>
  <span itemprop="locality">Mountain View</span>,
   <span itemprop="region">CA</span> <span itemprop="postal-code">94043</span>
 </span>
</address>

これは、2つの名前-値ペアをもつ単一の項目を作成する。

<span itemscope itemtype="http://microformats.org/profile/hcard"
><span itemprop=fn><span itemprop="n" itemscope><span itemprop="given-name"
>George</span> <span itemprop="family-name">Washington</span></span
></span></span>

片方は名前"fn"と値"George Washington"、もう片方は名前"n"とその値として2つ目のアイテムをもつ。その2つ目のアイテムは2つの名前-値ペアを持ち、それぞれ"George"と"Washington"をもつ"given-name"と"family-name"となる。これは、次のvCardへのマッピングに定義される:

BEGIN:VCARD
PROFILE:VCARD
VERSION:4.0
SOURCE:document's address
FN:George Washington
N:Washington;George;;;
END:VCARD

5.3.2 vEvent

アイテム型http://microformats.org/profile/hcalendar#veventをもつアイテムはイベントを表す。

この語彙は、アイテムに対するグローバル識別子をサポートしない。

次は、型の定義されたプロパティ名である。これらは、Internet Calendaring and Scheduling Core Object Specification (iCalendar)で定義される語彙に基づいており、値の解釈方法に関する詳細情報を見つけることができる。[RFC5545]

ここで使用されるイベントに関連するiCalendar語彙は一部のみである。この語彙は、完全なiCalendarのインスタンスを表現することはできない。

attach

イベントに関連付けられた文書のアドレスを与える。

絶対URLでなければならない。

名前attachをもつ任意の数のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

categories

イベントを分類することができるカテゴリーまたはタグの名前を与える。

はテキストでなければならない。

名前categoriesをもつ任意の数のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

class

イベントに関して情報のアクセス分類を与える。

は次のいずれかの値をもつテキストでなければならない:

これは単なる助言であり、機密性の尺度とみなすことはできない。

名前classをもつ単一のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

comment

イベントに関してコメントを与える。

はテキストでなければならない。

名前commentをもつ任意の数のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

description

イベントの詳細な説明を与える。

はテキストでなければならない。

名前descriptionをもつ単一のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

geo

イベントの地理的位置を与える。

はテキストでなければならず、次の構文と一致しなければならない:

  1. 任意で、U+002B PLUS SIGN文字(+)またはU+002D HYPHEN-MINUS文字(-)のいずれか。
  2. 1つ以上のASCII数字
  3. 任意で*、U+002E FULL STOP文字(.)に続く1つ以上のASCII数字
  4. U+003B SEMICOLON文字(;)。
  5. 任意で、U+002B PLUS SIGN文字(+)またはU+002D HYPHEN-MINUS文字(-)のいずれか。
  6. 1つ以上のASCII数字
  7. 任意で*、U+002E FULL STOP文字(.)に続く1つ以上のASCII数字

アスタリスク(*)でマークされる任意のコンポーネントは含まれるべきであり、それぞれ6桁の数字を持つべきである。

値は、10進数の度で、その順序(すなわち、"LAT LON"の順序)で、緯度および経度を指定する。経度は、それぞれ、正または負の実数として本初子午線の東および西の位置を表す。緯度は、それぞれ、正または負の実数として赤道の北および南の位置を表す。

名前geoをもつ単一のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

ロケーション

イベントの位置を与える。

はテキストでなければならない。

名前locationをもつ単一のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

resources

イベントのために必要とされるリソースを与える。

はテキストでなければならない。

名前resourcesをもつ任意の数のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

ステータス

イベントの確認ステータスを与える。

は次のいずれかの値をもつテキストでなければならない:

名前statusをもつ単一のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

summary

イベントの要約を与える。

はテキストでなければならない。

値を使用する場合、ユーザーエージェントは、U+0020 SPACE文字によってにおけるU+000A LINE FEED(LF)文字を置換すべきである。

名前summaryをもつ単一のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

dtend

イベントが終了までの日付および時刻を与える。

名前dtstartをもつプロパティが妥当な日付文字列である名前のdtendを含むプロパティを持つ型http://microformats.org/profile/hcalendar#veventをもつアイテムの中に存在する場合、名前dtendをもつプロパティの値もまた妥当な日付文字列となるテキストでなければならない。そうでなければ、プロパティの妥当なグローバル日付および時刻文字列となるテキストでなければならない。

いずれの場合も、は同じアイテムdtstartプロパティの値よりも時間的に遅れとなる。

dtendプロパティによって与えられる時刻はすべてを含んでない。したがって、終日イベントの場合、dtendプロパティのはイベント終了の日となる。

名前dtendをもつ単一のプロパティは、http://microformats.org/profile/hcalendar#veventが名前のdurationをもつプロパティを持たない限り、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内で存在してもよい。

dtstart

イベントが開始する日付および時刻を与える。

は、妥当な日付文字列または妥当なグローバル日付および時刻文字列のいずれかであるテキストでなければならない。

名前dtstartをもつ厳密に1つのプロパティは、型http://microformats.org/profile/hcalendar#veventで各アイテム内に存在しなければならない。

duration

イベントの継続時間を与える。

妥当なvevent期間文字列であるテキストでなければならない。

表される継続時間は、値で整数によって表されるすべての継続時間の合計である。

名前durationをもつ単一のプロパティは、http://microformats.org/profile/hcalendar#veventが名前のdtendをもつプロパティを持たない限り、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内で存在してもよい。

transp

空き時間の時間検索のために、イベントがカレンダーに時間を消費すると考えられるべきであるかどうかを与える。

は次のいずれかの値をもつテキストでなければならない:

名前transpをもつ単一のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

contact

イベントの連絡先情報を与える。

はテキストでなければならない。

名前contactをもつ任意の数のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

url

イベントのURLを与える。

絶対URLでなければならない。

名前urlをもつ単一のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

uid

イベントに対応するグローバルに一意な識別子を与える。

はテキストでなければならない。

名前uidをもつ単一のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

exdate

イベントが繰り返し規則にもかかわらず発生しない日付および時刻を与える。

は、妥当な日付文字列または妥当なグローバル日付および時刻文字列のいずれかであるテキストでなければならない。

名前exdateをもつ任意の数のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

rdate

イベントが再発する日付および時刻を与える。

は、次のいずれかのテキストでなければならない:

名前rdateをもつ任意の数のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

rrule

イベントが発生する日付および時刻を見つけるための規則を与える。

は、iCalendarで定義されるRECUR値型と一致するテキストでなければならない。[RFC5545]

名前rruleをもつ単一のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

created

イベント情報がカレンダーシステムで最初に作成された日付および時刻を与える。

は、妥当なグローバル日付および時刻文字列であるテキストでなければならない。

名前createdをもつ単一のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

last-modified

イベント情報がカレンダーシステムで最後に更新された日付および時刻を与える。

は、妥当なグローバル日付および時刻文字列であるテキストでなければならない。

名前last-modifiedをもつ単一のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

sequence

イベント情報のリビジョン番号を与える。

妥当な非負整数であるテキストでなければならない。

名前sequenceをもつ単一のプロパティは、型http://microformats.org/profile/hcalendar#veventをもつ各アイテム内に存在してもよい。

次のパターンに一致する場合、文字列は妥当なvevent継続時間文字列である:

  1. A U+0050 LATIN CAPITAL LETTER P文字(P)。

  2. 以下のうちの1つをとる:

5.3.2.1 Conversion to iCalendar

Given a list of nodes nodes in a Document, a user agent must run the following algorithm to extract any vEvent data represented by those nodes:

  1. If none of the nodes in nodes are items with the type http://microformats.org/profile/hcalendar#vevent, then there is no vEvent data. Abort the algorithm, returning nothing.

  2. Let output be an empty string.

  3. Add an iCalendar line with the type "BEGIN" and the value "VCALENDAR" to output.

  4. Add an iCalendar line with the type "PRODID" and the value equal to a user-agent-specific string representing the user agent to output.

  5. Add an iCalendar line with the type "VERSION" and the value "2.0" to output.

  6. For each node node in nodes that is an item with the type http://microformats.org/profile/hcalendar#vevent, run the following steps:

    1. Add an iCalendar line with the type "BEGIN" and the value "VEVENT" to output.

    2. Add an iCalendar line with the type "DTSTAMP" and a value consisting of an iCalendar DATE-TIME string representing the current date and time, with the annotation "VALUE=DATE-TIME", to output. [RFC5545]

    3. For each element element that is a property of the item node: for each name name in element's property names, run the appropriate set of substeps from the following list:

      If the property's value is an item

      Skip the property.

      If the property is dtend
      If the property is dtstart
      If the property is exdate
      If the property is rdate
      If the property is created
      If the property is last-modified

      Let value be the result of stripping all U+002D HYPHEN-MINUS (-) and U+003A COLON (:) characters from the property's value.

      If the property's value is a valid date string then add an iCalendar line with the type name and the value value to output, with the annotation "VALUE=DATE".

      Otherwise, if the property's value is a valid global date and time string then add an iCalendar line with the type name and the value value to output, with the annotation "VALUE=DATE-TIME".

      Otherwise skip the property.

      そうでなければ

      Add an iCalendar line with the type name and the property's value to output.

    4. Add an iCalendar line with the type "END" and the value "VEVENT" to output.

  7. Add an iCalendar line with the type "END" and the value "VCALENDAR" to output.

When the above algorithm says that the user agent is to add an iCalendar line consisting of a type type, a value value, and optionally an annotation, to a string output, it must run the following steps:

  1. Let line be an empty string.

  2. Append type, converted to ASCII uppercase, to line.

  3. If there is an annotation:

    1. Append a U+003B SEMICOLON character (;) to line.

    2. Append the annotation to line.

  4. Append a U+003A COLON character (:) to line.

  5. Prefix every U+005C REVERSE SOLIDUS character (\) in value with another U+005C REVERSE SOLIDUS character (\).

  6. Prefix every U+002C COMMA character (,) in value with a U+005C REVERSE SOLIDUS character (\).

  7. Prefix every U+003B SEMICOLON character (;) in value with a U+005C REVERSE SOLIDUS character (\).

  8. Replace every U+000D CARRIAGE RETURN U+000A LINE FEED character pair (CRLF) in value with a U+005C REVERSE SOLIDUS character (\) followed by a U+006E LATIN SMALL LETTER N character (n).

  9. Replace every remaining U+000D CARRIAGE RETURN (CR) or U+000A LINE FEED (LF) character in value with a U+005C REVERSE SOLIDUS character (\) followed by a U+006E LATIN SMALL LETTER N character (n).

  10. Append value to line.

  11. Let maximum length be 75.

  12. While line's code point length is greater than maximum length:

    1. Append the first maximum length code points of line to output.

    2. Remove the first maximum length code points from line.

    3. Append a U+000D CARRIAGE RETURN character (CR) to output.

    4. Append a U+000A LINE FEED character (LF) to output.

    5. Append a U+0020 SPACE character to output.

    6. Let maximum length be 74.

  13. Append (what remains of) line to output.

  14. Append a U+000D CARRIAGE RETURN character (CR) to output.

  15. Append a U+000A LINE FEED character (LF) to output.

This algorithm can generate invalid iCalendar output, if the input does not conform to the rules described for the http://microformats.org/profile/hcalendar#vevent item type and defined property names.

5.3.2.2

これは、イベントをマークアップするためにvEvent語彙を使用するページの例である:

<body itemscope itemtype="http://microformats.org/profile/hcalendar#vevent">
 ...
 <h1 itemprop="summary">Bluesday Tuesday: Money Road</h1>
 ...
 <time itemprop="dtstart" datetime="2009-05-05T19:00:00Z">May 5th @ 7pm</time>
 (until <time itemprop="dtend" datetime="2009-05-05T21:00:00Z">9pm</time>)
 ...
 <a href="http://livebrum.co.uk/2009/05/05/bluesday-tuesday-money-road"
    rel="bookmark" itemprop="url">Link to this page</a>
 ...
 <p>Location: <span itemprop="location">The RoadHouse</span></p>
 ...
 <p><input type=button value="Add to Calendar"
           onclick="location = getCalendar(this)"></p>
 ...
 <meta itemprop="description" content="via livebrum.co.uk">
</body>

getCalendar()関数は、読者のための練習として残している。

同じページには、ブログへのコピー&ペーストのために、次のようないくつかのマークアップを提供することができる:

<div itemscope itemtype="http://microformats.org/profile/hcalendar#vevent">
 <p>I'm going to
 <strong itemprop="summary">Bluesday Tuesday: Money Road</strong>,
 <time itemprop="dtstart" datetime="2009-05-05T19:00:00Z">May 5th at 7pm</time>
 to <time itemprop="dtend" datetime="2009-05-05T21:00:00Z">9pm</time>,
 at <span itemprop="location">The RoadHouse</span>!</p>
 <p><a href="http://livebrum.co.uk/2009/05/05/bluesday-tuesday-money-road"
       itemprop="url">See this event on livebrum.co.uk</a>.</p>
 <meta itemprop="description" content="via livebrum.co.uk">
</div>

5.3.3 ライセンス作品

アイテム型http://n.whatwg.org/workをもつアイテムは、作品(たとえば、記事、画像、映像、歌など)を表す。この型は、主に著者が作品のライセンス情報を含めることを可能にするために意図される。次は、型の定義されたプロパティ名である。

次は、型の定義されたプロパティ名である。

work

記載されている作品を識別する。

絶対URLでなければならない。

名前workをもつ厳密に1つのプロパティは、型http://n.whatwg.org/workで各アイテムの中に存在しなければならない。

title

作品の名前を与える。

名前titleをもつ単一のプロパティは、型http://n.whatwg.org/workをもつ各アイテム内に存在してもよい。

author

作品の著者または創作者のいずれかの名前または連絡先情報を与える。

は、型http://microformats.org/profile/hcardをもつアイテム、またはテキストのいずれかでなければならない。

名前authorをもつ任意の数のプロパティは、型http://n.whatwg.org/workをもつ各アイテム内に存在してもよい。

license

作品が使用可能なライセンスのいずれかを識別する。

絶対URLでなければならない。

名前licenseをもつ任意の数のプロパティは、型http://n.whatwg.org/workをもつ各アイテム内に存在してもよい。

5.3.3.1

この例は、クリエイティブ・コモンズ表示-継承4.0国際ライセンスおよびMITライセンスの下で同時にライセンスされる、My Pondと題する埋め込み画像を示す。

<figure itemscope itemtype="http://n.whatwg.org/work">
 <img itemprop="work" src="mypond.jpeg">
 <figcaption>
  <p><cite itemprop="title">My Pond</cite></p>
  <p><small>Licensed under the <a itemprop="license"
  href="https://creativecommons.org/licenses/by-sa/4.0/">Creative
  Commons Attribution-Share Alike 4.0 International License</a>
  and the <a itemprop="license"
  href="http://www.opensource.org/licenses/mit-license.php">MIT
  license</a>.</small>
 </figcaption>
</figure>