Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

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

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

NAME
RDF::vCard::Line - represents a line within a vCard DESCRIPTION
Instances of this class correspond to lines within vCards, though they could potentially be used as basis for other RFC 2425-based formats such as iCalendar. Constructor o "new(%options)" Returns a new RDF::vCard::Line object. The only options worth worrying about are: property (case-insensitive property name), value (arrayref or single string value), type_parameters (hashref of property-related parameters). RDF::vCard::Entity overloads stringification, so you can do the following: my $line = RDF::vCard::Line->new( property => 'email', value => 'joe@example.net', type_parameters => { type=>['PREF','INTERNET'] }, ); print "$line " if $line =~ /internet/i; Methods o "to_string()" Formats the line according to RFC 2425 and RFC 2426. o "add_to_model($model, $node)" Given an RDF::Trine::Model and an RDF::Trine::Node representing the entity (i.e. vcard) that this line belongs to, adds triples to the model for this line. o "property()" Returns the line's property - e.g. "EMAIL". o "property_node()" Returns the line's property as an RDF::Trine::Node that can be used as an RDF predicate. Returns undef if a sensible URI cannot be found. o "property_order()" Returns a string which can be used to sort a list of lines into a sensible order. o "value()" Returns an arrayref for the value. Each item in the arrayref could be a plain scalar, or an arrayref of scalars. For example the arrayref representing this name: N:Smith;John;Edward,James which is the vCard representation of somebody with surname Smith, given name John and additional names (middle names) Edward and James, might be represented with the following "value" arrayref: [ 'Smith', 'John', ['Edward', 'James'], ] or maybe: [ ['Smith'], 'John', ['Edward', 'James'], ] That's why it's sometimes useful to have a normalised version of it... o "nvalue()" Returns a normalised version of the arrayref for the value. It will always be an arrayref of arrayrefs. For example: [ ['Smith'], ['John'], ['Edward', 'James'], ] o "value_node()" Returns the line's value as an RDF::Trine::Node that can be used as an RDF object. For some complex properties (e.g. ADR, GEO, ORG, N, etc) the result is not especially useful. o "value_to_string()" Formats the line value according to RFC 2425 and RFC 2426. o "type_parameters()" Returns the type_parameters hashref. Here be monsters (kinda). SEE ALSO
RDF::vCard. 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::Line(3pm)

Check Out this Related 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)
Man Page