XML::Generator::RFC822::RDF - generate RDF/XML SAX2 events for RFC822 messages
my $folder = Email::Folder->new($path_mbox); while (my $msg = $folder->next_message()) { my $writer = XML::SAX::Writer->new(); my $filter = XML::Filter::DataIndenter->new(Handler=>$writer); my $generator = XML::Generator::RFC822::RDF->new(Handler=>$filter); $generator->parse($msg); }
Generate RDF/XML SAX2 events for RFC822 messages.
Messages are keyed using SHA1 digests of Message-IDs and email addresses. In the case of the latter this makes it easier to merge messages with contact data that has been serialized using XML::Generator::vCard::RDF (version 1.3+)
+ rdf:RDF + rdf:Description @rdf:about = x-urn:ietf:params:rfc822#SHA1([MESSAGEID]) - rfc822:To @rdf:resource = http://http://xmlns.com/foaf/0.1/mbox_sha1sum#SHA1([EMAILADDRESS]) - rfc822:From @rdf:resource = http://http://xmlns.com/foaf/0.1/mbox_sha1sum#SHA1([EMAILADDRESS]) - rfc822:Cc @rdf:resource = http://http://xmlns.com/foaf/0.1/mbox_sha1sum#SHA1([EMAILADDRESS]) - rfc822:Return-Path @rdf:resource = http://http://xmlns.com/foaf/0.1/mbox_sha1sum#SHA1([EMAILADDRESS]) - rfc822:Delivered-To @rdf:resource = http://http://xmlns.com/foaf/0.1/mbox_sha1sum#SHA1([EMAILADDRESS]) - rfc822:Reply-To @rdf:resource = http://http://xmlns.com/foaf/0.1/mbox_sha1sum#SHA1([EMAILADDRESS]) - rfc822:In-Reply-To @rdf:resource x-urn:ietf:params:rfc822#SHA1([INREPLYTO]) - rfc8822:References @rdf:resource x-urn:ietf:params:rfc822#SHA1([REFERENCES]) - rfc822:Date [REFORMATTED AS W3CDTF] - rfc822:[ALLOTHERHEADERS] + rfc822:Body + rdf:Seq - rdf:li @rdf:resource = x-urn:ietf:params:rfc822:Body#SHA1([MESSAGEID])_[n] # Body/MIME parts # (1) or more + rdf:Description @rdf:aboout = x-urn:ietf:params:rfc822:Body#SHA1([MESSAGEID])_[n] - rfc822:content-type - rdf:value # To, From, Cc, Return-Path, Delivered-To, Reply-To # (1) or more + rdf:Descripion @rdf:about = http://xmlns.com/foaf/0.1/mbox_sha1sum#SHA1([EMAILADDRESS]) - vCard:FN - vCard:EMAIL # In-Reply-To, References # (1) or more + rdf:Description @rdf:about = x-urn:ietf:params:rfc822#SHA1([MESSAGEID]) - rfc822:Message-ID
All MIME values are decoded and everything is encoded as UTF-8.
This method is inherited from XML::SAX::Base and returns a XML::Generator::RFC822::RDF object. Additionally, the following parameters are allowed :
Brief
Boolean.
If true, the parser will ignore a message's body and all headers except : To, From, Cc, Return-Path, Delivered-To, Reply-To, Date, Subject
Default is false.
Where @messages is one or more Email::Simple objects.
1.1
$Date: 2004/12/22 23:21:21 $
Aaron Straup Cope <ascope@cpan.org>
XML::Generator::vCard::RDF
Copyright (c) 2004 Aaron Straup Cope. All Rights Reserved.
This is free software, you may use it and distribute it under the same terms as Perl itself.
To install XML::Generator::RFC822::RDF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Generator::RFC822::RDF
CPAN shell
perl -MCPAN -e shell install XML::Generator::RFC822::RDF
For more information on module installation, please visit the detailed CPAN module installation guide.