/usr/share/gtk-doc/html/raptor2/raptor2-section-parser.html is in libraptor2-doc 2.0.14-1.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Parser</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="Raptor RDF Syntax Library Manual">
<link rel="up" href="reference-manual.html" title="Part II. Raptor Reference Manual">
<link rel="prev" href="raptor2-section-locator.html" title="Locator">
<link rel="next" href="raptor2-section-sax2.html" title="SAX2">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="raptor2-section-locator.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference-manual.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Raptor RDF Syntax Library Manual</th>
<td><a accesskey="n" href="raptor2-section-sax2.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#raptor2-section-parser.synopsis" class="shortcut">Top</a>
|
<a href="#raptor2-section-parser.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="raptor2-section-parser"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="raptor2-section-parser.top_of_page"></a>Parser</span></h2>
<p>Parser — RDF parsers - from a syntax to RDF triples</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="raptor2-section-parser.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">typedef <a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser">raptor_parser</a>;
<a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="returnvalue">raptor_parser</span></a> * <a class="link" href="raptor2-section-parser.html#raptor-new-parser" title="raptor_new_parser ()">raptor_new_parser</a> (<em class="parameter"><code><a class="link" href="raptor2-section-world.html#raptor-world" title="raptor_world"><span class="type">raptor_world</span></a> *world</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);
<a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="returnvalue">raptor_parser</span></a> * <a class="link" href="raptor2-section-parser.html#raptor-new-parser-for-content" title="raptor_new_parser_for_content ()">raptor_new_parser_for_content</a> (<em class="parameter"><code><a class="link" href="raptor2-section-world.html#raptor-world" title="raptor_world"><span class="type">raptor_world</span></a> *world</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *uri</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *mime_type</code></em>,
<em class="parameter"><code>const unsigned <span class="type">char</span> *buffer</code></em>,
<em class="parameter"><code><span class="type">size_t</span> len</code></em>,
<em class="parameter"><code>const unsigned <span class="type">char</span> *identifier</code></em>);
<span class="returnvalue">void</span> <a class="link" href="raptor2-section-parser.html#raptor-free-parser" title="raptor_free_parser ()">raptor_free_parser</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *parser</code></em>);
<span class="returnvalue">void</span> (<a class="link" href="raptor2-section-parser.html#raptor-graph-mark-handler" title="raptor_graph_mark_handler ()">*raptor_graph_mark_handler</a>) (<em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *graph</code></em>,
<em class="parameter"><code><span class="type">int</span> flags</code></em>);
<span class="returnvalue">void</span> (<a class="link" href="raptor2-section-parser.html#raptor-namespace-handler" title="raptor_namespace_handler ()">*raptor_namespace_handler</a>) (<em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-xml-namespace.html#raptor-namespace" title="raptor_namespace"><span class="type">raptor_namespace</span></a> *nspace</code></em>);
<span class="returnvalue">void</span> <a class="link" href="raptor2-section-parser.html#raptor-parser-set-statement-handler" title="raptor_parser_set_statement_handler ()">raptor_parser_set_statement_handler</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *parser</code></em>,
<em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-general.html#raptor-statement-handler" title="raptor_statement_handler ()"><span class="type">raptor_statement_handler</span></a> handler</code></em>);
enum <a class="link" href="raptor2-section-parser.html#raptor-graph-mark-flags" title="enum raptor_graph_mark_flags">raptor_graph_mark_flags</a>;
<span class="returnvalue">void</span> <a class="link" href="raptor2-section-parser.html#raptor-parser-set-graph-mark-handler" title="raptor_parser_set_graph_mark_handler ()">raptor_parser_set_graph_mark_handler</a>
(<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *parser</code></em>,
<em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-graph-mark-handler" title="raptor_graph_mark_handler ()"><span class="type">raptor_graph_mark_handler</span></a> handler</code></em>);
<span class="returnvalue">void</span> <a class="link" href="raptor2-section-parser.html#raptor-parser-set-namespace-handler" title="raptor_parser_set_namespace_handler ()">raptor_parser_set_namespace_handler</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *parser</code></em>,
<em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-namespace-handler" title="raptor_namespace_handler ()"><span class="type">raptor_namespace_handler</span></a> handler</code></em>);
const <a class="link" href="raptor2-section-general.html#raptor-syntax-description" title="raptor_syntax_description"><span class="returnvalue">raptor_syntax_description</span></a> * <a class="link" href="raptor2-section-parser.html#raptor-parser-get-description" title="raptor_parser_get_description ()">raptor_parser_get_description</a>
(<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>);
<a class="link" href="raptor2-section-locator.html#raptor-locator" title="raptor_locator"><span class="returnvalue">raptor_locator</span></a> * <a class="link" href="raptor2-section-parser.html#raptor-parser-get-locator" title="raptor_parser_get_locator ()">raptor_parser_get_locator</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>);
<span class="returnvalue">void</span> <a class="link" href="raptor2-section-parser.html#raptor-parser-parse-abort" title="raptor_parser_parse_abort ()">raptor_parser_parse_abort</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>);
<span class="returnvalue">int</span> <a class="link" href="raptor2-section-parser.html#raptor-parser-parse-chunk" title="raptor_parser_parse_chunk ()">raptor_parser_parse_chunk</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>,
<em class="parameter"><code>const unsigned <span class="type">char</span> *buffer</code></em>,
<em class="parameter"><code><span class="type">size_t</span> len</code></em>,
<em class="parameter"><code><span class="type">int</span> is_end</code></em>);
<span class="returnvalue">int</span> <a class="link" href="raptor2-section-parser.html#raptor-parser-parse-file" title="raptor_parser_parse_file ()">raptor_parser_parse_file</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *uri</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *base_uri</code></em>);
<span class="returnvalue">int</span> <a class="link" href="raptor2-section-parser.html#raptor-parser-parse-file-stream" title="raptor_parser_parse_file_stream ()">raptor_parser_parse_file_stream</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>,
<em class="parameter"><code><span class="type">FILE</span> *stream</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *filename</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *base_uri</code></em>);
<span class="returnvalue">int</span> <a class="link" href="raptor2-section-parser.html#raptor-parser-parse-iostream" title="raptor_parser_parse_iostream ()">raptor_parser_parse_iostream</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> *iostr</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *base_uri</code></em>);
<span class="returnvalue">int</span> <a class="link" href="raptor2-section-parser.html#raptor-parser-parse-start" title="raptor_parser_parse_start ()">raptor_parser_parse_start</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *uri</code></em>);
<span class="returnvalue">int</span> <a class="link" href="raptor2-section-parser.html#raptor-parser-parse-uri" title="raptor_parser_parse_uri ()">raptor_parser_parse_uri</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *uri</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *base_uri</code></em>);
<span class="returnvalue">int</span> <a class="link" href="raptor2-section-parser.html#raptor-parser-parse-uri-with-connection" title="raptor_parser_parse_uri_with_connection ()">raptor_parser_parse_uri_with_connection</a>
(<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *uri</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *base_uri</code></em>,
<em class="parameter"><code><span class="type">void</span> *connection</code></em>);
<a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="returnvalue">raptor_uri</span></a> * <a class="link" href="raptor2-section-parser.html#raptor-parser-get-graph" title="raptor_parser_get_graph ()">raptor_parser_get_graph</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>);
const <span class="returnvalue">char</span> * <a class="link" href="raptor2-section-parser.html#raptor-parser-get-name" title="raptor_parser_get_name ()">raptor_parser_get_name</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>);
<span class="returnvalue">int</span> <a class="link" href="raptor2-section-parser.html#raptor-parser-set-option" title="raptor_parser_set_option ()">raptor_parser_set_option</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-option.html#raptor-option" title="enum raptor_option"><span class="type">raptor_option</span></a> option</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *string</code></em>,
<em class="parameter"><code><span class="type">int</span> integer</code></em>);
<span class="returnvalue">int</span> <a class="link" href="raptor2-section-parser.html#raptor-parser-get-option" title="raptor_parser_get_option ()">raptor_parser_get_option</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-option.html#raptor-option" title="enum raptor_option"><span class="type">raptor_option</span></a> option</code></em>,
<em class="parameter"><code><span class="type">char</span> **string_p</code></em>,
<em class="parameter"><code><span class="type">int</span> *integer_p</code></em>);
const <span class="returnvalue">char</span> * <a class="link" href="raptor2-section-parser.html#raptor-parser-get-accept-header" title="raptor_parser_get_accept_header ()">raptor_parser_get_accept_header</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>);
<span class="returnvalue">void</span> <a class="link" href="raptor2-section-parser.html#raptor-parser-set-uri-filter" title="raptor_parser_set_uri_filter ()">raptor_parser_set_uri_filter</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-www.html#raptor-uri-filter-func" title="raptor_uri_filter_func ()"><span class="type">raptor_uri_filter_func</span></a> filter</code></em>,
<em class="parameter"><code><span class="type">void</span> *user_data</code></em>);
<a class="link" href="raptor2-section-world.html#raptor-world" title="raptor_world"><span class="returnvalue">raptor_world</span></a> * <a class="link" href="raptor2-section-parser.html#raptor-parser-get-world" title="raptor_parser_get_world ()">raptor_parser_get_world</a> (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="raptor2-section-parser.description"></a><h2>Description</h2>
<p>
The parsing class that allows creating a parser for reading from a
particular syntax (or can guess and use contextual information) that
will on demand generate RDF triples to a handler function, as chunks
of syntax data are passed into the parser. Parsing can be done from
strings in memory, files or from URIs on the web.
</p>
<p>
There are also methods to deal with handling errors, warnings and
returned triples as well as setting options (features) that can
adjust how parsing is performed.
</p>
</div>
<div class="refsect1">
<a name="raptor2-section-parser.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="raptor-parser"></a><h3>raptor_parser</h3>
<pre class="programlisting">raptor_parser* raptor_parser;
</pre>
<p>
Raptor Parser class
</p>
</div>
<hr>
<div class="refsect2">
<a name="raptor-new-parser"></a><h3>raptor_new_parser ()</h3>
<pre class="programlisting"><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="returnvalue">raptor_parser</span></a> * raptor_new_parser (<em class="parameter"><code><a class="link" href="raptor2-section-world.html#raptor-world" title="raptor_world"><span class="type">raptor_world</span></a> *world</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
<p>
Constructor - create a new raptor_parser object.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>world</code></em> :</span></p></td>
<td>world object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>the parser name or NULL for default parser</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> object or NULL on failure</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-new-parser-for-content"></a><h3>raptor_new_parser_for_content ()</h3>
<pre class="programlisting"><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="returnvalue">raptor_parser</span></a> * raptor_new_parser_for_content (<em class="parameter"><code><a class="link" href="raptor2-section-world.html#raptor-world" title="raptor_world"><span class="type">raptor_world</span></a> *world</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *uri</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *mime_type</code></em>,
<em class="parameter"><code>const unsigned <span class="type">char</span> *buffer</code></em>,
<em class="parameter"><code><span class="type">size_t</span> len</code></em>,
<em class="parameter"><code>const unsigned <span class="type">char</span> *identifier</code></em>);</pre>
<p>
Constructor - create a new raptor_parser.
</p>
<p>
Uses <a class="link" href="raptor2-section-world.html#raptor-world-guess-parser-name" title="raptor_world_guess_parser_name ()"><code class="function">raptor_world_guess_parser_name()</code></a> to find a parser by scoring
recognition of the syntax by a block of characters, the content
identifier or a mime type. The content identifier is typically a
filename or URI or some other identifier.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>world</code></em> :</span></p></td>
<td>world object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
<td>URI identifying the syntax (or NULL)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>mime_type</code></em> :</span></p></td>
<td>mime type identifying the content (or NULL)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>buffer of content to guess (or NULL)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
<td>length of buffer</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>identifier</code></em> :</span></p></td>
<td>identifier of content (or NULL)</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> object or NULL on failure</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-free-parser"></a><h3>raptor_free_parser ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> raptor_free_parser (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *parser</code></em>);</pre>
<p>
Destructor - destroy a raptor_parser object.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
<td>
<a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> object</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-graph-mark-handler"></a><h3>raptor_graph_mark_handler ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> (*raptor_graph_mark_handler) (<em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *graph</code></em>,
<em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre>
<p>
Graph start/end mark handler function.
</p>
<p>
Records start and end of graphs happening in a stream of generated
<a class="link" href="raptor2-section-triples.html#raptor-statement" title="raptor_statement"><span class="type">raptor_statement</span></a> via the statement handler. The callback starts a
graph when <em class="parameter"><code>flags</code></em> has <a class="link" href="raptor2-section-parser.html#RAPTOR-GRAPH-MARK-START:CAPS"><span class="type">RAPTOR_GRAPH_MARK_START</span></a> bit set.
</p>
<p>
The start and ends may be either declared in the syntax via some
keyword or mechanism such as TRiG {} syntax when <em class="parameter"><code>flags</code></em> has bit
<a class="link" href="raptor2-section-parser.html#RAPTOR-GRAPH-MARK-DECLARED:CAPS"><span class="type">RAPTOR_GRAPH_MARK_DECLARED</span></a> set, or be implied by the start/end of
the data in other syntaxes, and the bit will be unset.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em> :</span></p></td>
<td>graph to report, NULL for the default graph</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>bitmask of <a class="link" href="raptor2-section-parser.html#raptor-graph-mark-flags" title="enum raptor_graph_mark_flags"><span class="type">raptor_graph_mark_flags</span></a> flags</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-namespace-handler"></a><h3>raptor_namespace_handler ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> (*raptor_namespace_handler) (<em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-xml-namespace.html#raptor-namespace" title="raptor_namespace"><span class="type">raptor_namespace</span></a> *nspace</code></em>);</pre>
<p>
XML Namespace declaration reporting handler set by
<a class="link" href="raptor2-section-parser.html#raptor-parser-set-namespace-handler" title="raptor_parser_set_namespace_handler ()"><code class="function">raptor_parser_set_namespace_handler()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>nspace</code></em> :</span></p></td>
<td>
<a class="link" href="raptor2-section-xml-namespace.html#raptor-namespace" title="raptor_namespace"><span class="type">raptor_namespace</span></a> declared</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-set-statement-handler"></a><h3>raptor_parser_set_statement_handler ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> raptor_parser_set_statement_handler (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *parser</code></em>,
<em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-general.html#raptor-statement-handler" title="raptor_statement_handler ()"><span class="type">raptor_statement_handler</span></a> handler</code></em>);</pre>
<p>
Set the statement handler function for the parser.
</p>
<p>
Use this to set the function to receive statements as the parsing
proceeds. The statement argument to <em class="parameter"><code>handler</code></em> is shared and must be
copied by the caller with <a class="link" href="raptor2-section-triples.html#raptor-statement-copy" title="raptor_statement_copy ()"><code class="function">raptor_statement_copy()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
<td>
<a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> parser object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data pointer for callback</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>handler</code></em> :</span></p></td>
<td>new statement callback function</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-graph-mark-flags"></a><h3>enum raptor_graph_mark_flags</h3>
<pre class="programlisting">typedef enum {
RAPTOR_GRAPH_MARK_START = 1,
RAPTOR_GRAPH_MARK_DECLARED = 2
} raptor_graph_mark_flags;
</pre>
<p>
Graph mark handler bitmask flags
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="RAPTOR-GRAPH-MARK-START:CAPS"></a><span class="term"><code class="literal">RAPTOR_GRAPH_MARK_START</code></span></p></td>
<td>mark is start of graph (otherwise is end)
</td>
</tr>
<tr>
<td><p><a name="RAPTOR-GRAPH-MARK-DECLARED:CAPS"></a><span class="term"><code class="literal">RAPTOR_GRAPH_MARK_DECLARED</code></span></p></td>
<td>mark was declared in syntax rather than implict
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-set-graph-mark-handler"></a><h3>raptor_parser_set_graph_mark_handler ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> raptor_parser_set_graph_mark_handler
(<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *parser</code></em>,
<em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-graph-mark-handler" title="raptor_graph_mark_handler ()"><span class="type">raptor_graph_mark_handler</span></a> handler</code></em>);</pre>
<p>
Set the graph mark handler function for the parser.
</p>
<p>
See <a class="link" href="raptor2-section-parser.html#raptor-graph-mark-handler" title="raptor_graph_mark_handler ()"><span class="type">raptor_graph_mark_handler</span></a> and <a class="link" href="raptor2-section-parser.html#raptor-graph-mark-flags" title="enum raptor_graph_mark_flags"><span class="type">raptor_graph_mark_flags</span></a> for
the marks that may be returned by the handler.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
<td>
<a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> parser object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data pointer for callback</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>handler</code></em> :</span></p></td>
<td>new graph callback function</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-set-namespace-handler"></a><h3>raptor_parser_set_namespace_handler ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> raptor_parser_set_namespace_handler (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *parser</code></em>,
<em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-namespace-handler" title="raptor_namespace_handler ()"><span class="type">raptor_namespace_handler</span></a> handler</code></em>);</pre>
<p>
Set the namespace handler function for the parser.
</p>
<p>
When a prefix/namespace is seen in a parser, call the given
<em class="parameter"><code>handler</code></em> with the prefix string and the <a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> namespace URI.
Either can be NULL for the default prefix or default namespace.
</p>
<p>
The handler function does not deal with duplicates so any
namespace may be declared multiple times.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
<td>
<a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> parser object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data pointer for callback</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>handler</code></em> :</span></p></td>
<td>new namespace callback function</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-get-description"></a><h3>raptor_parser_get_description ()</h3>
<pre class="programlisting">const <a class="link" href="raptor2-section-general.html#raptor-syntax-description" title="raptor_syntax_description"><span class="returnvalue">raptor_syntax_description</span></a> * raptor_parser_get_description
(<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>);</pre>
<p>
Get description of the syntaxes of the parser.
</p>
<p>
The returned description is static and lives as long as the raptor
library (raptor world).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>rdf_parser</code></em> :</span></p></td>
<td>
<a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> parser object</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>description of syntax</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-get-locator"></a><h3>raptor_parser_get_locator ()</h3>
<pre class="programlisting"><a class="link" href="raptor2-section-locator.html#raptor-locator" title="raptor_locator"><span class="returnvalue">raptor_locator</span></a> * raptor_parser_get_locator (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>);</pre>
<p>
Get the current raptor locator object.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>rdf_parser</code></em> :</span></p></td>
<td>raptor parser</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>raptor locator</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-parse-abort"></a><h3>raptor_parser_parse_abort ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> raptor_parser_parse_abort (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>);</pre>
<p>
Abort an ongoing parsing.
</p>
<p>
Causes any ongoing generation of statements by a parser to be
terminated and the parser to return controlto the application
as soon as draining any existing buffers.
</p>
<p>
Most useful inside <a class="link" href="raptor2-section-parser.html#raptor-parser-parse-file" title="raptor_parser_parse_file ()"><code class="function">raptor_parser_parse_file()</code></a> or
<a class="link" href="raptor2-section-parser.html#raptor-parser-parse-uri" title="raptor_parser_parse_uri ()"><code class="function">raptor_parser_parse_uri()</code></a> when the Raptor library is directing the
parsing and when one of the callback handlers such as as set by
<a class="link" href="raptor2-section-parser.html#raptor-parser-set-statement-handler" title="raptor_parser_set_statement_handler ()"><code class="function">raptor_parser_set_statement_handler()</code></a> requires to return to the main
application code.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>rdf_parser</code></em> :</span></p></td>
<td>
<a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> parser object</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-parse-chunk"></a><h3>raptor_parser_parse_chunk ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> raptor_parser_parse_chunk (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>,
<em class="parameter"><code>const unsigned <span class="type">char</span> *buffer</code></em>,
<em class="parameter"><code><span class="type">size_t</span> len</code></em>,
<em class="parameter"><code><span class="type">int</span> is_end</code></em>);</pre>
<p>
Parse a block of content into triples.
</p>
<p>
This method can only be called after <a class="link" href="raptor2-section-parser.html#raptor-parser-parse-start" title="raptor_parser_parse_start ()"><code class="function">raptor_parser_parse_start()</code></a> has
initialised the parser.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>rdf_parser</code></em> :</span></p></td>
<td>RDF parser</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>content to parse</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
<td>length of buffer</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>is_end</code></em> :</span></p></td>
<td>non-0 if this is the end of the content (such as EOF)</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>non-0 on failure.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-parse-file"></a><h3>raptor_parser_parse_file ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> raptor_parser_parse_file (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *uri</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *base_uri</code></em>);</pre>
<p>
Parse RDF content at a file URI.
</p>
<p>
If <em class="parameter"><code>uri</code></em> is NULL (source is stdin), then the <em class="parameter"><code>base_uri</code></em> is required.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>rdf_parser</code></em> :</span></p></td>
<td>parser</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
<td>URI of RDF content or NULL to read from standard input</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>base_uri</code></em> :</span></p></td>
<td>the base URI to use (or NULL if the same)</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>non 0 on failure</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-parse-file-stream"></a><h3>raptor_parser_parse_file_stream ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> raptor_parser_parse_file_stream (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>,
<em class="parameter"><code><span class="type">FILE</span> *stream</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *filename</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *base_uri</code></em>);</pre>
<p>
Parse RDF content from a FILE*.
</p>
<p>
After draining the FILE* stream (EOF), fclose is not called on it.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>rdf_parser</code></em> :</span></p></td>
<td>parser</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
<td>FILE* of RDF content</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
<td>filename of content or NULL if it has no name</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>base_uri</code></em> :</span></p></td>
<td>the base URI to use</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>non 0 on failure</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-parse-iostream"></a><h3>raptor_parser_parse_iostream ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> raptor_parser_parse_iostream (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> *iostr</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *base_uri</code></em>);</pre>
<p>
Parse content from an iostream
</p>
<p>
If the parser requires a base URI and <em class="parameter"><code>base_uri</code></em> is NULL, an error
will be generated and the function will fail.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>rdf_parser</code></em> :</span></p></td>
<td>parser</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td>iostream to read from</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>base_uri</code></em> :</span></p></td>
<td>the base URI to use (or NULL)</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>non 0 on failure, <0 if a required base URI was missing</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-parse-start"></a><h3>raptor_parser_parse_start ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> raptor_parser_parse_start (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *uri</code></em>);</pre>
<p>
Start a parse of content with base URI.
</p>
<p>
Parsers that need a base URI can be identified using a syntax
description returned by <a class="link" href="raptor2-section-world.html#raptor-world-get-parser-description" title="raptor_world_get_parser_description ()"><code class="function">raptor_world_get_parser_description()</code></a>
statically or <a class="link" href="raptor2-section-parser.html#raptor-parser-get-description" title="raptor_parser_get_description ()"><code class="function">raptor_parser_get_description()</code></a> on a constructed
parser.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>rdf_parser</code></em> :</span></p></td>
<td>RDF parser</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
<td>base URI or may be NULL if no base URI is required</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>non-0 on failure, <0 if a required base URI was missing</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-parse-uri"></a><h3>raptor_parser_parse_uri ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> raptor_parser_parse_uri (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *uri</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *base_uri</code></em>);</pre>
<p>
Parse the RDF content at URI.
</p>
<p>
Sends an HTTP Accept: header whent the URI is of the HTTP protocol,
see <a class="link" href="raptor2-section-parser.html#raptor-parser-parse-uri-with-connection" title="raptor_parser_parse_uri_with_connection ()"><code class="function">raptor_parser_parse_uri_with_connection()</code></a> for details including
how the <em class="parameter"><code>base_uri</code></em> is used.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>rdf_parser</code></em> :</span></p></td>
<td>parser</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
<td>URI of RDF content</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>base_uri</code></em> :</span></p></td>
<td>the base URI to use (or NULL if the same)</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>non 0 on failure</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-parse-uri-with-connection"></a><h3>raptor_parser_parse_uri_with_connection ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> raptor_parser_parse_uri_with_connection
(<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *uri</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="type">raptor_uri</span></a> *base_uri</code></em>,
<em class="parameter"><code><span class="type">void</span> *connection</code></em>);</pre>
<p>
Parse RDF content at URI using existing WWW connection.
</p>
<p>
If <em class="parameter"><code>base_uri</code></em> is not given and during resolution of the URI, a
protocol redirection occurs, the final resolved URI will be
used as the base URI. If redirection does not occur, the
base URI will be <em class="parameter"><code>uri</code></em>.
</p>
<p>
If <em class="parameter"><code>base_uri</code></em> is given, it overrides the process above.
</p>
<p>
When <em class="parameter"><code>connection</code></em> is NULL and a MIME Type exists for the parser
type, this type is sent in an HTTP Accept: header in the form
Accept: MIME-TYPE along with a wildcard of 0.1 quality, so MIME-TYPE is
prefered rather than the sole answer. The latter part may not be
necessary but should ensure an HTTP 200 response.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>rdf_parser</code></em> :</span></p></td>
<td>parser</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
<td>URI of RDF content</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>base_uri</code></em> :</span></p></td>
<td>the base URI to use (or NULL if the same)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>connection object pointer or NULL to create a new one</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>non 0 on failure</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-get-graph"></a><h3>raptor_parser_get_graph ()</h3>
<pre class="programlisting"><a class="link" href="raptor2-section-uri.html#raptor-uri" title="raptor_uri"><span class="returnvalue">raptor_uri</span></a> * raptor_parser_get_graph (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>);</pre>
<p>
Get the current graph for the parser
</p>
<p>
The returned URI is owned by the caller and must be freed with
<a class="link" href="raptor2-section-uri.html#raptor-free-uri" title="raptor_free_uri ()"><code class="function">raptor_free_uri()</code></a>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>rdf_parser</code></em> :</span></p></td>
<td>parser</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>raptor_uri* graph name or NULL for the default graph</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-get-name"></a><h3>raptor_parser_get_name ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * raptor_parser_get_name (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>);</pre>
<p>
Get the name of a parser.
</p>
<p>
Use <a class="link" href="raptor2-section-parser.html#raptor-parser-get-description" title="raptor_parser_get_description ()"><code class="function">raptor_parser_get_description()</code></a> to get the alternate names and
aliases as well as other descriptive values.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>rdf_parser</code></em> :</span></p></td>
<td>
<a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> parser object</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the short name for the parser.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-set-option"></a><h3>raptor_parser_set_option ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> raptor_parser_set_option (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-option.html#raptor-option" title="enum raptor_option"><span class="type">raptor_option</span></a> option</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *string</code></em>,
<em class="parameter"><code><span class="type">int</span> integer</code></em>);</pre>
<p>
Set parser option.
</p>
<p>
If <em class="parameter"><code>string</code></em> is not NULL and the option type is numeric, the string
value is converted to an integer and used in preference to <em class="parameter"><code>integer</code></em>.
</p>
<p>
If <em class="parameter"><code>string</code></em> is NULL and the option type is not numeric, an error is
returned.
</p>
<p>
The <em class="parameter"><code>string</code></em> values used are copied.
</p>
<p>
The allowed options are available via
<a class="link" href="raptor2-section-option.html#raptor-world-get-option-description" title="raptor_world_get_option_description ()"><code class="function">raptor_world_get_option_description()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
<td>
<a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> parser object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>option</code></em> :</span></p></td>
<td>option to set from enumerated <a class="link" href="raptor2-section-option.html#raptor-option" title="enum raptor_option"><span class="type">raptor_option</span></a> values</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>string option value (or NULL)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>integer</code></em> :</span></p></td>
<td>integer option value</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>non 0 on failure or if the option is unknown</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-get-option"></a><h3>raptor_parser_get_option ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> raptor_parser_get_option (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-option.html#raptor-option" title="enum raptor_option"><span class="type">raptor_option</span></a> option</code></em>,
<em class="parameter"><code><span class="type">char</span> **string_p</code></em>,
<em class="parameter"><code><span class="type">int</span> *integer_p</code></em>);</pre>
<p>
Get parser option.
</p>
<p>
Any string value returned in *<em class="parameter"><code>string_p</code></em> is shared and must
be copied by the caller.
</p>
<p>
The allowed options are available via
<a class="link" href="raptor2-section-option.html#raptor-world-get-option-description" title="raptor_world_get_option_description ()"><code class="function">raptor_world_get_option_description()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
<td>
<a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> parser object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>option</code></em> :</span></p></td>
<td>option to get value</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>string_p</code></em> :</span></p></td>
<td>pointer to where to store string value</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>integer_p</code></em> :</span></p></td>
<td>pointer to where to store integer value</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>option value or < 0 for an illegal option</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-get-accept-header"></a><h3>raptor_parser_get_accept_header ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * raptor_parser_get_accept_header (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>);</pre>
<p>
Get an HTTP Accept value for the parser.
</p>
<p>
The returned string must be freed by the caller such as with
<a class="link" href="raptor2-section-memory.html#raptor-free-memory" title="raptor_free_memory ()"><code class="function">raptor_free_memory()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>rdf_parser</code></em> :</span></p></td>
<td>parser</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new Accept: header string or NULL on failure</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-set-uri-filter"></a><h3>raptor_parser_set_uri_filter ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> raptor_parser_set_uri_filter (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *parser</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-www.html#raptor-uri-filter-func" title="raptor_uri_filter_func ()"><span class="type">raptor_uri_filter_func</span></a> filter</code></em>,
<em class="parameter"><code><span class="type">void</span> *user_data</code></em>);</pre>
<p>
Set URI filter function for WWW retrieval.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
<td>parser object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>filter</code></em> :</span></p></td>
<td>URI filter function</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>User data to pass to filter function</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-parser-get-world"></a><h3>raptor_parser_get_world ()</h3>
<pre class="programlisting"><a class="link" href="raptor2-section-world.html#raptor-world" title="raptor_world"><span class="returnvalue">raptor_world</span></a> * raptor_parser_get_world (<em class="parameter"><code><a class="link" href="raptor2-section-parser.html#raptor-parser" title="raptor_parser"><span class="type">raptor_parser</span></a> *rdf_parser</code></em>);</pre>
<p>
Get the <a class="link" href="raptor2-section-world.html#raptor-world" title="raptor_world"><span class="type">raptor_world</span></a> object associated with a parser.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>rdf_parser</code></em> :</span></p></td>
<td>parser</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>raptor_world* pointer</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.18</div>
</body>
</html>
|