The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

RDF::Trine::Store::DBI - Persistent RDF storage based on DBI

VERSION

This document describes RDF::Trine::Store::DBI version 0.132_02

SYNOPSIS

 use RDF::Trine::Store::DBI;

DESCRIPTION

RDF::Trine::Store::DBI provides a persistent triple-store using the DBI module.

METHODS

Beyond the methods documented below, this class inherits methods from the RDF::Trine::Store class.

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 storetype key must be DBI for 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_store
clear_restrictions

Clear's the restrictions put on the binding of node types to the different statement positions. By default, the subject position is restricted to resources and blank nodes, and the predicate position to only resources. Calling this method will allow any node type in any statement position.

get_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 $statement to the underlying model.

remove_statement ( $statement [, $context])

Removes the specified $statement from the underlying model.

remove_statements ( $subject, $predicate, $object [, $context])

Removes the specified $statement from 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 $uri to the model. If $named is true, the data is added to the model using $uri as the named context.

add_string ( $data, $base_uri, $named, $format )

Addsd the contents of $data to the model. If $named is true, the data is added to the model using $base_uri as the named context.

add_statement ( $statement )

Adds the specified $statement to the underlying model.

remove_statement ( $statement )

Removes the specified $statement from 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 $data string. 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_hash for 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.