1RDF::Redland::Parser(3)User Contributed Perl DocumentatioRnDF::Redland::Parser(3)
2
3
4

NAME

6       RDF::Redland::Parser - Redland RDF Syntax Parsers Class
7

SYNOPSIS

9         use RDF::Redland;
10
11         ...
12         my $parser=new RDF::Redland::Parser("rdfxml");
13         my $parser2=new RDF::Redland::Parser(undef, "application/rdf+xml);
14
15         # Return as an RDF::Redland::Stream
16         my $stream=$parser->parse_as_stream($source_uri, $base_uri);
17
18         # Store in an RDF::Redland::Model
19         $parser->parse_into_model($source_uri, $base_uri, $model);
20

DESCRIPTION

22       This class represents parsers of various syntaxes that can deliver a
23       RDF model either as a RDF::Redland::Stream of RDF::Redland::Statement
24       objects or directly into an RDF::Redland::Model object.
25

CONSTRUCTORS

27       new [NAME [MIME_TYPE [URI]]]
28           Create a new RDF::Redland::Parser object for a syntax parser named
29           NAME, with MIME Type MIME_TYPE and/or URI URI.  Any field can be
30           undef or omitted; if all are omitted, a parser that provides MIME
31           Type application/rdf+xml will be requested.
32

METHODS

34       parse_as_stream SOURCE_URI BASE_URI
35           Parse the syntax at the RDF::Redland::URI SOURCE_URI with optional
36           base RDF::Redland::URI BASE_URI.  If the base URI is given then the
37           content is parsed as if it was at the base URI rather than the
38           source URI.
39
40           Returns an RDF::Redland::Stream of RDF::Redland::Statement objects
41           or undef on failure.
42
43       parse_into_model SOURCE_URI BASE_URI MODEL [HANDLER]
44           Parse the syntax at the RDF::Redland::URI SOURCE_URI with optional
45           base RDF::Redland::URI BASE_URI into RDF::Redland::Model MODEL.  If
46           the base URI is given then the content is parsed as if it was at
47           the base URI rather than the source URI.
48
49           If the optional HANDLER is given, it is a reference to a sub with
50           the signature
51             sub handler($$$$$$$$$) {
52               my($code, $level, $facility, $message, $line, $column, $byte,
53           $file, $uri)=@_;
54               ...
55             } that receives errors in parsing.
56
57       parse_string_as_stream STRING BASE_URI
58           Parse the syntax in STRING with required base RDF::Redland::URI
59           BASE_URI.
60
61           Returns an RDF::Redland::Stream of RDF::Redland::Statement objects
62           or undef on failure.
63
64       parse_string_into_model STRING BASE_URI MODEL [HANDLER]
65           Parse the syntax in STRING with required base RDF::Redland::URI
66           BASE_URI into RDF::Redfland::Model MODEL.
67
68           If the optional HANDLER is given, it is a reference to a sub with
69           the signature
70             sub handler($$$$$$$$$) {
71               my($code, $level, $facility, $message, $line, $column, $byte,
72           $file, $uri)=@_;
73               ...
74             } that receives errors in parsing.
75
76       feature URI [VALUE]
77           Get/set a parser feature.  The feature is named via
78           RDF::Redland::URI URI and the value is a RDF::Redland::Node.  If
79           VALUE is given, the feature is set to that value, otherwise the
80           current value is returned.
81
82       namespaces_seen
83           Get the set of namespace declarations seen during parsing as a hash
84           of key:prefix string (may be ''), value: RDF::Redland::URI objects.
85

SEE ALSO

87       RDF::Redland::URI
88

AUTHOR

90       Dave Beckett - http://www.dajobe.org/
91
92
93
94perl v5.32.0                      2020-07-29           RDF::Redland::Parser(3)
Impressum