.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Ace::Model 3pm" .TH Ace::Model 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Ace::Model \- Get information about AceDB models .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 7 \& use Ace; \& my $db = Ace\->connect(\-path=>\*(Aq/usr/local/acedb/elegans\*(Aq); \& my $model = $db\->model(\*(AqAuthor\*(Aq); \& print $model; \& $name = $model\->name; \& @tags = $model\->tags; \& print "Paper is a valid tag" if $model\->valid_tag(\*(AqPaper\*(Aq); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" 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. .PP Ace::Model objects are obtained either by calling an Ace database handle's \fBmodel()\fR method to retrieve the model of a named class, or by calling an Ace::Object's \fBmodel()\fR method to retrieve the object's particular model. .SH METHODS .IX Header "METHODS" .SS \fBnew()\fP .IX Subsection "new()" .Vb 1 \& $model = Ace::Model\->new($model_data); .Ve .PP 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. .SS \fBname()\fP .IX Subsection "name()" .Vb 1 \& $name = $model\->name; .Ve .PP This returns the class name for the model. .SS \fBtags()\fP .IX Subsection "tags()" .Vb 1 \& @tags = $model\->tags; .Ve .PP This returns a list of all the valid tags in the model. .SS \fBvalid_tag()\fP .IX Subsection "valid_tag()" .Vb 1 \& $boolean = $model\->valid_tag($tag); .Ve .PP This returns true if the given tag is part of the model. .SS \fBpath()\fP .IX Subsection "path()" .Vb 1 \& @path = $model\->path($tag) .Ve .PP 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'). .SS \fBasString()\fP .IX Subsection "asString()" .Vb 1 \& print $model\->asString; .Ve .PP \&\fBasString()\fR 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: .PP .Vb 1 \& print "Paper is unique" if $model=~/Paper ?Paper UNIQUE/; .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" Ace .SH AUTHOR .IX Header "AUTHOR" Lincoln Stein with extensive help from Jean Thierry-Mieg .PP Copyright (c) 1997\-1998, Lincoln D. Stein .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.