On 01.12.2017, at 16:12, Marshall Schor <[email protected]> wrote:
> 
> I'm in the middle of things with changes for 3.0.0sdk;  could you check out 
> the
> 3.0.0-beta tag and change
> in the uimaj-core project,
>   Class: org.apache.uima.cas.impl.FSClassRegistry
>   to comment out the throw clause: lines 456-460
> 
> and then rebuild uimaj-core, try it, and let me know if it works?
> 
> If so, let's put in a Jira to switch the "throw" to a "report" (not completely
> straight-forward, but not too hard- I can do the change...)

Commenting out these lines, I can load the CAS and I can also see that WebAnno
can access and render the annotations. 

However, it doesn't seem to be possible to retrieve the annotations by their 
addresses:

org.apache.uima.cas.impl.LowLevelException: Error in low-level CAS APIs: 
accessing FS with id 15, but no such FS exists in this CAS.
        at 
org.apache.uima.cas.impl.CASImpl.getFsFromId_checked(CASImpl.java:2444) 
~[classes/:?]
        at org.apache.uima.cas.impl.CASImpl.ll_getFSForRef(CASImpl.java:2641) 
~[classes/:?]

WebAnno uses the CasCompleteSerializer since FS addresses in v2 remained stable 
with this
particular serialization format.

I checked the CASImpl.svd.id2fs (JCasHashMap): all four of its 
JCasHashMapSubMaps report a size of 0.
It seems like during the deserialization, the id2fs map is not updated with the 
addresses obtained
from the serialized file. 

Digging further, I found that BinaryCasSerDes.createFSsFromHeaps actually sets 
up a
map of the v2 IDs obtained from the serialized CAS to the v3 FSes, but it does 
not actually
set the IDs of the v3 FSes to the values obtained from the CAS. Unfortunately, 
this is an
essential assumption made in the WebAnno code. 

It looks to me that v3 is rather flexible with respect to assigning IDs to FSes 
(unlike
v2 where this was bound to the heap organization). It would be great if this 
flexibility
could be used in order to assign the IDs in the way that they are read from the 
serialized
CAS (cf. CommonSerDesSequential.addr2fs).

Cheers,

-- Richard

Reply via email to