You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2012/11/19 15:22:59 UTC

[jira] [Created] (TIKA-1027) Allow null values when setting metadata

Jukka Zitting created TIKA-1027:
-----------------------------------

             Summary: Allow null values when setting metadata
                 Key: TIKA-1027
                 URL: https://issues.apache.org/jira/browse/TIKA-1027
             Project: Tika
          Issue Type: Improvement
          Components: metadata
            Reporter: Jukka Zitting
            Assignee: Jukka Zitting
            Priority: Minor
             Fix For: 1.3


Many file formats have optional metadata entries that result in a lot of {{if (value == null)}} statements around {{metadata.set(...)}} calls. It would be more convenient if the {{set}} method explicitly allowed a {{null}} value and that a call like {{metadata.set(name, null)}} was essentially equivalent to a {{metadata.remove(name)}} call.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (TIKA-1027) Allow null values when setting metadata

Posted by "Ray Gauss II (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TIKA-1027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500313#comment-13500313 ] 

Ray Gauss II commented on TIKA-1027:
------------------------------------

We'll want to define suggested behavior for embedding since a {{Metadata}} object is passed to an embedder containing the values to be set, and in some cases users will want to set certain fields to {{null}}.

An empty String could be used to indicate that a particular field should be set to {{null}} by the embedder, but if we move to something other than Strings to hold values in the {{Metadata}} class we'll need to re-evaluate.
                
> Allow null values when setting metadata
> ---------------------------------------
>
>                 Key: TIKA-1027
>                 URL: https://issues.apache.org/jira/browse/TIKA-1027
>             Project: Tika
>          Issue Type: Improvement
>          Components: metadata
>            Reporter: Jukka Zitting
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 1.3
>
>
> Many file formats have optional metadata entries that result in a lot of {{if (value == null)}} statements around {{metadata.set(...)}} calls. It would be more convenient if the {{set}} method explicitly allowed a {{null}} value and that a call like {{metadata.set(name, null)}} was essentially equivalent to a {{metadata.remove(name)}} call.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (TIKA-1027) Allow null values when setting metadata

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TIKA-1027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500330#comment-13500330 ] 

Jukka Zitting commented on TIKA-1027:
-------------------------------------

Hmm, good point. I'd argue that the simplicity and safety of not having to worry about null values outweighs the benefits of using nulls in the Embedder, but then I'm not using Embedder yet so I don't have a balanced view on the issue.

A somewhat hacky alternative to using null values to signify removals would be to pass a set of field names to remove, either as a separate argument or as a custom multi-valued metadata field.
                
> Allow null values when setting metadata
> ---------------------------------------
>
>                 Key: TIKA-1027
>                 URL: https://issues.apache.org/jira/browse/TIKA-1027
>             Project: Tika
>          Issue Type: Improvement
>          Components: metadata
>            Reporter: Jukka Zitting
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 1.3
>
>
> Many file formats have optional metadata entries that result in a lot of {{if (value == null)}} statements around {{metadata.set(...)}} calls. It would be more convenient if the {{set}} method explicitly allowed a {{null}} value and that a call like {{metadata.set(name, null)}} was essentially equivalent to a {{metadata.remove(name)}} call.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (TIKA-1027) Allow null values when setting metadata

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TIKA-1027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting resolved TIKA-1027.
---------------------------------

    Resolution: Fixed

Done in revision 1411237.
                
> Allow null values when setting metadata
> ---------------------------------------
>
>                 Key: TIKA-1027
>                 URL: https://issues.apache.org/jira/browse/TIKA-1027
>             Project: Tika
>          Issue Type: Improvement
>          Components: metadata
>            Reporter: Jukka Zitting
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 1.3
>
>
> Many file formats have optional metadata entries that result in a lot of {{if (value == null)}} statements around {{metadata.set(...)}} calls. It would be more convenient if the {{set}} method explicitly allowed a {{null}} value and that a call like {{metadata.set(name, null)}} was essentially equivalent to a {{metadata.remove(name)}} call.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira