Pascal Essiembre created TIKA-5082:
--------------------------------------
Summary: Opt-in mode to expose each file's own metadata names
(verbatim), next to or instead of the normalized keys
Key: TIKA-5082
URL: https://issues.apache.org/jira/browse/TIKA-5082
Project: Tika
Issue Type: New Feature
Components: metadata, parser
Affects Versions: 4.2.0
Environment: N/A
Reporter: Pascal Essiembre
h2. Background
TIKA-4794 and TIKA-4816 settled the 4.x rule: a key authored by the file or a
standard keeps its verbatim spelling, and Tika-computed keys live under
{{{}tk:{}}}. TIKA-4816 added {{KeyPrefix}} for names read from a document, and
listed "parser call-site migration to KeyPrefix" as a follow-up. This ticket
asks for that follow-up to cover the names a file's author published.
Today, for many formats, those names reach the Metadata only after a parser has
mapped them to a normalized key, merged them, or left them out. For example
(Tika 4.2.0):
* A Word {{{}Author{}}}, a PDF Info {{Author}} and an HTML {{<meta
name="author">}} all become {{{}dc:creator{}}}.
* E-mail headers become {{message:*}} or {{{}dc:*{}}}.
* Some entries are not returned: in Office files, the flags {{{}ScaleCrop{}}},
{{{}LinksUpToDate{}}}, {{{}HyperlinksChanged{}}}, {{SharedDoc}} and
{{{}DocSecurity{}}}; in PNG files, chunks such as gAMA, pHYs and tEXt.
* Raw forms are replaced by normalized ones, such as a PDF Info
{{CreationDate}} ({{{}D:20150319004520-04'00'{}}}) returned as an ISO date.
For users who index or audit documents, the name the author published is what
they know and search for ("Company" in Word, "Producer" in a PDF's Info
dictionary, "X-Mailer" in a message, the ID3 frame "TXXX:Mood"). Normalization
is useful and should stay the default.
We (Norconex Importer) implemented this on top of Tika 4.2.0 for: HTML meta
tags, e-mail headers, PDF Info and XMP, OOXML core/app/custom properties, ODF
meta.xml, OLE2 SummaryInformation and DocumentSummaryInformation, RTF \info,
EPUB OPF metadata, ID3v1/v2, Vorbis comments, and picture Exif/IPTC/XMP. We
read the metadata part of the file before Tika parses, then remove the keys
Tika derived from it. It works, but it duplicates Tika's format knowledge, and
the parsers are the better place for it. We would be glad to contribute what we
have.
h2. Proposal
A parse-context option, off by default, for example {{{}keepSourceNames{}}}:
* for every name a parser reads from the file, also write a key with the name
as the file spelled it (via {{KeyPrefix.file(...)}} or equivalent);
* let the user choose whether those keys are added next to the normalized
keys, or replace the keys derived from them.
Where the file itself only holds an ID (an ID3 frame code, an Exif directory
and tag number, an OLE2 property id), use the name the format's specification
publishes for that ID. Names the file does store (HTML meta names, PDF Info
keys, e-mail headers, custom Office properties, the description of an ID3 TXXX
frame, Vorbis comment names) are kept exactly as written.
Normalized keys stay the default, so nothing changes for existing users.
h2. Related
TIKA-4794, TIKA-4816 (KeyPrefix), TIKA-4773 (all XMP properties from images),
TIKA-4775 (unifying XMP parsing), TIKA-4449, TIKA-2122, TIKA-2747, TIKA-1903.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)