如何使用结构化数据(微数据)标记源代码

How to mark-up source code with Structured Data (micro-data)

我正在尝试使用 http://schema.org/Code 在博客上标记源代码。标记源代码的正确方法是什么?

我正在使用 Google 工具对其进行测试:http://www.google.com/webmasters/tools/richsnippets

<div itemscope itemtype="http://schema.org/Code" >
  some code
</div>

我认为类似的方法可能会奏效。但是什么都没有注册。
我看到它继承自 creativeWork,所以也许我应该使用其中一个属性来包含源代码内容,但我不确定。例如:

<div itemscope itemtype="http://schema.org/Code" >
  <meta itemprop="programmingLanguage" content="Java" />
  <span itemprop="exampleOfWork">import java.util.*;</span>
</div>

但是代码没有注册。它说 "exampleofwork is not part of the schema" 即使它应该被继承...

有人知道 correct/preferred 方法吗?

我认为 text property 应该用于实际代码:

The textual content of this CreativeWork.

一个最小的例子:

<div itemscope itemtype="http://schema.org/Code">
  <pre>
    <code itemprop="text">
      import java.util.*;
    </code>
  </pre>
</div>