AtteanX::Store::DBI - Database quad-store
This document describes AtteanX::Store::DBI version 0.000_01
use Attean; my $store = Attean->get_store('DBI')->new( dbh => $dbh );
AtteanX::Store::DBI provides a quad-store backed by a relational database.
dbh
This class consumes Attean::API::QuadStore, Attean::API::MutableQuadStore, and Attean::API::BulkUpdatableStore.
new ( dbh => $dbh )
Returns a new quad-store object backed by the database referenced by the supplied database handle.
init()
Create the tables and indexes required for using the database as a quadstore.
temporary_store()
Returns a temporary (in-memory, SQLite) store.
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, or an ARRAY reference of terms that are allowable in the respective quad position.
count_quads ( $subject, $predicate, $object, $graph )
Returns the count of all statements matching the specified subject, predicate and objects. Any of the arguments may be undef to match any value, or an ARRAY reference of terms that are allowable in the respective quad position.
get_graphs
Returns an iterator over the Attean::API::Term objects comprising the set of graphs of the stored quads.
add_quad ( $quad )
Adds the specified $quad to the underlying model.
$quad
remove_quad ( $statement )
Removes the specified $statement from the underlying model.
$statement
create_graph( $graph )
This is a no-op function for the memory quad-store.
drop_graph( $graph )
Removes all quads with the given $graph.
$graph
clear_graph( $graph )
begin_transaction
Begin a database transaction.
abort_transaction
Rollback the current database transaction.
end_transaction
Commit the current database transaction.
begin_bulk_updates
end_bulk_updates
database_type
Returns the database type name as a string (e.g. 'mysql', 'sqlite', or 'postgresql').
initialize_version
Insert data into the attean_version table.
create_schema_file
Returns the path to the file containing the database DDL for quadstore creation for the current database type if available, undef otherwise.
drop_schema_file
Returns the path to the file containing the database DDL for quadstore deletion for the current database type if available, undef otherwise.
available_database_types
Returns the names of the database types for which the system has schemas available to create and drop quadstore tables.
dbi_connect_args ( $type, %args )
dbi_connect_args ( %args )
Returns a quad $dsn, $user, $password, \%connect_args suitable for passing to DBI->connect to obtain a database handle to be used in constructing a AtteanX::Store::DBI quadstore.
$dsn, $user, $password, \%connect_args
DBI->connect
AtteanX::Store::DBI
%args must contain a value for the database key. It may also contain values for the optional keys: user, password, host, and port.
%args
database
user
password
host
port
If invoked as a class method, the $type parameter is required, and must be one of the database types returned by available_database_types.
$type
If invoked as an object method, the $type parameter must not be included; this information will be obtained directly from the AtteanX::Store::DBI object.
plans_for_algebra( $algebra, $model, $active_graphs, $default_graphs )
For BGP algebras, returns a DBI-specific Attean::API::Plan object, otherwise returns undef.
cost_for_plan( $plan )
Returns the estimated cost for a DBI-specific query plan, undef otherwise.
Please report any bugs or feature requests to through the GitHub web interface at https://github.com/kasei/perlrdf2/issues.
Gregory Todd Williams <gwilliams@cpan.org>
<gwilliams@cpan.org>
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.
To install AtteanX::Store::DBI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AtteanX::Store::DBI
CPAN shell
perl -MCPAN -e shell install AtteanX::Store::DBI
For more information on module installation, please visit the detailed CPAN module installation guide.