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 E5AE51101D for ; Tue, 8 Apr 2014 15:17:42 +0000 (UTC) Received: (qmail 77911 invoked by uid 500); 8 Apr 2014 15:17:41 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 77528 invoked by uid 500); 8 Apr 2014 15:17:38 -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 77520 invoked by uid 99); 8 Apr 2014 15:17:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Apr 2014 15:17:35 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [141.35.1.28] (HELO mailout0.rz.uni-jena.de) (141.35.1.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Apr 2014 15:17:30 +0000 Received: from mailsmtp2.rz.uni-jena.de (smtp.uni-jena.de [141.35.1.21]) by mailout0.rz.uni-jena.de (8.14.4/8.14.4) with ESMTP id s38FH8eT030845 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 8 Apr 2014 17:17:08 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uni-jena.de; s=dkim-2013; t=1396970228; bh=+683Il3dJuRMo8LXH7lKLQnkTrNVcXbQ4vXkGt/OCAs=; h=From:Content-Type:Content-Transfer-Encoding:Subject:Message-Id: Date:To:Mime-Version; b=qEmCYFdkLO3QA/S2tIuuBHtaBbSyOUXuJ0QsN9gtp5mSv4FVsNa8DfKQLozuONe8z Cg705l0YjXSvSkcYtoPJVeLHywp/0nxj1+5l/F2TO68Pq1Agh2u74rcHZQV7UEl9iI ipaP29q6uDzfgK4nkWKbHln2/k0AN9CTJaLgiB3ssZTDXj84p2c6dfErnY4b0OqGUv 4Mklvzvzp7Cul0rbjGEHAi7gL9nOGmYOoaR012eCg4Xyygd+sAJ4xr9JIo+UfHiEMR 6zpniytYPHgs42KjJ8vOtlgny/UB1oUf1efqWCGHqTnuu+iPuSzpUVlt9pwrdLy5dH gkFHqMefQnfxQ== Received: from dyn-0a238f4e.philo.uni-jena.de (dyn-0a238f4e.philo.uni-jena.de [10.35.143.78]) (authenticated id=si95xub bits=0) by mailsmtp2.rz.uni-jena.de (8.14.4/8.14.4) with ESMTP id s38FH8id007542 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Tue, 8 Apr 2014 17:17:08 +0200 From: =?windows-1252?Q?Erik_F=E4=DFler?= Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: FeaturePath with FSArray Message-Id: <30B8B0B6-3FB5-4A44-B873-21279B940D5B@uni-jena.de> Date: Tue, 8 Apr 2014 17:17:49 +0200 To: user@uima.apache.org Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) X-Mailer: Apple Mail (2.1874) X-Virus-Checked: Checked by ClamAV on apache.org Hi all, I have a component where a parameter is supposed to be a FeaturePath = string, e.g. /address/streetname Another parameter would be the type name, e.g. =93person=94. The component would now get an iterator over all =93person=94 instances = in the CAS and from each person geht the name of the street he or she is = living in. The problem is that =93address=94 is actually an FSArray of type = =93Address=94, i.e. one person can have multiple addresses. Each address = has then a feature =93streetname=94 I am easily able to get feature values when there is no array involved = or when I use built-in functions. But I can not manage to get back all = my street names. The code: TypeSystem ts =3D aJCas.getTypeSystem(); Type entityType =3D ts.getType(entityTypeString); FeaturePath fp =3D aJCas.createFeaturePath(); =09 try { fp.initialize(=93/address/streetname"); =09 FSIterator entityIterator =3D = aJCas.getAnnotationIndex(entityType).iterator(); while (entityIterator.hasNext()) { Annotation entity =3D entityIterator.next(); String streetname =3D fp.getValueAsString(entity); System.out.println(streetname); } } catch (CASException e) { e.printStackTrace(); } I get an exception saying the feature =93address=94 would be primitive. = Isn=92t there a way to involve arrays in feature paths? I saw the = FeatureValuePath interface in the JavaDocs and it looks like it could = handle arrays, but it is marked deprecated and I don=92t want to write a = component that could be non-functional in the future when the UIMA = version is updated. Some advice? Thank! Regards, Erik=