Reference

XTM::AsTMa(3pm)

XTM::AsTMa - Topic Map Parsing of AsTMa instances.

  # reading a topic map description from a file/url
  $atm = new XTM::AsTMa (file => 'mymap.atm');
  $tm  = $atm->sync_in();

This package provides parsing functionality for AsTMA instances as described in the package documentation (doc directory) or at

   http://topicmaps.bond.edu.au/astma/

Currently, only AsTMa= is supported, with the following constraints/additions: This feature was experimental and is now deprecated. 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. Writes a line to STDERR reporting the line number and an optional message. Useful for debugging. Adds a name attribute to the topic map. 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: It is still not allowed to use several name : encoding clauses.

Note: If no encoding is provided, utf8 is assumed. Turns on/off auto completion.

Note: topics which have been mentioned in a 'is-reified-by' clause will be always generated.

A directive can be inserted anywhere in the document but must be at the start of a line.
Constructor The constructor expects a hash as parameter containing one of the following fields: If given, then the AsTMa instance will be read from this url. If given, then the AsTMa data will be read from this file (This is just a convenience function as it will be mapped to url). If given, then the AsTMa instance will be read directly from this text. If set to 0, the AsTMa loader will NOT try to automatically generate topics which have been mentioned without being declared.

Note: topics which have been mentioned in a 'is-reified-by' clause will be always generated. If several fields ("file", "url", "text") are specified, it is undefined which one will be taken. Examples:

   $atm = new XTM::AsTMa (file => 'here.atm');
   $atm = new XTM::AsTMa (url  => 'file:here.atm',  # the same
                          auto_complete => 0);      # but with auto_completion turned off
   $atm = new XTM::AsTMa (text => '# this is AsTMa');

Methods $time = $atm->last_mod

returns the UNIX time when the resource has been modified last. "undef" is returned if the result cannot be determined. $tmmemory = $atm->sync_in

loads an AsTMa instance and returns a XTM::Memory object. Note that that all undefined topics will be defined automatically, unless "auto_complete" is set to 0.

The only optional parameter is "consistency". It will be used when building the map while reading the AsTMa instance. See XTM for details. is not implemented. XTM Copyright 200[1-2], Robert Barta <[email protected]>, 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

History