libraptor2 man page

libraptor2 — Raptor RDF syntax library 2.0


#include <raptor2.h>


raptor_parser *p=raptor_new_parser(world,rdfxml);


raptor_uri *file_uri=raptor_new_uri(world,;






cc prog.c -o prog `pkg-config raptor2 --cflags` `pkg-config raptor2 --libs`


The Raptor library provides a high-level interface to a set of parsers and serializers that generate Resource Description Framework (RDF) triples by parsing syntaxes or serialize the triples into syntaxes.

The supported parsing syntaxes include RDF/XML, N-Triples, Turtle, TRiG, RSS tag soup (including all RSS and Atoms), GRDDL, RDF/JSON, RDFa and the serializing syntaxes include RDF/XML (3 varieties), N-Quads, N-Triples, Turtle, RSS 1.0, Atom 1.0, GraphViz DOT and RDF/JSON. The RDF/XML parser can use either expat or libxml XML parsers for providing the SAX event stream. The library functions are arranged in an object-oriented style with constructors, destructors and method calls. The statements and error messages are delivered via callback functions.

Raptor also contains classes to support the RDF graph triples: a statement object containing term objects and support for RDF URI-References for both parsing them and resolving / retrieval of URIs.

It some utility classes such as an I/O Stream abstraction for supporting reading and writing to and from a variety of locations, AVL Trees, String buffers and Sequences.

Raptor uses Unicode strings for RDF literals and URIs and preserves them throughout the library. It uses the UTF-8 encoding of Unicode at the API for passing in or returning Unicode strings. It is intended that the preservation of Unicode for URIs supports Internationalized Resource Identifiers (IRIs).

API Reference

See the HTML API docs that may be installed system wide at /usr/share/gtk-doc/html/raptor2/ or on the web at

API Changes

See the Raptor API docs changes section at and the upgrading information when converting from libraptor(1) code at

Conforming to

RDF/XML Syntax (Revised), Dave Beckett (ed.) W3C Recommendation,

N-Triples, in RDF Test Cases, Jan Grant and Dave Beckett (eds.) W3C Recommendation,…

Turtle - Terse RDF Triple Language, Dave Beckett,

RSS 0.91 spec revision 3, Dan Libby, Netscape,…

RDF Site Summary (RSS) 1.0,

Atom 1.0 syndication format, RFC 4287,

Gleaning Resource Descriptions from Dialects of Languages (GRDDL), Dan Connolly (ed.), W3C Recommendation, 2007-09-11,…

RDFa in XHTML: Syntax and Processing, Ben Adida, Mark Birbeck, Shane McCarron, Steven Pemberton (eds.)
W3C Recommendation, 2008-10-14,…

See Also



Dave Beckett -

Referenced By