NAME
XTM::ATM - Topic Map Conversion from AsTMa
SYNOPSIS
# usage A: immediate conversion
use XTM::ATM;
print atm2xtm (in => sub { return <> }, # default anyway
out => sub { print @_; }, # default
err => sub { print STDERR @_ }, #default
auto_complete => 1,
basename => sub { return $_[0]; }
);
print xtm2atm (); # will die as it is not yet implemented
# usage B: OO with on-demand sync-in
# reading a topic map description from a file/url
$atm = new XTM::ATM (url => 'mymap.atm');
DESCRIPTION
This package provides conversion routines between AsTMA
http://topicmaps.bond.edu.au/astma/and XTM
http://www.topicmaps.org/xtm/NON-OO INTERFACE
Functions
atm2xtm
xtm2atm
-
Not implemented yet.
OO INTERFACE
Constructor
The constructor expects a hash as parameter containing one of the following fields:
- url:
-
If given then the AsTMa data will be read/written from/to this url.
- file:
-
If given then the AsTMa data will be read/written from/to this file (This is just a convenience function as it will be mapped to url).
- text:
-
If given then the AsTMa data will be read/written from/to this text. (See method text how to retrieve the current value).
If several fields are specified, an exception will be raised.
Examples:
$xtm = new XTM::ATM (file => 'here.xml');
$xtm = new XTM::ATM (url => 'file:here.xml'); # the same
$xtm = new XTM::ATM (text => '....');
Methods
The methods sync_in
, sync_out
and last_mod
implement the methods from the abstract class.
last_mod
-
returns the UNIX time when the resource has been modified last.
undef
is returned if the result cannot be determined. sync_in
-
actually loads an AsTMa resource and returns a XTM::Memory object.
sync_out
-
is currently not implemented.
SEE ALSO
AUTHOR INFORMATION
Copyright 2001, Robert Barta <rho@telecoma.net>, All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.