NAME
RDF::Trine::Store::DBI - Persistent RDF storage based on DBI
VERSION
This document describes RDF::Trine::Store::DBI version 0.125_02
SYNOPSIS
use RDF::Trine::Store::DBI;
DESCRIPTION
RDF::Trine::Store::DBI provides a persistent triple-store using the DBI module.
METHODS
new ( $model_name, $dbh )new ( $model_name, $dsn, $user, $pass )-
Returns a new storage object using the supplied arguments to construct a DBI object for the underlying database.
new_with_config ( $hashref )-
Returns a new storage object configured with a hashref with certain keys as arguments.
The
storetypekey must beDBIfor this backend.These keys should also be used:
name-
The name of the model.
dsn-
The DBI Data Source Name for the underlying database.
username-
The username of the database user.
password-
The password of the database user.
new_with_object ( $dbi_db )-
Initialize the store with a DBI::db object.
temporary_storeget_statements ($subject, $predicate, $object [, $context] )-
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.
get_pattern ( $bgp [, $context] )-
Returns a stream object of all bindings matching the specified graph pattern.
get_contexts-
Returns an RDF::Trine::Iterator over the RDF::Trine::Node objects comprising the set of contexts of the stored quads.
add_statement ( $statement [, $context] )-
Adds the specified
$statementto the underlying model. remove_statement ( $statement [, $context])-
Removes the specified
$statementfrom the underlying model. remove_statements ( $subject, $predicate, $object [, $context])-
Removes the specified
$statementfrom the underlying model. count_statements ($subject, $predicate, $object)-
Returns a count of all the statements matching the specified subject, predicate and objects. Any of the arguments may be undef to match any value.
add_uri ( $uri, $named, $format )-
Addsd the contents of the specified
$urito the model. If$namedis true, the data is added to the model using$urias the named context. add_string ( $data, $base_uri, $named, $format )-
Addsd the contents of
$datato the model. If$namedis true, the data is added to the model using$base_urias the named context. add_statement ( $statement )-
Adds the specified
$statementto the underlying model. remove_statement ( $statement )-
Removes the specified
$statementfrom the underlying model. variable_columns ( $var )-
Given a variable name, returns the set of column aliases that store the values for the column (values for Literals, URIs, and Blank Nodes).
add_variable_values_joins-
Modifies the query by adding LEFT JOINs to the tables in the database that contain the node values (for literals, resources, and blank nodes).
_mysql_hash ( $data )-
Returns a hash value for the supplied
$datastring. This value is computed using the same algorithm that Redland's mysql storage backend uses. _mysql_node_hash ( $node )-
Returns a hash value (computed by
_mysql_hashfor the supplied$node. The hash value is based on the string value of the node and the node type. statements_table-
Returns the name of the Statements table.
statements_prefix-
Returns the prefix for the underlying Statements database table.
set_statements_prefix ( $prefix )-
Sets the prefix for the underlying Statements database table.
model_name-
Returns the name of the underlying model.
make_private_predicate_view ( $prefix, @preds )dbh-
Returns the underlying DBI database handle.
init-
Creates the necessary tables in the underlying database.
BUGS
Please report any bugs or feature requests to <gwilliams@cpan.org>.
AUTHOR
Gregory Todd Williams <gwilliams@cpan.org>
COPYRIGHT
Copyright (c) 2006-2010 Gregory Todd Williams. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.