NAME
RDF::AllegroGraph::Catalog - AllegroGraph catalog handle
SYNOPSIS
my $server = new RDF::AllegroGraph::Server ('http://localhost:8080');
my $vienna = new RDF::AllegroGraph::Catalog (NAME => '/vienna', SERVER => $server);
warn "all repositories in vienna: ".Dumper $vienna->repositories;
# open an existing
my $air = $vienna->repository ('/air-quality');
# create one if it does not exist
use Fcntl;
my $water = $vienna->repository ('/water', mode => O_CREAT);
DESCRIPTION
Allegrograph catalogs are a container for individual repositories (RDF::AllegrGraph::Repository). The latter roughly correspond to what the RDF folks call a model. You can get a catalog handle from the AG server (RDF::AllegroGraph::Server).
INTERFACE
Constructor
The constructor expects the following options:
NAME
(mandatory, string)-
This is a string of the form
/mycatalog
and it identifies that very catalog on the server. SERVER
(mandatory, RDF::AllegroGraph::Server object)-
This is the handle to the server.
Example:
my $server = new RDF::AllegroGraph::Server (...);
my $vienna = new RDF::AllegroGraph::Catalog (NAME => '/vienna', SERVER => $server);
Methods
- repositories
-
@repos = $cat->repositories
This method returns RDF::AllegroGraph::Repository objects for all repositories in the catalog.
- repository
-
$repo = $cat->repository ($repo_id [, $mode ])
This method returns an RDF::AllegroGraph::Repository object for the repository with the provided id. That id always has the form
/somerepository
.If that repository does not exist in the catalog, then an exception
cannot open
will be raised. That is, unless the optional mode is provided having the POSIX valueO_CREAT
. Then the repository will be created.
AUTHOR
Robert Barta, <rho at devc.at>
COPYRIGHT & LICENSE
Copyright 200[9] Robert Barta, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.