.\" 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 "RDF::vCard::Exporter 3pm" .TH RDF::vCard::Exporter 3pm "2021-01-07" "perl v5.32.0" "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::vCard::Exporter \- export RDF data to vCard format .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use RDF::vCard; \& \& my $input = "http://example.com/contact\-data.rdf"; \& my $exporter = RDF::vCard::Exporter\->new(vcard_version => 3); \& \& print $_ foreach $exporter\->export_cards($input); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module reads \s-1RDF\s0 and writes vCards. .SS "Constructor" .IX Subsection "Constructor" .IP "\(bu" 4 \&\f(CW\*(C`new(%options)\*(C'\fR .Sp Returns a new RDF::vCard::Exporter object. .Sp Options: .RS 4 .IP "\(bu" 4 \&\fBvcard_version\fR \- '3' or '4'. This module will happily use vCard 3.0 constructs in vCard 4.0 and vice versa. But in certain places it can lean one way or the other. This option allows you to influence that. .RE .RS 4 .RE .SS "Methods" .IX Subsection "Methods" .IP "\(bu" 4 \&\f(CW\*(C`export_cards($input, %options)\*(C'\fR .Sp Returns a list of vCards found in the input, in no particular order. .Sp The input may be a \s-1URI,\s0 file name, RDF::Trine::Model or anything else that can be handled by the \f(CW\*(C`rdf_parse\*(C'\fR method of RDF::TrineShortcuts. .Sp Supported options include \fBsort\fR which, if set to true, causes the output to be sorted by name (as well as is possible); \fBsource\fR which allows you to provide the \s-1URL\s0 where the cards were sourced from; and \&\fBprodid\fR which allows you to set the product \s-1ID\s0 used in the output. .Sp (A prodid must be in \s-1FPI\s0 format to be valid, though the module doesn't check this. undef is allowed. By default, RDF::vCard:Exporter uses its own prodid, and unless you have a good reason to change this, you should probably let it.) .Sp e.g. .Sp .Vb 6 \& my @cards = $exporter\->export_cards( \& $some_data, \& sort => 1, \& source => \*(Aqhttp://bigcorp.example.com/data.rdf\*(Aq, \& prodid => \*(Aq+//IDN example.net//NONSGML MyScript v 0.1//EN\*(Aq, \& ); .Ve .Sp Each item in the list returned is an RDF::vCard::Entity, though that class overloads stringification, so you can just treat each item as a string mostly. .IP "\(bu" 4 \&\f(CW\*(C`export_card($input, $subject, %options)\*(C'\fR .Sp As per \f(CW\*(C`export_cards\*(C'\fR but exports just a single card. .Sp The subject provided must be an RDF::Trine::Node::Blank or RDF::Trine::Node::Resource of type v:VCard. .IP "\(bu" 4 \&\f(CW\*(C`is_v3\*(C'\fR .Sp Returns true if this exporter is in vCard 3.0 mode. .IP "\(bu" 4 \&\f(CW\*(C`is_v4\*(C'\fR .Sp Returns true if this exporter is in vCard 4.0 mode. .SS "\s-1RDF\s0 Input" .IX Subsection "RDF Input" Input is expected to use the newer of the 2010 revision of the W3C's vCard vocabulary . (Note that even though this was revised in 2010, the term URIs include \*(L"2006\*(R" in them.) .PP Some extensions from the namespace are also supported. (Namely: vx:usage, vx:kind, vx:gender, vx:sex, vx:dday, vx:anniversary, vx:lang, vx:caladruri, vx:caluri, vx:fburl, vx:impp, vx:source.) .PP The module author has made the decision not to support \s-1FOAF\s0 and other \s-1RDF\s0 vocabularies that may be used to model contact information for people and organisations, as they do not necessarily map cleanly onto vCard. People hoping to map non-vCard \s-1RDF\s0 to vCard using this module may have some luck pre-processing their \s-1RDF\s0 using a rules-based reasoner. .SS "vCard Output" .IX Subsection "vCard Output" The output of this module mostly aims at vCard 3.0 (\s-1RFC 2426\s0) compliance. In the face of weird input data though, (e.g. an \s-1FN\s0 property that is a \&\s-1URI\s0 instead of a literal) it can pretty easily descend into exporting junk, non-compliant vCards. .PP Many vCard 4.0 properties, such as the \s-1IMPP\s0 and \s-1KIND,\s0 are also supported. .PP The \fBvcard_version\fR constructor option allows you to influence how some properties like \s-1GEO\s0 and \s-1TEL\s0 (which differ between 3.0 and 4.0) are output. .SH "SEE ALSO" .IX Header "SEE ALSO" RDF::vCard, HTML::Microformats, RDF::TrineShortcuts. .PP . .PP . .SH "AUTHOR" .IX Header "AUTHOR" Toby Inkster . .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2011 Toby Inkster .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.