You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Yoshinobu KANO <ka...@is.s.u-tokyo.ac.jp> on 2007/07/13 11:11:15 UTC

Removal and addition of FS between views

Hi,

(Excuse me if this is a duplicated post.)
I tried the following code but got error

" is over view "_InitialView" and cannot be added to indexes
associated with the different view "created".
       at org.apache.uima.cas.impl.CASImpl.addFsToIndexes(CASImpl.java:3880)
       at org.apache.uima.jcas.impl.JCasImpl.addFsToIndexes(JCasImpl.java:1076)
...

I checked the source code of UIMA but it seems that the removal of the
FS was not made properly.

My question is that:
1. Is it impossible to share FeatureStructures between multi-views in
a single CAS?
2. If yes, then remove a FS from a view and add it to another view is
also impossible?

Thanks!

-Yoshinobu

Inside JCasAnnotatorImplBase with the multi-view settings:

 public void process(JCas aJCas) throws AnalysisEngineProcessException {

   TypeSystem typeSystem = aJCas.getTypeSystem();
   try {
     JCas initialView = aJCas.getView("_InitialView");
     JCas createdView = initialView.createView("created");
//      JCas createdView = aJCas.createView("created");


       FSIterator allIndexedFS =
initialView.getFSIndexRepository().getAllIndexedFS(typeSystem.getTopType());
       while (allIndexedFS.hasNext()) {
         TOP top = (TOP) allIndexedFS.next();

// I think it should work without removing...   top.getView() may have
returned illegal handle though it should be removed from indexes
         initialView.removeFsFromIndexes(top);
//          top.removeFromIndexes();
         createdView.addFsToIndexes(top);
       }

     }

   } catch (CASException e) {
     e.printStackTrace();
   }


 }

-- 
Yoshinobu KANO
kano@is.s.u-tokyo.ac.jp
Tsujii Laboratory, the University of Tokyo
http://www-tsujii.is.s.u-tokyo.ac.jp/

RE: Rules engine as an annotator

Posted by Pascal Coupet <pa...@temis.com>.
Hi Thilo,

I don't know about a free JSR 94. The following article from SUN
provides a reference implementation on top of JESS.
JAVAhttp://java.sun.com/developer/technicalArticles/J2SE/JavaRule.html

JSR 94 defines the way to communicate with the engine but not the rule
language itself witch is specific to each implementation.

Pascal

-----Original Message-----
From: Thilo Goetz [mailto:twgoetz@gmx.de] 
Sent: Friday, July 13, 2007 9:13 AM
To: uima-user@incubator.apache.org
Subject: Re: Rules engine as an annotator

Hi Pascal,

Pascal Coupet wrote:
> Do somebody knows if there is a java rule engine that has been
> encapsulated as an UIMA annotator or if a generic annotator toward JSR
> 94 exists or if somebody planned this? 
> 
> Thanks,
> 
> Pascal

not that I know of.  Is there a free JSR 94 implementation that could
be wrapped?

--Thilo

RE: Rules engine as an annotator

Posted by "LeHouillier, Frank D." <Fr...@gd-ais.com>.
If I can make a business case for it here I will give it a shot.  It is
something we could use anyway.

Frank

-----Original Message-----
From: Thilo Goetz [mailto:twgoetz@gmx.de] 
Sent: Friday, July 13, 2007 11:56 AM
To: uima-user@incubator.apache.org
Subject: Re: Rules engine as an annotator

And it's even Apache licensed, way to go!  Now we just need
somebody to wrap it in an annotator.  Volunteers?

--Thilo

Olivier Terrier wrote:
> Hi
>  
> Maybe GroovyRules ?
> https://groovyrules.dev.java.net/
>  
> Olivier
> 
> ________________________________
> 
> From: Thilo Goetz [mailto:twgoetz@gmx.de]
> Sent: Fri 7/13/2007 3:13 PM
> To: uima-user@incubator.apache.org
> Subject: Re: Rules engine as an annotator
> 
> 
> 
> Hi Pascal,
> 
> Pascal Coupet wrote:
>> Do somebody knows if there is a java rule engine that has been
>> encapsulated as an UIMA annotator or if a generic annotator toward
JSR
>> 94 exists or if somebody planned this?
>>
>> Thanks,
>>
>> Pascal
> 
> not that I know of.  Is there a free JSR 94 implementation that could
> be wrapped?
> 
> --Thilo
> 
> 
> 

