uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Eckart de Castilho <...@apache.org>
Subject Re: uimafit and access to java objects from the driver code
Date Mon, 20 Feb 2017 17:40:16 GMT

as far as I know, UIMA doesn't support injecting pre-existing Java 
objects into components out-of-the-box. However ...

... you can work around this using a custom ResourceManager, e.g. the
SimpleNamedResourceManager [1] from uimaFIT. 

Another approach I experimented with in the past was to forcibly
hook into the UIMA core framework in order to post-process
components after creation. This approach is show-cased in the
experimental Spring support module [2] in uimaFIT.

A third approach I had been playing with in the past was using
JNDI via the uimaFIT "ExternalResourceLocator" mechanism [3,4].

So although UIMA doesn't support this out-of-the-box, there are
several proof-of-concept implementations that you can use or build


-- Richard

[1] https://svn.apache.org/repos/asf/uima/uimafit/trunk/uimafit-core/src/main/java/org/apache/uima/fit/util/SimpleNamedResourceManager.java
[2] https://svn.apache.org/repos/asf/uima/uimafit/trunk/uimafit-spring/src/test/java/org/apache/uima/fit/spring/SpringContextResourceManagerTest.java
[3] https://svn.apache.org/repos/asf/uima/uimafit/trunk/uimafit-core/src/main/java/org/apache/uima/fit/factory/locator/JndiResourceLocator.java#
[4] https://svn.apache.org/repos/asf/uima/uimafit/trunk/uimafit-core/src/test/java/org/apache/uima/fit/factory/ExternalResourceFactoryTest.java

P.S.: most people post to the mailing list, but you can also post to Stack Overflow - we're
monitoring it :)

> On 20.02.2017, at 14:59, Hendrik L├╝cke-Tieke <helt@outlook.com> wrote:
> Hi,
> I have some driver Code which prepares some stuff, then runs a Pipeline, and finally
wants to use the results that have been generated in the Pipeline.
> As far as i have understood the whole uimafit world, uima is in control the LifeCycle
of everything that happens within a Pipeline. This lifecycle is controlled using the ResourceManager.
Data Exchange with the driver application is not foreseen. I.e. the following pseudocode cannot
work by design:
> Graph<V,E> g = new ReadWriteGraph<V,E>();
> AnalysisEngineDescription graphMapper = createEngineDescription(GraphMapper.class)
> SimplePipeline.runPipeline(
>    createReaderDescription(TextReader.class, ...),
>    // more annotators ...
>    graphMapper);
> assert(g.vertexSet().isEmpty(), false);
> Is that correct? Or am i missing some hidden feature, which does actually enable this?
The only way to Exchange data with the driver program would be to implement some serialization
mechanism in the graphMapper  and deserialize it after the Pipeline has run.
> Best,
> Hendrik
> PS: this Mailing list or stackoverflow?

View raw message