[ 
https://issues.apache.org/jira/browse/UIMA-2419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13644938#comment-13644938
 ] 

Marshall Schor commented on UIMA-2419:
--------------------------------------

Putting this change in would shift the balance between error reporting and 
"making frequently used paradigms easier".  

Background: There are 2 classes of views:  1) the default-initial-view, with 
the reserved name _InitialView, and 2) all other views, each having different 
names.

Currently the balance is set:

All view creation is to be done by User code (User code = annotator code or 
application code, as opposed to UIMA Framework code).  There is one exception, 
put in for backwards compatibility: the case where an annotator was 
sofa-unaware AND the view was to be the default unnamed initial view.  In this 
case (only) the framework created the view in the CAS called _InitialView.

The case that this Jira address is where the annotator is sofa-unaware and the 
view name, after mapping is other than _InitialView.  If the framework were to 
automatically create this view if it didn't exist, then a potentially useful 
error message - that a view which is expected by the design, doesn't exist - 
would not be generated.

Since "View design" for a UIMA application could have errors where on 
particular execution flows, expected Views were not present, it would seem 
better to continue to present these as Errors.

For cases where the "View design" wanted to allow a particular aggregate to be 
entered with an expected View missing, then that could be explicitly designed 
into the aggregate, or into the calling application (if this was a top level 
aggregate, or into any previously running component.  The design in this case 
have a bit of code which queried for the existence of the view in question, and 
if not present, created it.  

But this would be only for those "View designs" that had this kind of 
variability expected.  Other view designs, where it was expected that a view 
was produced by some point in the flow, would continue to get errors thrown if 
the view wasn't there.

My opinion at the moment is that there is not enough common usage of automatic 
view creation to give up the error reporting currently possible for missing but 
expected views.  Other opinions welcome :-)
                
> Initial view for sofa unaware components not automatically created
> ------------------------------------------------------------------
>
>                 Key: UIMA-2419
>                 URL: https://issues.apache.org/jira/browse/UIMA-2419
>             Project: UIMA
>          Issue Type: Bug
>          Components: Core Java Framework
>    Affects Versions: 2.4.0SDK
>            Reporter: Richard Eckart de Castilho
>              Labels: patch
>         Attachments: UIMA-2419-REC-20120609.patch
>
>
> When running a sofa-unaware component in an aggregate analysis engine, the 
> initial view for the component to operate on is not automatically created if 
> it does not exist. This causes a CASRuntimeException, here "No sofaFS with 
> name A found.".
> {noformat}
> org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator 
> processing failed.    
>       at 
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:394)
>       at 
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:298)
>       at 
> org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:568)
>       at 
> org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(ASB_impl.java:410)
>       at 
> org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:343)
>       at 
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:265)
>       at 
> org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.processAndOutputNewCASes(AnalysisEngineImplBase.java:340)
>          ...
> Caused by: org.apache.uima.cas.CASRuntimeException: No sofaFS with name A 
> found.
>       at org.apache.uima.cas.impl.CASImpl.getSofa(CASImpl.java:661)
>       at org.apache.uima.cas.impl.CASImpl.getView(CASImpl.java:2658)
>       at org.apache.uima.impl.Util.getStartingView(Util.java:46)
>       at 
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:349)
>       ... 31 more
> {noformat}
> I'd consider this a bug, because a sofa-unaware component cannot be expected 
> to create a view itself. If the sofa-unaware component is the first one in an 
> aggregate, e.g. acting as a reader, then there is also no other component to 
> create the view before.
> If the initial view of a component it is mapped to does not exist, it should 
> be the task of the UIMA framework to create this view. 
> See also CPE ArtifactProducer:481 (UIMA 2.4.0).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to