Torsten Zesch | 1 Nov 2007 18:40
Picon
Favicon

Set configuration parameters of a collection reader before it is initialized

Hi all,

I have written a CollectionReader that reads from a database. I added
the database connection parameters as mandatory parameters to the
descriptor. They are initialized with the correct values for the
production database.

Now, I want to write some unit tests that connect to a (always
available) test database, as the production database might not be
available at testing time.
I tried it with the code below, but the the reader's initialize() method
is already called when

CollectionReader reader =
UIMAFramework.produceCollectionReader(specifier);

is executed. That means, the test will fail before it had the chance to
reconfigure the parameters.

Is there any way to set the configuration parameters of a collection
reader before it is actually initialized?

Thanks,
Torsten

<snip>
// a map that contains the configuration parameters
Map<String,Object> configParameters = new HashMap<String, Object>() {{
// fill the map with some parameters
...        
(Continue reading)

Marshall Schor | 1 Nov 2007 20:26

Re: Exception in a pipeline with more than one document to analize

Roberto Franchini wrote:
> On 10/30/07, Marshall Schor <msa@...> wrote:
>   
>> Thanks Roberto -
>>
>> Upon further investigation - it appears to be a synchronization
>> problem.  I was incorrect in saying that the implementation assumes
>> "that the JCas has been previously initialized for this type (which was
>> not "loadable" when the JCas was initialized earlier)."  There is in
>> fact code to handle this case.  But it appears it may not be threadsafe.
>>
>>     
>
> Oh, threads... World would be a better place without threads :)
> Tell me if I can help you in some way. I can switch to the snapshots
> or build uima's jars from scratch.
>   
Jira issue 607 fixes this problem, I think.  If you can, please build
from the latest SVN and see if this fixes things.

I created a test case before fixing things, and got it to fail, and now,
after the changes, it runs.

-Marshall

Adam Lally | 1 Nov 2007 22:36
Picon

Re: Set configuration parameters of a collection reader before it is initialized

On 11/1/07, Torsten Zesch <zesch@...> wrote:
><snip/>
> Is there any way to set the configuration parameters of a collection
> reader before it is actually initialized?
>

Yes, it's possible to do this.  Instead of parseResourceSpecifier,
call parseCollectionReaderDescription.  Then you can call methods on
the CollectionReaderDescription object to change the parameter values.
 Effectively you're overriding the values that were in the descriptor,
before instantiating your component.  The methods to do this are
something like:

collectionReaderDescription.getCollectionReaderMetaData().getConfigurationParameterSettings().setParameterValue(name,value)

But I didn't test that so I might have gotten it slightly wrong.

-Adam

Marshall Schor | 2 Nov 2007 12:15

UIMA at ApacheCon 2007

Hi everyone -

I will be at ApacheCon 2007 in less than couple of weeks in Atlanta, and
would be happy to meet and chat with any UIMA users that might be attending.

I am scheduled to give a 15 minute quick talk on UIMA adoption on
Thursday, Nov 15th at 3 PM (but this might change - see the bulletin
boards), and am scheduled to host a UIMA birds-of-a-feather session
(see:  http://wiki.apache.org/apachecon/BirdsOfaFeatherUs07)
<http://wiki.apache.org/apachecon/BirdsOfaFeatherUs07>
on Wednesday evening.

-Marshall Schor

Marshall Schor | 2 Nov 2007 12:18

Call for talk proposals - ApacheCon 2008 - Europe (Amsterdam)

If anyone is planning on attending ApacheCon 2008, please consider
submitting talk proposals at http://apachecon.com/html/login.html

They're already calling for evaluation of proposals, and I noticed there
were no UIMA related talks proposed - it may not be too late :-)

-Marshall

Ahmed Ragheb | 4 Nov 2007 15:32
Picon
Favicon

Can annotators dynamically set the typesystem it will create at runtime


Dear all,

For some application, the annotator needs to create an annotation of a type
that is not defined in the type system. It will be consumed a component
that doesn't need to know the type system in order to process the
annotations. Is it possible that the annotator dynamically set the
typesystem it will create at runtime?

Thanks

Best Regards,
Ahmed
-------------------------------------------------------------------------------

Ahmed M. Ragheb
Software Engineer
Advanced Technologies Group
IBM Cairo Technology Development Center
IBM WTC, Egypt Branch, P.O.B.  166, El-Ahram, Giza, Egypt.
   Tel: DID: (202) 35361048    S/B: (202) 35362536 Ext: 1048
    e-mail: ragheba@...

