This file is indexed.

/usr/share/doc/python-rdflib-doc/html/apidocs/rdflib.plugins.parsers.pyMicrodata.html is in python-rdflib-doc 4.1.2-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    

    <title>pyMicrodata Package &mdash; rdflib 4.1.2 documentation</title>

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>


    
    <link rel="stylesheet" href="../_static/rtd.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '4.1.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../../_static/searchtools.js"></script>
    <link rel="top" title="rdflib 4.1.2 documentation" href="../index.html" />
    <link rel="up" title="parsers Package" href="rdflib.plugins.parsers.html" />
    <link rel="next" title="pyRdfa Package" href="rdflib.plugins.parsers.pyRdfa.html" />
    <link rel="prev" title="parsers Package" href="rdflib.plugins.parsers.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="rdflib.plugins.parsers.pyRdfa.html" title="pyRdfa Package"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="rdflib.plugins.parsers.html" title="parsers Package"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">rdflib 4.1.2 documentation</a> &raquo;</li>
          <li><a href="modules.html" >rdflib API docs</a> &raquo;</li>
          <li><a href="rdflib.html" >rdflib Package</a> &raquo;</li>
          <li><a href="rdflib.plugins.html" >plugins Package</a> &raquo;</li>
          <li><a href="rdflib.plugins.parsers.html" accesskey="U">parsers Package</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="pymicrodata-package">
