Set::Relation

Relation data type for Perl
Download

Set::Relation Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Darren Duncan
  • Publisher web site:
  • http://search.cpan.org/~duncand/

Set::Relation Tags


Set::Relation Description

Relation data type for Perl Set::Relation is a Perl module that provides a simple Perl-native facility for an application to organize and process information using the relational model of data, without having to employ a separate DBMS, and without having to employ a whole separate sub-language (such as Muldis Rosetta does). Rather, it is integrated a lot more into the Perl way of doing things, and you use it much like a Perl array or hash, or like some other third-party Set:: modules available for Perl. This module defines a Perl 5 object role that represents a Muldis D relation value, whose methods implement all the Muldis D relational operators. Or more specifically, it defines several such roles (immutable and mutable variants) and there are several bundled implementing Perl 5 classes.WARNING: This module is still experimental and may change in incompatible ways between releases. While the module is considered feature complete, and is fully documented, and a review of its code makes it look correct, most features have in fact not yet been tested in running code and so might actually be broken. This module might in fact work for you now, but it is officially alpha quality. Please use it with caution.If you want to help out with this module's development, generally the most helpful thing you can do to start out is to flesh out the test suite. I suggest looking at the test suites of other Set:: modules as well as various database related modules as inspiration or a source for copying.Loosely speaking, a Set::Relation object is a wrapper over a set of hash refs, where all the hash refs in the set have the same number of elements and the same set of hash keys; so in this context, a Perl hash ref and a Set::Relation object correspond to the relational model concepts of a tuple and a relation, respectively. A relation is analogous to a SQL row-set but that the columns and rows are not ordered, and there are no duplicate column names or duplicate rows. Set::Relation provides all the normal operators of other Set:: classes, such as 'is_subset', 'union', 'diff' etc, but it also provides operators like 'join', 'quotient', 'projection', 'group', 'summary', 'semijoin', 'restriction', 'semidiff', 'tclose', 'outer_join' etc.Note, you can model a whole relational database by having a hash ref whose keys are akin to SQL table names and whose values are Set::Relation objects.The name Set::Relation was chosen because it seems the most descriptive. A 'relation' is a value, same as an integer or an array is a value, and a relation can do everything a generic set can do plus more. The Set:: namespace is used to reduce confusion amongst other concepts of the word 'relation', as some people think it means 'compare'; Set:: illustrates that this class' objects are functionally set-like collection values.SYNOPSIS use Set::Relation::V2; sub relation { return Set::Relation::V2->new( @_ ); } my $r1 = relation( , , , ] ] ); my $r2 = relation( ); my $r3 = $r1->join( $r2 ); my $r3_as_nfmt_perl = $r3->members(); my $r3_as_ofmt_perl = $r3->members( 1 ); # Then $r3_as_nfmt_perl contains: # # And $r3_as_ofmt_perl contains: # , , # , # ] ] Requirements: · Perl


Set::Relation Related Software