Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

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

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

NAME
TM::Serializable::LTM - Topic Maps, trait for parsing of LTM instances. SYNOPSIS
# this is not an end-user package # see the source of TM::Materialized::LTM DESCRIPTION
This package provides parsing functionality for LTM 1.3 instances with the exceptions listed below. LTM 1.3 is backwards compatible with version 1.2. As LTM 1.3 is not yet public, please contact the author (Lars M. Garshol) for a copy. http://www.ontopia.net/download/ltm.html Deviations from the LTM Specification comments: The parser does NOT recognizes nested comments. Any closest following */ sequence terminates a comment. The parser does also not distinguish between comments within or outside strings. Justification: Speed of parsing and complexity of the parser. scope: Only exactly ONE topic can be specified for a scope. Justification: Multiple topics per scope are allowed by the standard, but are undefined in their semantics. The underlying TM representation does NOT allow for multiple topics per scope. variants Variants are currently not supported. This also includes sort names and display names. Justification: Will be added later. syntax Any number of statements are allowed in LTM files (also 0). Justification: There is no reason to do otherwise. TOPICMAP directive This is currently not implemented. Justification: There are better ways to do that. MERGEMAP directive The HyTime, ISO13250 format is not implemented as there is currently no driver in the TM suite. Justification: As long as there is no interest (read: bribe money), it never will. BASEURI directive BASEURI is currently not honored for all local URIs. Justification: I do not understand its purpose. encoding This is currently ignored. Justification: Will be added later. Subject Locators It is a violation to use more than one subject locator per topic. Justification: This is enforced by the underlying model. Source Locators No source locators are created. Justification: There is no such concept (thankfully) in the TM suite. role type: If a role is not specified, it will remain default to "thing" and not - as the specification mandates - will be substituted by the topic type. Justification: First, a topic might have several types (which one to use?), secondly there might be several topics in a member and thirdly, a role should generally NOT be the type of a member. Notes Merging The parser (like any other in the TM suite) does NOT perform merging automatically. You have to trigger that explicitely with the method "consolidate". MERGEMAP directive The strings determining the format are checked case-insensitive, so ASTMA and AsTMa are treated equally. The location of the map can be defined via any URI handled by LWP::Simple. If no scheme is provided file: will be assumed. INTERFACE
Methods deserialize This method tries to parse the passed in text stream as LTM instance. It will raise an exception on the first parse error. serialize This is not implemented. SEE ALSO
TM AUTHOR INFORMATION
Copyright 200[1-6], 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 2008-06-12 TM::Serializable::LTM(3pm)

Check Out this Related Man Page

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

NAME
TM::Serializable - Topic Maps, abstract trait for stream (map) based input/output drivers SYNOPSIS
# step 1) you write an input/output driver for a serialized TM format package MyFormat; # provides methods sub deserialize { my $self = shift; # gets current map my $stream = shift; # .... fill the map with content } sub serialize { my $self = shift; # get the map # .... return ... #serialized content } 1; # step 2) construct a subclass of TM using this driver package MapWithMyFormat; use TM; use base qw(TM); use Class::Trait qw(TM::Serializable MyFormat); 1; # step 3) use it in your application my $tm = new MapWithMyFormat (url => 'file:map.myformat'); $tm->sync_in; # uses MyFormat to parse the content from the file DESCRIPTION
This trait implements synchronizable resources using a serialized format. Examples are formats such as AsTMa 1.0, 2.0, LTM, CTM, XTM. The only thing these drivers have to provide are the methods "serialize" and "deserialize" which serialize maps to streams and vice-versa. This trait provides the implementations for "source_in" and "source_out" triggering "deserialize" and "serialize", respectively. INTERFACE
Methods source_in Uses the URL attached to the map object to trigger "deserialize" on the stream content behind the resource. All URLs of LWP are supported. If the URI is "io:stdio" then content from STDIN is consumed. This content can be consumed more than once (it is buffered internally), so that you can read several times from "io:stdin" getting the same input. If the resource URI is "io:stdout", then nothing happens. If the resource URI is "null:", then nothing happens. [Since TM 1.53]: Any additional parameters are passed through to the underlying "deserialize" method. source_out This method triggers "serialize" on the object. The contents will be copied to the resource identified by the URI attached to the object. At the moment, only "file:" URLs and "io:stdout" is supported. If the resource URI is "io:stdin", nothing happens. If the resource URI is "null:", nothing happens. If the resource URI is "inline:.." nothing happens. [Since TM 1.53]: Any additional parameters are passed through to the underlying "serialize" method. SEE ALSO
TM, TM::Synchronizable AUTHOR INFORMATION
Copyright 20(0[2-6]|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-06-05 TM::Serializable(3pm)
Man Page