<h1>pyMicrodata Package<a class="headerlink" href="#pymicrodata-package" title="Permalink to this headline"></a></h1>
<div class="section" id="id1">
<h2><tt class="xref py py-mod docutils literal"><span class="pre">pyMicrodata</span></tt> Package<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h2>
<span class="target" id="module-rdflib.plugins.parsers.pyMicrodata"></span><p>This module implements the microdata-&gt;RDF algorithm, as documented by the U{W3C Semantic Web Interest Group
Note&lt;<a class="reference external" href="http://www.w3.org/TR/2012/NOTE-microdata-rdf-20120308/">http://www.w3.org/TR/2012/NOTE-microdata-rdf-20120308/</a>&gt;}.</p>
<p>The module can be used via a stand-alone script (an example is part of the distribution) or bound to a CGI script as a Web Service. An example CGI script is also added to the distribution. Both the local script and the distribution may have to be adapted to local circumstances.</p>
<div class="section" id="simple-usage">
<h3>(Simple) Usage<a class="headerlink" href="#simple-usage" title="Permalink to this headline"></a></h3>
<dl class="docutils">
<dt>From a Python file, expecting a Turtle output::</dt>
<dd>from pyMicrodata import pyMicrodata
print pyMicrodata().rdf_from_source(&#8216;filename&#8217;)</dd>
<dt>Other output formats are also possible. E.g., to produce RDF/XML output, one could use::</dt>
<dd>from pyMicrodata import pyMicrodata
print pyMicrodata().rdf_from_source(&#8216;filename&#8217;, outputFormat=&#8217;pretty-xml&#8217;)</dd>
<dt>It is also possible to embed an RDFa processing. Eg, using::</dt>
<dd>from pyMicrodata import pyMicrodata
graph = pyMicrodata().graph_from_source(&#8216;filename&#8217;)</dd>
</dl>
<p>returns an RDFLib.Graph object instead of a serialization thereof. See the the description of the
L{pyMicrodata class&lt;pyMicrodata.pyMicrodata&gt;} for further possible entry points details.</p>
<p>There is also, as part of this module, a L{separate entry for CGI calls&lt;processURI&gt;}.</p>
<div class="section" id="return-formats">
<h4>Return formats<a class="headerlink" href="#return-formats" title="Permalink to this headline"></a></h4>
<p>By default, the output format for the graph is RDF/XML. At present, the following formats are also available (with the corresponding key to be used in the package entry points):</p>
<blockquote>
<div><ul class="simple">
<li>&#8220;xml&#8221;: U{RDF/XML&lt;<a class="reference external" href="http://www.w3.org/TR/rdf-syntax-grammar/">http://www.w3.org/TR/rdf-syntax-grammar/</a>&gt;}</li>
<li>&#8220;turtle&#8221;: U{Turtle&lt;<a class="reference external" href="http://www.w3.org/TR/turtle/">http://www.w3.org/TR/turtle/</a>&gt;} (default)</li>
<li>&#8220;nt&#8221;: U{N-triple&lt;<a class="reference external" href="http://www.w3.org/TR/rdf-testcases/#ntriples">http://www.w3.org/TR/rdf-testcases/#ntriples</a>&gt;}</li>
<li>&#8220;json&#8221;: U{JSON-LD&lt;<a class="reference external" href="http://json-ld.org/spec/latest/json-ld-syntax/">http://json-ld.org/spec/latest/json-ld-syntax/</a>&gt;}</li>
</ul>
</div></blockquote>
<p>&#64;summary: Microdata parser (distiller)
&#64;requires: Python version 2.5 or up
&#64;requires: U{RDFLib&lt;<a class="reference external" href="http://rdflib.net">http://rdflib.net</a>&gt;}
&#64;requires: U{html5lib&lt;<a class="reference external" href="http://code.google.com/p/html5lib/">http://code.google.com/p/html5lib/</a>&gt;} for the HTML5 parsing; note possible dependecies on Python&#8217;s version on the project&#8217;s web site
&#64;organization: U{World Wide Web Consortium&lt;<a class="reference external" href="http://www.w3.org">http://www.w3.org</a>&gt;}
&#64;author: U{Ivan Herman&lt;<a class="reference external" href="http://www.w3.org/People/Ivan/">http://www.w3.org/People/Ivan/</a>&gt;}
&#64;license: This software is available for use under the
U{W3C® SOFTWARE NOTICE AND LICENSE&lt;href=&#8221;<a class="reference external" href="http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231">http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231</a>&#8220;&gt;}
&#64;copyright: W3C</p>
<dl class="exception">
<dt id="rdflib.plugins.parsers.pyMicrodata.HTTPError">
<em class="property">exception </em><tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.</tt><tt class="descname">HTTPError</tt><big>(</big><em>http_msg</em>, <em>http_code</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata.html#HTTPError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.HTTPError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#rdflib.plugins.parsers.pyMicrodata.MicrodataError" title="rdflib.plugins.parsers.pyMicrodata.MicrodataError"><tt class="xref py py-class docutils literal"><span class="pre">rdflib.plugins.parsers.pyMicrodata.MicrodataError</span></tt></a></p>
<p>Raised when HTTP problems are detected. It does not add any new functionality to the
Exception class.</p>
<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.HTTPError.__init__">
<tt class="descname">__init__</tt><big>(</big><em>http_msg</em>, <em>http_code</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata.html#HTTPError.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.HTTPError.__init__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyMicrodata.HTTPError.__module__">
<tt class="descname">__module__</tt><em class="property"> = 'rdflib.plugins.parsers.pyMicrodata'</em><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.HTTPError.__module__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="exception">
<dt id="rdflib.plugins.parsers.pyMicrodata.MicrodataError">
<em class="property">exception </em><tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.</tt><tt class="descname">MicrodataError</tt><big>(</big><em>msg</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata.html#MicrodataError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.MicrodataError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></p>
<p>Superclass exceptions representing error conditions defined by the RDFa 1.1 specification.
It does not add any new functionality to the
Exception class.</p>
<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.MicrodataError.__init__">
<tt class="descname">__init__</tt><big>(</big><em>msg</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata.html#MicrodataError.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.MicrodataError.__init__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyMicrodata.MicrodataError.__module__">
<tt class="descname">__module__</tt><em class="property"> = 'rdflib.plugins.parsers.pyMicrodata'</em><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.MicrodataError.__module__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyMicrodata.MicrodataError.__weakref__">
<tt class="descname">__weakref__</tt><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.MicrodataError.__weakref__" title="Permalink to this definition"></a></dt>
<dd><p>list of weak references to the object (if defined)</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyMicrodata.processURI">
<tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.</tt><tt class="descname">processURI</tt><big>(</big><em>uri</em>, <em>outputFormat</em>, <em>form</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata.html#processURI"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.processURI" title="Permalink to this definition"></a></dt>
<dd><p>The standard processing of a microdata uri options in a form, ie, as an entry point from a CGI call.</p>
<p>The call accepts extra form options (eg, HTTP GET options) as follows:</p>
<p>&#64;param uri: URI to access. Note that the &#8220;text:&#8221; and &#8220;uploaded:&#8221; values are treated separately; the former is for textual intput (in which case a StringIO is used to get the data) and the latter is for uploaded file, where the form gives access to the file directly.
&#64;param outputFormat: serialization formats, as understood by RDFLib. Note that though &#8220;turtle&#8221; is
a possible parameter value, some versions of the RDFLib turtle generation does funny (though legal) things with
namespaces, defining unusual and unwanted prefixes...
&#64;param form: extra call options (from the CGI call) to set up the local options (if any)
&#64;type form: cgi FieldStorage instance
&#64;return: serialized graph
&#64;rtype: string</p>
</dd></dl>

<dl class="class">
<dt id="rdflib.plugins.parsers.pyMicrodata.pyMicrodata">
<em class="property">class </em><tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.</tt><tt class="descname">pyMicrodata</tt><big>(</big><em>base=''</em>, <em>vocab_expansion=False</em>, <em>vocab_cache=True</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata.html#pyMicrodata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.pyMicrodata" title="Permalink to this definition"></a></dt>
<dd><p>Main processing class for the distiller
&#64;ivar base: the base value for processing
&#64;ivar http_status: HTTP Status, to be returned when the package is used via a CGI entry. Initially set to 200, may be modified by exception handlers</p>
<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.pyMicrodata.__init__">
<tt class="descname">__init__</tt><big>(</big><em>base=''</em>, <em>vocab_expansion=False</em>, <em>vocab_cache=True</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata.html#pyMicrodata.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.pyMicrodata.__init__" title="Permalink to this definition"></a></dt>
<dd><p>&#64;keyword base: URI for the default &#8220;base&#8221; value (usually the URI of the file to be processed)
&#64;keyword vocab_expansion: whether vocab expansion should be performed or not
&#64;type vocab_expansion: Boolean
&#64;keyword vocab_cache: if vocabulary expansion is done, then perform caching of the vocabulary data
&#64;type vocab_cache: Boolean</p>
</dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyMicrodata.pyMicrodata.__module__">
<tt class="descname">__module__</tt><em class="property"> = 'rdflib.plugins.parsers.pyMicrodata'</em><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.pyMicrodata.__module__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.pyMicrodata.graph_from_DOM">
<tt class="descname">graph_from_DOM</tt><big>(</big><em>dom</em>, <em>graph=None</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata.html#pyMicrodata.graph_from_DOM"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.pyMicrodata.graph_from_DOM" title="Permalink to this definition"></a></dt>
<dd><p>Extract the RDF Graph from a DOM tree.
&#64;param dom: a DOM Node element, the top level entry node for the whole tree (to make it clear, a
dom.documentElement is used to initiate processing)
&#64;keyword graph: an RDF Graph (if None, than a new one is created)
&#64;type graph: rdflib Graph instance. If None, a new one is created.
&#64;return: an RDF Graph
&#64;rtype: rdflib Graph instance</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.pyMicrodata.graph_from_source">
<tt class="descname">graph_from_source</tt><big>(</big><em>name</em>, <em>graph=None</em>, <em>rdfOutput=False</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata.html#pyMicrodata.graph_from_source"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.pyMicrodata.graph_from_source" title="Permalink to this definition"></a></dt>
<dd><p>Extract an RDF graph from an microdata source. The source is parsed, the RDF extracted, and the RDF Graph is
returned. This is a front-end to the L{pyMicrodata.graph_from_DOM} method.</p>
<p>&#64;param name: a URI, a file name, or a file-like object
&#64;return: an RDF Graph
&#64;rtype: rdflib Graph instance</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.pyMicrodata.rdf_from_source">
<tt class="descname">rdf_from_source</tt><big>(</big><em>name</em>, <em>outputFormat='pretty-xml'</em>, <em>rdfOutput=False</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata.html#pyMicrodata.rdf_from_source"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.pyMicrodata.rdf_from_source" title="Permalink to this definition"></a></dt>
<dd><p>Extract and RDF graph from an RDFa source and serialize it in one graph. The source is parsed, the RDF
extracted, and serialization is done in the specified format.
&#64;param name: a URI, a file name, or a file-like object
&#64;keyword outputFormat: serialization format. Can be one of &#8220;turtle&#8221;, &#8220;n3&#8221;, &#8220;xml&#8221;, &#8220;pretty-xml&#8221;, &#8220;nt&#8221;. &#8220;xml&#8221; and &#8220;pretty-xml&#8221;, as well as &#8220;turtle&#8221; and &#8220;n3&#8221; are synonyms.
&#64;return: a serialized RDF Graph
&#64;rtype: string</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.pyMicrodata.rdf_from_sources">
<tt class="descname">rdf_from_sources</tt><big>(</big><em>names</em>, <em>outputFormat='pretty-xml'</em>, <em>rdfOutput=False</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata.html#pyMicrodata.rdf_from_sources"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.pyMicrodata.rdf_from_sources" title="Permalink to this definition"></a></dt>
<dd><p>Extract and RDF graph from a list of RDFa sources and serialize them in one graph. The sources are parsed, the RDF
extracted, and serialization is done in the specified format.
&#64;param names: list of sources, each can be a URI, a file name, or a file-like object
&#64;keyword outputFormat: serialization format. Can be one of &#8220;turtle&#8221;, &#8220;n3&#8221;, &#8220;xml&#8221;, &#8220;pretty-xml&#8221;, &#8220;nt&#8221;. &#8220;xml&#8221; and &#8220;pretty-xml&#8221;, as well as &#8220;turtle&#8221; and &#8220;n3&#8221; are synonyms.
&#64;return: a serialized RDF Graph
&#64;rtype: string</p>
</dd></dl>

</dd></dl>

</div>
</div>
</div>
<div class="section" id="module-rdflib.plugins.parsers.pyMicrodata.microdata">
<span id="microdata-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">microdata</span></tt> Module<a class="headerlink" href="#module-rdflib.plugins.parsers.pyMicrodata.microdata" title="Permalink to this headline"></a></h2>
<p>The core of the Microdata-&gt;RDF conversion, a more or less verbatim implementation of the
U{W3C IG Note&lt;<a class="reference external" href="http://www.w3.org/TR/microdata-rdf/">http://www.w3.org/TR/microdata-rdf/</a>&gt;}. Because the implementation was also used to check
the note itself, it tries to be fairly close to the text.</p>
<p>&#64;organization: U{World Wide Web Consortium&lt;<a class="reference external" href="http://www.w3.org">http://www.w3.org</a>&gt;}
&#64;author: U{Ivan Herman&lt;a href=&#8221;<a class="reference external" href="http://www.w3.org/People/Ivan/">http://www.w3.org/People/Ivan/</a>&#8220;&gt;}
&#64;license: This software is available for use under the
U{W3C® SOFTWARE NOTICE AND LICENSE&lt;href=&#8221;<a class="reference external" href="http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231">http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231</a>&#8220;&gt;}</p>
<dl class="class">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.Evaluation_Context">
<em class="property">class </em><tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.microdata.</tt><tt class="descname">Evaluation_Context</tt><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#Evaluation_Context"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.Evaluation_Context" title="Permalink to this definition"></a></dt>
<dd><p>Evaluation context structure. See Section 4.1 of the U{W3C IG Note&lt;<a class="reference external" href="http://www.w3.org/TR/microdata-rdf/">http://www.w3.org/TR/microdata-rdf/</a>&gt;}for the details.</p>
<p>&#64;ivar current_type : an absolute URL for the current type, used when an item does not contain an item type
&#64;ivar memory: mapping from items to RDF subjects
&#64;type memory: dictionary
&#64;ivar current_name: an absolute URL for the in-scope name, used for generating URIs for properties of items without an item type
&#64;ivar current_vocabulary: an absolute URL for the current vocabulary, from the registry</p>
<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.Evaluation_Context.__init__">
<tt class="descname">__init__</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#Evaluation_Context.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.Evaluation_Context.__init__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.Evaluation_Context.__module__">
<tt class="descname">__module__</tt><em class="property"> = 'rdflib.plugins.parsers.pyMicrodata.microdata'</em><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.Evaluation_Context.__module__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.Evaluation_Context.__str__">
<tt class="descname">__str__</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#Evaluation_Context.__str__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.Evaluation_Context.__str__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.Evaluation_Context.get_memory">
<tt class="descname">get_memory</tt><big>(</big><em>item</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#Evaluation_Context.get_memory"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.Evaluation_Context.get_memory" title="Permalink to this definition"></a></dt>
<dd><p>Get the memory content (ie, RDF subject) for &#8216;item&#8217;, or None if not stored yet
&#64;param item: an &#8216;item&#8217;, in microdata terminology
&#64;type item: DOM Element Node
&#64;return: None, or an RDF Subject (URIRef or BNode)</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.Evaluation_Context.new_copy">
<tt class="descname">new_copy</tt><big>(</big><em>itype</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#Evaluation_Context.new_copy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.Evaluation_Context.new_copy" title="Permalink to this definition"></a></dt>
<dd><p>During the generation algorithm a new copy of the current context has to be done with a new current type.</p>
<p>At the moment, the content of memory is copied, ie, a fresh dictionary is created and the content copied over.
Not clear whether that is necessary, though, maybe a simple reference is enough...
&#64;param itype : an absolute URL for the current type
&#64;return: a new evaluation context instance</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.Evaluation_Context.set_memory">
<tt class="descname">set_memory</tt><big>(</big><em>item</em>, <em>subject</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#Evaluation_Context.set_memory"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.Evaluation_Context.set_memory" title="Permalink to this definition"></a></dt>
<dd><p>Set the memory content, ie, the subject, for &#8216;item&#8217;.
&#64;param item: an &#8216;item&#8217;, in microdata terminology
&#64;type item: DOM Element Node
&#64;param subject: RDF Subject
&#64;type subject: URIRef or Blank Node</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.Microdata">
<em class="property">class </em><tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.microdata.</tt><tt class="descname">Microdata</tt><big>(</big><em>document</em>, <em>base=None</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#Microdata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.Microdata" title="Permalink to this definition"></a></dt>
<dd><p>This class encapsulates methods that are defined by the U{microdata spec&lt;<a class="reference external" href="http://dev.w3.org/html5/md/Overview.html">http://dev.w3.org/html5/md/Overview.html</a>&gt;},
as opposed to the RDF conversion note.</p>
<p>&#64;ivar document: top of the DOM tree, as returned by the HTML5 parser
&#64;ivar base: the base URI of the Dom tree, either set from the outside or via a &#64;base element</p>
<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.Microdata.__init__">
<tt class="descname">__init__</tt><big>(</big><em>document</em>, <em>base=None</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#Microdata.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.Microdata.__init__" title="Permalink to this definition"></a></dt>
<dd><p>&#64;param document: top of the DOM tree, as returned by the HTML5 parser
&#64;param base: the base URI of the Dom tree, either set from the outside or via a &#64;base element</p>
</dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.Microdata.__module__">
<tt class="descname">__module__</tt><em class="property"> = 'rdflib.plugins.parsers.pyMicrodata.microdata'</em><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.Microdata.__module__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.Microdata.getElementById">
<tt class="descname">getElementById</tt><big>(</big><em>id</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#Microdata.getElementById"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.Microdata.getElementById" title="Permalink to this definition"></a></dt>
<dd><p>This is a method defined for DOM 2 HTML, but the HTML5 parser does not seem to define it. Oh well...
&#64;param id: value of an &#64;id attribute to look for
&#64;return: array of nodes whose &#64;id attribute matches C{id} (formally, there should be only one...)</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.Microdata.get_item_properties">
<tt class="descname">get_item_properties</tt><big>(</big><em>item</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#Microdata.get_item_properties"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.Microdata.get_item_properties" title="Permalink to this definition"></a></dt>
<dd><p>Collect the item&#8217;s properties, ie, all DOM descendent nodes with &#64;itemprop until the subtree hits another
&#64;itemscope. &#64;itemrefs are also added at this point.</p>
<p>&#64;param item: current item
&#64;type item: DOM Node
&#64;return: array of items, ie, DOM Nodes</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.Microdata.get_top_level_items">
<tt class="descname">get_top_level_items</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#Microdata.get_top_level_items"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.Microdata.get_top_level_items" title="Permalink to this definition"></a></dt>
<dd><p>A top level item is and element that has the &#64;itemscope set, but no &#64;itemtype. They have to
be collected in pre-order and depth-first fashion.</p>
<p>&#64;return: list of items (ie, DOM Nodes)</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion">
<em class="property">class </em><tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.microdata.</tt><tt class="descname">MicrodataConversion</tt><big>(</big><em>document</em>, <em>graph</em>, <em>base=None</em>, <em>vocab_expansion=False</em>, <em>vocab_cache=True</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#MicrodataConversion"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#rdflib.plugins.parsers.pyMicrodata.microdata.Microdata" title="rdflib.plugins.parsers.pyMicrodata.microdata.Microdata"><tt class="xref py py-class docutils literal"><span class="pre">rdflib.plugins.parsers.pyMicrodata.microdata.Microdata</span></tt></a></p>
<p>Top level class encapsulating the conversion algorithms as described in the W3C note.</p>
<p>&#64;ivar graph: an RDF graph; an RDFLib Graph
&#64;type graph: RDFLib Graph
&#64;ivar document: top of the DOM tree, as returned by the HTML5 parser
&#64;ivar ns_md: the Namespace for the microdata vocabulary
&#64;ivar base: the base of the Dom tree, either set from the outside or via a &#64;base element</p>
<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion.__init__">
<tt class="descname">__init__</tt><big>(</big><em>document</em>, <em>graph</em>, <em>base=None</em>, <em>vocab_expansion=False</em>, <em>vocab_cache=True</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#MicrodataConversion.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion.__init__" title="Permalink to this definition"></a></dt>
<dd><p>&#64;param graph: an RDF graph; an RDFLib Graph
&#64;type graph: RDFLib Graph
&#64;param document: top of the DOM tree, as returned by the HTML5 parser
&#64;keyword base: the base of the Dom tree, either set from the outside or via a &#64;base element
&#64;keyword vocab_expansion: whether vocab expansion should be performed or not
&#64;type vocab_expansion: Boolean
&#64;keyword vocab_cache: if vocabulary expansion is done, then perform caching of the vocabulary data
&#64;type vocab_cache: Boolean</p>
</dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion.__module__">
<tt class="descname">__module__</tt><em class="property"> = 'rdflib.plugins.parsers.pyMicrodata.microdata'</em><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion.__module__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion.convert">
<tt class="descname">convert</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#MicrodataConversion.convert"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion.convert" title="Permalink to this definition"></a></dt>
<dd><p>Top level entry to convert and generate all the triples. It finds the top level items,
and generates triples for each of them; additionally, it generates a top level entry point
to the items from base in the form of an RDF list.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion.generate_predicate_URI">
<tt class="descname">generate_predicate_URI</tt><big>(</big><em>name</em>, <em>context</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#MicrodataConversion.generate_predicate_URI"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion.generate_predicate_URI" title="Permalink to this definition"></a></dt>
<dd><p>Generate a full URI for a predicate, using the type, the vocabulary, etc.</p>
<p>For details of this entry, see Section 4.4
&#64;param name: name of the property, ie, what appears in &#64;itemprop
&#64;param context: an instance of an evaluation context
&#64;type context: L{Evaluation_Context}</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion.generate_property_values">
<tt class="descname">generate_property_values</tt><big>(</big><em>subject</em>, <em>predicate</em>, <em>objects</em>, <em>context</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#MicrodataConversion.generate_property_values"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion.generate_property_values" title="Permalink to this definition"></a></dt>
<dd><p>Generate the property values for for a specific subject and predicate. The context should specify whether
the objects should be added in an RDF list or each triples individually.</p>
<p>&#64;param subject: RDF subject
&#64;type subject: RDFLib Node (URIRef or blank node)
&#64;param predicate: RDF predicate
&#64;type predicate: RDFLib URIRef
&#64;param objects: RDF objects
&#64;type objects: list of RDFLib nodes (URIRefs, Blank Nodes, or literals)
&#64;param context: evaluation context
&#64;type context: L{Evaluation_Context}</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion.generate_triples">
<tt class="descname">generate_triples</tt><big>(</big><em>item</em>, <em>context</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#MicrodataConversion.generate_triples"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion.generate_triples" title="Permalink to this definition"></a></dt>
<dd><p>Generate the triples for a specific item. See the W3C Note for the details.</p>
<p>&#64;param item: the DOM Node for the specific item
&#64;type item: DOM Node
&#64;param context: an instance of an evaluation context
&#64;type context: L{Evaluation_Context}
&#64;return: a URIRef or a BNode for the (RDF) subject</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion.get_property_value">
<tt class="descname">get_property_value</tt><big>(</big><em>node</em>, <em>context</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#MicrodataConversion.get_property_value"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.MicrodataConversion.get_property_value" title="Permalink to this definition"></a></dt>
<dd><p>Generate an RDF object, ie, the value of a property. Note that if this element contains
an &#64;itemscope, then a recursive call to L{MicrodataConversion.generate_triples} is done and the
return value of that method (ie, the subject for the corresponding item) is return as an
object.</p>
<p>Otherwise, either URIRefs are created for &lt;a&gt;, &lt;img&gt;, etc, elements, or a Literal; the latter
gets a time-related type for the &lt;time&gt; element.</p>
<p>&#64;param node: the DOM Node for which the property values should be generated
&#64;type node: DOM Node
&#64;param context: an instance of an evaluation context
&#64;type context: L{Evaluation_Context}
&#64;return: an RDF resource (URIRef, BNode, or Literal)</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.PropertySchemes">
<em class="property">class </em><tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.microdata.</tt><tt class="descname">PropertySchemes</tt><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#PropertySchemes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.PropertySchemes" title="Permalink to this definition"></a></dt>
<dd><dl class="attribute">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.PropertySchemes.__module__">
<tt class="descname">__module__</tt><em class="property"> = 'rdflib.plugins.parsers.pyMicrodata.microdata'</em><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.PropertySchemes.__module__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.PropertySchemes.contextual">
<tt class="descname">contextual</tt><em class="property"> = 'contextual'</em><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.PropertySchemes.contextual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.PropertySchemes.vocabulary">
<tt class="descname">vocabulary</tt><em class="property"> = 'vocabulary'</em><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.PropertySchemes.vocabulary" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.ValueMethod">
<em class="property">class </em><tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.microdata.</tt><tt class="descname">ValueMethod</tt><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/microdata.html#ValueMethod"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.ValueMethod" title="Permalink to this definition"></a></dt>
<dd><dl class="attribute">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.ValueMethod.__module__">
<tt class="descname">__module__</tt><em class="property"> = 'rdflib.plugins.parsers.pyMicrodata.microdata'</em><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.ValueMethod.__module__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.ValueMethod.list">
<tt class="descname">list</tt><em class="property"> = 'list'</em><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.ValueMethod.list" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyMicrodata.microdata.ValueMethod.unordered">
<tt class="descname">unordered</tt><em class="property"> = 'unordered'</em><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.microdata.ValueMethod.unordered" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="module-rdflib.plugins.parsers.pyMicrodata.registry">
<span id="registry-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">registry</span></tt> Module<a class="headerlink" href="#module-rdflib.plugins.parsers.pyMicrodata.registry" title="Permalink to this headline"></a></h2>
<p>Hardcoded version of the current microdata-&gt;RDF registry. There is also a local registry to include some test cases.
Finally, there is a local dictionary for prefix mapping for the registry items; these are the preferred prefixes
for those vocabularies, and are used to make the output nicer.</p>
<p>&#64;organization: U{World Wide Web Consortium&lt;<a class="reference external" href="http://www.w3.org">http://www.w3.org</a>&gt;}
&#64;author: U{Ivan Herman&lt;a href=&#8221;<a class="reference external" href="http://www.w3.org/People/Ivan/">http://www.w3.org/People/Ivan/</a>&#8220;&gt;}
&#64;license: This software is available for use under the
U{W3C® SOFTWARE NOTICE AND LICENSE&lt;href=&#8221;<a class="reference external" href="http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231">http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231</a>&#8220;&gt;}</p>
</div>
<div class="section" id="module-rdflib.plugins.parsers.pyMicrodata.utils">
<span id="utils-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">utils</span></tt> Module<a class="headerlink" href="#module-rdflib.plugins.parsers.pyMicrodata.utils" title="Permalink to this headline"></a></h2>
<p>Various utilities for pyMicrodata</p>
<p>&#64;organization: U{World Wide Web Consortium&lt;<a class="reference external" href="http://www.w3.org">http://www.w3.org</a>&gt;}
&#64;author: U{Ivan Herman&lt;a href=&#8221;<a class="reference external" href="http://www.w3.org/People/Ivan/">http://www.w3.org/People/Ivan/</a>&#8220;&gt;}
&#64;license: This software is available for use under the
U{W3C® SOFTWARE NOTICE AND LICENSE&lt;href=&#8221;<a class="reference external" href="http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231">http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231</a>&#8220;&gt;}</p>
<dl class="class">
<dt id="rdflib.plugins.parsers.pyMicrodata.utils.URIOpener">
<em class="property">class </em><tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.utils.</tt><tt class="descname">URIOpener</tt><big>(</big><em>name</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/utils.html#URIOpener"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.utils.URIOpener" title="Permalink to this definition"></a></dt>
<dd><p>A wrapper around the urllib2 method to open a resource. Beyond accessing the data itself, the class
sets the content location.
The class also adds an accept header to the outgoing request, namely
text/html and application/xhtml+xml (unless set explicitly by the caller).</p>
<p>&#64;ivar data: the real data, ie, a file-like object
&#64;ivar headers: the return headers as sent back by the server
&#64;ivar location: the real location of the data (ie, after possible redirection and content negotiation)</p>
<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyMicrodata.utils.URIOpener.CONTENT_LOCATION">
<tt class="descname">CONTENT_LOCATION</tt><em class="property"> = 'Content-Location'</em><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.utils.URIOpener.CONTENT_LOCATION" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyMicrodata.utils.URIOpener.__init__">
<tt class="descname">__init__</tt><big>(</big><em>name</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/utils.html#URIOpener.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.utils.URIOpener.__init__" title="Permalink to this definition"></a></dt>
<dd><p>&#64;param name: URL to be opened
&#64;keyword additional_headers: additional HTTP request headers to be added to the call</p>
</dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyMicrodata.utils.URIOpener.__module__">
<tt class="descname">__module__</tt><em class="property"> = 'rdflib.plugins.parsers.pyMicrodata.utils'</em><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.utils.URIOpener.__module__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyMicrodata.utils.fragment_escape">
<tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.utils.</tt><tt class="descname">fragment_escape</tt><big>(</big><em>name</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/utils.html#fragment_escape"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.utils.fragment_escape" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyMicrodata.utils.generate_RDF_collection">
<tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.utils.</tt><tt class="descname">generate_RDF_collection</tt><big>(</big><em>graph</em>, <em>vals</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/utils.html#generate_RDF_collection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.utils.generate_RDF_collection" title="Permalink to this definition"></a></dt>
<dd><p>Generate an RDF List from vals, returns the head of the list
&#64;param graph: RDF graph
&#64;type graph: RDFLib Graph
&#64;param vals: array of RDF Resources
&#64;return: head of the List (an RDF Resource)</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyMicrodata.utils.generate_URI">
<tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.utils.</tt><tt class="descname">generate_URI</tt><big>(</big><em>base</em>, <em>v</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/utils.html#generate_URI"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.utils.generate_URI" title="Permalink to this definition"></a></dt>
<dd><p>Generate an (absolute) URI; if val is a fragment, then using it with base,
otherwise just return the value
&#64;param base: Absolute URI for base
&#64;param v: relative or absolute URI</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyMicrodata.utils.get_Literal">
<tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.utils.</tt><tt class="descname">get_Literal</tt><big>(</big><em>Pnode</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/utils.html#get_Literal"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.utils.get_Literal" title="Permalink to this definition"></a></dt>
<dd><p>Get (recursively) the full text from a DOM Node.</p>
<p>&#64;param Pnode: DOM Node
&#64;return: string</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyMicrodata.utils.get_lang">
<tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.utils.</tt><tt class="descname">get_lang</tt><big>(</big><em>node</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/utils.html#get_lang"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.utils.get_lang" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyMicrodata.utils.get_lang_from_hierarchy">
<tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.utils.</tt><tt class="descname">get_lang_from_hierarchy</tt><big>(</big><em>document</em>, <em>node</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/utils.html#get_lang_from_hierarchy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.utils.get_lang_from_hierarchy" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyMicrodata.utils.get_time_type">
<tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.utils.</tt><tt class="descname">get_time_type</tt><big>(</big><em>string</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/utils.html#get_time_type"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.utils.get_time_type" title="Permalink to this definition"></a></dt>
<dd><p>Check whether the string abides to one of the accepted time related datatypes, and returns that one if yes
&#64;param string: the attribute value to be checked
&#64;return : a datatype URI or None</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyMicrodata.utils.is_absolute_URI">
<tt class="descclassname">rdflib.plugins.parsers.pyMicrodata.utils.</tt><tt class="descname">is_absolute_URI</tt><big>(</big><em>uri</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyMicrodata/utils.html#is_absolute_URI"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyMicrodata.utils.is_absolute_URI" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../index.html">
              <img class="logo" src="../_static/logo.svg" alt="Logo"/>
            </a></p>
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">pyMicrodata Package</a><ul>
<li><a class="reference internal" href="#id1"><tt class="docutils literal"><span class="pre">pyMicrodata</span></tt> Package</a><ul>
<li><a class="reference internal" href="#simple-usage">(Simple) Usage</a><ul>
<li><a class="reference internal" href="#return-formats">Return formats</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#module-rdflib.plugins.parsers.pyMicrodata.microdata"><tt class="docutils literal"><span class="pre">microdata</span></tt> Module</a></li>
<li><a class="reference internal" href="#module-rdflib.plugins.parsers.pyMicrodata.registry"><tt class="docutils literal"><span class="pre">registry</span></tt> Module</a></li>
<li><a class="reference internal" href="#module-rdflib.plugins.parsers.pyMicrodata.utils"><tt class="docutils literal"><span class="pre">utils</span></tt> Module</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="rdflib.plugins.parsers.html"
                        title="previous chapter">parsers Package</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="rdflib.plugins.parsers.pyRdfa.html"
                        title="next chapter">pyRdfa Package</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/apidocs/rdflib.plugins.parsers.pyMicrodata.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="rdflib.plugins.parsers.pyRdfa.html" title="pyRdfa Package"
             >next</a> |</li>
        <li class="right" >
          <a href="rdflib.plugins.parsers.html" title="parsers Package"
             >previous</a> |</li>
        <li><a href="../index.html">rdflib 4.1.2 documentation</a> &raquo;</li>
          <li><a href="modules.html" >rdflib API docs</a> &raquo;</li>
          <li><a href="rdflib.html" >rdflib Package</a> &raquo;</li>
          <li><a href="rdflib.plugins.html" >plugins Package</a> &raquo;</li>
          <li><a href="rdflib.plugins.parsers.html" >parsers Package</a> &raquo;</li> 
      </ul>
    </div>
<div class="footer">
    &copy; Copyright 2009 - 2013, RDFLib Team.
  Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.2.2.
  <br />Theme based on <a href="http://readthedocs.org/">Read The Docs</a>

</div>





  </body>
</html>