| RDF-Core documentation | view source | Contained in the RDF-Core distribution. |
RDF::Core::Model - RDF model
my $storage = new RDF::Core::Storage::Memory;
my $model = new RDF::Core::Model (Storage => $storage);
my $subject = new RDF::Core::Resource('http://www.gingerall.cz/employees/Jim');
my $predicate = $subject->new('http://www.gingerall.cz/rdfns#name');
my $object = new RDF::Core::Literal('Jim Brown');
my $statement = new RDF::Core::Statement($subject, $predicate, $object);
$model->addStmt($statement);
print "Model contains ".$model->countStmts."statement(s).\n"
Model provides interface to store RDF statements, ask about them and retrieve them back.
$options is a hash reference, available options are
a reference to a RDF::Core::Storage implementation
Add RDF::Core::Statement instance to Model, unless it already exists there.
Remove statement from Model, if it's there.
Check if statement exists, that matches given mask. Parameters can be undefined, every value matches undefined parameter.
Count matching statements.
Retrieve matching statements. Returns RDF::Core::Enumerator object.
Return a reference to an array keeping all objects, that are values of specified $predicate for given $subject.
Return a reference to an array keeping all objects, that are members of the $container. Objects are sorted.
This package is subject to the MPL (or the GPL alternatively).
Ginger Alliance, rdf@gingerall.cz
RDF::Core::Statement, RDF::Core::Storage, RDF::Core::Serializer, RDF::Core::Parser, RDF::Core::Enumerator
| RDF-Core documentation | view source | Contained in the RDF-Core distribution. |