.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" 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 turned on, 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 .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "DublinCore::Record 3pm" .TH DublinCore::Record 3pm "2015-06-07" "perl v5.20.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" DublinCore::Record \- Container for Dublin Core metadata elements .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use DublinCore::Record; \& \& my $record = DublinCore::Record\->new(); \& \& # later ... \& \& # print the title \& print $record\->element( \*(Aqtitle\*(Aq )\->content; \& \& ## list context will retrieve all of a particular element \& foreach my $element ( $record\->element( \*(AqCreator\*(Aq ) ) { \& print "creator: ", $element\->content(), "\en"; \& } \& \& ## qualified dublin core \& my $creation = $record\->element( \*(AqDate.created\*(Aq )\->content(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" DublinCore::Record is an abstract class for manipulating DublinCore metadata. The Dublin Core is a small set of metadata elements for describing information resources. For more information on embedding DublinCore in \s-1HTML\s0 see \s-1RFC 2731 \&\s0 or .SH "METHODS" .IX Header "METHODS" .SS "\fInew()\fP" .IX Subsection "new()" The constructor. Takes no arguments. .PP .Vb 1 \& $record = DublinCore::Record\->new(); .Ve .ie n .SS "add( @elements )" .el .SS "add( \f(CW@elements\fP )" .IX Subsection "add( @elements )" Adds valid DublinCore::Element objects to the record. .ie n .SS "remove( @elements )" .el .SS "remove( \f(CW@elements\fP )" .IX Subsection "remove( @elements )" Removes valid DublinCore::Element object from the record. .SS "\fIelement()\fP" .IX Subsection "element()" This method will return a relevant DublinCore::Element object. When called in a scalar context \fIelement()\fR will return the first relevant element found, and when called in a list context it will return all the relevant elements (since Dublin Core elements are repeatable). .PP .Vb 3 \& ## retrieve first title element \& my $element = $record\->element( \*(AqTitle\*(Aq ); \& my $title = $element\->content(); \& \& ## shorthand object chaining to extract element content \& my $title = $record\->element( \*(AqTitle\*(Aq )\->content(); \& \& ## retrieve all creator elements \& @creators = $record\->element( \*(AqCreator\*(Aq ); .Ve .PP You can also retrieve qualified elements in a similar fashion. .PP .Vb 1 \& my $date = $record\->element( \*(AqDate.created\*(Aq )\->content(); .Ve .PP In order to fascilitate chaining \fIelement()\fR will return an empty DublinCore::Element object when the requested element does not exist. You can check if you're getting an empty empty back by using the \fIis_empty()\fR method. .PP .Vb 3 \& if( $record\->element( \*(Aqtitle\*(Aq )\->is_empty ) { \& # no title \& } .Ve .SS "\fIelements()\fP" .IX Subsection "elements()" Returns all the Dublin Core elements found as DublinCore::Element objects which you can then manipulate further. .PP .Vb 4 \& foreach my $element ( $record\->elements() ) { \& print "name=", $element\->name(), "\en"; \& print "content=", $element\->content(), "\en"; \& } .Ve .SS "\fItitle()\fP" .IX Subsection "title()" Returns a DublinCore::Element object for the title element. You can then retrieve content, qualifier, scheme, lang attributes like so. .PP .Vb 5 \& my $title = $record\->title(); \& print "content: ", $title\->content(), "\en"; \& print "qualifier: ", $title\->qualifier(), "\en"; \& print "scheme: ", $title\->scheme(), "\en"; \& print "language: ", $title\->language(), "\en"; .Ve .PP Since there can be multiple instances of a particular element type (title, creator, subject, etc) you can retrieve multiple title elements by calling \&\fItitle()\fR in a list context. .PP .Vb 4 \& my @titles = $record\->title(); \& foreach my $title ( @titles ) { \& print "title: ", $title\->content(), "\en"; \& } .Ve .SS "\fIcreator()\fP" .IX Subsection "creator()" Retrieve creator information in the same manner as \fItitle()\fR. .SS "\fIsubject()\fP" .IX Subsection "subject()" Retrieve subject information in the same manner as \fItitle()\fR. .SS "\fIdescription()\fP" .IX Subsection "description()" Retrieve description information in the same manner as \fItitle()\fR. .SS "\fIpublisher()\fP" .IX Subsection "publisher()" Retrieve publisher information in the same manner as \fItitle()\fR. .SS "\fIcontributor()\fP" .IX Subsection "contributor()" Retrieve contributor information in the same manner as \fItitle()\fR. .SS "\fIdate()\fP" .IX Subsection "date()" Retrieve date information in the same manner as \fItitle()\fR. .SS "\fItype()\fP" .IX Subsection "type()" Retrieve type information in the same manner as \fItitle()\fR. .SS "\fIformat()\fP" .IX Subsection "format()" Retrieve format information in the same manner as \fItitle()\fR. .SS "\fIidentifier()\fP" .IX Subsection "identifier()" Retrieve identifier information in the same manner as \fItitle()\fR. .SS "\fIsource()\fP" .IX Subsection "source()" Retrieve source information in the same manner as \fItitle()\fR. .SS "\fIlanguage()\fP" .IX Subsection "language()" Retrieve language information in the same manner as \fItitle()\fR. .SS "\fIrelation()\fP" .IX Subsection "relation()" Retrieve relation information in the same manner as \fItitle()\fR. .SS "\fIcoverage()\fP" .IX Subsection "coverage()" Retrieve coverage information in the same manner as \fItitle()\fR. .SS "\fIrights()\fP" .IX Subsection "rights()" Retrieve rights information in the same manner as \fItitle()\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "\(bu" 4 DublinCore::Element .IP "\(bu" 4 Dublin Core .IP "\(bu" 4 \&\s-1RFC 2731 \s0 .IP "\(bu" 4 perl4lib .SH "AUTHOR" .IX Header "AUTHOR" .IP "\(bu" 4 Ed Summers .IP "\(bu" 4 Brian Cassidy .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2007 by Ed Summers, Brian Cassidy .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.