OGDL::Parser - OGDL parser class
#Two easy interfaces
#or parsing a string
#Another way to use the parser
#This method allows passing of any file handle to the parser
# $g is an OGDL::Graph object
# print the whole graph.
OGDL possibly is a human editable alternative to XML. For details please see http://ogdl.sourceforge.net/. This class will parse an ogdl conformed file or string into an OGDL::Graph object.
$g=OGDL::Parser::fileToGraph($filename) This is a simple way of parsing an ogdl file. The method accepts filename and returns an OGDL::Graph object parsed from the file. It returns undef if the parsing failed for any reason.
$g=OGDL::Parser::stringToGraph($string) This provides an easy way to parse an ogdl content held in memory. It accepts a string and returnes an OGDL::Graph object parsed from the string. It returns undef if the parsing failed.
$p=OGDL::Parser->new($rootname) This method constructs an OGDL::Parser object. If $rootname is provided, it uses $rootname as the name of the rootnode for the graph to parsed.
$p->read(*FILEHANDLE) This method reads in text into its internal buffer and make it ready for parsing. The method can be used several times to read in contents from different sources. The resulting ogdl graph will be a plain combination of all the contents.
$p->append($str) This method adds $str to its internal buffer and make it ready for parsing.
$g=$p->parse This method parses its internal buffer and returns the OGDL::Graph object from parsing. It returns undef if parsing fails.
To install OGDL::Path, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.