/usr/share/perl5/AtteanX/Store/Simple.pm is in libattean-perl 0.012-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | =head1 NAME
AtteanX::Store::Simple - Simple, unindexed, in-memory RDF store
=head1 VERSION
This document describes AtteanX::Store::Simple version 0.012
=head1 SYNOPSIS
use AtteanX::Store::Simple;
=head1 DESCRIPTION
AtteanX::Store::Simple provides an in-memory quad-store.
=cut
use v5.14;
use warnings;
package AtteanX::Store::Simple 0.012 {
use Moo;
use Type::Tiny::Role;
use Types::Standard qw(Int ArrayRef HashRef ConsumerOf InstanceOf);
use Encode;
use Set::Scalar;
use Digest::SHA;
use List::Util qw(first);
use Scalar::Util qw(refaddr reftype blessed);
use namespace::clean;
with 'Attean::API::QuadStore';
my @pos_names = Attean::API::Quad->variables;
=head1 METHODS
Beyond the methods documented below, this class inherits methods from the
L<Attean::API::QuadStore> class.
=over 4
=item C<< new ( quads => \@quads ) >>
Returns a new memory-backed storage object.
=cut
has quads => (is => 'rw', isa => ArrayRef[ConsumerOf['Attean::API::Quad']], default => sub { [] });
=item C<< get_quads ( $subject, $predicate, $object, $graph ) >>
Returns a stream object of all statements matching the specified subject,
predicate and objects. Any of the arguments may be undef to match any value.
=cut
sub get_quads {
my $self = shift;
my @nodes = @_;
my %bound;
foreach my $pos (0 .. 3) {
my $n = $nodes[ $pos ];
if (blessed($n) and $n->does('Attean::API::Variable')) {
$n = undef;
$nodes[$pos] = undef;
}
if (blessed($n)) {
$bound{ $pos_names[$pos] } = $n;
}
}
my $quads = $self->quads;
my $iter = Attean::ListIterator->new( values => $quads, item_type => 'Attean::API::Quad' );
return $iter->grep(sub {
my $q = shift;
foreach my $key (keys %bound) {
my $term = $q->$key();
unless ($term->equals( $bound{$key} )) {
return 0;
}
}
return 1;
});
return $iter;
}
}
1;
__END__
=back
=head1 BUGS
Please report any bugs or feature requests to through the GitHub web interface
at L<https://github.com/kasei/perlrdf2/issues>.
=head1 AUTHOR
Gregory Todd Williams C<< <gwilliams@cpan.org> >>
=head1 COPYRIGHT
Copyright (c) 2014--2016 Gregory Todd Williams. This
program is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
=cut
|