1

microdata を使用して、私たちの小さな映画クラブについて Google に明確に説明しようとしています。schema.org を何度も調べて、必要な 3 つの主要なクラスを確立しました。それは、Movie、MovieTheater、および Event です。

ただし、コードをレイアウトする必要があるように見える方法は、直感に反しています。

PLACE (MovieTheater) が MOVIE を上映する EVENT を開催することは、私には理にかなっているように思えます。

しかし、MOVIE を EVENT 内に配置する方法がないため、それは不可能のようです。

これらのものを 1 つのエンティティとしてリストできるように思われる唯一の方法は、MOVIETHEATER で行われるイベントを含む MOVIE を最も外側に配置することです。しかし、複数の MOVIE をリストしたい場合は、MOVIE オブジェクトの下にすべての MOVIETHEATER データを繰り返さなければならず、その結果、不要な HTML が大量に作成されます。

それで、私はそれを間違って読んだり、何かを見逃したりしましたか?それともそれを行う唯一の方法ですか?

4

1 に答える 1

1

あなたが正しいようです。MovieTheater の説明と重複しないように、 microdata itemrefを使用します。例のように

In this example, a single license statement is applied to two works, using itemref from the items representing the works:

<!DOCTYPE HTML>
<html>
 <head>
  <title>Photo gallery</title>
 </head>
 <body>
  <h1>My photos</h1>
  <figure itemscope itemtype="http://n.whatwg.org/work" itemref="licenses">
   <img itemprop="work" src="images/house.jpeg" alt="A white house, boarded up, sits in a forest.">
   <figcaption itemprop="title">The house I found.</figcaption>
  </figure>
  <figure itemscope itemtype="http://n.whatwg.org/work" itemref="licenses">
   <img itemprop="work" src="images/mailbox.jpeg" alt="Outside the house is a mailbox. It has a leaflet inside.">
   <figcaption itemprop="title">The mailbox.</figcaption>
  </figure>
  <footer>
   <p id="licenses">All images licensed under the <a itemprop="license"
   href="http://www.opensource.org/licenses/mit-license.php">MIT
   license</a>.</p>
  </footer>
 </body>
</html>

ところで、schema.org に関するコメントや提案をpublic-vocabs@w3.orgに書くことができます。

于 2013-06-24T19:11:24.730 に答える