title: How to mark-up source code with Structured Data (micro-data)
body: <p>I'm trying to use <a href="http://schema.org/Code" rel="nofollow">http://schema.org/Code</a> to markup source code on a blog.  What is the correct way to markup source code?</p>
  
  <p>I'm using the Google tool to test it: <a href="http://www.google.com/webmasters/tools/richsnippets" rel="nofollow">http://www.google.com/webmasters/tools/richsnippets</a></p>
  
  <pre><code>&lt;div itemscope itemtype="http://schema.org/Code" &gt;
    some code
  &lt;/div&gt;
  </code></pre>
  
  <p>I thought something like that might work.  But nothing is registered.<br>
  I see that it inherits from creativeWork, so maybe I should be using one of those properties to contain the source code content instead, but I'm not sure. eg:  </p>
  
  <pre><code>&lt;div itemscope itemtype="http://schema.org/Code" &gt;
    &lt;meta itemprop="programmingLanguage" content="Java" /&gt;
    &lt;span itemprop="exampleOfWork"&gt;import java.util.*;&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>But the code is not registered. And it says "exampleofwork is not part of the schema" even though it should be inherited...</p>
  
  <p>Does anybody know the correct/preferred approach?</p>