Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tm::objectable(3pm) [debian man page]

TM::ObjectAble(3pm)					User Contributed Perl Documentation				       TM::ObjectAble(3pm)

NAME
TM::Synchronizable - Topic Maps, trait for storing objects into backends SYNOPSIS
my $tm = .... # get a topic map from somewhere use Class::Trait; Class::Trait->apply ($tm, "TM::ObjectAble"); my %store; # find yourself a proper store, can be anything HASHish # append it to the list of stores, or .... push @{ $tm->storages }, \%store; # prepend it to the list of stores unshift @{ $tm->storages }, \%store; # store it (the proper storage will take it) $tm->objectify ('tm:some-topic', "whatever object or data"); # get it back my @objects = $tm->object ('tm:some-topic', 'tm:some-topic2'); # get rid of it $tm->deobjectify ('tm:some-topic'); DESCRIPTION
This trait implements functionality to store arbitrary data on a per-topic basis. Conceptually, the storage can be thought as one large hash, as keys being use the internal topic identifiers, as values the object data. But to allow different topics to store their object data in different places, this interface works with a list of such hashes. Each hash (native or tied to some implementation) in the list is visited (starting from the start of the list) and can take over the storage. Whether this is based on the topic id, on some other topic information, or on the MIME type of the data (if it has one), is up to the implementation to decide. INTERFACE
Methods storages $listref = $tm->storages This method returns an array reference. You can "unshift" or "push" your storage implementation onto this list. Example: my %store1; push @{ $tm->storages }, \%store1 objectify $tm->objectify ($tid => $some_data, ...); This method stores actually the data. It takes a hash, with the topic id as keys and according values and tries to find for each of the pairs an appropriate storage. If none can be found, it will raise an exception. NOTE: Yes, this is a stupid name. deobjectify $tm->deobjectify ($tid, ...) This method removes any data stored for the provided topic(s). If no data can be found in the appropriate storage, an exception will be raised. object @objects = $tm->object ($tid, ...) This method returns any data stored for the provided objects. If no data can be found for a particular topic, then "undef" will be returned. SEE ALSO
TM AUTHOR INFORMATION
Copyright 20(10), Robert Barta <drrho@cpan.org>, All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. http://www.perl.com/perl/misc/Artistic.html perl v5.10.1 2010-10-27 TM::ObjectAble(3pm)

Check Out this Related Man Page

TM::Analysis(3pm)					User Contributed Perl Documentation					 TM::Analysis(3pm)

NAME
TM::Analysis - Topic Maps, analysis functions SYNOPSIS
use TM::Materialized::AsTMa; my $tm = new TM::Materialized::AsTMa (file => 'test.atm'); $tm->sync_in; Class::Trait->apply ($tm, 'TM::Analysis'); print Dumper $tm->statistics; print Dumper $tm->orphanage; DESCRIPTION
This package contains some topic map analysis functionality. INTERFACE
statistics This (currently quite limited) function computes a reference to hash containing the following fields: "nr_toplets" Nr of midlets in the map. This includes ALL midlets for topics and also those for assertions. "nr_asserts" Nr of assertions in the map. "nr_clusters" Nr of clusters according to the "cluster" function elsewhere in this document. orphanage This computes all topics which have either no supertype and also those which have no type. Without further parameters, it returns a hash reference with the following fields: "untyped" Holds a list reference to all topic ids which have no type. "empty" Holds a list reference to all topic ids which have no instance. "unclassified" Holds a list reference to all topic ids which have no superclass. "unspecified" Holds a list reference to all topic ids which have no subclass. Optionally, a list of the identifiers above can be passed in so that only that particular information is actually returned (some speedup): my $o = TM::Analysis::orphanage ($tm, 'untyped'); entropy This method returns a hash (reference) where the keys are the assertion types and the values are the individual entropies of these assertion types. More frequently used (inflationary) types will have a lower value, very seldomly used ones too. Only those in the middle count most. SEE ALSO
TM COPYRIGHT AND LICENSE
Copyright 20(0[3-68]|10) by Robert Barta, <drrho@cpan.org> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-06-06 TM::Analysis(3pm)
Man Page