NAME
RDFStore::Model - An implementation of the Model RDF API
SYNOPSIS
use RDFStore::Model;
use RDFStore::NodeFactory;
use RDFStore::FindIndex;
use Data::MagicTie;
my $factory= new RDFStore::NodeFactory();
my $statement = $factory->createStatement(
$factory->createResource('http://perl.org'),
$factory->createResource('http://iscool.org/schema/1.0/#label'),
$factory->createLiteral('Cool Web site')
);
my $statement1 = $factory->createStatement(
$factory->createResource("http://www.altavista.com"),
$factory->createResource("http://pen.jrc.it/schema/1.0/#author"),
$factory->createLiteral("Who? :-)")
);
my $statement2 = $factory->createStatement(
$factory->createUniqueResource(),
$factory->createUniqueResource(),
$factory->createLiteral("")
);
my $index_db={};
tie %{$index_db},"Data::MagicTie",'index/triples',(Q => 20);
my $index=new RDFStore::FindIndex($index_db);
my $model = new RDFStore::Model($factory,undef,$index,undef);
$model->add($statement);
$model->add($statement1);
$model->add($statement2);
my $model1 = $model->duplicate();
print $model1->getDigest->equals( $model1->getDigest );
print $model1->getDigest->hashCode;
my $found = $model->find($statement2->subject,undef,undef);
foreach (keys %{$found->elements}) {
print $found->elements->{$_}->getLabel(),"\n";
};
DESCRIPTION
An RDFStore::Stanford::Model implementation using Digested URIs and Perl hashes to store triplets. The actual store could be tied to a Data::MagicTie(3) hash/array and the RDFStore::FindIndex(3) module.
SEE ALSO
Data::MagicTie(3) Digest(3) RDFStore::Stanford::Digest(3) RDFStore::RDFNode RDFStore::Resource RDFStore::FindIndex(3)
AUTHOR
Alberto Reggiori <alberto.reggiori@jrc.it>