Am 30.05.2013 um 12:11 schrieb Mansi verma <[email protected]>:

> Ok
> 
> I am making a mistake. I dont want to use UimaFit to initialize the
> resource. If I initialize it using uimafit, i will have to run the pipeline
> using uimafit too. Am I right ?

You are not right (at least you shoudn't be). Descriptors built with uimaFIT
should work with any UIMA runtime environment (uimaFIT, CPE, UIMA-AS, …).
There maybe things to observe, like making sure the type systems are properly
communicated to the runtime environment, but in general an XML descriptor
generated with uimaFIT has nothing uimaFIT specific in it. If it turns out
there is a problem loading and using an uimaFIT-generated XML descriptor,
that would be considered a bug.

If your components use the uimaFIT annotations (@ConfigurationParameter,
@ExternalResource), you need to have uimaFIT on the classpath, but you
do not need to actually run your pipeline with uimaFIT. You should be able
to run your pipeline with any UIMA runtime environment (uimaFIT, CPE, UIMA-AS, 
…).
If it turns out there is a problem, that would be a bug.

> I want to be able to initialize the external Shared Resource my self, as
> the number of such resources are unknown, they are passed at run time. So
> the pipeline has to take in what resources to load from some file and then
> load them. Is that possible.

UIMA does not allow passing pre-instantiated objects into a pipeline. It wants
to be able to instantiate everything itself via its ResourceManager mechanism.
Hence all the fuzz about the (XML) descriptors. It's possible, of course, to
to everything manually and use a custom resource manager implementation. There
is a proof-of-concept for this in the uimaFIT svn, but that wouldn't work with
any arbitrary UIMA runtime environment then.

As far as I can tell, the UIMA resource mechanism is not designed to operate
with unknown numbers of resources. A component in UIMA declares a resource
dependency with a specific key. Only one resource can be bound to that key,
not multiple. So in the concept of UIMA using static descriptors, the number
of external resources used by a component must be known. See also [1].

If you dynamically create your descriptors using plain UIMA or uimaFIT, you
can decide at creation time how many dependencies you create. But there is
no official way you can determine the number/names of available resources
at runtime, even if you dynamically created the bindings. You could pass in the
names of the bound resources via an additional multi-valued parameter or you'd
need to use reflection to inspect private variables of the UIMA framework.
See also [2]

> I see that I can produce a resource using UIMAFramework.produceResource but
> it requires a resourceSpecifier. I do not know how to initialize a resource
> specifier. I was trying to use uimafit to first generate the external
> resource description and then use its resource specifier to call
> produceResource function.
> 
> This approach is cumbersome and isnt working!! So is there a way to
> initialize ResourceSpecifier so that I can use produceResource function
> from uimaFramework.

Maybe some other UIMA developer/user can provide additional insight.

Cheers,

-- Richard

[1] https://issues.apache.org/jira/browse/UIMA-2801
[2] https://issues.apache.org/jira/browse/UIMA-2903

Reply via email to