Contents

Bundle: org.eclipse.smila.aperture.pipelets.AperturePipelet

Description

This pipelet converts various document formats (such as PDF, Microsoft Office formats, OpenOffice formats, etc.) to plain text using Aperture technology: A binary attachment content can thus be converted to plain text and stored in an attribute. In addition to that, metadata properties of the document (like title, author, etc) can be extracted and written to record attibutes. The optional MimeType of the document in MimeTypeAttribute is used for conversion. If no MimeType is provided a MimeType identification is done inside the pipelet using a MimeTypeIdentifier service.

Configuration

Property

Type

Read Type

Description

inputType

String : ATTACHMENT, ATTRIBUTE

runtime

selects if the input is found in an attachment or attribute of the record. Usually it doesn't make sense to use "ATTRIBUTE" here because the documents to convert are binary content.

outputType

String : ATTACHMENT, ATTRIBUTE

runtime

selects if output should be stored in an attachment or attribute of the record

inputName

String

runtime

name of input attachment or path to input attribute (process a String literal of attribute)

outputName

String

runtime

name of output attachment or path to output attribute for plain text (store result as String literal of attribute)

ExtractProperties

String

runtime

Specifies which metadata properties reported by Aperture for the document should be written to which record attribute. See below for details.

MimeTypeAttribute

String

runtime

Parameter referencing the attribute that contains the mimetype of the document. The parameter (resp. attribute) may not be set (null) and then a mimetype detection is performed. If the attribute has not been set, it will be set during the processing of the record to the detected mime type.

FileExtensionAttribute

String

runtime

Parameter referencing the attribute that file extension of the file that was the source of the attachment content. If the mimetype attribute is not specified or does not have a value, the file extension can be used to improve the automatic mime type detection. It not specified, the mimetype detection is based on the attachment content only.

Note that all properties are required and must be provided.

Configuring the Property Mapping

In addition to the plain text content, Aperture can extract metadata properties from documents like the title, author, publisher, dates of publication etc, ... The names of these properties are URIs. Aperture uses URIs defined by

and probably there are others which we just did not discover yet. It depends very much on the documents what is actually extracted. To check with your documents you can download one of the "aperture-eclipse-1.4.0" archives from [2], unpack it and start bin/fileinspector.(sh|bat). Open a document with it and you will see an RDF representation of the extracted metadata.

To store such metadata properties in SMILA records, you must specify the URLs of the properties you want to store in the ExtractProperties parameter. Usually this parameter contains a sequence of string values. The string values can have one of the following formats:

<Property-URL>: Add the values of this property to an attribute with the same name.

<Property-URL>-><Attribute-Name>: Add the values of the property to the attribute with the given name

<Property-URL>->><Attribute-Name>: Store the values of the property in the attribute with the given name, remove existing values first.

To improve readability, it is possible to abbreviate the property URLs by using namespace prefixes. The available prefixes are specified in namespaces.properties in the org.eclipse.smila.aperture bundle. To add namespaces to this file, extend it and put it in the configuration area in directory org.eclipse.smila.aperture. Using the predefined namespaces you can use, for example:

If you use namespace abbreviations to specify the properties to extract, but don't specify target attributes, the target attributes will be the abbreviated URIs.

If the property value reported by Aperture is a resource, the pipelet tries to find a display name for it. It checks the following properties in this order:

nco:fullname

nie:title

nao:prefLabel

rdfs:label

If none of them has a value for the resource, the URI of the resource is used as the attribute value.

It is possile to specify the complete mapping in a single string value. To do this, concatenate the single values from the sequence using a semicolon ";" as the separator. This makes it easier to use the AperturePipelet in the PipeletProcessorWorker which currently allows only simple string parameters for pipelet configuration.

In any case, the resulting attribute is

a single Value, if only one value has been extracted and the value is not appeded to previously existing values

a AnySeq containing all values, if more than one value has been extracted or new values are appended to existing values.

Example

The following example shows how to configure the pipelet to extract the text from the attachment called Content and stores the extracted text in the attribute Text. Additionally the eventually contained Company, Manager and Creator will be stored in properties which are named after their class URIs.

E.g. if a word document with the value "ACME" as company and "John Doe" as creator, the resulting record would contain the plain text in the attribute Text, the value ACME in the attribute http://schemas.openxmlformats.org/officeDocument/2006/extended-properties/Company, as well as the value John Doe in an attribute dc:creator.

Extending Aperture

SMILA does not contain the complete Aperture distribution, because some converters need third party libraries with problematic licenses that we are not allowed to distribute. However, it should be easy to include those parts of Aperture into your SMILA installation yourself: Just