|
DMOZ::ParseRDF - Parse the I |
DMOZ::ParseRDF - Parse the gigantic dmoz.org content file into smaller parts.
use DMOZ::ParseRDF;
my $dmoz = DMOZ::ParseRDF->new({
-rdf_gzip_stream => 1,
-rdf_local_file => 'content.rdf.u8.gz',
-rdf_gzip_path => '/bin/gzip',
-rdf_part_stack => {
'Top/Arts' => '/home/dmoz/arts.part'
}
});
DMOZ::ParseRDF is an object-oriented module for parsing DMOZ data into manageable sub-sections. As of January 8th 2004 the DMOZ content file is around 1.3GB in size. The data is free to download and can be used in your custom database but please make sure you read the license agreement at http://dmoz.org/license.html first.
The available attributes are listed below:
The hash is sorted before parsing begins to ensure that the parser can parse each category alphabetically (which is how the RDF file is formatted).
parse()
Here are some simple examples of how to use DMOZ::ParseRDF
This example sets attributes by calling methods...
my $dmoz = DMOZ::ParseRDF->new();
$dmoz->data('/home/dmoz/content.rdf.u8.gz');
$dmoz->gzip_stream(1);
$dmoz->gzip('/bin/gzip');
$dmoz->parts({
'Top/Health' => '/home/dmoz/health.part'
});
$dmoz->parse() or die $dmoz->error();
This example sets attributes at the time of creating the object...
my $dmoz = DMOZ::ParseRDF->new({
-rdf_local_file => '/home/dmoz/content.rdf.u8.gz',
-rdf_gzip_path => '/bin/gzip',
-rdf_gzip_stream => 1,
-rdf_part_stack => {
'Top/Health' => '/home/dmoz/health.part'
}
});
$dmoz->parse() or die $dmoz->error();
Due to the nature of this module and the tasks it performs, it hogs CPU power. Fortunately the memory usage stays quite low as the data is not stored in memory.
Just be aware that CPU power will briefly hit the roof while parsing the DMOZ content.
Please email <paul@wilsonprograms.com> for support. You may also visit the Wilson Programming support forum at http://wilsonprograms.com/cgi-bin/bb/gforum.cgi
DMOZ::ParseRDF was written by Paul Wilson <paul@wilsonprograms.com> in 2004
Copyright (c) Paul Wilson and Wilson Programming 2004. All Rights Reserved.
|
DMOZ::ParseRDF - Parse the I |