libraptor2(3)
π libraptor2 β Raptor RDF syntax library 2.0 π
okay bestie, so this is a page from the Library Functions Manual, and it's literally the glow-up era of Raptor β the RDF syntax library, version 2.0. sit down, hydrate, let's go π¦
β¨ SYNOPSIS β¨
no cap, here's the whole vibe in one little block:
#include <raptor2.h>
world=raptor_new_world();
raptor_parser *p=raptor_new_parser(world,rdfxml);
raptor_set_statement_handler(p,NULL,print_triples);
raptor_uri *file_uri=raptor_new_uri(world,http://example.org/);
raptor_parser_parse_file(p,file_uri,base_uri);
raptor_parser_parse_uri(p,uri,NULL);
raptor_free_parser(p);
raptor_free_uri(file_uri);
raptor_free_world(world);
cc prog.c -o prog `pkg-config raptor2 --cflags` `pkg-config raptor2 --libs`
and yes, that last line is how you actually build your little program, pkg-config carrying you the whole way π«Ά
πΈ DESCRIPTION πΈ
The Raptor library hands you a high-level interface to a whole squad of parsers and serializers. what do they do? they generate Resource Description Framework (RDF) triples by parsing syntaxes, or they take those triples and serialize them back out into syntaxes. it's giving both directions, iconic honestly π
okay so the parsing syntaxes it supports are:
- RDF/XML
- N-Triples
- Turtle
- TRiG
- RSS tag soup (including all RSS and Atoms)
- GRDDL
- RDF/JSON
- RDFa
and the serializing syntaxes are:
- RDF/XML (3 varieties)
- N-Quads
- N-Triples
- Turtle
- RSS 1.0
- Atom 1.0
- GraphViz DOT
- RDF/JSON
The RDF/XML parser can use either expat or libxml XML parsers to provide the SAX event stream β pick your fighter, both valid β¨
The library functions are arranged in an object-oriented style, with constructors, destructors and method calls. The statements and error messages get delivered via callback functions β so it's not me yelling at you, it's a function you registered earlier π
Raptor also contains classes to support the RDF graph triples: a statement object containing term objects, plus support for RDF URI-References for both parsing them and resolving / retrieval of URIs. the way that it handles URIs... obsessed π¦
It some utility classes too β an I/O Stream abstraction for supporting reading and writing to and from a variety of locations, AVL Trees, String buffers and Sequences. very "built different" of it π«Ά
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. And it's intended that the preservation of Unicode for URIs supports Internationalized Resource Identifiers (IRIs). global queen behaviour π
π API REFERENCE π
See the HTML API docs, which may be installed system wide at /usr/share/gtk-doc/html/raptor2/ or on the web at http://librdf.org/raptor/api/ π
π« API CHANGES π«
See the Raptor API docs changes section at http://librdf.org/raptor/api/raptor-changes.html β and the upgrading information for when you're converting from libraptor(1) code, at http://librdf.org/raptor/UPGRADING.html π§
π CONFORMING TO π
the receipts, bestie β every spec this thing plays nice with:
- RDF/XML Syntax (Revised), Dave Beckett (ed.) W3C Recommendation,
http://www.w3.org/TR/rdf-syntax-grammar/ - N-Triples, in RDF Test Cases, Jan Grant and Dave Beckett (eds.) W3C Recommendation,
http://www.w3.org/TR/rdf-testcases/#ntriples - Turtle - Terse RDF Triple Language, Dave Beckett,
http://www.dajobe.org/2004/01/turtle/ - RSS 0.91 spec revision 3, Dan Libby, Netscape,
http://my.netscape.com/publish/formats/rss-spec-0.91.html - RDF Site Summary (RSS) 1.0,
http://purl.org/rss/1.0/spec - Atom 1.0 syndication format, RFC 4287,
http://www.ietf.org/rfc/rfc4287.txt - Gleaning Resource Descriptions from Dialects of Languages (GRDDL), Dan Connolly (ed.), W3C Recommendation, 2007-09-11,
http://www.w3.org/TR/2007/REC-grddl-20070911/ - RDFa in XHTML: Syntax and Processing, Ben Adida, Mark Birbeck, Shane McCarron, Steven Pemberton (eds.) W3C Recommendation, 2008-10-14,
http://www.w3.org/TR/2008/REC-rdfa-syntax-20081014/
π SEE ALSO π
rapper(1)β yes, go say hi π
ποΈ AUTHOR ποΈ
Dave Beckett - http://www.dajobe.org/
and that's the whole page, no notes π
this was libraptor2(3), dated 2010-08-16, from the Library Functions Manual β slay, go parse something π₯
π¦ where this page comes from
- alpine 3.24: raptor2-doc 2.0.16-r1 Β· LGPL-2.1-or-later
- arch rolling: raptor 2.0.16-9 Β· Apache-2.0 OR GPL-2.0-or-later OR LGPL-2.1-or-later
- centos-stream 9: raptor2-devel 2.0.15-31.el9 Β· GPLv2+ or LGPLv2+ or ASL 2.0
- centos-stream 9: raptor2-devel 2.0.15-31.el9 Β· GPLv2+ or LGPLv2+ or ASL 2.0
- debian bookworm: libraptor2-dev 2.0.15-4+deb12u1 Β· LGPL-2.1-or-later
- debian trixie: libraptor2-dev 2.0.16-6 Β· LGPL-2.1-or-later
- fedora 43: raptor2-devel 2.0.15-49.fc43 Β· GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ OR Apache-2.0
- fedora 43: raptor2-devel 2.0.15-49.fc43 Β· GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ OR Apache-2.0
- fedora 44: raptor2-devel 2.0.15-50.fc44 Β· GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ OR Apache-2.0
- fedora 44: raptor2-devel 2.0.15-50.fc44 Β· GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ OR Apache-2.0
- opensuse-leap 16.0: raptor 2.0.16-160000.2.2 Β· Apache-2.0 OR GPL-2.0-or-later OR LGPL-2.1-or-later
- opensuse-leap 16.0: raptor 2.0.16-160000.2.2 Β· Apache-2.0 OR GPL-2.0-or-later OR LGPL-2.1-or-later
- opensuse-leap 16.0: raptor 2.0.16-160000.2.2 Β· Apache-2.0 OR GPL-2.0-or-later OR LGPL-2.1-or-later
- opensuse-leap 16.0: raptor 2.0.16-160000.2.2 Β· Apache-2.0 OR GPL-2.0-or-later OR LGPL-2.1-or-later
- ubuntu jammy: libraptor2-dev 2.0.15-0ubuntu4
- ubuntu jammy: libraptor2-dev 2.0.15-0ubuntu4.1
- ubuntu noble: libraptor2-dev 2.0.16-3build3 Β· LGPL-2.1-or-later
- ubuntu noble: libraptor2-dev 2.0.16-3ubuntu0.1 Β· LGPL-2.1-or-later
- ubuntu questing: libraptor2-dev 2.0.16-6
- ubuntu resolute: libraptor2-dev 2.0.16-6build1 Β· LGPL-2.1-or-later
- ubuntu stonking: libraptor2-dev 2.0.16-7 Β· LGPL-2.1-or-later
- Copyright (C) 2002-2010 David Beckett - http://www.dajobe.org/
- Copyright (C) 2002-2005 University of Bristol, UK
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms