.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Ace::Model 3pm" .TH Ace::Model 3pm "2016-02-01" "perl v5.24.1" "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 \fImodel()\fR method to retrieve the model of a named class, or by calling an Ace::Object's \fImodel()\fR method to retrieve the object's particular model. .SH "METHODS" .IX Header "METHODS" .SS "\fInew()\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 "\fIname()\fP" .IX Subsection "name()" .Vb 1 \& $name = $model\->name; .Ve .PP This returns the class name for the model. .SS "\fItags()\fP" .IX Subsection "tags()" .Vb 1 \& @tags = $model\->tags; .Ve .PP This returns a list of all the valid tags in the model. .SS "\fIvalid_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 "\fIpath()\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 "\fIasString()\fP" .IX Subsection "asString()" .Vb 1 \& print $model\->asString; .Ve .PP \&\fIasString()\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.