.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" 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" '' '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. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" 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 "RDF::RDFa::Generator 3pm" .TH RDF::RDFa::Generator 3pm "2012-12-12" "perl v5.14.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" RDF::RDFa::Generator \- generate some data in RDFa .SH "DESCRIPTION" .IX Header "DESCRIPTION" .SS "Constructor" .IX Subsection "Constructor" .ie n .IP """$gen = RDF::RDFa::Generator\->new(style => $style, %options)""" 4 .el .IP "\f(CW$gen = RDF::RDFa::Generator\->new(style => $style, %options)\fR" 4 .IX Item "$gen = RDF::RDFa::Generator->new(style => $style, %options)" Creates a new generator object. \f(CW$style\fR is one of the following case-sensitive strings: \&'HTML::Head' (the default), 'HTML::Hidden' or 'HTML::Pretty'. You can also construct an object like this: .Sp .Vb 1 \& $gen = RDF::RDFa::Generator::HTML::Head\->new(%options); .Ve .Sp Options include: .RS 4 .IP "\(bu" 4 \&\fBbase\fR \- the base \s-1URL\s0 where the output data will be published. This allows in some cases for the generated RDFa to include relative URIs. .IP "\(bu" 4 \&\fBdata_context\fR \- if non-null, a \s-1URI\s0 (string) which indicates the context (named graph) containing the data to generate RDFa for. .IP "\(bu" 4 \&\fBnamespaces\fR \- a {prefix=>uri} hashref of preferred \s-1CURIE\s0 prefixes. .IP "\(bu" 4 \&\fBns\fR \- a {uri=>prefix} hashref of preferred \s-1CURIE\s0 prefixes. \s-1DEPRECATED\s0 \- use \fBnamespaces\fR instead. .IP "\(bu" 4 \&\fBprefix_attr\fR \- use the \f(CW@prefix\fR attribute for \s-1CURIE\s0 prefixes (RDFa 1.1 only). Boolean, defaults to false. .IP "\(bu" 4 \&\fBsafe_xml_literals\fR \- prevents \s-1XML\s0 literals from injecting arbitrary \s-1XHTML\s0 into the output. Boolean, \fBdefaults to \s-1FALSE\s0\fR. .IP "\(bu" 4 \&\fBtitle\fR \- assign a element for generated \s-1XHTML\s0 documents. .IP "\(bu" 4 \&\fBversion\fR \- set generated RDFa version. Valid values are '1.0' (the default) or '1.1'. .RE .RS 4 .RE .SS "Public Methods" .IX Subsection "Public Methods" .ie n .IP """$gen\->create_document($model)""" 4 .el .IP "\f(CW$gen\->create_document($model)\fR" 4 .IX Item "$gen->create_document($model)" Creates a new RDFa file containing triples. \f(CW$model\fR is an RDF::Trine::Model object providing the triples. Returns an XML::LibXML::Document object suitable for serialising using its \f(CW\*(C`toString\*(C'\fR method. .Sp If you're planning on serving the RDFa with the text/html media type, then it is recommended that you use HTML::HTML5::Writer to serialise the document rather than \f(CW\*(C`toString\*(C'\fR. .Sp Can also be called as a class method: .Sp .Vb 3 \& $document = RDF::RDFa::Generator\->create_document($model) \& # Same as: \& # $document = RDF::RDFa::Generator\->new\->create_document($model) .Ve .ie n .IP """$gen\->inject_document($document, $model)""" 4 .el .IP "\f(CW$gen\->inject_document($document, $model)\fR" 4 .IX Item "$gen->inject_document($document, $model)" Injects an existing document with triples. \f(CW$document\fR is an XML::LibXML::Document to inject, or a well-formed \s-1XML\s0 string. \f(CW$model\fR is an RDF::Trine::Model object providing the triples. Returns an XML::LibXML::Document object suitable for serialising using its \f(CW\*(C`toString\*(C'\fR method. .Sp See \f(CW\*(C`create_document\*(C'\fR for information about serving the RDFa with the text/html media type. .Sp Can also be called as a class method. See \f(CW\*(C`create_document\*(C'\fR for details. .ie n .IP """$gen\->nodes($model)""" 4 .el .IP "\f(CW$gen\->nodes($model)\fR" 4 .IX Item "$gen->nodes($model)" Provides triple-laden XML::LibXML::Elements to be added to a document. \&\f(CW$model\fR is an RDF::Trine::Model object providing the triples. If called in list context, returns a list of XML::LibXML::Element objects which can be added to a document; otherwise returns an XML::LibXML::NodeList containing a list of such elements. .Sp Can also be called as a class method. See \f(CW\*(C`create_document\*(C'\fR for details. .Sp The HTML::Pretty generator can be passed a couple of additional options: .Sp .Vb 1 \& $gen\->nodes($model, notes_heading=>\*(AqAdditional Info\*(Aq, notes=>\e@notes); .Ve .Sp The notes are a list of RDF::RDFa::Generator::HTML::Pretty::Note objects which are added as notes to the end of each subject's data. .PP Additionally the methods \f(CW\*(C`serialize_model_to_file\*(C'\fR, \f(CW\*(C`serialize_model_to_string\*(C'\fR, \&\f(CW\*(C`serialize_iterator_to_file\*(C'\fR and \f(CW\*(C`serialize_iterator_to_string\*(C'\fR are provided for compatibility with the RDF::Trine::Serializer interface. .SH "BUGS" .IX Header "BUGS" Please report any bugs to <http://rt.cpan.org/>. .SH "SEE ALSO" .IX Header "SEE ALSO" HTML::HTML5::Writer, XML::LibXML, RDF::RDFa::Parser, RDF::Trine, RDF::Prefixes. .PP <http://www.perlrdf.org/>. .SH "AUTHOR" .IX Header "AUTHOR" Toby Inkster <tobyink@cpan.org>. .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" Copyright (C) 2010 by Toby Inkster .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8 or, at your option, any later version of Perl 5 you may have available. .SS "Icons" .IX Subsection "Icons" RDF::RDFa::Generator::HTML::Pretty uses the FamFamFam Silk icons; see <http://famfamfam.com/lab/icons/silk/>.