Adam Lally wrote: ...
Possible conclusion for the Java API: We should provide a way to get all of the FS from the CAS and add new FS to the CAS, as part of the Base CAS API. Note that we currently jump through hoops in XMI/XCAS serialization because we don't have such access.
That's a basic design question. The CAS was not designed to deliver that information. If the standard requires it, we'll need to change the CAS. It's a completely orthogonal issue, though.
...
Thilo advocates addressing this issue by eliminating the capability to create objects off the base CAS. But there is an alternative solution, which is to add the ability to retrieve objects from the base CAS. The latter may be more in-sync with the proposed UIMA spec.
Since that's the way it used to be, I have no problem with that. All I want is consistency and conceptual clarity ;-)
In that case, a view could be seen as just a set of indexes, with possibly just two methods: getIndexes() (and variations) and addToIndexes(FS). The base CAS would be a view on everything. A view might be what we now call index repository. In fact, if we just rename the index repository to "view", we're done ;-). Just a little implementation to make more than one index repository possible.
I think the reason we don't have a way to retrieve objects from the base CAS is that our built-in annotation index, sorted by location within the Sofa, doesn't make sense if not segregated by Sofa. But other kinds of indexes may very well be useful for the entire CAS. Perhaps even bag indexes separated by type are useful. (Note we have suggested in the past that we might implement such bag indexes by default in a future version.)
I couldn't agree more (except for the default bag indexes). It makes no sense at all that global indexes must be accessed via a particular view.
Sorry for the length of this post, I hope it is helpful. I think the summary from my point of view is that in light of the UIMA spec, views ought to be an optional way to interact with a CAS. If we want to make them required, we should take that up with the OASIS TC and see if we can get buy-in there, before we try to implement anything.
So no CAS cas = inCas.getView()? --Thilo