"We think in generalities, but we live in details.", Alfred North Whitehead

Marshall Schor | 4 Nov 2007 19:44

Re: Can annotators dynamically set the typesystem it will create at runtime

When a UIMA application is initialized, all of the components' type
systems are combined / merged into a shared type system that the
application will use.  This type system is fixed at the start of the
run, and cannot be changed.

That being said, it is possible for a particular annotator to create an
instance of a type it doesn't know about until run time, provided that
some component in the application specifies and defines that type.

Does that cover the use case you have in mind?  If not, could you
provide a few more details of the use case?

Thanks. -Marshall

Ahmed Ragheb wrote:
> Dear all,
>
> For some application, the annotator needs to create an annotation of a type
> that is not defined in the type system. It will be consumed a component
> that doesn't need to know the type system in order to process the
> annotations. Is it possible that the annotator dynamically set the
> typesystem it will create at runtime?
>
>
> Thanks
>
> Best Regards,
> Ahmed
> -------------------------------------------------------------------------------
>
(Continue reading)

Marshall Schor | 4 Nov 2007 19:46

Re: Call for talk proposals - ApacheCon 2008 - Europe (Amsterdam)

Just learned that the Call for Proposals for ApacheCon 2008 in Europe
(Amsterdam) is now closed.

-Marshall

Marshall Schor wrote:
> If anyone is planning on attending ApacheCon 2008, please consider
> submitting talk proposals at http://apachecon.com/html/login.html
>
> They're already calling for evaluation of proposals, and I noticed there
> were no UIMA related talks proposed - it may not be too late :-)
>
> -Marshall
>
>
>   

Roberto Franchini | 5 Nov 2007 09:24
Picon
Gravatar

Re: Exception in a pipeline with more than one document to analize

On 11/1/07, Marshall Schor <msa@...> wrote:
> Roberto Franchini wrote:
> > On 10/30/07, Marshall Schor <msa@...> wrote:
> >
[cut]
> >
> Jira issue 607 fixes this problem, I think.  If you can, please build
> from the latest SVN and see if this fixes things.
>
> I created a test case before fixing things, and got it to fail, and now,
> after the changes, it runs.
>

Ok, I'll update and rebuild today or at least tomorrow. Thank you very
much for your effort!
Roberto

--

-- 
Roberto Franchini
CELI s.r.l.  (http://www.celi.it) - C.so Moncalieri 21 - 10131 Torino - ITALY
Tel +39-011-6600814 - Fax +39-011-6600687
jabber:ro.franchini@... skype:ro.franchini

Roberto Franchini | 6 Nov 2007 14:07
Picon
Gravatar

Re: Exception in a pipeline with more than one document to analize

On 11/5/07, Roberto Franchini <ro.franchini@...> wrote:
> On 11/1/07, Marshall Schor <msa@...> wrote:
> > Roberto Franchini wrote:
> > > On 10/30/07, Marshall Schor <msa@...> wrote:
> > >
> [cut]
> > >
> > Jira issue 607 fixes this problem, I think.  If you can, please build
> > from the latest SVN and see if this fixes things.
> >
> > I created a test case before fixing things, and got it to fail, and now,
> > after the changes, it runs.
> >
>
> Ok, I'll update and rebuild today or at least tomorrow. Thank you very
> much for your effort!
> Roberto
>

The test doesn't run on my linux machine (elcipse 3.3.1, SUN java 6):
I think ther's only a miswrited path, but I didn't find it :(

org.apache.uima.resource.ResourceInitializationException:
Initialization of CAS Processor with name "ErrorTestAnnotator" failed.
	at org.apache.uima.collection.impl.CollectionProcessingEngine_impl.initialize(CollectionProcessingEngine_impl.java:83)
	at org.apache.uima.impl.UIMAFramework_impl._produceCollectionProcessingEngine(UIMAFramework_impl.java:395)
	at org.apache.uima.UIMAFramework.produceCollectionProcessingEngine(UIMAFramework.java:865)
	at org.apache.uima.collection.impl.cpm.PearCasPoolTest.setupCpm(PearCasPoolTest.java:166)
	at org.apache.uima.collection.impl.cpm.PearCasPoolTest.core(PearCasPoolTest.java:91)
	at org.apache.uima.collection.impl.cpm.PearCasPoolTest.testCasPool(PearCasPoolTest.java:72)
(Continue reading)


Gmane