The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

TM::Serializable::AsTMa - Topic Maps, trait for parsing AsTMa instances.

SYNOPSIS

  # this is not an end-user package
  # see the source in TM::Materialized::AsTMa how this can be used

DESCRIPTION

This trait provides parsing functionality for AsTMa= instances. AsTMa= is a textual shorthand notation for Topic Map authoring. Currently, AsTMa= 1.3 and the (experimental) AsTMa= 2.0 is supported.

AsTMa= 1.3

This follows the specification: http://astma.it.bond.edu.au/authoring.xsp with the following constraints/additions:

following directives are supported:
%cancel

Cancels the parse process on this very line and ignores the rest of the AsTMa instance. Useful for debugging faulty maps. There is an appropriate line written to STDERR.

%log [ message ]

Writes a line to STDERR reporting the line number and an optional message. Useful for debugging.

%encoding [ encoding ]

Specifies which encoding to use to interpret the following text. This implies that this directive may appear several times to change the encoding. Whether this is a good idea in terms of information management, is a different question.

Note: If no encoding is provided, utf8 is assumed.

A directive can be inserted anywhere in the document but must be at the start of a line.

AsTMa= 2.0

It follows the specification on http://astma.it.bond.edu.au/astma=-spec-2.0r1.0.dbk with the following changes:

this is work in progress

INTERFACE

Methods

deserialize

This method take a string and tries to parse AsTMa= content from it. It will raise an exception on parse error.

serialize

This is not implemented. Maybe it never will.

SEE ALSO

TM, TM::Serializable

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