UIMA Notes: Accessing Annotation and Types from the Index - 11791-04/project-team04 GitHub Wiki
Ok, TOP is just a feature structure that does not contain annotation (start index, end index).
So stuffs that are in the JCas’s index are either subclass of Annotation (think pos tags) or TOP (think string, integer, relevant documents). getAnnotationIndex(type) gets you access to the Annotation subtypes, and getAllIndexedFS() gets you access to the TOP subtypes.
I will be pushing an updated version of the echo AE that retrieves subtypes of TOP (Document, Passage) from the JCas.
Also, for adding TOP subtypes to to JCas you call TOP::addToIndexes(jcas) . You can also find it in the Json Helper class:
input.getDocuments().stream() .map(uri -> TypeFactory.createDocument(jcas, uri)) .forEach(Document::addToIndexes);
I have that working in my local Echo AE, will push soon,.
-Joseph