Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tm::serializable::jtm(3pm) [debian man page]

TM::Serializable::JTM(3pm)				User Contributed Perl Documentation				TM::Serializable::JTM(3pm)

NAME
TM::Serializable::JTM - Topic Maps, trait for reading/writing JSON Topic Map instances. SYNOPSIS
# 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"); DESCRIPTION
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: o Variants are not supported by TM. o Reification of basenames, occurrences and roles is not supported by TM. o Multiple scopes are not supported by TM. INTERFACE
Methods deserialize This method take a string and parses JTM content from it. It will raise an exception on any parsing error. On success, it will return the map object. The method understands one key/value parameter pair: o format (choices: "json", "yaml") 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". serialize This method serializes the map object in JTM notation and returns the result as a string. The method understands one key/value parameter pair: o format (choices: "json", "yaml") 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". SEE ALSO
TM, TM::Serializable AUTHOR INFORMATION
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 perl v5.10.1 2010-07-18 TM::Serializable::JTM(3pm)

Check Out this Related Man Page

TM::Serializable::XTM(3pm)				User Contributed Perl Documentation				TM::Serializable::XTM(3pm)

NAME
TM::Serializable::XTM - Topic Maps, trait for parsing and dumping XTM instances. SYNOPSIS
# this is not an end-user package # see the source in TM::Materialized::XTM how this can be used DESCRIPTION
This trait provides parsing and dumping functionality for XTM instances. Version 1.0 : <http://www.topicmaps.org/xtm/index.html> Version 1.1 : <http://www.jtc1sc34.org/repository/0495.htm> Version 2.0 : <http://www.isotopicmaps.org/sam/sam-xtm/> Limitations o only a single <topicMap> is allowed in one instance, there is no support for multiple maps per document o only a single scope is allowed for (base)names, occurrences and associations. o In XTM 1.1 you cannot host XML content in occurrences. o No reification support in 1.0 or 1.1. o This package does not make any use of item identifiers. o Relative URIs are NOT made absolute via the base URI where the map is loaded from. This may NOT be what a user ultimately wants. Also all URI canonicalization is skipped. o The "xlink:type" attribute is completely ignored. TODOs o <mergeMap> is handled in 1.0, 1.1, but any scoping topic is ignored. This is related to the above. o At this stage, you can only include other XTM instances with <mergeMap>, not AsTMa= or LTM. This may be fixed in the future. o No variants are serialized or deserialized. o Reification of topic map item is NOT supported. o "isa" and "is-subclass-of" associations which are scoped (or reified) are not handled special yet. o Suppress trivia might also suppress homepage << occurrence assertions. o Relative URLs in "mergeMap" are not made absolute. INTERFACE
Methods deserialize This method takes an XTM string and tries to parse it. It will raise an exception on parse error. The if a "version" attribute exists, then the value serialize This method serializes the map object into XTM notation and returns the resulting string. It will raise an exception if the object contains constructs that XTM cannot represent. The result is a standard Perl string, so you may need to force it into a particular encoding. The method understands a number of key/value pair parameters: "omit_trivia" (default: 0) This option suppresses the output of topics without any characteristics. "version" (default: 2.0) This option controls whether XTM 1.0 or XTM 2.0 (default) is generated. SEE ALSO
TM, TM::Serializable AUTHOR INFORMATION
Copyright 200[78] Alexander Zangerl, Robert Barta. 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-06-05 TM::Serializable::XTM(3pm)
Man Page