RDF::AllegroGraph::Server - AllegroGraph server handle
#-- orthodox approach my $server = new RDF::AllegroGraph::Server (ADDRESS => 'http://localhost:8080', TEST => 0, AUTHENTICATION => 'joe:secret'); my @catalogs = $server->catalogs; #-- commodity # get handles to all models (repositories) at the server my @models = $server->models; # get one in particular my $model = $server->model ('/testcat/testrepo');
Objects of this class represent handles to remote AllegroGraph HTTP server. Such a server can hold several catalogs and each of them can hold repositories. Here we also use the orthodox concept of a model which is simply one particular repository in one particular catalog.
For addressing one model we use a simple path structure, such as
All methods die with
protocol error if they do not receive an expected success.
To get a handle to the AG server, you can instantiate this class. The following options are recognized:
Specifies the REST HTTP address. Must be an absolute URL, without trailing slash. The constructor dies otherwise.
If set, the client will try to test connectivity with the AG server.
String which must be of the form
:). That will be interpreted as username and password to do basic HTTP authentication against the server.
@cats = $server->catalogs
This method lists the catalogs available on the remote server. The result is a list of relative paths.
This method tries to connect to the server and will return
1on success. Otherwise an exception will be raised.
%models = $server->models
This method lists all models available on the server. Returned is a hash reference. The keys are the model identifiers, all of the form
/somecatalog/somerepository. The values are repository objects.
$server->model ($mod_id, option1 => value1, ...)
This method tries to find an repository in a certain catalog. This model id is always of the form
/somecatalog/somerepository. The following options are understood:
If the model does already exist, then an RDF::AllegroGraph::Repository object will be returned. If the specified catalog does not exist, then a
no catalogexception will be raised. Otherwise, if the repository there does not exist and the
O_CREAT, then it will be generated. Otherwise an exception
cannot open repositorywill be raised.
<rho at devc.at>
Copyright 200 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.