Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

rdf::vcard::importer(3pm) [debian man page]

RDF::vCard::Importer(3pm)				User Contributed Perl Documentation				 RDF::vCard::Importer(3pm)

NAME
RDF::vCard::Importer - import RDF data from vCard format SYNOPSIS
use RDF::vCard; use RDF::TrineShortcuts qw':all'; my $importer = RDF::vCard::Importer->new; print $_ foreach $importer->import_file('contacts.vcf'); print rdf_string($importer->model => 'RDFXML'); DESCRIPTION
This module reads vCards and writes RDF. Constructor o "new(%options)" Returns a new RDF::vCard::Importer object and initialises it. The only valid option currently is ua which can be set to an LWP::UserAgent for those rare occasions that the Importer needs to fetch stuff from the Web. Methods o "init" Reinitialise the importer. Forgets any cards that have already been imported. o "model" Return an RDF::Trine::Model containing data for all cards that have been imported since the importer was last initialised. o "import_file($filename, %options)" Imports vCard data from a file on the file system. The data is added to the importer's model (and can be retrieved using the "model" method). This function returns a list of RDF::vCard::Entity objects, so it's also possible to access the data that way. There is currently only one supported option: "lang" which takes an ISO language code indicating the default language of text within the vCard data. o "import_fh($filehandle, %options)" As per "import_file", but operates on a file handle. o "import_string($string, %options)" As per "import_file", but operates on vCard data in a string. o "import_url($url)" As per "import_file", but fetches vCard data from a Web address. Sends an HTTP Accept header of: text/directory;profile=vCard, text/vcard, text/x-vcard, text/directory;q=0.1 vCard Input vCard 3.0 should be supported fairly completely. Some vCard 4.0 constructs will also work. Much of the heavy lifting is performed by Text::vFile::asData, so this module may be affected by bugs in that distribution. RDF Output Output uses the newer of the 2010 revision of the W3C's vCard vocabulary http://www.w3.org/Submission/vcard-rdf/ <http://www.w3.org/Submission/vcard-rdf/>. (Note that even though this was revised in 2010, the term URIs include "2006" in them.) Some extensions from the namespace <http://buzzword.org.uk/rdf/vcardx#> are also output. The AGENT property is currently omitted from output. This will be added in a later version. SEE ALSO
RDF::vCard. http://www.w3.org/Submission/vcard-rdf/ <http://www.w3.org/Submission/vcard-rdf/>. <http://www.perlrdf.org/>. AUTHOR
Toby Inkster <tobyink@cpan.org>. COPYRIGHT
Copyright 2011 Toby Inkster This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-06-23 RDF::vCard::Importer(3pm)

Check Out this Related Man Page

HTML::Microformats::Format::hCard(3pm)			User Contributed Perl Documentation		    HTML::Microformats::Format::hCard(3pm)

NAME
HTML::Microformats::Format::hCard - the hCard microformat SYNOPSIS
use HTML::Microformats::DocumentContext; use HTML::Microformats::Format::hCard; my $context = HTML::Microformats::DocumentContext->new($dom, $uri); my @cards = HTML::Microformats::Format::hCard->extract_all( $dom->documentElement, $context); foreach my $card (@cards) { print $card->get_fn . " "; } DESCRIPTION
HTML::Microformats::Format::hCard inherits from HTML::Microformats::Format. See the base class definition for a description of property getter/setter methods, constructors, etc. Additional Method o "to_vcard" This method exports the hCard as a vCard 3.0. It requires RDF::vCard to work, and will throw an error at run-time if it's not available. o "to_vcard4" This method exports the hCard as a vCard 3.0. It requires RDF::vCard to work, and will throw an error at run-time if it's not available. o "to_vcard4_xml" This method exports the hCard as a vCard XML. It requires RDF::vCard and XML::LibXML to work, and will throw an error at run-time if it's not available. MICROFORMAT
HTML::Microformats::Format::hCard supports hCard as described at <http://microformats.org/wiki/hcard>, with the following additions: o vCard 4.0 terms This module includes additional property terms taken from the latest vCard 4.0 drafts. For example the property 'impp' may be used to mark up instant messaging addresses for a contact. The vCard 4.0 property 'kind' is used to record the kind of contact described by the hCard (an individual, an organisation, etc). In many cases this is automatically inferred. o Embedded species microformat If the species microformat (see HTML::Microformats::Format::species) is found embedded within an hCard, then this is taken to be the species of a contact. o Embedded hMeasure If the hMeasure microformat (see HTML::Microformats::Format::hMeasure) is found embedded within an hCard, and no 'item' property is provided, then the measurement is taken to pertain to the contact described by the hCard. RDF OUTPUT
Data is returned using the W3C's vCard vocabulary (<http://www.w3.org/2006/vcard/ns#>) with some supplemental terms from Toby Inkster's vCard extensions vocabulary (<http://buzzword.org.uk/rdf/vcardx#>) and occasional other terms. After long deliberation on the "has-a/is-a issue", the author of this module decided that the holder of a vCard and the vCard itself should be modelled as two separate resources, and this is how the data is returned. Some information about the holder of the vCard can be inferred from information about the vCard; for instance, the vCard's fn property can be used to determin the holder's foaf:name. This module uses FOAF (<http://xmlns.com/foaf/0.1/>) to represent information about the holder of the vCard. BUGS
Please report any bugs to <http://rt.cpan.org/>. SEE ALSO
HTML::Microformats::Format, HTML::Microformats. AUTHOR
Toby Inkster <tobyink@cpan.org>. COPYRIGHT
Copyright 2008-2011 Toby Inkster This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. perl v5.14.2 2011-12-06 HTML::Microformats::Format::hCard(3pm)
Man Page