On Tue, Aug 26, 2014 at 4:33 AM, Marshall Schor <[email protected]> wrote:

>
> On 8/25/2014 6:54 PM, Jens Grivolla wrote:
> > Is the JSON serialization documented somewhere?
> Yes, there's a chapter in the reference book.  You can build that
> (uima-docbook-references), until it's released.
>
> There are also lots of Javadocs in the main implementing class:
> XmiCasSerializer.  (It's in this class because it shares a lot of the
> machinery
> with Xmi serialization).


Ok, I'll take another deeper look at this.


> > It would be very useful if the serialization allowed one to easily pull
> out
> > a partial CAS with just a subset of the views (by only including some
> > subtrees of the JSON structure), and merge views into it.
> Another optional part of the serialization is a list of views, together
> with an
> array of numbers each one of which represents a serialized Feature
> Structure
> that is indexed in that view.
>

Yes, I saw that. But the FSs themselves are all together.

Feature Structures can be classified into "Annotations" and other types
> (not a
> subtype of Annotation).
>
> Annotations are special - they have an implied reference to a particular
> subject
> of analysis.  So they are restricted to being indexed in the view that is
> associated with that subject-of-analysis.
>
> Other types (not subtypes of Annotation (or more precisely,
> AnnotationBase)) do
> not have this restriction, and can be indexed in multiple views.
>

Thanks for the refresher. That means that the view-specific parts (Sofa and
Annotations) could be grouped with the view they belong to and there could
just be an additional section for FSs that are not bound to a view.

That would make it much easier to just pull out a subset of views (e.g.
when storing the CAS in MongoDB), as well as write individual views back,
without retrieving all the FSs one doesn't need. The main problem I see is
with the FS ids, which probably need to be unique across the entire CAS.
Thus creating new annotations in a partial CAS that doesn't know about the
other views could create conflicts.

My usecase is e.g. passing a document through video analysis (a batch
process not directly integrated as a UIMA AE), which would generate a lot
of output that gets integrated in the CAS. I then need to pass just the
view that includes the OCR output to a text analysis pipeline, and would
like to avoid retrieving all the other views from the database and passing
a huge CAS through my pipeline when I really only need a small part of the
information.

-- Jens

Reply via email to