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 EA04319C8F for ; Sat, 19 Mar 2016 21:25:47 +0000 (UTC) Received: (qmail 15099 invoked by uid 500); 19 Mar 2016 21:25:47 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 15056 invoked by uid 500); 19 Mar 2016 21:25:47 -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 15041 invoked by uid 99); 19 Mar 2016 21:25:47 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Mar 2016 21:25:47 +0000 Received: from [10.0.1.25] (ip-178-203-23-159.hsi10.unitymediagroup.de [178.203.23.159]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id BB7FE1A003F; Sat, 19 Mar 2016 21:25:46 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: Change an at run-time From: Richard Eckart de Castilho In-Reply-To: <012301d17fd5$9cd4ac00$d67e0400$@gnoetics.com> Date: Sat, 19 Mar 2016 22:25:44 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <6C4A27F4-2F90-427E-9283-E4EA7906B720@apache.org> References: <012301d17fd5$9cd4ac00$d67e0400$@gnoetics.com> To: user@uima.apache.org X-Mailer: Apple Mail (2.3112) Hi, you might find this interesting (although I haven't used that in a long = time): = https://uima.apache.org/d/uimaj-current/references.html#ugr.ref.xml.compon= ent_descriptor.aes.environment_variable_references Also, after you a have parser the specifier in the last line of your = code, you can traverse it, locate the element you wish to change and simply = change it at runtime. In that case it doesn't matter what the XML file = contains. The Java object structure is very similar to the XML structure. It may = be a=20 bit verbose to actually get to the point where you want to go and = *maybe* you'll have to cast some interfaces to their implementations to get = access to setters, but in general it should work. Cheers, -- Richard > On 16.03.2016, at 23:46, D. Heinze wrote: >=20 > I have separate xml engine descriptor files for set of ConceptMapper > engines, each using a distinct compiled dictionary file that is = specified in > as shown below. > The ConceptMapper engines are configured and run programmatically by = one of > the engines in the overall UIMA pipeline, where the engines are run > selectively on data that is constructed on the fly. > Because all the descriptor files are alike (with stop word = definitions, > etc.) except for the that specifies the dictionary, I would = like > to be able to have only one xml descriptor and be able to set a = version > number as a Java -D parameter when starting the engine and then add it = to > the name after the ResourceSpecifier is created and before > produceAnalysisEngine is called. >=20 > Is this possible? Or, can somehow be omitted from the = descriptor > file and specified at run-time as a configuration parameter? > Thanks / Dan=20 >=20 > ENGINE INITIALIZATION CODE: > is =3D cls.getClassLoader().getResourceAsStream( desc);=20 > XMLInputSource source =3D new XMLInputSource( is, null);=20 > ResourceSpecifier specifier =3D > UIMAFramework.getXMLParser().parseResourceSpecifier( source); =20= > ae =3D UIMAFramework.produceAnalysisEngine(specifier); >=20 > DESCRIPTOR (desc): > > > = org.apache.uima.java > true >=20 > = org.apache.uima.conceptMapper.ConceptMapper notatorImplementationName> > ... > > > > DictionaryFileName > A file containing the dictionary. Modify this URL = to > use a different dictionary. > >=20 > = com/gnoetics/resources/dictionary/ConceptMapperRoots_dict > >=20 > = org.apache.uima.conceptMapper.support.dictionaryResour= ce > .CompiledDictionaryResource_impl > > > > > DictionaryFile > DictionaryFileName > > > > >=20