| 1 |
<?xml version="1.0" encoding="iso-8859-1"?> |
| 2 |
<?xml version="1.0"?> |
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 |
<head> |
| 5 |
<title>Redland RDF Application Framework - Perl RDF::Redland Class</title> |
| 6 |
</head> |
| 7 |
<body> |
| 8 |
|
| 9 |
<h1 style="text-align:center">Redland RDF Application Framework - Perl RDF::Redland Class</h1> |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
<div name="index"> |
| 14 |
<p><a name="__index__"></a></p> |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
</div> |
| 28 |
|
| 29 |
|
| 30 |
<h2><a name="name">NAME</a></h2> |
| 31 |
<p>RDF::Redland - Redland RDF Class</p> |
| 32 |
|
| 33 |
<h2><a name="synopsis">SYNOPSIS</a></h2> |
| 34 |
<pre> |
| 35 |
use RDF::Redland; |
| 36 |
my $storage=new RDF::Redland::Storage("hashes", "test", "new='yes',hash-type='memory'"); |
| 37 |
my $model=new RDF::Redland::Model($storage, ""); |
| 38 |
</pre> |
| 39 |
<pre> |
| 40 |
... |
| 41 |
</pre> |
| 42 |
|
| 43 |
<h2><a name="description">DESCRIPTION</a></h2> |
| 44 |
<p>This class initialises the Redland RDF classes.</p> |
| 45 |
<p>See the main classes for full detail: <a href="Redland/Node.html">the RDF::Redland::Node manpage</a>, <a href="Redland/BlankNode.html">the RDF::Redland::BlankNode manpage</a>, <a href="Redland/URINode.html">the RDF::Redland::URINode manpage</a>, <a href="Redland/LiteralNode.html">the RDF::Redland::LiteralNode manpage</a>, <a href="Redland/XMLLiteralNode.html">the RDF::Redland::XMLLiteralNode manpage</a>, <a href="Redland/URI.html">the RDF::Redland::URI manpage</a>, <a href="Redland/Statement.html">the RDF::Redland::Statement manpage</a>, <a href="Redland/Model.html">the RDF::Redland::Model manpage</a>, <a href="Redland/Storage.html">the RDF::Redland::Storage manpage</a>, <a href="Redland/Parser.html">the RDF::Redland::Parser manpage</a>, <a href="Redland/Query.html">the RDF::Redland::Query manpage</a>, <a href= |
| 46 |
"/docs/pod/RDF/Redland/QueryResults.html">the RDF::Redland::QueryResults manpage</a>, <a href="Redland/Iterator.html">the RDF::Redland::Iterator manpage</a>, <a href="Redland/Stream.html">the RDF::Redland::Stream manpage</a> and <a href="Redland/RSS.html">the RDF::Redland::RSS manpage</a>.</p> |
| 47 |
|
| 48 |
<h2><a name="static_methods">STATIC METHODS</a></h2> |
| 49 |
<dl> |
| 50 |
<dt><strong><a name="set_log_handler" class="item">set_log_handler SUB</a></strong></dt> |
| 51 |
<dd> |
| 52 |
<p>Set <em>SUB</em> as the subroutine to be called on any Redland error, warning or log message. The subroutine must have the followign signature:</p> |
| 53 |
<pre> |
| 54 |
sub handler ($$$$$$$$$) { |
| 55 |
my($code, $level, $facility, $message, $line, $column, $byte, $file, $uri)=@_; |
| 56 |
# int error code |
| 57 |
# int log level |
| 58 |
# int facility causing the error (parsing, serializing, ...) |
| 59 |
# string error message |
| 60 |
# int line number (<0 if not relevant) |
| 61 |
# int column number (<0 if not relevant) |
| 62 |
# int byte number (<0 if not relevant) |
| 63 |
# string file name or undef |
| 64 |
# string URI or undef |
| 65 |
|
| 66 |
# ...do something with the information ... |
| 67 |
}; |
| 68 |
</pre> |
| 69 |
<pre> |
| 70 |
RDF::Redland::set_log_handler(\&handler); |
| 71 |
</pre></dd> |
| 72 |
<dt><strong><a name="reset_log_handler" class="item">reset_log_handler</a></strong></dt> |
| 73 |
<dd> |
| 74 |
<p>Reset redland to use the default logging handler, typically printing the message to stdout or stderr and exiting on a fatal error.</p> |
| 75 |
</dd> |
| 76 |
<dt><strong><a name="set_error_handler" class="item">set_error_handler SUB</a></strong></dt> |
| 77 |
<dd> |
| 78 |
<p>The method set_log_handler is much more flexible than this and includes this functionality.</p> |
| 79 |
<p>Set <em>SUB</em> as the subroutine to be called on a Redland error with the error message as the single argument. For example:</p> |
| 80 |
<pre> |
| 81 |
RDF::Redland::set_error_handler(sub { |
| 82 |
my $msg=shift; |
| 83 |
# Do something with $msg |
| 84 |
}); |
| 85 |
</pre> |
| 86 |
<p>The default if this is not set, is to run die $msg</p> |
| 87 |
</dd> |
| 88 |
<dt><strong><a name="set_warning_handler" class="item">set_warning_handler SUB</a></strong></dt> |
| 89 |
<dd> |
| 90 |
<p>The method set_log_handler is much more flexible than this and includes this functionality.</p> |
| 91 |
<p>Set <em>SUB</em> as the subroutine to be called on a Redland warning with the warning message as the single argument. For example:</p> |
| 92 |
<pre> |
| 93 |
RDF::Redland::set_warning_handler(sub { |
| 94 |
my $msg=shift; |
| 95 |
# Do something with $msg |
| 96 |
}); |
| 97 |
</pre> |
| 98 |
<p>The default if this is not set, is to run warn $msg</p> |
| 99 |
</dd> |
| 100 |
</dl> |
| 101 |
|
| 102 |
<h2><a name="see_also">SEE ALSO</a></h2> |
| 103 |
<p><a href="Redland/Node.html">the RDF::Redland::Node manpage</a>, <a href="Redland/BlankNode.html">the RDF::Redland::BlankNode manpage</a>, <a href="Redland/URINode.html">the RDF::Redland::URINode manpage</a>, <a href="Redland/LiteralNode.html">the RDF::Redland::LiteralNode manpage</a>, <a href="Redland/XMLLiteralNode.html">the RDF::Redland::XMLLiteralNode manpage</a>, <a href="Redland/URI.html">the RDF::Redland::URI manpage</a>, <a href="Redland/Statement.html">the RDF::Redland::Statement manpage</a>, <a href="Redland/Model.html">the RDF::Redland::Model manpage</a>, <a href="Redland/Storage.html">the RDF::Redland::Storage manpage</a>, <a href="Redland/Parser.html">the RDF::Redland::Parser manpage</a>, <a href="Redland/Query.html">the RDF::Redland::Query manpage</a>, <a href="Redland/QueryResults.html">the |
| 104 |
RDF::Redland::QueryResults manpage</a>, <a href="Redland/Iterator.html">the RDF::Redland::Iterator manpage</a>, <a href="Redland/Stream.html">the RDF::Redland::Stream manpage</a> and <a href="Redland/RSS.html">the RDF::Redland::RSS manpage</a>.</p> |
| 105 |
|
| 106 |
<h2><a name="author">AUTHOR</a></h2> |
| 107 |
<p>Dave Beckett - <a href="http://www.dajobe.org/">http://www.dajobe.org/</a></p> |
| 108 |
<hr /> |
| 109 |
|
| 110 |
<p>(C) Copyright 2000-2014 <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> |
| 111 |
|
| 112 |
</body> |
| 113 |
</html> |