<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Ace::Model - Get information about AceDB models</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:root@localhost" /> </head> <body style="background-color: white"> <!-- INDEX BEGIN --> <div name="index"> <p><a name="__index__"></a></p> <!-- <ul> <li><a href="#name">NAME</a></li> <li><a href="#synopsis">SYNOPSIS</a></li> <li><a href="#description">DESCRIPTION</a></li> <li><a href="#methods">METHODS</a></li> <ul> <li><a href="#new__"><code>new()</code></a></li> <li><a href="#name__"><code>name()</code></a></li> <li><a href="#tags__"><code>tags()</code></a></li> <li><a href="#valid_tag__"><code>valid_tag()</code></a></li> <li><a href="#path__"><code>path()</code></a></li> <li><a href="#asstring__"><code>asString()</code></a></li> </ul> <li><a href="#see_also">SEE ALSO</a></li> <li><a href="#author">AUTHOR</a></li> </ul> --> </div> <!-- INDEX END --> <p> </p> <h1><a name="name">NAME</a></h1> <p>Ace::Model - Get information about AceDB models</p> <p> </p> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1> <pre> use Ace; my $db = Ace->connect(-path=>'/usr/local/acedb/elegans'); my $model = $db->model('Author'); print $model; $name = $model->name; @tags = $model->tags; print "Paper is a valid tag" if $model->valid_tag('Paper');</pre> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p>This class is provided for access to AceDB class models. It provides the model in human-readable form, and does some limited but useful parsing on your behalf.</p> <p>Ace::Model objects are obtained either by calling an Ace database handle's <code>model()</code> method to retrieve the model of a named class, or by calling an Ace::Object's <code>model()</code> method to retrieve the object's particular model.</p> <p> </p> <hr /> <h1><a name="methods">METHODS</a></h1> <p> </p> <h2><a name="new__"><code>new()</code></a></h2> <pre> $model = Ace::Model->new($model_data);</pre> <p>This is a constructor intended only for use by Ace and Ace::Object classes. It constructs a new Ace::Model object from the raw string data in models.wrm.</p> <p> </p> <h2><a name="name__"><code>name()</code></a></h2> <pre> $name = $model->name;</pre> <p>This returns the class name for the model.</p> <p> </p> <h2><a name="tags__"><code>tags()</code></a></h2> <pre> @tags = $model->tags;</pre> <p>This returns a list of all the valid tags in the model.</p> <p> </p> <h2><a name="valid_tag__"><code>valid_tag()</code></a></h2> <pre> $boolean = $model->valid_tag($tag);</pre> <p>This returns true if the given tag is part of the model.</p> <p> </p> <h2><a name="path__"><code>path()</code></a></h2> <pre> @path = $model->path($tag)</pre> <p>Returns the path to the indicated tag, returning a list of intermediate tags. For example, in the C elegans ?Locus model, the path for 'Compelementation_data" will return the list ('Type','Gene').</p> <p> </p> <h2><a name="asstring__"><code>asString()</code></a></h2> <pre> print $model->asString;</pre> <p><code>asString()</code> returns the human-readable representation of the model with comments stripped out. Internally this method is called to automatically convert the model into a string when appropriate. You need only to start performing string operations on the model object in order to convert it into a string automatically:</p> <pre> print "Paper is unique" if $model=~/Paper ?Paper UNIQUE/;</pre> <p> </p> <hr /> <h1><a name="see_also">SEE ALSO</a></h1> <p><a href="/AcePerl/docs/./Ace.html">the Ace manpage</a></p> <p> </p> <hr /> <h1><a name="author">AUTHOR</a></h1> <p>Lincoln Stein <<a href="mailto:lstein@w3.org">lstein@w3.org</a>> with extensive help from Jean Thierry-Mieg <<a href="mailto:mieg@kaa.crbm.cnrs-mop.fr">mieg@kaa.crbm.cnrs-mop.fr</a>></p> <p>Copyright (c) 1997-1998, Lincoln D. Stein</p> <p>This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.</p> </body> </html>