RDF::R...Parser(3pm)
β¨ RDF::R...Parser π
(it's the RDF::Redland::Parser page, bestie)
okay so you found the RDF::R...Parser manpage in the User Contributed Perl Documentation section and I'm SO glad you're here π«Ά this is the whole thing, every single crumb, no skips.
πΈ NAME
RDF::Redland::Parser β the Redland RDF Syntax Parsers Class, aka the girl who takes your weird RDF syntax and turns it into actual statements π
π SYNOPSIS
use RDF::Redland;
...
my $parser=new RDF::Redland::Parser("rdfxml");
my $parser2=new RDF::Redland::Parser(undef, "application/rdf+xml);
# Return as an RDF::Redland::Stream
my $stream=$parser->parse_as_stream($source_uri, $base_uri);
# Store in an RDF::Redland::Model
$parser->parse_into_model($source_uri, $base_uri, $model);
π¦ DESCRIPTION
so basically, this class is the parser representation moment β¨ It handles a bunch of different syntaxes, and it can hand you back an RDF model in two iconic ways:
- as an
RDF::Redland::Streamfull ofRDF::Redland::Statementobjects, or - straight into an
RDF::Redland::Modelobject.
that's it, that's the whole vibe. slay.
π CONSTRUCTORS
new [NAME [MIME_TYPE [URI]]]β makes you a brand newRDF::Redland::Parserobject for a syntax parser named NAME, with MIME Type MIME_TYPE and/or URI URI. literally any of those fields can beundefor just... not there. And if you omit all of them? it requests a parser that provides MIME Typeapplication/rdf+xml. no notes π
π METHODS
parse_as_stream SOURCE_URI BASE_URIβ parses the syntax living at theRDF::Redland::URISOURCE_URI, with an optional baseRDF::Redland::URIBASE_URI. If you give it a base URI, the content gets parsed as if it was chillin' at the base URI instead of the source URI. Returns anRDF::Redland::StreamofRDF::Redland::Statementobjects, orundefon failure π lowkey rude of it but that's the deal.parse_into_model SOURCE_URI BASE_URI MODEL [HANDLER]β parses the syntax at theRDF::Redland::URISOURCE_URI with optional baseRDF::Redland::URIBASE_URI, and yeets it intoRDF::Redland::ModelMODEL. Same base-URI situation as above: if the base URI is given, the content is parsed as if it was at the base URI rather than the source URI.
If you pass the optional HANDLER, it's a reference to a sub with this exact signature:
sub handler($$$$$$$$$) {
my($code, $level, $facility, $message, $line, $column, $byte,
$file, $uri)=@_;
...
}
and that sub receives errors in parsing π«Ά (nine whole args, she's doing the most, but valid.)
parse_string_as_stream STRING BASE_URIβ parses the syntax inside STRING with a required baseRDF::Redland::URIBASE_URI. Returns anRDF::Redland::StreamofRDF::Redland::Statementobjects, orundefon failure. bestie the base URI here is required, don't forget it πparse_string_into_model STRING BASE_URI MODEL [HANDLER]β parses the syntax in STRING with required baseRDF::Redland::URIBASE_URI intoRDF::Redfland::ModelMODEL. (yes, that's exactly how it's spelled on the page,Redfland, iconic typo, we keep it fr fr.)
If you pass the optional HANDLER, it's a reference to a sub with this signature:
sub handler($$$$$$$$$) {
my($code, $level, $facility, $message, $line, $column, $byte,
$file, $uri)=@_;
...
}
which receives errors in parsing π
feature URI [VALUE]β get/set a parser feature, main character energy. The feature is named viaRDF::Redland::URIURI and the value is aRDF::Redland::Node. If you hand over VALUE, the feature gets set to that value. Otherwise? the current value comes back to you πnamespaces_seenβ gets you the set of namespace declarations seen during parsing, as a hash. Key: the prefix string (and yes, it may be''). Value:RDF::Redland::URIobjects. obsessed.
π₯ SEE ALSO
RDF::Redland::URI
π AUTHOR
Dave Beckett β http://www.dajobe.org/ π
bestie reminder:perl v5.42.3, dated2026-08-20, and this whole page isRDF::R...Parser(3pm)from the User Contributed Perl Documentation. go forth and parse, you absolute legend ππ
π¦ where this page comes from
- ubuntu stonking: librdf-perl 1.0.17.1+dfsg-9build1 Β· LGPL-2.1-or-later OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms