.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" 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 "RDF::RDFa::Generator 3pm" .TH RDF::RDFa::Generator 3pm "2017-12-23" "perl v5.26.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" RDF::RDFa::Generator \- Generate data for RDFa serialization .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 <https://github.com/kjetilk/p5\-rdf\-rdfa\-generator/issues>. .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>. .PP Kjetil Kjernsmo <kjetilk@cpan.org>. .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" Copyright (C) 2010 by Toby Inkster, 2017 Kjetil Kjernsmo .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/>.