Re: Rules engine as an annotator

Posted by Thilo Goetz <tw...@gmx.de>.
And it's even Apache licensed, way to go!  Now we just need
somebody to wrap it in an annotator.  Volunteers?

--Thilo

Olivier Terrier wrote:
> Hi
>  
> Maybe GroovyRules ?
> https://groovyrules.dev.java.net/
>  
> Olivier
> 
> ________________________________
> 
> From: Thilo Goetz [mailto:twgoetz@gmx.de]
> Sent: Fri 7/13/2007 3:13 PM
> To: uima-user@incubator.apache.org
> Subject: Re: Rules engine as an annotator
> 
> 
> 
> Hi Pascal,
> 
> Pascal Coupet wrote:
>> Do somebody knows if there is a java rule engine that has been
>> encapsulated as an UIMA annotator or if a generic annotator toward JSR
>> 94 exists or if somebody planned this?
>>
>> Thanks,
>>
>> Pascal
> 
> not that I know of.  Is there a free JSR 94 implementation that could
> be wrapped?
> 
> --Thilo
> 
> 
> 

RE: Rules engine as an annotator

Posted by Olivier Terrier <ol...@temis.com>.
Hi
 
Maybe GroovyRules ?
https://groovyrules.dev.java.net/
 
Olivier

________________________________

From: Thilo Goetz [mailto:twgoetz@gmx.de]
Sent: Fri 7/13/2007 3:13 PM
To: uima-user@incubator.apache.org
Subject: Re: Rules engine as an annotator



Hi Pascal,

Pascal Coupet wrote:
> Do somebody knows if there is a java rule engine that has been
> encapsulated as an UIMA annotator or if a generic annotator toward JSR
> 94 exists or if somebody planned this?
>
> Thanks,
>
> Pascal

not that I know of.  Is there a free JSR 94 implementation that could
be wrapped?

--Thilo



Re: Rules engine as an annotator

Posted by Thilo Goetz <tw...@gmx.de>.
Hi Pascal,

Pascal Coupet wrote:
> Do somebody knows if there is a java rule engine that has been
> encapsulated as an UIMA annotator or if a generic annotator toward JSR
> 94 exists or if somebody planned this? 
> 
> Thanks,
> 
> Pascal

not that I know of.  Is there a free JSR 94 implementation that could
be wrapped?

--Thilo

Rules engine as an annotator

Posted by Pascal Coupet <pa...@temis.com>.
Do somebody knows if there is a java rule engine that has been
encapsulated as an UIMA annotator or if a generic annotator toward JSR
94 exists or if somebody planned this? 

Thanks,

Pascal


Re: Removal and addition of FS between views

Posted by Eddie Epstein <ea...@gmail.com>.
On 7/13/07, Yoshinobu KANO <ka...@is.s.u-tokyo.ac.jp> wrote:
> (Excuse me if this is a duplicated post.)
> I tried the following code but got error
>
> " is over view "_InitialView" and cannot be added to indexes
> associated with the different view "created".
>        at org.apache.uima.cas.impl.CASImpl.addFsToIndexes(CASImpl.java:3880)
>        at org.apache.uima.jcas.impl.JCasImpl.addFsToIndexes(JCasImpl.java:1076)
> ...

This error must be for an annotation FS. As mentioned in the other
reply, an annotation FS can only be indexed in the View associated
with the annotation's Sofa.

> My question is that:
> 1. Is it impossible to share FeatureStructures between multi-views in
> a single CAS?
> 2. If yes, then remove a FS from a view and add it to another view is
> also impossible?

Except for annotation FS, an FS can be added to the index of multiple
views. The sharing of an annotation FS between views is accomplished,
for example, by creating a reference from an FS indexed in view-A to
an annotation FS whose Sofa is associated with view-B.

Hope this is becoming clearer,
Eddie