Topic maps, trait for json topic map instances.
use TM::Materialized::JTM; my $tm=TM::Materialized::JTM(file=>"somefile.jtm"); $tm->sync_in; ... # map was modified, now save the changes $tm->sync_out;
This package provides map parsing and creating functionality for \s-1JTM\s0 (\s-1JSON\s0 Topic Map) instances. The \s-1JSON\s0 Topic Map format is defined here: http://www.cerny-online.com/jtm/1.0/ <http://www.cerny-online.com/jtm/1.0/>.
$tm = TM::Materialized::JTM->new (...); The constructor expects a hash as described in TM::Materialized::Stream, with one additional key/value parameter:
format (choices: "json", "yaml") This option controls whether the \s-1JTM\s0 data is treated as being in \s-1JSON\s0 format or in \s-1YAML\s0 (which is a superset of \s-1JSON\s0). This applies to both reading and writing of map data. The default value is "json".
$tm->format('json'); $curformat=$tm->format; This method gets or sets the format parameter for future operations. Possible choices: "json", "yaml".
TM::Serializable::JTM
Copyright 2010, Alexander Zangerl, 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