.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 .. .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 "AtteanX::Serializer::RDFa 3pm" .TH AtteanX::Serializer::RDFa 3pm "2021-02-17" "perl v5.32.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" AtteanX::Serializer::RDFa \- RDFa Serializer for Attean .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use Attean; \& use Attean::RDF qw(iri); \& use URI::NamespaceMap; \& \& my $ser = Attean\->get_serializer(\*(AqRDFa\*(Aq)\->new; \& my $string = $ser\->serialize_iter_to_bytes($iter); \& \& my $ns = URI::NamespaceMap\->new( { ex => iri(\*(Aqhttp://example.org/\*(Aq) }); \& $ns\->guess_and_add(\*(Aqfoaf\*(Aq); \& my $note = RDF::RDFa::Generator::HTML::Pretty::Note\->new(iri(\*(Aqhttp://example.org/foo\*(Aq), \*(AqThis is a Note\*(Aq); \& my $ser = Attean\->get_serializer(\*(AqRDFa\*(Aq)\->new(base => iri(\*(Aqhttp://example.org/\*(Aq), \& namespaces => $ns, \& style => \*(AqHTML::Pretty\*(Aq, \& generator_options => { notes => [$note]}); \& $ser\->serialize_iter_to_io($fh, $iter); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module can be used to serialize RDFa with several different styles. It is implemented using Attean to wrap around RDF::RDFa::Generator, which does the heavy lifting. It composes Attean::API::TripleSerializer and Attean::API::AbbreviatingSerializer. .SH "METHODS AND ATTRIBUTES" .IX Header "METHODS AND ATTRIBUTES" .SS "Attributes" .IX Subsection "Attributes" In addition to attributes required by Attean::API::TripleSerializer that should not be a concern to users, the following attributes can be set: .ie n .IP """style""" 4 .el .IP "\f(CWstyle\fR" 4 .IX Item "style" This attribute sets the serialization style used by RDF::RDFa::Generator, see its documentation for details. .ie n .IP """namespaces""" 4 .el .IP "\f(CWnamespaces\fR" 4 .IX Item "namespaces" A \s-1HASH\s0 reference mapping prefix strings to URI::NamespaceMap objects. RDF::RDFa::Generator will help manage this map, see its documentation for details. .ie n .IP """base""" 4 .el .IP "\f(CWbase\fR" 4 .IX Item "base" An Attean::API::IRI object representing the base against which relative IRIs in the serialized data should be resolved. There is some support in RDF::RDFa::Generator, but currently, it doesn't do much. .ie n .IP """generator_options""" 4 .el .IP "\f(CWgenerator_options\fR" 4 .IX Item "generator_options" A \s-1HASH\s0 reference that will be passed as options to RDF::RDFa::Generator's \f(CW\*(C`create_document\*(C'\fR method. This is typically options that are specific to different styles, see synopsis for example. .SS "Methods" .IX Subsection "Methods" This implements four required methods: .ie n .IP """serialize_iter_to_io( $fh, $iterator )""" 4 .el .IP "\f(CWserialize_iter_to_io( $fh, $iterator )\fR" 4 .IX Item "serialize_iter_to_io( $fh, $iterator )" Serializes the elements from the Attean::API::Iterator \f(CW$iterator\fR to the IO::Handle object \f(CW$fh\fR. .ie n .IP """serialize_iter_to_bytes( $fh )""" 4 .el .IP "\f(CWserialize_iter_to_bytes( $fh )\fR" 4 .IX Item "serialize_iter_to_bytes( $fh )" Serializes the elements from the Attean::API::Iterator \f(CW$iterator\fR and returns the serialization as a \s-1UTF\-8\s0 encoded byte string. .ie n .IP """media_types"" and ""file_extensions""" 4 .el .IP "\f(CWmedia_types\fR and \f(CWfile_extensions\fR" 4 .IX Item "media_types and file_extensions" Declares that \s-1HTML\s0 media types are used for the output of this module. .SH "BUGS" .IX Header "BUGS" Please report any bugs to . .SH "SEE ALSO" .IX Header "SEE ALSO" RDF::RDFa::Generator, RDF::Trine::Serializer::RDFa. .SH "TODO" .IX Header "TODO" .IP "\(bu" 4 The \f(CW\*(C`style\*(C'\fR attribute may be implemented with better constraints. .IP "\(bu" 4 Make the writers (i.e. the code actually writing the \s-1DOM\s0) configurable. .SH "AUTHOR" .IX Header "AUTHOR" Kjetil Kjernsmo . .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" This software is copyright (c) 2017, 2018, 2019, 2021 by Kjetil Kjernsmo. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. .SH "DISCLAIMER OF WARRANTIES" .IX Header "DISCLAIMER OF WARRANTIES" \&\s-1THIS PACKAGE IS PROVIDED \*(L"AS IS\*(R" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\s0