title: Parsing HTML+RDFa in RDFLib
body: <p>RDFLib seems to <a href="https://rdflib.readthedocs.io/en/stable/" rel="nofollow noreferrer">support</a> parsing RDFa data. Upon implementing a snippet to parse an RDFa-annotated HTML page, I run into this problem:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/home/zonk/.local/lib/python3.8/site-packages/rdflib/plugin.py&quot;, line 107, in get
      p = _plugins[(name, kind)]
  KeyError: ('html', &lt;class 'rdflib.parser.Parser'&gt;)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;basic-rdfa.py&quot;, line 7, in &lt;module&gt;
      g.parse(&quot;beatles.rdfa.html&quot;, format='html') 
    File &quot;/home/zonk/.local/lib/python3.8/site-packages/rdflib/graph.py&quot;, line 1209, in parse
      parser = plugin.get(format, Parser)()
    File &quot;/home/zonk/.local/lib/python3.8/site-packages/rdflib/plugin.py&quot;, line 109, in get
      raise PluginException(&quot;No plugin registered for (%s, %s)&quot; % (name, kind))
  rdflib.plugin.PluginException: No plugin registered for (html, &lt;class 'rdflib.parser.Parser'&gt;)
  </code></pre>
  <p>The following snippet is used:</p>
  <pre><code>from rdflib import Graph, plugin
  g = Graph()
  g.parse(&quot;beatles.rdfa.html&quot;, format='html') 
  
  for subj, pred, obj in g:
      if(subj, pred, obj) not in g:
          raise Exception(&quot;Zonk!&quot;)
  
  print(f&quot;Graph g has {len(g)} statements.&quot;)
  print(g.serialize(format=&quot;turtle&quot;))
  </code></pre>
  <p>with the following dummy data:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;title&gt;John Lennon&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;div vocab="http://schema.org/"&gt;
    &lt;div typeof="Person"&gt;
      &lt;link property="rdfa:copy" href="#lennon"/&gt;
      &lt;link property="rdfa:copy" href="#band"/&gt;
    &lt;/div&gt;
    &lt;p resource="#lennon" typeof="rdfa:Pattern"&gt; 
      Name: &lt;span property="name"&gt;John Lennon&lt;/span&gt;
    &lt;p&gt;
    &lt;div resource="#band" typeof="rdfa:Pattern"&gt;
      &lt;div property="band" typeof="MusicGroup"&gt;
        &lt;link property="rdfa:copy" href="#beatles"/&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div resource="#beatles" typeof="rdfa:Pattern"&gt;
      &lt;p&gt;Band: &lt;span property="name"&gt;The Beatles&lt;/span&gt;&lt;/p&gt;
      &lt;p&gt;Size: &lt;span property="size"&gt;4&lt;/span&gt; players&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Indeed there is no line in <code>plugin.py</code> that registers any HTML data. How can I parse the rdfa-annotated data in this case?</p>
  <p>Thank you in advance.</p>