1

我正在尝试使用微数据向谷歌清楚地解释我们的小电影俱乐部。我在 schema.org 上反复研究并建立了我需要的三个主要类:Movie、MovieTheater 和 Event。

然而,我似乎需要布置代码的方式是违反直觉的。

在我看来,PLACE(电影院)会举办一个他们将放映电影的活动,这似乎是合乎逻辑的。

但这似乎是不可能的,因为没有办法将 MOVIE 放在 EVENT 中。

似乎我可以将这些东西列为单个实体的唯一方法是将 MOVIE 放在最外面,其中包含一个在 MOVIETHEATER 发生的事件。但是,如果我想列出多个 MOVIE,我将不得不重复 MOVIE 对象下的所有 MOVIETHEATER 数据,从而导致大量不必要的 HTML。

那么,我是读错了还是错过了什么?或者这是唯一的方法吗?

4

1 回答 1

1

看来你是对的。使用微数据的 itemref以免重复 MovieTheater 描述。就像在例子中

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>

顺便说一句,您可以在public-vocabs@w3.org写您对 schema.org 的评论和建议

于 2013-06-24T19:11:24.730 回答