Ticket #38 (closed enhancement: wontfix)
Enchance Support for MIME entities and email.
| Reported by: | phreedom_ | Owned by: | m4db0b |
|---|---|---|---|
| Priority: | critical | Milestone: | next-release |
| Component: | ontology-nie | Version: | 1.1 |
| Keywords: | Cc: | Philip, Van, Hoof, <spam@…>, phreedom_, m4db0b, mylka |
Description
Email is definitely a message. However it's a bit too elaborate and convoluted compared to other message types.
Our first attempt at representing email was to try and make it look like a typical message by pretending it's just a text with possibly some files attached. It makes sense to keep this representation for compatibility with all other message types.
However there's a demand to also keep the true structure of email as a tree of MIME entities. This can be easily done by representing MIME entities as a nie:DataObject to store useful properties such as encoding, content-disposition and representing MIME entity contents using a nie:InformationElement child appropriate for the content type. Multipart MIME entities should be treated as containers.
nmo:Email can be linked to its MIME representation using a dedicated property(like the proposed nmo:hasContent).
Alternatively, nmo:Email can be subclassed from a MIME multipart/container and can directly contain MIME entities,
serving as the topmost multipart MIME entity container typically found in email.
The first approach has an advantage in that it keeps the structure of email intact in all cases.
The second approach can save us an extra indirection(by not having a separate resource for the topmost container) at the price of being unable to represent the simplest case without workarounds, a plaintext email.
In this case, Email has to be treated as a container that contains a single MIME entity representing the plaintext content. The number of triples and resources needed for these use cases however stays the same regardless of the approach taken.
I'll leave it to others to flame as to the merits of these two approaches :)
Proposed changes(1st approach)
Please pay attention to comments.
# better name? nmo:hasContent a rdf:Property ; rdfs:domain nmo:Email ; rdfs:comment "Links nmo:Email with its topmost MIME entity" ; rdfs:label "hasContent" ; nrl:maxCardinality "1" ; rdfs:range nmo:MimePart .
# name = MIMEMultipart, MimePartCountainer? nmo:Multipart a rdfs:Class ; rdfs:comment "A MIME entity container. Corresponds to multipart/* MIME types." ; rdfs:label "Multipart" ; rdfs:subClassOf nfo:DataContainer . # name=mimePartBoundary? nmo:partBoundary a rdf:Property ; rdfs:domain nmo:Multipart ; rdfs:comment "Boundary string used to delimit MIME entities contained in a multipart/* MIME entity." ; rdfs:label "partBoundary" ; rdfs:range xsd:string . # Supercedes MimeEntity. Should we use MimeEntity name instead? nmo:MimePart a rdfs:Class ; rdfs:comment "A MIME entity, as defined in RFC2045, Section 2.4." ; rdfs:label "MimePart" ; rdfs:subClassOf nfo:EmbeddedFileDataObject . # Content-disposition header is encountered in emails ONLY, not necessarily in other MIME use cases nmo:contentDisposition a rdf:Property ; rdfs:domain nmo:MimePart ; rdfs:comment "Content-disposition header value." ; rdfs:label "contentDisposition" ; nrl:maxCardinality "1" ; rdfs:range xsd:string . # It's not very nice to steal MessageHeader for this, but # defining another equivalent class doesn't make sense as well as renaming the existing one. nmo:mimeHeader a rdf:Property ; rdfs:domain nmo:MimePart ; rdfs:comment "MIME entity header." ; rdfs:label "mimeHeader" ; rdfs:range rdfs:MessageHeader .
Deprecate this
This is broken. Should be a nie:DataObject. Superceded by nmo:MimePart:
nmo:MimeEntity a rdfs:Class ; rdfs:comment "A MIME entity, as defined in RFC2045, Section 2.4." ; rdfs:label "MimeEntity" ; rdfs:subClassOf nie:InformationElement .
This isn't needed since contents of an email is either text or something that's barely representable as a single mimetype. Putting mimetypes of all contained resources here is just as reasonable as putting all mimetypes of files in a folder into mimeType property of the said folder.
nmo:contentMimeType a rdf:Property ; rdfs:domain nmo:Email ; rdfs:range xsd:string ; rdfs:subPropertyOf nie:mimeType .
We should use nie:hasLogicalPart child to point to real attachments(as opposed to inlined text and whatnot) to enable mail clients to easily list things users consider attachments, not everything that's embedded.
nmo:hasAttachment a rdf:Property ; rdfs:comment "Links a message with files that were sent as attachments." ; rdfs:domain nmo:Message ; rdfs:label "hasAttachment" ; rdfs:range nfo:Attachment ; rdfs:subPropertyOf nie:hasPart .
The second approach
Would drop nmo:hasContent and add
nmo:Email rdfs:subClassOf nmo:Multipart .