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

NAME

NNexus::DB::API - API routines for commonly used NNexus queries

SYNOPSIS

    use NNexus::DB;
    my $db = NNexus::DB->new(%options);
    $db->method(@arguments);

DESCRIPTION

This class provides API methods for specific SQL queries commonly needed by NNexus.

METHODS

Table: Objects

$db->add_object_by(url=>$url,domain=>$domain);

Adds a new object, identified by its $url and $domain. The $domain should match the name of the NNexus::Index::$domain plug-in class.

$db->select_object_by(url=>$url,objectid=>$objectid);

Retrieve the DB row of an object, identified by its $url, OR $objectid. Returns a Perl hashref, each key being a DB column name.

Table: Concepts

$db->add_concept_by(%options);
$db->select_concept_by(%options);
$db->delete_concept_by(%options);
$db->select_firstword_matches($word);
$db->add_linkscache_by(%options);
$db->select_linkscache_by(%options);
$db->delete_linkscache_by(%options);
$db->invalidate_by(%options);

Generic Methods

$db->last_inserted_id;

Return the last inserted id, in an auto-generated primary key column. DBMS-independent, supports MySQL and SQLite so far.

$db->reset_db;

Reset, and if necessary initialize, a SQLite database. This routine holds the reference code, defining the NNexus database schema. NOTE: Only works for a SQLite backend.

AUTHOR

Deyan Ginev <d.ginev@jacobs-university.de>

COPYRIGHT

 Research software, produced as part of work done by 
 the KWARC group at Jacobs University Bremen.
 Released under the MIT license (MIT)