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 4589CE2DE for ; Tue, 19 Feb 2013 14:05:18 +0000 (UTC) Received: (qmail 17924 invoked by uid 500); 19 Feb 2013 14:05:18 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 16183 invoked by uid 500); 19 Feb 2013 14:05:13 -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 16150 invoked by uid 99); 19 Feb 2013 14:05:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2013 14:05:12 +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 (nike.apache.org: domain of heljohns@cisco.com designates 173.37.86.80 as permitted sender) Received: from [173.37.86.80] (HELO rcdn-iport-9.cisco.com) (173.37.86.80) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2013 14:05:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4184; q=dns/txt; s=iport; t=1361282702; x=1362492302; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=hPlLtdZewffYNXSXNwwwbAtWJ5nNPYDWblUqvsvgaFQ=; b=ePflRXpm9XI0r1DTrg0WNJmmwg/LiMGv0t3lzWUTSewC4McgeseEJ0sh oH2LW/2d85GP+sB5SJU2qlbABRIHh9rkeDFUuMzVkguHt1bJudNCLWsyF ZIwc4lxyO+9EadwpraYrhsPHPeDbAyOpHpY82MItrPEbBgZA9R9340p1W 4=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgEFANuFI1GtJXG+/2dsb2JhbABFwD+BChZzgh8BAQEEOksEAgEIEQQBAQEKFAkHMhQJCAEBBAoJCIgKsByQHY5dJhIGgllhA5JslBeDB4In X-IronPort-AV: E=Sophos;i="4.84,695,1355097600"; d="scan'208";a="175715482" Received: from rcdn-core2-3.cisco.com ([173.37.113.190]) by rcdn-iport-9.cisco.com with ESMTP; 19 Feb 2013 14:04:41 +0000 Received: from xhc-aln-x01.cisco.com (xhc-aln-x01.cisco.com [173.36.12.75]) by rcdn-core2-3.cisco.com (8.14.5/8.14.5) with ESMTP id r1JE4fcQ024015 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Tue, 19 Feb 2013 14:04:41 GMT Received: from xmb-rcd-x03.cisco.com ([169.254.7.17]) by xhc-aln-x01.cisco.com ([173.36.12.75]) with mapi id 14.02.0318.004; Tue, 19 Feb 2013 08:04:40 -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: Ac4OIBcg9JTXPj5kTLKiX9VF5sauuAAnNsMAAAVh8jA= Date: Tue, 19 Feb 2013 14:04:40 +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.115.124] 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 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 > >