NAME

XML::Generator::RFC822::RDF - generate RDF/XML SAX2 events for RFC822 messages

SYNOPSIS

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);
      }

DESCRIPTION

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+)

DOCUMENT FORMAT

+ 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.

PACKAGE METHODS
__PACKAGE__->new(%args)
This method is inherited from XML::SAX::Base and returns a XML::Generator::RFC822::RDF object. Additionally, the following parameters are allowed :

        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.

OBJECT METHODS
$obj->parse(@messages)
Where @messages is one or more Email::Simple objects.

VERSION

1.1

DATE

$Date: 2004/12/22 23:21:21 $

AUTHOR

Aaron Straup Cope <ascope@cpan.org>

SEE ALSO

XML::Generator::vCard::RDF

LICENSE

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.