use strict;

require RDF::Core::Model;
require RDF::Core::Model::Parser;
require RDF::Core::Enumerator;
require RDF::Core::Statement;
require RDF::Core::Storage::DB_File;

# create storage
my $storage = new RDF::Core::Storage::DB_File(Name =>'./rdfdata',
                                                 MemLimit => 5000,
                                                );

# create model and map to storage
my $model = new RDF::Core::Model (Storage => $storage);

# define parser options and parse external RDF/XML document
my %options = ( Model => $model,
             Source => "/home/shelleyp/www/articles/monsters1.rdf",
             SourceType => 'file',
             BaseURI => "http://burningbird.net/",
             InlineURI => "http://burningbird.net/"
            );
my $parser = new RDF::Core::Model::Parser(%options);
$parser->parse;

# enumerate through statements, printing out labels
my $enumerator = $model->getStmts;
my $statement = $enumerator->getFirst;
while (defined $statement) {
   print $statement->getLabel."\n";
   $statement = $enumerator->getNext
}

# close enumerator
$enumerator->close;
