The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Redland RDF Application Framework - Perl RDF::Redland::Parser Class</title>
</head>
<body>

<h1 style="text-align:center">Redland RDF Application Framework - Perl RDF::Redland::Parser Class</h1>


<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>
<!--

<ul>

        <li><a href="#name">NAME</a></li>
        <li><a href="#synopsis">SYNOPSIS</a></li>
        <li><a href="#description">DESCRIPTION</a></li>
        <li><a href="#constructors">CONSTRUCTORS</a></li>
        <li><a href="#methods">METHODS</a></li>
        <li><a href="#see_also">SEE ALSO</a></li>
        <li><a href="#author">AUTHOR</a></li>
</ul>

--></div>
<!-- INDEX END -->

<h2><a name="name">NAME</a></h2>
<p>RDF::Redland::Parser - Redland RDF Syntax Parsers Class</p>

<h2><a name="synopsis">SYNOPSIS</a></h2>
<pre>
  use RDF::Redland;
</pre>
<pre>
  ...
  my $parser=new RDF::Redland::Parser("rdfxml");
  my $parser2=new RDF::Redland::Parser(undef, "application/rdf+xml);
</pre>
<pre>
  # Return as an RDF::Redland::Stream
  my $stream=$parser-&gt;parse_as_stream($source_uri, $base_uri);
  
  # Store in an RDF::Redland::Model
  $parser-&gt;parse_into_model($source_uri, $base_uri, $model);
</pre>

<h2><a name="description">DESCRIPTION</a></h2>
<p>This class represents parsers of various syntaxes that can deliver a RDF model either as a RDF::Redland::Stream of RDF::Redland::Statement objects or directly into an RDF::Redland::Model object.</p>

<h2><a name="constructors">CONSTRUCTORS</a></h2>
<dl>
<dt><strong><a name="new_name_mime_type_uri" class="item">new [NAME [MIME_TYPE [URI]]]</a></strong></dt>
<dd>
<p>Create a new RDF::Redland::Parser object for a syntax parser named <em>NAME</em>, with MIME Type <em>MIME_TYPE</em> and/or URI <em>URI</em>. Any field can be undef or omitted; if all are omitted, a parser that provides MIME Type application/rdf+xml will be requested.</p>
</dd>
</dl>

<h2><a name="methods">METHODS</a></h2>
<dl>
<dt><strong><a name="parse_as_stream_source_uri_base_uri" class="item">parse_as_stream SOURCE_URI BASE_URI</a></strong></dt>
<dd>
<p>Parse the syntax at the RDF::Redland::URI <em>SOURCE_URI</em> with optional base RDF::Redland::URI <em>BASE_URI</em>. If the base URI is given then the content is parsed as if it was at the base URI rather than the source URI.</p>
<p>Returns an RDF::Redland::Stream of RDF::Redland::Statement objects or undef on failure.</p>
</dd>
<dt><strong><a name="parse_into_model_source_uri_base_uri_model_handler" class="item">parse_into_model SOURCE_URI BASE_URI MODEL [HANDLER]</a></strong></dt>
<dd>
<p>Parse the syntax at the RDF::Redland::URI <em>SOURCE_URI</em> with optional base RDF::Redland::URI <em>BASE_URI</em> into RDF::Redland::Model <em>MODEL</em>. If the base URI is given then the content is parsed as if it was at the base URI rather than the source URI.</p>
<p>If the optional <em>HANDLER</em> is given, it is a reference to a sub with the signature sub <code>handler($$$$$$$$$)</code> { my($code, $level, $facility, $message, $line, $column, $byte, $file, $uri)=@_; ... } that receives errors in parsing.</p>
</dd>
<dt><strong><a name="parse_string_as_stream_string_base_uri" class="item">parse_string_as_stream STRING BASE_URI</a></strong></dt>
<dd>
<p>Parse the syntax in <em>STRING</em> with required base RDF::Redland::URI <em>BASE_URI</em>.</p>
<p>Returns an RDF::Redland::Stream of RDF::Redland::Statement objects or undef on failure.</p>
</dd>
<dt><strong><a name="parse_string_into_model_string_base_uri_model_handler" class="item">parse_string_into_model STRING BASE_URI MODEL [HANDLER]</a></strong></dt>
<dd>
<p>Parse the syntax in <em>STRING</em> with required base RDF::Redland::URI <em>BASE_URI</em> into RDF::Redfland::Model <em>MODEL</em>.</p>
<p>If the optional <em>HANDLER</em> is given, it is a reference to a sub with the signature sub <code>handler($$$$$$$$$)</code> { my($code, $level, $facility, $message, $line, $column, $byte, $file, $uri)=@_; ... } that receives errors in parsing.</p>
</dd>
<dt><strong><a name="feature_uri_value" class="item">feature URI [VALUE]</a></strong></dt>
<dd>
<p>Get/set a parser feature. The feature is named via RDF::Redland::URI <em>URI</em> and the value is a RDF::Redland::Node. If <em>VALUE</em> is given, the feature is set to that value, otherwise the current value is returned.</p>
</dd>
<dt><strong><a name="namespaces_seen" class="item">namespaces_seen</a></strong></dt>
<dd>
<p>Get the set of namespace declarations seen during parsing as a hash of key:prefix string (may be ''), value: RDF::Redland::URI objects.</p>
</dd>
</dl>

<h2><a name="see_also">SEE ALSO</a></h2>
<p><a href="URI.html">the RDF::Redland::URI manpage</a></p>

<h2><a name="author">AUTHOR</a></h2>
<p>Dave Beckett - <a href="http://www.dajobe.org/">http://www.dajobe.org/</a></p>
<hr />

<p>(C) Copyright 2000-2011 <a href="http://www.dajobe.org/">Dave Beckett</a>, (C) Copyright 2000-2005 <a href="http://www.bristol.ac.uk/">University of Bristol</a></p>

</body>
</html>