RDF::v...porter(3pm)

πŸ“¦
version 0.012 Β· 4 versions
, in debian bookworm, ubuntu noble

πŸ’– 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 new RDF::vCard::Importer object, 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 an RDF::Trine::Model holding 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 as import_file, but she operates on a file handle instead πŸ“
  • import_string($string, %options) β€” literally the same as import_file, but the vCard data is in a string. no files, no handles, just vibes ✨
  • import_url($url) β€” literally the same as import_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 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