File Coverage

blib/lib/RDF/AllegroGraph/Easy.pm
Criterion Covered Total %
statement 12 15 80.0
branch n/a
condition 0 2 0.0
subroutine 4 5 80.0
pod 0 1 0.0
total 16 23 69.5


line stmt bran cond sub pod time code
1             package RDF::AllegroGraph::Easy;
2              
3 5     5   8943 use warnings;
  5         12  
  5         179  
4 5     5   25 use strict;
  5         12  
  5         189  
5              
6             require Exporter;
7 5     5   25 use base qw(Exporter);
  5         9  
  5         591  
8              
9             =pod
10              
11             =head1 NAME
12              
13             RDF::AllegroGraph::Easy - Simplistic Interface to AllegroGraph HTTP server
14              
15             =head1 SYNOPSIS
16              
17             my $storage = new RDF::AllegroGraph::Easy ('http://my:secret@localhost:10035');
18             my $model = $storage->model ('/scratch/catlitter', mode => O_CREAT);
19              
20             $model->add (....); # add stuff
21             $model->delete (...); # get rid of stuff
22             my @tuples = $model->sparql ('SELECT ...'); # query it
23             $model->disband; # remove the whole thing
24              
25             =head1 DESCRIPTION
26              
27             The idea of this interface is to concentrate on the essentials:
28              
29             =over
30              
31             =item *
32              
33             how to get a handle to a remote tuple store (see L for details)
34              
35             =item *
36              
37             how to get RDF content into that model (see L for details)
38              
39             =item *
40              
41             how to query the model (see L for details)
42              
43             =back
44              
45             Currently this abstraction layer supports v3 and v4 AG server, albeit with many omissions.
46              
47             =head1 INTERFACE
48              
49             =head2 Constructor
50              
51             [changed v0.6]
52              
53             The constructor expects one parameter which is interpreted as HTTP endpoint for your AllegroGraph
54             server. If left C, then the default C will be used.
55              
56             B: No trailing slash!
57              
58             =cut
59              
60             sub new {
61 0     0 0   my $class = shift;
62 0   0       my $address = shift || 'http://localhost:10035';
63 5     5   2877 use RDF::AllegroGraph::Server;
  5         19  
  5         552  
64 0           return new RDF::AllegroGraph::Server (ADDRESS => $address, @_);
65             }
66              
67             =pod
68              
69             =head1 AUTHOR
70              
71             Robert Barta, C<< >>
72              
73             =head1 BUGS
74              
75             Please report any bugs or feature requests to C, or
76             through the web interface at
77             L. I will be notified, and
78             then you'll automatically be notified of progress on your bug as I make changes.
79              
80              
81             =head1 COPYRIGHT & LICENSE
82              
83             Copyright 20(09|10) Robert Barta, all rights reserved.
84              
85             This program is free software; you can redistribute it and/or modify it under the same terms as Perl
86             itself.
87              
88              
89             =cut
90              
91             our $VERSION = '0.08';
92              
93             1;
94              
95             __END__