File Coverage

blib/lib/RDF/AllegroGraph/Catalog.pm
Criterion Covered Total %
statement 9 13 69.2
branch n/a
condition n/a
subroutine 3 7 42.8
pod 4 4 100.0
total 16 24 66.6


line stmt bran cond sub pod time code
1             package RDF::AllegroGraph::Catalog;
2              
3 15     15   97 use strict;
  15         30  
  15         489  
4 15     15   76 use warnings;
  15         31  
  15         1996  
5              
6             require Exporter;
7 15     15   83 use base qw(Exporter);
  15         43  
  15         7458  
8              
9             =pod
10              
11             =head1 NAME
12              
13             RDF::AllegroGraph::Catalog - AllegroGraph catalog handle (abstract)
14              
15             =head1 SYNOPSIS
16              
17             my $server = new RDF::AllegroGraph::Server (ADDRESS => 'http://localhost:8080');
18             my $vienna = new RDF::AllegroGraph::Catalog (NAME => '/vienna', SERVER => $server);
19              
20             warn "all repositories in vienna: ".Dumper $vienna->repositories;
21              
22             # open an existing
23             my $air = $vienna->repository ('/vienna/air-quality');
24             # create one if it does not exist
25             use Fcntl;
26             my $water = $vienna->repository ('/vienna/water', mode => O_CREAT);
27              
28             =head1 DESCRIPTION
29              
30             AllegroGraph catalogs are containers for individual repositories
31             (L). The latter roughly correspond to what the RDF folks call a
32             I. You can get a catalog handle from the AG server (L).
33              
34             =head2 Naming
35              
36             AllegroGraph understands I and I. While the latter are mostly what RDF model
37             are called elsewhere, catalogs are containers for a set of repositories. I are
38             supported by this interface, you will have to configure them either in the C
39             configuration file, or create them with the web interface (since AGv4). Since AGv4 there is also the
40             I. It always exists.
41              
42             To provide a consistent naming, this interface uses a simple path language:
43              
44             =over
45              
46             =item C
47              
48             This specifies the root container. Any repository (such as, say, C) is
49             addressable via C.
50              
51             =item C
52              
53             Named catalogs (such as, say, C) are addressed as C and, yes, without further
54             context it is now not decidable whether C is a repository inside the root catalog or a
55             catalog on it own.
56              
57             Anyways, .... repositories B one named catalog are again unambigously addressable, such as
58             C.
59              
60             =back
61              
62             =head2 AG version 3 and 4
63              
64             This is interface supports AGv3 (3.3 onwards) and AGv4 (4.2 onwards), even though many features will
65             be missing (until I really need them). Still, the overall interface tries to be as version agnostic
66             as possible. When this fails, you should consult the proper subclass for the version, such as
67             L for example.
68              
69             =head1 INTERFACE
70              
71             =head2 Constructor
72              
73             The constructor expects the following options:
74              
75             =over
76              
77             =item C (mandatory, string)
78              
79             This is a string of the form C and it identifies that very catalog on the server.
80              
81             =item C (mandatory, L object)
82              
83             This is the handle to the server.
84              
85             =back
86              
87             Example:
88              
89             my $server = new RDF::AllegroGraph::Server (...);
90             my $vienna = new RDF::AllegroGraph::Catalog (NAME => '/vienna', SERVER => $server);
91              
92              
93             =head2 Methods
94              
95             =over
96              
97             =item B
98              
99             I<@repos> = I<$cat>->repositories
100              
101             This method returns a list of L objects of this catalog.
102              
103             =cut
104              
105             sub repositories {
106 0     0 1   die;
107             }
108              
109             =pod
110              
111             =item B
112              
113             I<$repo> = I<$cat>->repository (I<$repo_id> [, I<$mode> ])
114              
115             This method returns an L object for the repository with
116             the provided id. That id always has the form C.
117              
118             If that repository does not exist in the catalog, then an exception C will be
119             raised. That is, unless the optional I is provided having the POSIX value C. Then the
120             repository will be created.
121              
122             =cut
123              
124             sub repository {
125 0     0 1   die;
126             }
127              
128             =pod
129              
130             =item B
131              
132             This method simply returns the version supported by the protocol, in the form of C<3.3>, or similar.
133              
134             =cut
135              
136             sub version {
137 0     0 1   die;
138             }
139              
140             =pod
141              
142             =item B
143              
144             This method returns the protocol version the catalog supports.
145              
146             =cut
147              
148             sub protocol {
149 0     0 1   die;
150             }
151              
152              
153             =pod
154              
155             =back
156              
157             =head1 AUTHOR
158              
159             Robert Barta, C<< >>
160              
161             =head1 COPYRIGHT & LICENSE
162              
163             Copyright 20(09|1[01]) Robert Barta, all rights reserved.
164              
165             This program is free software; you can redistribute it and/or modify it under the same terms as Perl
166             itself.
167              
168             L
169              
170             =cut
171              
172             our $VERSION = '0.06';
173              
174             1;
175              
176             __END__