TM::Serializable::JTM
Topic Maps, trait for reading/writing JSON Topic Map instances.
- Provided by: libtm-perl (Version: 1.56-7)
- Report a bug
Topic Maps, trait for reading/writing JSON Topic Map instances.
# NOTE: this is not an end-user package, # see TM::Materialized::JTM for common application patterns # reading JSON/YAML: my $tm=TM->new(...); Class::Trait->apply($tm,"TM::Serializable::JTM"); $tm->deserialize($jsondata); # writing JSON/YAML: # ...a map $tm is instantiated somehow Class::Trait->apply($tm,"TM::Serializable::JTM"); my $yamltext=$tm->serialize(format=>"yaml");
This trait provides functionality for reading and writing Topic Maps in JTM (JSON Topic Map) format, as defined here: <http://www.cerny-online.com/jtm/1.0/>.
Limitations:
The method understands one key/value parameter pair:
This option controls whether the JTM is expected to be in JSON format or in YAML (which is a superset of JSON).
If no format parameter is given but the TM::Materialized::JTM trait is used, then the format is inherited from there; otherwise the default is "json".
The method understands one key/value parameter pair:
This option controls whether the JTM result should be created in the JSON format or in YAML (which is a superset of JSON).
If no format parameter is given but the TM::Materialized::JTM trait is used, then the format is inherited from there; otherwise the default is "json".
TM, TM::Serializable
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