This file is indexed.

/usr/share/doc/python-rdflib-doc/html/apidocs/rdflib.plugins.parsers.pyRdfa.extras.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
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
<!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>extras 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="pyRdfa Package" href="rdflib.plugins.parsers.pyRdfa.html" />
    <link rel="next" title="host Package" href="rdflib.plugins.parsers.pyRdfa.host.html" />
    <link rel="prev" title="pyRdfa Package" href="rdflib.plugins.parsers.pyRdfa.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.host.html" title="host Package"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="rdflib.plugins.parsers.pyRdfa.html" title="pyRdfa 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" >parsers Package</a> &raquo;</li>
          <li><a href="rdflib.plugins.parsers.pyRdfa.html" accesskey="U">pyRdfa Package</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="extras-package">
<h1>extras Package<a class="headerlink" href="#extras-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">extras</span></tt> Package<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h2>
<span class="target" id="module-rdflib.plugins.parsers.pyRdfa.extras"></span><p>Collection of external modules that are used by pyRdfa and are added for an easier 
distribution</p>
</div>
<div class="section" id="module-rdflib.plugins.parsers.pyRdfa.extras.httpheader">
<span id="httpheader-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">httpheader</span></tt> Module<a class="headerlink" href="#module-rdflib.plugins.parsers.pyRdfa.extras.httpheader" title="Permalink to this headline"></a></h2>
<p>Utility functions to work with HTTP headers.</p>
<p>This module provides some utility functions useful for parsing
and dealing with some of the HTTP 1.1 protocol headers which
are not adequately covered by the standard Python libraries.</p>
<p>Requires Python 2.2 or later.</p>
<p>The functionality includes the correct interpretation of the various
Accept-* style headers, content negotiation, byte range requests,
HTTP-style date/times, and more.</p>
<p>There are a few classes defined by this module:</p>
<blockquote>
<div><ul class="simple">
<li>class content_type   &#8211; media types such as &#8216;text/plain&#8217;</li>
<li>class language_tag   &#8211; language tags such as &#8216;en-US&#8217;</li>
<li>class range_set      &#8211; a collection of (byte) range specifiers</li>
<li>class range_spec     &#8211; a single (byte) range specifier</li>
</ul>
</div></blockquote>
<p>The primary functions in this module may be categorized as follows:</p>
<blockquote>
<div><ul class="simple">
<li>Content negotiation functions...
* acceptable_content_type()
* acceptable_language()
* acceptable_charset()
* acceptable_encoding()</li>
<li>Mid-level header parsing functions...
* parse_accept_header()
* parse_accept_language_header()
* parse_range_header()</li>
<li>Date and time...
* http_datetime()
* parse_http_datetime()</li>
<li>Utility functions...
* quote_string()
* remove_comments()
* canonical_charset()</li>
<li>Low level string parsing functions...
* parse_comma_list()
* parse_comment()
* parse_qvalue_accept_list()
* parse_media_type()
* parse_number()
* parse_parameter_list()
* parse_quoted_string()
* parse_range_set()
* parse_range_spec()
* parse_token()
* parse_token_or_quoted_string()</li>
</ul>
</div></blockquote>
<p>And there are some specialized exception classes:</p>
<blockquote>
<div><ul class="simple">
<li>RangeUnsatisfiableError</li>
<li>RangeUnmergableError</li>
<li>ParseError</li>
</ul>
</div></blockquote>
<p>See also:</p>
<blockquote>
<div><blockquote>
<div><ul>
<li><dl class="first docutils">
<dt>RFC 2616, &#8220;Hypertext Transfer Protocol &#8211; HTTP/1.1&#8221;, June 1999.</dt>
<dd><p class="first last">&lt;<a class="reference external" href="http://www.ietf.org/rfc/rfc2616.txt">http://www.ietf.org/rfc/rfc2616.txt</a>&gt;
Errata at &lt;<a class="reference external" href="http://purl.org/NET/http-errata">http://purl.org/NET/http-errata</a>&gt;</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>RFC 2046, &#8220;(MIME) Part Two: Media Types&#8221;, November 1996.</dt>
<dd><p class="first last">&lt;<a class="reference external" href="http://www.ietf.org/rfc/rfc2046.txt">http://www.ietf.org/rfc/rfc2046.txt</a>&gt;</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>RFC 3066, &#8220;Tags for the Identification of Languages&#8221;, January 2001.</dt>
<dd><p class="first last">&lt;<a class="reference external" href="http://www.ietf.org/rfc/rfc3066.txt">http://www.ietf.org/rfc/rfc3066.txt</a>&gt;</p>
</dd>
</dl>
</li>
</ul>
</div></blockquote>
<p>Note: I have made a small modification on the regexp for internet date, 
to make it more liberal (ie, accept a time zone string of the form +0000)
Ivan Herman &lt;<a class="reference external" href="http://www.ivan-herman.net">http://www.ivan-herman.net</a>&gt;, March 2011.</p>
<p>Have added statements to make it (hopefully) Python 3 compatible.
Ivan Herman &lt;<a class="reference external" href="http://www.ivan-herman.net">http://www.ivan-herman.net</a>&gt;, August 2012.</p>
</div></blockquote>
<dl class="exception">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.ParseError">
<em class="property">exception </em><tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">ParseError</tt><big>(</big><em>args</em>, <em>input_string</em>, <em>at_position</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#ParseError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.ParseError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.ValueError</span></tt></p>
<p>Exception class representing a string parsing error.</p>
<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.ParseError.__init__">
<tt class="descname">__init__</tt><big>(</big><em>args</em>, <em>input_string</em>, <em>at_position</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#ParseError.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.ParseError.__init__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

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

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

</dd></dl>

<dl class="exception">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.RangeUnmergableError">
<em class="property">exception </em><tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">RangeUnmergableError</tt><big>(</big><em>reason=None</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#RangeUnmergableError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.RangeUnmergableError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.ValueError</span></tt></p>
<p>Exception class when byte ranges are noncontiguous and can not be merged together.</p>
<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.RangeUnmergableError.__init__">
<tt class="descname">__init__</tt><big>(</big><em>reason=None</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#RangeUnmergableError.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.RangeUnmergableError.__init__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

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

</dd></dl>

<dl class="exception">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.RangeUnsatisfiableError">
<em class="property">exception </em><tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">RangeUnsatisfiableError</tt><big>(</big><em>reason=None</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#RangeUnsatisfiableError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.RangeUnsatisfiableError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.ValueError</span></tt></p>
<p>Exception class when a byte range lies outside the file size boundaries.</p>
<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.RangeUnsatisfiableError.__init__">
<tt class="descname">__init__</tt><big>(</big><em>reason=None</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#RangeUnsatisfiableError.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.RangeUnsatisfiableError.__init__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

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

</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.acceptable_charset">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">acceptable_charset</tt><big>(</big><em>accept_charset_header</em>, <em>charsets</em>, <em>ignore_wildcard=True</em>, <em>default='ISO-8859-1'</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#acceptable_charset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.acceptable_charset" title="Permalink to this definition"></a></dt>
<dd><p>Determines if the given charset is acceptable to the user agent.</p>
<p>The accept_charset_header should be the value present in the HTTP
&#8220;Accept-Charset:&#8221; header.  In mod_python this is typically
obtained from the req.http_headers table; in WSGI it is
environ[&#8220;Accept-Charset&#8221;]; other web frameworks may provide other
methods of obtaining it.</p>
<p>Optionally the accept_charset_header parameter can instead be the
list returned from the parse_accept_header() function in this
module.</p>
<p>The charsets argument should either be a charset identifier string,
or a sequence of them.</p>
<p>This function returns the charset identifier string which is the
most prefered and is acceptable to both the user agent and the
caller.  It will return the default value if no charset is negotiable.</p>
<p>Note that the wildcarded charset &#8220;*&#8221; will be ignored.  To override
this, call with ignore_wildcard=False.</p>
<p>See also: RFC 2616 section 14.2, and
&lt;<a class="reference external" href="http://www.iana.org/assignments/character-sets">http://www.iana.org/assignments/character-sets</a>&gt;</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.acceptable_content_type">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">acceptable_content_type</tt><big>(</big><em>accept_header</em>, <em>content_types</em>, <em>ignore_wildcard=True</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#acceptable_content_type"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.acceptable_content_type" title="Permalink to this definition"></a></dt>
<dd><p>Determines if the given content type is acceptable to the user agent.</p>
<p>The accept_header should be the value present in the HTTP
&#8220;Accept:&#8221; header.  In mod_python this is typically obtained from
the req.http_headers_in table; in WSGI it is environ[&#8220;Accept&#8221;];
other web frameworks may provide other methods of obtaining it.</p>
<p>Optionally the accept_header parameter can be pre-parsed, as
returned from the parse_accept_header() function in this module.</p>
<p>The content_types argument should either be a single MIME media
type string, or a sequence of them.  It represents the set of
content types that the caller (server) is willing to send.
Generally, the server content_types should not contain any
wildcarded values.</p>
<p>This function determines which content type which is the most
preferred and is acceptable to both the user agent and the server.
If one is negotiated it will return a four-valued tuple like:</p>
<blockquote>
<div>(server_content_type, ua_content_range, qvalue, accept_parms)</div></blockquote>
<p>The first tuple value is one of the server&#8217;s content_types, while
the remaining tuple values descript which of the client&#8217;s
acceptable content_types was matched.  In most cases accept_parms
will be an empty list (see description of parse_accept_header()
for more details).</p>
<p>If no content type could be negotiated, then this function will
return None (and the caller should typically cause an HTTP 406 Not
Acceptable as a response).</p>
<p>Note that the wildcarded content type &#8220;<em>/</em>&#8221; sent by the client
will be ignored, since it is often incorrectly sent by web
browsers that don&#8217;t really mean it.  To override this, call with
ignore_wildcard=False.  Partial wildcards such as &#8220;image/<a href="#id2"><span class="problematic" id="id3">*</span></a>&#8221; will
always be processed, but be at a lower priority than a complete
matching type.</p>
<p>See also: RFC 2616 section 14.1, and
&lt;<a class="reference external" href="http://www.iana.org/assignments/media-types/">http://www.iana.org/assignments/media-types/</a>&gt;</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.acceptable_language">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">acceptable_language</tt><big>(</big><em>accept_header</em>, <em>server_languages</em>, <em>ignore_wildcard=True</em>, <em>assume_superiors=True</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#acceptable_language"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.acceptable_language" title="Permalink to this definition"></a></dt>
<dd><p>Determines if the given language is acceptable to the user agent.</p>
<p>The accept_header should be the value present in the HTTP
&#8220;Accept-Language:&#8221; header.  In mod_python this is typically
obtained from the req.http_headers_in table; in WSGI it is
environ[&#8220;Accept-Language&#8221;]; other web frameworks may provide other
methods of obtaining it.</p>
<p>Optionally the accept_header parameter can be pre-parsed, as
returned by the parse_accept_language_header() function defined in
this module.</p>
<p>The server_languages argument should either be a single language
string, a language_tag object, or a sequence of them.  It
represents the set of languages that the server is willing to
send to the user agent.</p>
<p>Note that the wildcarded language tag &#8220;*&#8221; will be ignored.  To
override this, call with ignore_wildcard=False, and even then
it will be the lowest-priority choice regardless of it&#8217;s
quality factor (as per HTTP spec).</p>
<p>If the assume_superiors is True then it the languages that the
browser accepts will automatically include all superior languages.
Any superior languages which must be added are done so with one
half the qvalue of the language which is present.  For example, if
the accept string is &#8220;en-US&#8221;, then it will be treated as if it
were &#8220;en-US, en;q=0.5&#8221;.  Note that although the HTTP 1.1 spec says
that browsers are supposed to encourage users to configure all
acceptable languages, sometimes they don&#8217;t, thus the ability
for this function to assume this.  But setting assume_superiors
to False will insure strict adherence to the HTTP 1.1 spec; which
means that if the browser accepts &#8220;en-US&#8221;, then it will not
be acceptable to send just &#8220;en&#8221; to it.</p>
<p>This function returns the language which is the most prefered and
is acceptable to both the user agent and the caller.  It will
return None if no language is negotiable, otherwise the return
value is always an instance of language_tag.</p>
<p>See also: RFC 3066 &lt;<a class="reference external" href="http://www.ietf.org/rfc/rfc3066.txt">http://www.ietf.org/rfc/rfc3066.txt</a>&gt;, and
ISO 639, links at &lt;<a class="reference external" href="http://en.wikipedia.org/wiki/ISO_639">http://en.wikipedia.org/wiki/ISO_639</a>&gt;, and
&lt;<a class="reference external" href="http://www.iana.org/assignments/language-tags">http://www.iana.org/assignments/language-tags</a>&gt;.</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.canonical_charset">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">canonical_charset</tt><big>(</big><em>charset</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#canonical_charset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.canonical_charset" title="Permalink to this definition"></a></dt>
<dd><p>Returns the canonical or preferred name of a charset.</p>
<p>Additional character sets can be recognized by this function by
altering the character_set_aliases dictionary in this module.
Charsets which are not recognized are simply converted to
upper-case (as charset names are always case-insensitive).</p>
<p>See &lt;<a class="reference external" href="http://www.iana.org/assignments/character-sets">http://www.iana.org/assignments/character-sets</a>&gt;.</p>
</dd></dl>

<dl class="class">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type">
<em class="property">class </em><tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">content_type</tt><big>(</big><em>content_type_string=None</em>, <em>with_parameters=True</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>This class represents a media type (aka a MIME content type), including parameters.</p>
<p>You initialize these by passing in a content-type declaration
string, such as &#8220;text/plain; charset=ascii&#8221;, to the constructor or
to the set() method.  If you provide no string value, the object
returned will represent the wildcard <em>/</em> content type.</p>
<p>Normally you will get the value back by using str(), or optionally
you can access the components via the &#8216;major&#8217;, &#8216;minor&#8217;, &#8216;media_type&#8217;,
or &#8216;parmdict&#8217; members.</p>
<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__eq__">
<tt class="descname">__eq__</tt><big>(</big><em>other</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type.__eq__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__eq__" title="Permalink to this definition"></a></dt>
<dd><p>Equality test.</p>
<p>Note that this is an exact match, including any parameters if any.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__getstate__">
<tt class="descname">__getstate__</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type.__getstate__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__getstate__" title="Permalink to this definition"></a></dt>
<dd><p>Pickler</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__hash__">
<tt class="descname">__hash__</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type.__hash__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__hash__" title="Permalink to this definition"></a></dt>
<dd><p>Hash this object; the hash is dependent only upon the value.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__init__">
<tt class="descname">__init__</tt><big>(</big><em>content_type_string=None</em>, <em>with_parameters=True</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__init__" title="Permalink to this definition"></a></dt>
<dd><p>Create a new content_type object.</p>
<p>See the set() method for a description of the arguments.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__len__">
<tt class="descname">__len__</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type.__len__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__len__" title="Permalink to this definition"></a></dt>
<dd><p>Logical length of this media type.
For example:</p>
<blockquote>
<div>len(&#8216;<em>/</em>&#8216;)  -&gt; 0
len(&#8216;image/<a href="#id4"><span class="problematic" id="id5">*</span></a>&#8216;) -&gt; 1
len(&#8216;image/png&#8217;) -&gt; 2
len(&#8216;text/plain; charset=utf-8&#8217;)  -&gt; 3
len(&#8216;text/plain; charset=utf-8; filename=xyz.txt&#8217;) -&gt; 4</div></blockquote>
</dd></dl>

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

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__ne__">
<tt class="descname">__ne__</tt><big>(</big><em>other</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type.__ne__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__ne__" title="Permalink to this definition"></a></dt>
<dd><p>Inequality test.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__repr__">
<tt class="descname">__repr__</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type.__repr__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__repr__" title="Permalink to this definition"></a></dt>
<dd><p>Python representation of this object.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__setstate__">
<tt class="descname">__setstate__</tt><big>(</big><em>state</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type.__setstate__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__setstate__" title="Permalink to this definition"></a></dt>
<dd><p>Unpickler</p>
</dd></dl>

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

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__unicode__">
<tt class="descname">__unicode__</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type.__unicode__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.__unicode__" title="Permalink to this definition"></a></dt>
<dd><p>Unicode string value.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.is_composite">
<tt class="descname">is_composite</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type.is_composite"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.is_composite" title="Permalink to this definition"></a></dt>
<dd><p>Is this media type composed of multiple parts.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.is_universal_wildcard">
<tt class="descname">is_universal_wildcard</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type.is_universal_wildcard"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.is_universal_wildcard" title="Permalink to this definition"></a></dt>
<dd><p>Returns True if this is the unspecified &#8216;<em>/</em>&#8216; media type.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.is_wildcard">
<tt class="descname">is_wildcard</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type.is_wildcard"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.is_wildcard" title="Permalink to this definition"></a></dt>
<dd><p>Returns True if this is a &#8216;something/<a href="#id6"><span class="problematic" id="id7">*</span></a>&#8216; media type.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.is_xml">
<tt class="descname">is_xml</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type.is_xml"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.is_xml" title="Permalink to this definition"></a></dt>
<dd><p>Returns True if this media type is XML-based.</p>
<p>Note this does not consider text/html to be XML, but
application/xhtml+xml is.</p>
</dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.major">
<tt class="descname">major</tt><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.major" title="Permalink to this definition"></a></dt>
<dd><p>Major media classification</p>
</dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.media_type">
<tt class="descname">media_type</tt><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.media_type" title="Permalink to this definition"></a></dt>
<dd><p>Returns the just the media type &#8216;type/subtype&#8217; without any paramters (read-only).</p>
</dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.minor">
<tt class="descname">minor</tt><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.minor" title="Permalink to this definition"></a></dt>
<dd><p>Minor media sub-classification</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.set">
<tt class="descname">set</tt><big>(</big><em>content_type_string</em>, <em>with_parameters=True</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type.set"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.set" title="Permalink to this definition"></a></dt>
<dd><p>Parses the content type string and sets this object to it&#8217;s value.</p>
<p>For a more complete description of the arguments, see the
documentation for the parse_media_type() function in this module.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.set_parameters">
<tt class="descname">set_parameters</tt><big>(</big><em>parameter_list_or_dict</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#content_type.set_parameters"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.content_type.set_parameters" title="Permalink to this definition"></a></dt>
<dd><p>Sets the optional paramters based upon the parameter list.</p>
<p>The paramter list should be a semicolon-separated name=value string.
Any paramters which already exist on this object will be deleted,
unless they appear in the given paramter_list.</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.http_datetime">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">http_datetime</tt><big>(</big><em>dt=None</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#http_datetime"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.http_datetime" title="Permalink to this definition"></a></dt>
<dd><p>Formats a datetime as an HTTP 1.1 Date/Time string.</p>
<p>Takes a standard Python datetime object and returns a string
formatted according to the HTTP 1.1 date/time format.</p>
<p>If no datetime is provided (or None) then the current
time is used.</p>
<p>ABOUT TIMEZONES: If the passed in datetime object is naive it is
assumed to be in UTC already.  But if it has a tzinfo component,
the returned timestamp string will have been converted to UTC
automatically.  So if you use timezone-aware datetimes, you need
not worry about conversion to UTC.</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.is_token">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">is_token</tt><big>(</big><em>s</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#is_token"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.is_token" title="Permalink to this definition"></a></dt>
<dd><p>Determines if the string is a valid token.</p>
</dd></dl>

<dl class="class">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag">
<em class="property">class </em><tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">language_tag</tt><big>(</big><em>tagname</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>This class represents an RFC 3066 language tag.</p>
<p>Initialize objects of this class with a single string representing
the language tag, such as &#8220;en-US&#8221;.</p>
<p>Case is insensitive. Wildcarded subtags are ignored or stripped as
they have no significance, so that &#8220;en-<em>&#8221; is the same as &#8220;en&#8221;.
However the universal wildcard &#8220;</em>&#8221; language tag is kept as-is.</p>
<p>Note that although relational operators such as &lt; are defined,
they only form a partial order based upon specialization.</p>
<dl class="docutils">
<dt>Thus for example,</dt>
<dd>&#8220;en&#8221; &lt;= &#8220;en-US&#8221;</dd>
<dt>but,</dt>
<dd>not &#8220;en&#8221; &lt;= &#8220;de&#8221;, and
not &#8220;de&#8221; &lt;= &#8220;en&#8221;.</dd>
</dl>
<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__eq__">
<tt class="descname">__eq__</tt><big>(</big><em>other</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag.__eq__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__eq__" title="Permalink to this definition"></a></dt>
<dd><p>== operator. Are the two languages the same?</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__ge__">
<tt class="descname">__ge__</tt><big>(</big><em>other</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag.__ge__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__ge__" title="Permalink to this definition"></a></dt>
<dd><p>&gt;= operator.  Returns True if this language is the same as
or a more specialized dialect of the other one.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__gt__">
<tt class="descname">__gt__</tt><big>(</big><em>other</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag.__gt__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__gt__" title="Permalink to this definition"></a></dt>
<dd><p>&gt; operator.  Returns True if this language is a more
specialized dialect of the other one.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__init__">
<tt class="descname">__init__</tt><big>(</big><em>tagname</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__init__" title="Permalink to this definition"></a></dt>
<dd><p>Initialize objects of this class with a single string representing
the language tag, such as &#8220;en-US&#8221;.  Case is insensitive.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__le__">
<tt class="descname">__le__</tt><big>(</big><em>other</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag.__le__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__le__" title="Permalink to this definition"></a></dt>
<dd><p>&lt;= operator. Returns True if the other language is the same
as or a more specialized dialect of this one.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__len__">
<tt class="descname">__len__</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag.__len__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__len__" title="Permalink to this definition"></a></dt>
<dd><p>Number of subtags in this tag.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__lt__">
<tt class="descname">__lt__</tt><big>(</big><em>other</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag.__lt__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__lt__" title="Permalink to this definition"></a></dt>
<dd><p>&lt; operator. Returns True if the other language is a more
specialized dialect of this one.</p>
</dd></dl>

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

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__neq__">
<tt class="descname">__neq__</tt><big>(</big><em>other</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag.__neq__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__neq__" title="Permalink to this definition"></a></dt>
<dd><p>!= operator. Are the two languages different?</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__repr__">
<tt class="descname">__repr__</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag.__repr__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__repr__" title="Permalink to this definition"></a></dt>
<dd><p>The python representation of this language tag.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__str__">
<tt class="descname">__str__</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag.__str__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__str__" title="Permalink to this definition"></a></dt>
<dd><p>The standard string form of this language tag.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__unicode__">
<tt class="descname">__unicode__</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag.__unicode__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.__unicode__" title="Permalink to this definition"></a></dt>
<dd><p>The unicode string form of this language tag.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.all_superiors">
<tt class="descname">all_superiors</tt><big>(</big><em>include_wildcard=False</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag.all_superiors"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.all_superiors" title="Permalink to this definition"></a></dt>
<dd><p>Returns a list of this language and all it&#8217;s superiors.</p>
<p>If include_wildcard is False, then &#8220;*&#8221; will not be among the
output list, unless this language is itself &#8220;*&#8221;.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.dialect_of">
<tt class="descname">dialect_of</tt><big>(</big><em>other</em>, <em>ignore_wildcard=True</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag.dialect_of"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.dialect_of" title="Permalink to this definition"></a></dt>
<dd><p>Is this language a dialect (or subset/specialization) of another.</p>
<p>This method returns True if this language is the same as or a
specialization (dialect) of the other language_tag.</p>
<p>If ignore_wildcard is False, then all languages will be
considered to be a dialect of the special language tag of &#8220;*&#8221;.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.is_universal_wildcard">
<tt class="descname">is_universal_wildcard</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag.is_universal_wildcard"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.is_universal_wildcard" title="Permalink to this definition"></a></dt>
<dd><p>Returns True if this language tag represents all possible
languages, by using the reserved tag of &#8220;*&#8221;.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.superior">
<tt class="descname">superior</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#language_tag.superior"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.language_tag.superior" title="Permalink to this definition"></a></dt>
<dd><p>Returns another instance of language_tag which is the superior.</p>
<p>Thus en-US gives en, and en gives <a href="#id8"><span class="problematic" id="id9">*</span></a>.</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_accept_header">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">parse_accept_header</tt><big>(</big><em>header_value</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#parse_accept_header"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_accept_header" title="Permalink to this definition"></a></dt>
<dd><p>Parses the Accept: header.</p>
<p>The value of the header as a string should be passed in; without
the header name itself.</p>
<p>This will parse the value of any of the HTTP headers &#8220;Accept&#8221;,
&#8220;Accept-Charset&#8221;, &#8220;Accept-Encoding&#8221;, or &#8220;Accept-Language&#8221;.  These
headers are similarly formatted, in that they are a list of items
with associated quality factors.  The quality factor, or qvalue,
is a number in the range [0.0..1.0] which indicates the relative
preference of each item.</p>
<p>This function returns a list of those items, sorted by preference
(from most-prefered to least-prefered).  Each item in the returned
list is actually a tuple consisting of:</p>
<blockquote>
<div>( item_name, item_parms, qvalue, accept_parms )</div></blockquote>
<dl class="docutils">
<dt>As an example, the following string,</dt>
<dd>text/plain; charset=&#8221;utf-8&#8221;; q=.5; columns=80</dd>
<dt>would be parsed into this resulting tuple,</dt>
<dd>( &#8216;text/plain&#8217;, [(&#8216;charset&#8217;,&#8217;utf-8&#8217;)], 0.5, [(&#8216;columns&#8217;,&#8216;80&#8217;)] )</dd>
</dl>
<p>The value of the returned item_name depends upon which header is
being parsed, but for example it may be a MIME content or media
type (without parameters), a language tag, or so on.  Any optional
parameters (delimited by semicolons) occuring before the &#8220;q=&#8221;
attribute will be in the item_parms list as (attribute,value)
tuples in the same order as they appear in the header.  Any quoted
values will have been unquoted and unescaped.</p>
<p>The qvalue is a floating point number in the inclusive range 0.0
to 1.0, and roughly indicates the preference for this item.
Values outside this range will be capped to the closest extreme.</p>
<blockquote>
<div>(!) Note that a qvalue of 0 indicates that the item is
explicitly NOT acceptable to the user agent, and should be
handled differently by the caller.</div></blockquote>
<p>The accept_parms, like the item_parms, is a list of any attributes
occuring after the &#8220;q=&#8221; attribute, and will be in the list as
(attribute,value) tuples in the same order as they occur.
Usually accept_parms will be an empty list, as the HTTP spec
allows these extra parameters in the syntax but does not
currently define any possible values.</p>
<p>All empty items will be removed from the list.  However, duplicate
or conflicting values are not detected or handled in any way by
this function.</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_accept_language_header">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">parse_accept_language_header</tt><big>(</big><em>header_value</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#parse_accept_language_header"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_accept_language_header" title="Permalink to this definition"></a></dt>
<dd><p>Parses the Accept-Language header.</p>
<p>Returns a list of tuples, each like:</p>
<blockquote>
<div>(language_tag, qvalue, accept_parameters)</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_comma_list">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">parse_comma_list</tt><big>(</big><em>s</em>, <em>start=0</em>, <em>element_parser=None</em>, <em>min_count=0</em>, <em>max_count=0</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#parse_comma_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_comma_list" title="Permalink to this definition"></a></dt>
<dd><p>Parses a comma-separated list with optional whitespace.</p>
<p>Takes an optional callback function <cite>element_parser</cite>, which
is assumed to be able to parse an individual element.  It
will be passed the string and a <cite>start</cite> argument, and
is expected to return a tuple (parsed_result, chars_consumed).</p>
<p>If no element_parser is given, then either single tokens or
quoted strings will be parsed.</p>
<p>If min_count &gt; 0, then at least that many non-empty elements
must be in the list, or an error is raised.</p>
<p>If max_count &gt; 0, then no more than that many non-empty elements
may be in the list, or an error is raised.</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_comment">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">parse_comment</tt><big>(</big><em>s</em>, <em>start=0</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#parse_comment"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_comment" title="Permalink to this definition"></a></dt>
<dd><p>Parses a ()-style comment from a header value.</p>
<p>Returns tuple (comment, chars_consumed), where the comment will
have had the outer-most parentheses and white space stripped.  Any
nested comments will still have their parentheses and whitespace
left intact.</p>
<p>All -escaped quoted pairs will have been replaced with the actual
characters they represent, even within the inner nested comments.</p>
<p>You should note that only a few HTTP headers, such as User-Agent
or Via, allow ()-style comments within the header value.</p>
<p>A comment is defined by RFC 2616 section 2.2 as:</p>
<blockquote>
<div>comment = &#8220;(&#8221; <a href="#id10"><span class="problematic" id="id11">*</span></a>( ctext | quoted-pair | comment ) &#8221;)&#8221;
ctext   = &lt;any TEXT excluding &#8220;(&#8221; and &#8221;)&#8221;&gt;</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_http_datetime">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">parse_http_datetime</tt><big>(</big><em>datestring</em>, <em>utc_tzinfo=None</em>, <em>strict=False</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#parse_http_datetime"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_http_datetime" title="Permalink to this definition"></a></dt>
<dd><p>Returns a datetime object from an HTTP 1.1 Date/Time string.</p>
<p>Note that HTTP dates are always in UTC, so the returned datetime
object will also be in UTC.</p>
<p>You can optionally pass in a tzinfo object which should represent
the UTC timezone, and the returned datetime will then be
timezone-aware (allowing you to more easly translate it into
different timzeones later).</p>
<p>If you set &#8216;strict&#8217; to True, then only the RFC 1123 format
is recognized.  Otherwise the backwards-compatible RFC 1036
and Unix asctime(3) formats are also recognized.</p>
<p>Please note that the day-of-the-week is not validated.
Also two-digit years, although not HTTP 1.1 compliant, are
treated according to recommended Y2K rules.</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_media_type">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">parse_media_type</tt><big>(</big><em>media_type</em>, <em>start=0</em>, <em>with_parameters=True</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#parse_media_type"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_media_type" title="Permalink to this definition"></a></dt>
<dd><p>Parses a media type (MIME type) designator into it&#8217;s parts.</p>
<p>Given a media type string, returns a nested tuple of it&#8217;s parts.</p>
<blockquote>
<div>((major,minor,parmlist), chars_consumed)</div></blockquote>
<p>where parmlist is a list of tuples of (parm_name, parm_value).
Quoted-values are appropriately unquoted and unescaped.</p>
<p>If &#8216;with_parameters&#8217; is False, then parsing will stop immediately
after the minor media type; and will not proceed to parse any
of the semicolon-separated paramters.</p>
<dl class="docutils">
<dt>Examples:</dt>
<dd><p class="first">image/png -&gt; ((&#8216;image&#8217;,&#8217;png&#8217;,[]), 9)
text/plain; charset=&#8221;utf-16be&#8221;</p>
<blockquote class="last">
<div>-&gt; ((&#8216;text&#8217;,&#8217;plain&#8217;,[(&#8216;charset,&#8217;utf-16be&#8217;)]), 30)</div></blockquote>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_number">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">parse_number</tt><big>(</big><em>s</em>, <em>start=0</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#parse_number"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_number" title="Permalink to this definition"></a></dt>
<dd><p>Parses a positive decimal integer number from the string.</p>
<p>A tuple is returned (number, chars_consumed).  If the
string is not a valid decimal number, then (None,0) is returned.</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_parameter_list">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">parse_parameter_list</tt><big>(</big><em>s</em>, <em>start=0</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#parse_parameter_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_parameter_list" title="Permalink to this definition"></a></dt>
<dd><p>Parses a semicolon-separated &#8216;parameter=value&#8217; list.</p>
<p>Returns a tuple (parmlist, chars_consumed), where parmlist
is a list of tuples (parm_name, parm_value).</p>
<p>The parameter values will be unquoted and unescaped as needed.</p>
<p>Empty parameters (as in &#8221;;;&#8221;) are skipped, as is insignificant
white space.  The list returned is kept in the same order as the
parameters appear in the string.</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_quoted_string">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">parse_quoted_string</tt><big>(</big><em>s</em>, <em>start=0</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#parse_quoted_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_quoted_string" title="Permalink to this definition"></a></dt>
<dd><p>Parses a quoted string.</p>
<p>Returns a tuple (string, chars_consumed).  The quote marks will
have been removed and all -escapes will have been replaced with
the characters they represent.</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_qvalue_accept_list">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">parse_qvalue_accept_list</tt><big>(</big><em>s</em>, <em>start=0</em>, <em>item_parser=&lt;function parse_token at 0xf4ca7df4&gt;</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#parse_qvalue_accept_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_qvalue_accept_list" title="Permalink to this definition"></a></dt>
<dd><p>Parses any of the Accept-* style headers with quality factors.</p>
<dl class="docutils">
<dt>This is a low-level function.  It returns a list of tuples, each like:</dt>
<dd>(item, item_parms, qvalue, accept_parms)</dd>
</dl>
<p>You can pass in a function which parses each of the item strings, or
accept the default where the items must be simple tokens.  Note that
your parser should not consume any paramters (past the special &#8220;q&#8221;
paramter anyway).</p>
<p>The item_parms and accept_parms are each lists of (name,value) tuples.</p>
<p>The qvalue is the quality factor, a number from 0 to 1 inclusive.</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_range_header">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">parse_range_header</tt><big>(</big><em>header_value</em>, <em>valid_units=('bytes'</em>, <em>'none')</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#parse_range_header"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_range_header" title="Permalink to this definition"></a></dt>
<dd><p>Parses the value of an HTTP Range: header.</p>
<p>The value of the header as a string should be passed in; without
the header name itself.</p>
<p>Returns a range_set object.</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_range_set">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">parse_range_set</tt><big>(</big><em>s</em>, <em>start=0</em>, <em>valid_units=('bytes'</em>, <em>'none')</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#parse_range_set"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_range_set" title="Permalink to this definition"></a></dt>
<dd><p>Parses a (byte) range set specifier.</p>
<p>Returns a tuple (range_set, chars_consumed).</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_range_spec">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">parse_range_spec</tt><big>(</big><em>s</em>, <em>start=0</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#parse_range_spec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_range_spec" title="Permalink to this definition"></a></dt>
<dd><p>Parses a (byte) range_spec.</p>
<p>Returns a tuple (range_spec, chars_consumed).</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_token">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">parse_token</tt><big>(</big><em>s</em>, <em>start=0</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#parse_token"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_token" title="Permalink to this definition"></a></dt>
<dd><p>Parses a token.</p>
<dl class="docutils">
<dt>A token is a string defined by RFC 2616 section 2.2 as:</dt>
<dd>token = 1*&lt;any CHAR except CTLs or separators&gt;</dd>
</dl>
<p>Returns a tuple (token, chars_consumed), or (&#8216;&#8217;,0) if no token
starts at the given string position.  On a syntax error, a
ParseError exception will be raised.</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_token_or_quoted_string">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">parse_token_or_quoted_string</tt><big>(</big><em>s</em>, <em>start=0</em>, <em>allow_quoted=True</em>, <em>allow_token=True</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#parse_token_or_quoted_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.parse_token_or_quoted_string" title="Permalink to this definition"></a></dt>
<dd><p>Parses a token or a quoted-string.</p>
<p>&#8216;s&#8217; is the string to parse, while start is the position within the
string where parsing should begin.  It will returns a tuple
(token, chars_consumed), with all -escapes and quotation already
processed.</p>
<p>Syntax is according to BNF rules in RFC 2161 section 2.2,
specifically the &#8216;token&#8217; and &#8216;quoted-string&#8217; declarations.
Syntax errors in the input string will result in ParseError
being raised.</p>
<p>If allow_quoted is False, then only tokens will be parsed instead
of either a token or quoted-string.</p>
<p>If allow_token is False, then only quoted-strings will be parsed
instead of either a token or quoted-string.</p>
</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.quote_string">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">quote_string</tt><big>(</big><em>s</em>, <em>always_quote=True</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#quote_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.quote_string" title="Permalink to this definition"></a></dt>
<dd><p>Produces a quoted string according to HTTP 1.1 rules.</p>
<p>If always_quote is False and if the string is also a valid token,
then this function may return a string without quotes.</p>
</dd></dl>

<dl class="class">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set">
<em class="property">class </em><tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">range_set</tt><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_set"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>A collection of range_specs, with units (e.g., bytes).</p>
<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.__init__">
<tt class="descname">__init__</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_set.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.__init__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

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

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

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.__slots__">
<tt class="descname">__slots__</tt><em class="property"> = ['units', 'range_specs']</em><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.__slots__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

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

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.coalesce">
<tt class="descname">coalesce</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_set.coalesce"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.coalesce" title="Permalink to this definition"></a></dt>
<dd><p>Collapses all consecutive range_specs which together define a contiguous range.</p>
<p>Note though that this method will not re-sort the range_specs, so a
potentially contiguous range may not be collapsed if they are
not sorted.  For example the ranges:</p>
<blockquote>
<div>10-20, 30-40, 20-30</div></blockquote>
<p>will not be collapsed to just 10-40.  However if the ranges are
sorted first as with:</p>
<blockquote>
<div>10-20, 20-30, 30-40</div></blockquote>
<p>then they will collapse to 10-40.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.fix_to_size">
<tt class="descname">fix_to_size</tt><big>(</big><em>size</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_set.fix_to_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.fix_to_size" title="Permalink to this definition"></a></dt>
<dd><p>Changes all length-relative range_specs to absolute range_specs based upon given file size.
If none of the range_specs in this set can be satisfied, then the
entire set is considered unsatifiable and an error is raised.
Otherwise any unsatisfiable range_specs will simply be removed
from this set.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.from_str">
<tt class="descname">from_str</tt><big>(</big><em>s</em>, <em>valid_units=('bytes'</em>, <em>'none')</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_set.from_str"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.from_str" title="Permalink to this definition"></a></dt>
<dd><p>Sets this range set based upon a string, such as the Range: header.</p>
<p>You can also use the parse_range_set() function for more control.</p>
<p>If a parsing error occurs, the pre-exising value of this range
set is left unchanged.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.is_contiguous">
<tt class="descname">is_contiguous</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_set.is_contiguous"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.is_contiguous" title="Permalink to this definition"></a></dt>
<dd><p>Can the collection of range_specs be coalesced into a single contiguous range?</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.is_single_range">
<tt class="descname">is_single_range</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_set.is_single_range"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.is_single_range" title="Permalink to this definition"></a></dt>
<dd><p>Does this range specifier consist of only a single range set?</p>
</dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.range_specs">
<tt class="descname">range_specs</tt><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.range_specs" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.units">
<tt class="descname">units</tt><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_set.units" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec">
<em class="property">class </em><tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">range_spec</tt><big>(</big><em>first=0</em>, <em>last=None</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>A single contiguous (byte) range.</p>
<p>A range_spec defines a range (of bytes) by specifying two offsets,
the &#8216;first&#8217; and &#8216;last&#8217;, which are inclusive in the range.  Offsets
are zero-based (the first byte is offset 0).  The range can not be
empty or negative (has to satisfy first &lt;= last).</p>
<p>The range can be unbounded on either end, represented here by the
None value, with these semantics:</p>
<blockquote>
<div><ul class="simple">
<li>A &#8216;last&#8217; of None always indicates the last possible byte</li>
</ul>
<blockquote>
<div>(although that offset may not be known).</div></blockquote>
<ul class="simple">
<li>A &#8216;first&#8217; of None indicates this is a suffix range, where
the last value is actually interpreted to be the number
of bytes at the end of the file (regardless of file size).</li>
</ul>
</div></blockquote>
<p>Note that it is not valid for both first and last to be None.</p>
<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__contains__">
<tt class="descname">__contains__</tt><big>(</big><em>offset</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.__contains__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__contains__" title="Permalink to this definition"></a></dt>
<dd><p>Does this byte range contain the given byte offset?</p>
<p>If the offset &lt; 0, then it is taken as an offset from the end
of the file, where -1 is the last byte.  This type of offset
will only work with suffix ranges.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__eq__">
<tt class="descname">__eq__</tt><big>(</big><em>other</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.__eq__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__eq__" title="Permalink to this definition"></a></dt>
<dd><p>Compare ranges for equality.</p>
<p>Note that if non-specific ranges are involved (such as 34- and -5),
they could compare as not equal even though they may represent
the same set of bytes in some contexts.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__ge__">
<tt class="descname">__ge__</tt><big>(</big><em>other</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.__ge__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__ge__" title="Permalink to this definition"></a></dt>
<dd><p>&gt;= operator is not defined</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__gt__">
<tt class="descname">__gt__</tt><big>(</big><em>other</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.__gt__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__gt__" title="Permalink to this definition"></a></dt>
<dd><p>&gt; operator is not defined</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__init__">
<tt class="descname">__init__</tt><big>(</big><em>first=0</em>, <em>last=None</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__init__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__le__">
<tt class="descname">__le__</tt><big>(</big><em>other</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.__le__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__le__" title="Permalink to this definition"></a></dt>
<dd><p>&lt;= operator is not defined</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__lt__">
<tt class="descname">__lt__</tt><big>(</big><em>other</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.__lt__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__lt__" title="Permalink to this definition"></a></dt>
<dd><p>&lt; operator is not defined</p>
</dd></dl>

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

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__ne__">
<tt class="descname">__ne__</tt><big>(</big><em>other</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.__ne__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__ne__" title="Permalink to this definition"></a></dt>
<dd><p>Compare ranges for inequality.</p>
<p>Note that if non-specific ranges are involved (such as 34- and -5),
they could compare as not equal even though they may represent
the same set of bytes in some contexts.</p>
</dd></dl>

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

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__slots__">
<tt class="descname">__slots__</tt><em class="property"> = ['first', 'last']</em><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__slots__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__str__">
<tt class="descname">__str__</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.__str__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.__str__" title="Permalink to this definition"></a></dt>
<dd><p>Returns a string form of the range as would appear in a Range: header.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.copy">
<tt class="descname">copy</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.copy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.copy" title="Permalink to this definition"></a></dt>
<dd><p>Makes a copy of this range object.</p>
</dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.first">
<tt class="descname">first</tt><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.first" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.fix_to_size">
<tt class="descname">fix_to_size</tt><big>(</big><em>size</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.fix_to_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.fix_to_size" title="Permalink to this definition"></a></dt>
<dd><p>Changes a length-relative range to an absolute range based upon given file size.</p>
<p>Ranges that are already absolute are left as is.</p>
<p>Note that zero-length files are handled as special cases,
since the only way possible to specify a zero-length range is
with the suffix range &#8220;-0&#8221;.  Thus unless this range is a suffix
range, it can not satisfy a zero-length file.</p>
<p>If the resulting range (partly) lies outside the file size then an
error is raised.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.is_fixed">
<tt class="descname">is_fixed</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.is_fixed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.is_fixed" title="Permalink to this definition"></a></dt>
<dd><p>Returns True if this range is absolute and a fixed size.</p>
<p>This occurs only if neither first or last is None.  Converse
is the is_unbounded() method.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.is_suffix">
<tt class="descname">is_suffix</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.is_suffix"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.is_suffix" title="Permalink to this definition"></a></dt>
<dd><p>Returns True if this is a suffix range.</p>
<p>A suffix range is one that specifies the last N bytes of a
file regardless of file size.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.is_unbounded">
<tt class="descname">is_unbounded</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.is_unbounded"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.is_unbounded" title="Permalink to this definition"></a></dt>
<dd><p>Returns True if the number of bytes in the range is unspecified.</p>
<p>This can only occur if either the &#8216;first&#8217; or the &#8216;last&#8217; member
is None.  Converse is the is_fixed() method.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.is_whole_file">
<tt class="descname">is_whole_file</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.is_whole_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.is_whole_file" title="Permalink to this definition"></a></dt>
<dd><p>Returns True if this range includes all possible bytes.</p>
<p>This can only occur if the &#8216;last&#8217; member is None and the first
member is 0.</p>
</dd></dl>

<dl class="attribute">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.last">
<tt class="descname">last</tt><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.last" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.merge_with">
<tt class="descname">merge_with</tt><big>(</big><em>other</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.merge_with"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.merge_with" title="Permalink to this definition"></a></dt>
<dd><p>Tries to merge the given range into this one.</p>
<p>The size of this range may be enlarged as a result.</p>
<p>An error is raised if the two ranges do not overlap or are not
contiguous with each other.</p>
</dd></dl>

<dl class="method">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.set">
<tt class="descname">set</tt><big>(</big><em>first</em>, <em>last</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#range_spec.set"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.range_spec.set" title="Permalink to this definition"></a></dt>
<dd><p>Sets the value of this range given the first and last offsets.</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="rdflib.plugins.parsers.pyRdfa.extras.httpheader.remove_comments">
<tt class="descclassname">rdflib.plugins.parsers.pyRdfa.extras.httpheader.</tt><tt class="descname">remove_comments</tt><big>(</big><em>s</em>, <em>collapse_spaces=True</em><big>)</big><a class="reference internal" href="../_modules/rdflib/plugins/parsers/pyRdfa/extras/httpheader.html#remove_comments"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#rdflib.plugins.parsers.pyRdfa.extras.httpheader.remove_comments" title="Permalink to this definition"></a></dt>
<dd><p>Removes any ()-style comments from a string.</p>
<p>In HTTP, ()-comments can nest, and this function will correctly
deal with that.</p>
<p>If &#8216;collapse_spaces&#8217; is True, then if there is any whitespace
surrounding the comment, it will be replaced with a single space
character.  Whitespace also collapses across multiple comment
sequences, so that &#8220;a (b) (c) d&#8221; becomes just &#8220;a d&#8221;.</p>
<p>Otherwise, if &#8216;collapse_spaces&#8217; is False then all whitespace which
is outside any comments is left intact as-is.</p>
</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="#">extras Package</a><ul>
<li><a class="reference internal" href="#id1"><tt class="docutils literal"><span class="pre">extras</span></tt> Package</a></li>
<li><a class="reference internal" href="#module-rdflib.plugins.parsers.pyRdfa.extras.httpheader"><tt class="docutils literal"><span class="pre">httpheader</span></tt> Module</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="rdflib.plugins.parsers.pyRdfa.html"
                        title="previous chapter">pyRdfa Package</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="rdflib.plugins.parsers.pyRdfa.host.html"
                        title="next chapter">host Package</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/apidocs/rdflib.plugins.parsers.pyRdfa.extras.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.host.html" title="host Package"
             >next</a> |</li>
        <li class="right" >
          <a href="rdflib.plugins.parsers.pyRdfa.html" title="pyRdfa 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>
          <li><a href="rdflib.plugins.parsers.pyRdfa.html" >pyRdfa 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>