Return-Path: X-Original-To: apmail-uima-user-archive@www.apache.org Delivered-To: apmail-uima-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 74102E27E for ; Tue, 19 Feb 2013 23:44:02 +0000 (UTC) Received: (qmail 78479 invoked by uid 500); 19 Feb 2013 23:44:02 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 78395 invoked by uid 500); 19 Feb 2013 23:44:02 -0000 Mailing-List: contact user-help@uima.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@uima.apache.org Delivered-To: mailing list user@uima.apache.org Received: (qmail 78385 invoked by uid 99); 19 Feb 2013 23:44:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2013 23:44:02 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of heljohns@cisco.com designates 173.37.86.78 as permitted sender) Received: from [173.37.86.78] (HELO rcdn-iport-7.cisco.com) (173.37.86.78) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2013 23:43:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4816; q=dns/txt; s=iport; t=1361317434; x=1362527034; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=BTTB/IvKtdbMjhFDLVIO0P9KN1eZIgKedZ8ve0QOEw8=; b=Yv0w1cN3pxnue1h4OpMpQfchG255SAbZDU7OmT4MCLK1FP7VT2aGTFNE 9vOC//FQsQA/od/4K3qU1SdIcxnvT8dloVsJ+xIjcRCsfBF20fAfKZTEB bdm18ut78GsiwHJQo5LWwUdcW0NrMPQzWxSL8TkyTkr8qbebGT0iLQfdW c=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgEFAAwNJFGtJXG8/2dsb2JhbABFwESBDRZzgh8BAQEEOksEAgEIEQQBAQEKFAkHMhQJCAEBBAoJCIgKsC6QJo5dJhIGgllhA5JslBeDB4In X-IronPort-AV: E=Sophos;i="4.84,698,1355097600"; d="scan'208";a="178930792" Received: from rcdn-core2-1.cisco.com ([173.37.113.188]) by rcdn-iport-7.cisco.com with ESMTP; 19 Feb 2013 23:43:33 +0000 Received: from xhc-rcd-x01.cisco.com (xhc-rcd-x01.cisco.com [173.37.183.75]) by rcdn-core2-1.cisco.com (8.14.5/8.14.5) with ESMTP id r1JNhX9R001999 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Tue, 19 Feb 2013 23:43:33 GMT Received: from xmb-rcd-x03.cisco.com ([169.254.7.17]) by xhc-rcd-x01.cisco.com ([173.37.183.75]) with mapi id 14.02.0318.004; Tue, 19 Feb 2013 17:43:32 -0600 From: "Helen Johnson -X (heljohns - Infobahn Softworld Inc at Cisco)" To: "user@uima.apache.org" Subject: RE: SimpleServer, & instantiating CAS with custom typesystem? Thread-Topic: SimpleServer, & instantiating CAS with custom typesystem? Thread-Index: Ac4OIBcg9JTXPj5kTLKiX9VF5sauuAAnNsMAAAVh8jAACfsPgA== Date: Tue, 19 Feb 2013 23:43:32 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.21.100.238] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org So it turns out I cannot invoke cas.reset()=20 from inside an annotator, nor can I set anew the text to be processed using cas.setDocumentText() once the doc-text has already been set in the SimpleServer Service.java cla= ss. What are my options for altering the document text inside an annotator afte= r the SimpleServer Service.java has already set the document text? -Helen -----Original Message----- From: Helen Johnson -X (heljohns - Infobahn Softworld Inc at Cisco)=20 Sent: Tuesday, February 19, 2013 7:05 AM To: user@uima.apache.org Subject: RE: SimpleServer, & instantiating CAS with custom typesystem? Thanks for your reply, Jens. I admit I had been avoiding setting the text of the CAS to be the entire XM= L string I get back from the first REST service because it is a massive str= ing and I only want a couple nodes from that xml string to be processed thr= oughout the UIMA pipeline. But I see your point. So then, in this new AE, I retrieve the entire XML string from the CAS, do= the zone-information processing from the specific nodes of the XML. I assu= me it is straightforward to then reset the CAS text to be just this text I = have found in the original XML. Specifically, I would use CAS.reset() to e= mpty the CAS of the original (full XML) text, then jCAS.setDocumentText() w= ith the new string of just the relevant text, as well as load all the doc-z= one annotations at this point. Is this right? Cheers, Helen -----Original Message----- From: Jens Grivolla [mailto:j+asf@grivolla.net]=20 Sent: Tuesday, February 19, 2013 3:20 AM To: user@uima.apache.org Subject: Re: SimpleServer, & instantiating CAS with custom typesystem? Hi, SimpleServer itself is in a way your CR, creating a CAS with the docume= nt text you sent. Why do you want to change SimpleServer, it seems that you= only want to add annotations to the CAS, not fundamentally change how the = CAS is created. It seems to me that it would be far easier to just create an AE that adds t= hose annotations. Then you won't have any typesystem issues either, since t= he AE would have the appropriate typesystem. HTH, Jens On 02/18/2013 10:37 PM, Helen Johnson -X (heljohns - Infobahn Softworld Inc= at Cisco) wrote: > I'm stumped: > > I have a UIMA pipeline that starts with a CollectionReader that > > - reads XML input (response from a REST service), > > - identifies a couple of relevant XML nodes > > - makes document-level annotations from the relevant nodes (titl= e, document body, footnote section) > From there, the AnalysisEngine portion of the pipeline has many AEs that= I've wrapped into a single AggregateAnalysisEngine. > The CollectionReader and the AAE all work correctly in this pipeline. > > Now I need to transfer this pipeline into a SimpleServer REST service env= ironment. > I've created a PEAR of the AAE portion of the pipeline, but I can't inclu= de the CollectionReader in this PEAR. > First question: > It is my understanding the CR cannot be included in the PEAR for the simp= leServer, am I correct in this? > > In order to get those document-zoning annotations of title, body & footno= te, I have added some methods to the Service.java class in the SimpleServer= package that do the XML parsing and then do the adding of these annotation= s to the JCAS before the AAE is called. The error that is being thrown at t= his point is this: > > "The server encountered an internal error (JCas type "myPackage.DocClass.= ArticleMainTitle" used in Java code, but was not declared in the XML type d= escriptor.) that prevented it from fulfilling this request." > > Second question: > Where is Service.java looking for the typesystem xml file to be? I have t= ried all of the following, with the same error result: > > - put the typesystem descriptor file, myTSD.xml, in SimpleServer= /lib > > - create a jar containing myTSD.xml, put it into SimpleServer/li= b and add that to the build path > > - (after the two above attempts), in SimpleServer project proper= ties, add "lib" to the UIMA CDE Property Page > > - in SimpleServer project properties, in UIMA Type System, point= to the myTSD.xml file in lib > > - put myTSD.xml in SimpeServer/WebContent/WEB-INF/lib > > - put the jar containing myTSD.xml in the SimpleServer/WebConten= t/WEB-INF/lib > > - put myTSD.xml in SimpleServer/WebContent/WEB-INF/resources > > Final question: > When a CAS gets instantiated (or reset, as it does in Service.java), how = can I tell it to use a custom typesystem, and where will it look for that t= ypesystem.xml file within the SimpleServer project? > > Thank you, > Helen Johnson > >