NAME

Biblio::Thesaurus::SQLite - Perl extension for managing ISO thesaurs into a SQLite database

SYNOPSIS

use Biblio::Thesaurus::SQLite;
ISOthe2TheSql('thesaurus', 'dbfile');
TheSql2ISOthe('dbfile', 'output_file');
getTermAsXHTML('term', 'dbfile');
getTermAsISOthe('term', 'dbfile');
getTermAsPerl('term', 'dbfile');
setTerm('term', 'rel', 'definition', 'dbfile');
deleteTerm('term', 'rel', 'definition');
changeTerm('term', 'oldrel', 'olddef', 'newrel', 'newdef', 'dbfile');

DESCRIPTION

This module provides transparent methods to maintain Thesaurus files in a backend SQLite database. The module uses a subset from ISO 2788 which defines some standard features to be found on thesaurus files. The module also supports multilingual thesaurus and some extensions to the ISOs standard.

METHODS

ISOthe2TheSql THESAURUS, DBFILE

This method reads a ISO thesaurus ASCII file, and converts it to a SQLite database, stored on 'DBFILE'.

WARNING: This method will erase any existing DB with DBFILE filename

TheSql2ISOthe DBFILE, THESAURUS

This method dumps the SQLIte thesaurus database DBFILE to a file THESAURUS, and tries to write a beautiful (or not) ISO thesaurus format.

getTermAs<FORMAT> TERM, DBFILE

Search in the database for info about this term and outputs it in the following FORMAT:

XHTML

Usefull (or not yet) to use in CGI modules. A simple table is used to write the output of the query.

ISOThesaurus

Tries to output the info about the term in a ISO Thesaurus text format.

Perl

Constructs a Perl structure (see the "picture" below) and outputs the text representation of it using the Data::Dumper format

ovo => {
         NT => [_, _, _]
         SN => [_, _, _]
       }
setTerm TERM, RELATION, DEFINITION, DBFILE

This method tries to blindly add information about the term into the SQLite database... Much work to be done here...

deleteTerm TERM, RELATION, DEFINITION, DBFILE

This simple deletes the TERM with the RELATION and DEFINITION from the database

changeTerm TERM, OLDRELATION, OLDDEFINITION, NEWRELATION, NEWDEFINITION, DBFILE

Given the relation and the definition to delete, and the new relation/definition to insert into the database, this method tries to do just that! (but it's really really primitive right now...)

TODO

This module should be extended to work with *any* DBI class, not just a SQLite one. Also, it should check and try to correct incongruences that ca happen loading, adding, changing or deleting a term.

Of course, it needs better docs too :P

BUGS

For now, please contact me using my email. In the future, I'll find something better (I'm still getting used to RT).

SEE ALSO

perl(1), Data::Dumper(3x), Biblio::Thesaurus(3x), DBIx::Simple(3x)

AUTHOR

Ruben Fonseca, <fonseka@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2005 by krani1

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.