The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Text::Tradition::Parser::GraphML

SYNOPSIS

  use Text::Tradition;
  
  my $t_from_file = Text::Tradition->new( 
    'name' => 'my text',
    'input' => 'Self',
    'file' => '/path/to/tradition.xml'
    );
    
  my $t_from_string = Text::Tradition->new( 
    'name' => 'my text',
    'input' => 'Self',
    'string' => $tradition_xml,
    );

DESCRIPTION

Parser module for Text::Tradition to read in its own GraphML output format. GraphML is a relatively simple graph description language; a 'graph' element can have 'node' and 'edge' elements, and each of these can have simple 'data' elements for attributes to be saved.

The graph itself has attributes as in the Collation object:

  • linear

  • ac_label

  • baselabel

  • wit_list_separator

The node objects have the following attributes:

  • name

  • reading

  • identical

  • rank

  • class

The edge objects have the following attributes:

  • class

  • witness (for 'path' class edges)

  • extra (for 'path' class edges)

  • relationship (for 'relationship' class edges)

  • equal_rank (for 'relationship' class edges)

  • non_correctable (for 'relationship' class edges)

  • non_independent (for 'relationship' class edges)

METHODS

parse

parse( $graph, $opts );

Takes an initialized Text::Tradition object and a set of options; creates the appropriate nodes and edges on the graph. The options hash should include either a 'file' argument or a 'string' argument, depending on the source of the XML to be parsed.

BUGS / TODO

  • Make this into a stream parser with GraphML

LICENSE

This package is free software and is provided "as is" without express or implied warranty. You can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Tara L Andrews <aurum@cpan.org>