.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "RDF::Redland::Parser 3pm" .TH RDF::Redland::Parser 3pm "2020-11-09" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" RDF::Redland::Parser \- Redland RDF Syntax Parsers Class .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& 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); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class represents parsers of various syntaxes that can deliver a \&\s-1RDF\s0 model either as a RDF::Redland::Stream of RDF::Redland::Statement objects or directly into an RDF::Redland::Model object. .SH "CONSTRUCTORS" .IX Header "CONSTRUCTORS" .IP "new [\s-1NAME\s0 [\s-1MIME_TYPE\s0 [\s-1URI\s0]]]" 4 .IX Item "new [NAME [MIME_TYPE [URI]]]" Create a new RDF::Redland::Parser object for a syntax parser named \fI\s-1NAME\s0\fR, with \s-1MIME\s0 Type \fI\s-1MIME_TYPE\s0\fR and/or \s-1URI\s0 \fI\s-1URI\s0\fR. Any field can be undef or omitted; if all are omitted, a parser that provides \s-1MIME\s0 Type application/rdf+xml will be requested. .SH "METHODS" .IX Header "METHODS" .IP "parse_as_stream \s-1SOURCE_URI BASE_URI\s0" 4 .IX Item "parse_as_stream SOURCE_URI BASE_URI" Parse the syntax at the RDF::Redland::URI \fI\s-1SOURCE_URI\s0\fR with optional base RDF::Redland::URI \fI\s-1BASE_URI\s0\fR. If the base \s-1URI\s0 is given then the content is parsed as if it was at the base \s-1URI\s0 rather than the source \s-1URI.\s0 .Sp Returns an RDF::Redland::Stream of RDF::Redland::Statement objects or undef on failure. .IP "parse_into_model \s-1SOURCE_URI BASE_URI MODEL\s0 [\s-1HANDLER\s0]" 4 .IX Item "parse_into_model SOURCE_URI BASE_URI MODEL [HANDLER]" Parse the syntax at the RDF::Redland::URI \fI\s-1SOURCE_URI\s0\fR with optional base RDF::Redland::URI \fI\s-1BASE_URI\s0\fR into RDF::Redland::Model \fI\s-1MODEL\s0\fR. If the base \s-1URI\s0 is given then the content is parsed as if it was at the base \s-1URI\s0 rather than the source \s-1URI.\s0 .Sp If the optional \fI\s-1HANDLER\s0\fR is given, it is a reference to a sub with the signature sub handler($$$$$$$$$) { my($code, \f(CW$level\fR, \f(CW$facility\fR, \f(CW$message\fR, \f(CW$line\fR, \f(CW$column\fR, \f(CW$byte\fR, \f(CW$file\fR, \f(CW$uri\fR)=@_; ... } that receives errors in parsing. .IP "parse_string_as_stream \s-1STRING BASE_URI\s0" 4 .IX Item "parse_string_as_stream STRING BASE_URI" Parse the syntax in \fI\s-1STRING\s0\fR with required base RDF::Redland::URI \fI\s-1BASE_URI\s0\fR. .Sp Returns an RDF::Redland::Stream of RDF::Redland::Statement objects or undef on failure. .IP "parse_string_into_model \s-1STRING BASE_URI MODEL\s0 [\s-1HANDLER\s0]" 4 .IX Item "parse_string_into_model STRING BASE_URI MODEL [HANDLER]" Parse the syntax in \fI\s-1STRING\s0\fR with required base RDF::Redland::URI \fI\s-1BASE_URI\s0\fR into RDF::Redfland::Model \fI\s-1MODEL\s0\fR. .Sp If the optional \fI\s-1HANDLER\s0\fR is given, it is a reference to a sub with the signature sub handler($$$$$$$$$) { my($code, \f(CW$level\fR, \f(CW$facility\fR, \f(CW$message\fR, \f(CW$line\fR, \f(CW$column\fR, \f(CW$byte\fR, \f(CW$file\fR, \f(CW$uri\fR)=@_; ... } that receives errors in parsing. .IP "feature \s-1URI\s0 [\s-1VALUE\s0]" 4 .IX Item "feature URI [VALUE]" Get/set a parser feature. The feature is named via RDF::Redland::URI \&\fI\s-1URI\s0\fR and the value is a RDF::Redland::Node. If \fI\s-1VALUE\s0\fR is given, the feature is set to that value, otherwise the current value is returned. .IP "namespaces_seen" 4 .IX Item "namespaces_seen" Get the set of namespace declarations seen during parsing as a hash of key:prefix string (may be ''), value: RDF::Redland::URI objects. .SH "SEE ALSO" .IX Header "SEE ALSO" RDF::Redland::URI .SH "AUTHOR" .IX Header "AUTHOR" Dave Beckett \- http://www.dajobe.org/