uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Eckart de Castilho (JIRA)" <...@uima.apache.org>
Subject [jira] [Commented] (UIMA-2801) Allow multi-valued external resources
Date Sat, 01 Jun 2013 20:48:20 GMT

    [ https://issues.apache.org/jira/browse/UIMA-2801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13672231#comment-13672231
] 

Richard Eckart de Castilho commented on UIMA-2801:
--------------------------------------------------

This has been implemented based on the nested resources support. A base resource called "ResourceList"
is used as the anchor of the list and is bound to key declared in the @ExternalResource annotation.
List elements are bound to this ResourceList as "ELEMENT[n]" resources. The list knows its
own size. The factories and initializer for external resources have been enhanced to handle
ResourceList.
                
> Allow multi-valued external resources
> -------------------------------------
>
>                 Key: UIMA-2801
>                 URL: https://issues.apache.org/jira/browse/UIMA-2801
>             Project: UIMA
>          Issue Type: Improvement
>          Components: uimaFIT
>            Reporter: Richard Eckart de Castilho
>            Assignee: Richard Eckart de Castilho
>             Fix For: 2.1.0uimaFIT
>
>
> Currently, there can only be one external resource per key, e.g.:
> {code}
>   final static String MODEL_KEY = "Model";
>   @ExternalResource(key = MODEL_KEY)
>   private SharedModel model;
> ---
> AnalysisEngineDescription aed1 = createPrimitiveDescription(Annotator.class,
>   Annotator.MODEL_KEY, extDesc);
> {code}
> There are cases where we want to pass a multiple external resources at a time, e.g. multiple
models when can be used jointly by a component. It is inconvenient to have the component declare
one key per model, because we do not know their number in advance. Adding support for adding
multi-valued external resources in uimaj-core looks like a major change, as the XML descriptors
would need to be extended. At the level of uimaFIT, it should be rather easy to implement
something like this:
> {code}
>   final static String MODEL_KEY = "Model";
>   @ExternalResource(key = MODEL_KEY)
>   private List<SharedModel> model;
> ---
> AnalysisEngineDescription aed1 = createPrimitiveDescription(Annotator.class,
>   Annotator.MODEL_KEY, asList(extDesc1, extDesc2, extDesc3));
> {code}
> uimaFIT may implicitly bind the three values to "Model#1", "Model#2", and "Model#3".
When configuring a component, it can check that the external resource parameter field is multi-valued
and look for the keys with the "#X" postfixes.

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

Mime
View raw message