uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kline, Larry D" <Larry.Kl...@USONCOLOGY.COM>
Subject RE: problem retrieving the annotations of a specific sofa view over a REST service
Date Tue, 26 Feb 2013 23:32:11 GMT
Everything I talked about is on the server.  The server-side webservice
implementation does this:

1. Create a new JCas from the analysis engine (which was already
initialized)
2. Get its Initial_View
3. Set the incoming text string into the initial view
4. Run the analysis engine
5. Get the resulting annotations from the JCas and copy them to my own
POJOs
6. Reset the JCas
6. Return the POJOs

I'm sure there are other ways to do this, and my way may not even be the
best.  I am by no means an expert.  Possibly my resetting the JCas is
unnecessary.  I was thinking that if I didn't do that, over time the AE
would be filled up with old annotations.

Larry

-----Original Message-----
From: Helen Johnson -X (heljohns - Infobahn Softworld Inc at Cisco)
[mailto:heljohns@cisco.com] 
Sent: Tuesday, February 26, 2013 2:59 PM
To: user@uima.apache.org
Subject: RE: problem retrieving the annotations of a specific sofa view
over a REST service

Larry,

Thanks for the response, I'm still a little confused ...
 
>> "I do a JCas.reset at the end of the webservice method"
Just to be clear, you are talking about this on the client-side code,
right? And the PEAR is the server-side?
I do this too: first the server  does a cas.reset(), then the server
sets data into the cas by cas.setDocumentText(), then the server
requests the AE (actually an AAE) that it unpacked from the PEAR to
process the data in the cas by ae.process(cas).

>> "So before I do that I copy the annotations into some serializable
POJOs of my own"
Again, you are talking client-side code?
If so, how do you get a sofa-view of the CAS that is not the default
"_InitialView"?
This is where I am having trouble.

Except that you say, 
>>"Those are what I return to the client" 
So it sounds like the serializable POJO creation might be server-side
code that resides inside the UIMA-PEAR?
Is this a CASConsumer or something that creates these POJOs?
How do you connect the POJOs back to the client side?

Cheers,
Helen




-----Original Message-----
From: Kline, Larry D [mailto:Larry.Kline@USONCOLOGY.COM] 
Sent: Tuesday, February 26, 2013 2:50 PM
To: user@uima.apache.org
Subject: RE: problem retrieving the annotations of a specific sofa view
over a REST service

I have a similar pipeline and deployment (as a pear in a web service).
I do a JCas.reset at the end of the web service method.  This of course
clears all the annotations out of the CAS.  So before I do that I copy
the annotations into some serializable POJOs of my own.  Those are what
I return to the client.  I'm not using a RESTful interface so I generate
client side code from the web service's WSDL.

I'm not sure that UIMA annotations can be serialized over a web service
call.  Or if you would even want to.  They have a very complicated
internal structure.

Larry Kline

-----Original Message-----
From: Helen Johnson -X (heljohns - Infobahn Softworld Inc at Cisco)
[mailto:heljohns@cisco.com]
Sent: Tuesday, February 26, 2013 12:52 PM
To: user@uima.apache.org
Subject: problem retrieving the annotations of a specific sofa view over
a REST service

I have a UIMA pipeline that consists of an AAE that uses multiple sofa
views.
The first component of the AAE takes the _InitialView cas.documentText,
which is XML, converts it to plain text, and inputs this new text and
some annotations into a new view called plainText (thank you to those
last week that helped me figure out this labyrinth).
The subsequent AEs in the AAE create many annotations.
A final AnnotationPrinter AE at the end of the pipeline shows that the
plainText view of the CAS contains the annotations I expect.

Next, this AAE is wrapped into a PEAR and deployed onto a tomcat server
as a REST service (using the sandbox SimpleServer).
The response to a call to the AAE server is supposed to be the
annotations. However, the result is blank - there are no annotations
being sent back from the AAE.


-          Could this have to do with the annotations being associated
with the plainText view instead of the _InitialView?

-          If so, how do  I force the AAE to return the annotations
associated with the plainText view?

-          Or, how do I set the plainText view annotations to be
available in the "default" view?

Thank you,
Helen Johnson
</pre>The contents of this electronic mail message and any attachments
are confidential, possibly privileged and intended for the addressee(s)
only.<br>Only the addressee(s) may read, disseminate, retain or
otherwise use this message. If received in error, please immediately
inform the sender and then delete this message without disclosing its
contents to anyone.</pre>


Mime
View raw message