この文書はRDFa Lite 1.1 (W3C Recommendation June 07 2012)の一部を日本語に訳したものです。正確な仕様についての情報を得たい方は、上記URLを参照してください。

Table of Contents

1. はじめに

RDFaの完全な文法 [RDFA-CORE] は、人間関係や場所、イベントなどの構造化されたデータをHTMLやXML文書でかなり複雑な形で表現する事ができるよう、基本的なものから高級なものまで様々な機能を規定しています。それら高級な機能は時に構造化されたデータについてあまり詳しくない制作者によるRDFaの利用を難しくしています。この簡略化されたバージョンのRDFaは構造化データの世界の優しい手引きで、Webページでちょっとしたデータを表現したい制作者を主な対象としており、学びやすく、シンプルなマークアップで八割の制作者の需要を満たせるようなRDFaの最小限のサブセットを規定することを目標としています。

2. 属性

RDFa Liteはvocabtypeofpropertyresource、そしてprefixの5つのシンプルな属性で構成されています。また、これらRDFa 1.1 Liteの属性はフルセットであるRDFa 1.1の属性の完全な前方互換です。つまりRDFa Liteで十分でないなら、RDFaの強力な属性を追加するだけでRDFaに移行することが可能だということです。

2.1 vocab、typeof、property

RDFaはMicroformats [MICROFORMATS] やMicrodata [MICRODATA] と同じように、機械が私達が何を言っているのか理解できるようにWeb上で事柄について喋ることを可能にするものです。通常、私達がある事柄について喋る時、特定の語彙を用いますよね? 例えば人物について喋りたい時は名前電話番号といった表現を持つ語彙を使うでしょう。Web上で事柄をマークアップする場合、同じようにどのような語彙を用いているのかを明らかにする必要があります。以下は段落で事柄をマークアップするためにどのような語彙を用いているかを明示する簡単な例です:

<p vocab="http://schema.org/">
   My name is Manu Sporny and you can give me a ring via 1-800-555-0199.
</p>

この例では用いようとしている語彙http://schema.org/で見つかることを明示しています。この語彙はある有名な検索エンジンの会社がリリースしたもので、検索エンジンが関心を持つ一般的な事柄 — 例えば人物や場所、レビュー、レシピ、他にはイベントなどの事柄 — をWebで喋るためのものです。語彙を明示したなら続いて、どのような事柄について喋るかも明らかにする必要があります。このケースでは人物について喋るわけなので、以下のようにマークアップすることになります:

<p vocab="http://schema.org/" typeof="Person">
   My name is Manu Sporny and you can give me a ring via 1-800-555-0199.
</p>

これであとは検索エンジン向けにこの人物のプロパティーを追加していくだけです。この次の例では、この人物の名前と電話番号、そしてWebページをマークアップします。文字列もURLもRDFa Liteでマークアップすることができます。この次の例では検索エンジンにどのようなデータが渡されるか青でハイライトされていることに特に注意してください:

<p vocab="http://schema.org/" typeof="Person">
   My name is
   <span property="name">Manu Sporny</span>
   and you can give me a ring via
   <span property="telephone">1-800-555-0199</span>
   or visit
   <a property="url" href="http://manu.sporny.org/">my homepage</a>.
</p>

こうすることによって、誰かが検索エンジンで「Manu Spornyの電話番号」と検索した時に、検索エンジンはより適切な答えとして直接電話番号を提示したり、より関連性が高いWebページへ誘導することができるようになります。

2.2 resource

もし他のWeb制作者があなたのページ内の事柄について喋ることができるようにしたいのなら、それらの事柄について識別子を定義する必要があります。HTMLでid属性を使ってページの一部分に識別子を付けるのと同じように、resource属性を使って事柄の識別子を定義することができます:

<p vocab="http://schema.org/" resource="#manu" typeof="Person">
   My name is
   <span property="name">Manu Sporny</span>
   and you can give me a ring via
   <span property="telephone">1-800-555-0199</span>.
   <img property="image" src="http://manu.sporny.org/img/manu.png" />
</p>

このマークアップがhttp://example.org/peopleというURLに含まれるとすると、この事柄についての識別子はそのアドレスにresource属性の値を加えたものになります。したがってこの事柄の識別子はhttp://example.org/people#manuになるでしょう。この識別子はまた別のページで同じ事柄について喋りたい場合にも役に立ちます。このようにWeb上のありとあらゆる事柄をユニークなURLを使って識別することによって、事柄のWebを構築することができるようになります。Webアプリケーションの会社はこの事柄のWebを「Manu Spornyの電話番号は何番で、誰に似ているのか?」というような複雑な質問に答えるために利用することができるでしょう。

2.3 prefix

時として、事柄を定義する際に制作者が必要とする表現を語彙が全ては持っていないこともあります。こういった場合にしばしば制作者が必要とすることになるRDFa 1.1 Liteの最後の機能は、一つ以上の語彙を指定するためのものです。例えば、ある人物を定義する場合にその人物が好きな動物を指定する必要があるとすると、以下のようにして定義することができます:

<p vocab="http://schema.org/" prefix="ov: http://open.vocab.org/terms/" resource="#manu" typeof="Person">
   My name is
   <span property="name">Manu Sporny</span>
   and you can give me a ring via
   <span property="telephone">1-800-555-0199</span>.
   <img property="image" src="http://manu.sporny.org/img/manu.png" />
   My favorite animal is the <span property="ov:preferredAnimal">Liger</span>.
</p>

この例では短縮形のプリフィックスをOpen Vocabulary (ov)として割り当て、そのプリフィックスを使ってpreferredAnimalというその語彙の表現を指定しています。schema.orgは好きな動物を表現する明確な方法を持っていないため、このようにして別の語彙を使って目的を達成することになるわけです。

RDFa 1.1 Liteはdcfoaf、そしてschemaといった便利でよく使われているプリフィックスを数多くあらかじめ定義しています。これにより制作者がそれらよく使われるプリフィックスを宣言するのを忘れたとしても、その構造化されたデータがきちんと解釈されうることが保証されます。宣言済みのプリフィックスの完全なリストはRDFa Core Initial Contextを参照してください。

データ構造についての基本的な解説などを含め、RDFa Liteで出来ることについてもっと知りたいのなら、RDFa Primer [RDFA-PRIMER] のRDFa Liteについて解説しているセクションを参照してください。


Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.

Status of This Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This document has been reviewed by W3C Members, by software developers, and by other W3C groups and interested parties, and is endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.

This document is the culmination of a series of discussions between the World Wide Web Consortium, including the RDF Web Applications Working Group, the Vocabularies Community Group, the HTML Working Group, and the sponsors of the schema.org initiative, including Google, Yahoo!, Microsoft, and Yandex. It has recieved review from representatives in these organizations and enjoys consensus at this point in time. There were no changes made during the Proposed Recommendation period. The implementation report used by the director to transition to Recommendation has been made available.

This document was published by the W3C RDF Web Applications Working Group as a Recommendation. If you wish to make comments regarding this document, please send them to public-rdfa@w3.org (subscribe, archives). All feedback is welcome.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.