RDF::v...porter(3pm)
π RDF::vCard::Importer π
okay so bestie, welcome to the manual page for RDF::vCard::Importer β that's the Perl module, section 3pm, filed under User Contributed Perl Documentation. she reads vCards and writes RDF, and honestly? she's serving. let's get into it π«Ά
β¨ NAME β¨
RDF::vCard::Importer β import RDF data from vCard format
πΈ SYNOPSIS πΈ
like, here's the whole vibe in five lines:
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 π¦
bestie. this module reads vCards and writes RDF. that's the whole personality and she's iconic for it π
π Constructor π
new(%options)β hands you a brand newRDF::vCard::Importerobject, all initialised and ready to go, like a fresh manicure β¨
the only valid option rn is ua, which you can set to an LWP::UserAgent β for those rare occasions when the Importer needs to fetch stuff from the Web. rare. occasions. iykyk π
π Methods π
initβ reinitialises the importer. she forgets every card that's already been imported. memory wiped, clean slate, no cap π§modelβ returns anRDF::Trine::Modelholding the data for all cards imported since the last time the importer was initialised. it's giving "your whole contacts list but make it triples" πimport_file($filename, %options)β imports vCard data from a file on the file system.
the data gets added to the importer's model (grab it back with the model method, bestie).
this one returns a list of RDF::vCard::Entity objects, so you can also poke at the data that way if that's more your thing.
there's currently only one supported option: lang, which takes an ISO language code indicating the default language of the text inside the vCard data π
import_fh($filehandle, %options)β literally the same asimport_file, but she operates on a file handle instead πimport_string($string, %options)β literally the same asimport_file, but the vCard data is in a string. no files, no handles, just vibes β¨import_url($url)β literally the same asimport_file, but she fetches the vCard data from a Web address π
she 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 β not everything, but like, a good amount π«Ά
much of the heavy lifting is performed by Text::vFile::asData, so heads up: this module may be affected by bugs in that distribution. not her fault, but she's affected, fr fr π
β RDF Output β
output uses the newer of the 2010 revision of the W3C's vCard vocabulary: http://www.w3.org/Submission/vcard-rdf/. and yes bestie, even though it was revised in 2010, the term URIs still include 2006 in them. that's just how it is. don't ask π
some extensions from the namespace http://buzzword.org.uk/rdf/vcardx# are also output β¨
β οΈ the AGENT property is currently omitted from the output. it'll be added in a later version. for now: no agent, no notes π
π SEE ALSO π
π 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.
and that's the whole page, bestie!! π this lil doc was rendered by perl v5.34.0 on 2022-06-17, and the manual name up top is RDF::v...porter(3pm) (the terminal truncated it, not me, i would never π
). go forth and import some vCards, you main character π¦πβ¨
π¦ where this page comes from
- debian bookworm: librdf-vcard-perl 0.012-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: librdf-vcard-perl 0.012-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms