@Test public void testXmiDBReader() throws UIMAException, IOException { CollectionReader xmiReader = CollectionReaderFactory.createReader(XmiDBReader.class, XmiDBReader.PARAM_COSTOSYS_CONFIG_NAME, costosysConfig, XmiDBReader.PARAM_READS_BASE_DOCUMENT, true, XmiDBReader.PARAM_ANNOTATIONS_TO_LOAD, new String[]{Token.class.getCanonicalName(), Sentence.class.getCanonicalName()}, XmiDBReader.PARAM_TABLE, xmisubset, XmiDBReader.PARAM_RESET_TABLE, true ); JCas jCas = XmiDBSetupHelper.getJCasWithRequiredTypes(); List<String> tokenText = new ArrayList<>(); List<String> sentenceText = new ArrayList<>(); assertTrue(xmiReader.hasNext()); while (xmiReader.hasNext()) { xmiReader.getNext(jCas.getCas()); JCasUtil.selectSingle(jCas, Header.class); JCasUtil.select(jCas, Token.class).stream().map(Annotation::getCoveredText).forEach(tokenText::add); JCasUtil.select(jCas, Sentence.class).stream().map(Annotation::getCoveredText).forEach(sentenceText::add); jCas.reset(); } assertFalse(tokenText.isEmpty()); assertFalse(sentenceText.isEmpty()); }
@Override public void getNext(JCas jCas) throws CollectionException { log.trace("Reading next document."); initializeAnnotationTableNames(jCas); log.trace("Retrieving document data from the database."); byte[][] data = getNextArtifactData(); log.trace("Got document data with {} fields.", null != data ? data.length : 0); if (data != null) populateCas(jCas, data); }
XmiDBReader extends DBReader implements Initializable { @Override public void getNext(JCas jCas) throws CollectionException { log.trace("Reading next document."); initializeAnnotationTableNames(jCas); log.trace("Retrieving document data from the database."); byte[][] data = getNextArtifactData(); log.trace("Got document data with {} fields.", null != data ? data.length : 0); if (data != null) populateCas(jCas, data); } }
XmiDBReader extends DBReader implements Initializable { @Override public void getNext(JCas jCas) throws CollectionException { log.trace("Reading next document."); initializeAnnotationTableNames(jCas); log.trace("Retrieving document data from the database."); byte[][] data = getNextArtifactData(); log.trace("Got document data with {} fields.", null != data ? data.length : 0); if (data != null) populateCas(jCas, data); }  }
XmiDBReader extends DBReader implements Initializable { @Override public void getNext(JCas jCas) throws CollectionException { log.trace("Reading next document."); initializeAnnotationTableNames(jCas); log.trace("Retrieving document data from the database."); byte[][] data = getNextArtifactData(); log.trace("Got document data with {} fields.", null != data ? data.length : 0); if (data != null) populateCas(jCas, data); }  @Override void initialize(UimaContext context); @Override void getNext(JCas jCas); @Override String[] getAdditionalTableNames(); @Override String[] getTables(); }
XmiDBReader extends DBReader implements Initializable { @Override public void getNext(JCas jCas) throws CollectionException { log.trace("Reading next document."); initializeAnnotationTableNames(jCas); log.trace("Retrieving document data from the database."); byte[][] data = getNextArtifactData(); log.trace("Got document data with {} fields.", null != data ? data.length : 0); if (data != null) populateCas(jCas, data); }  @Override void initialize(UimaContext context); @Override void getNext(JCas jCas); @Override String[] getAdditionalTableNames(); @Override String[] getTables(); static final String PARAM_STORE_XMI_ID; static final String PARAM_LOG_FINAL_XMI; static final String PARAM_READS_BASE_DOCUMENT; static final String PARAM_INCREASED_ATTRIBUTE_SIZE; static final String PARAM_XERCES_ATTRIBUTE_BUFFER_SIZE; static final String PARAM_XMI_NAMESPACES_SCHEMA; static final String PARAM_ANNOTATIONS_TO_LOAD; @ConfigurationParameter(name = PARAM_XMI_NAMESPACES_SCHEMA, mandatory = false, defaultValue = "public", description = "Each XMI file defines a number of XML namespaces according to the types used in the document. Those namespaces are stored in a table named '" + XmiSplitConstants.XMI_NS_TABLE + "' when splitting annotations in annotation modules by the XMI DB writer. This parameter allows to specify in which Postgres schema this table should be looked for. Also, the table listing the annotation tables is stored in this Postgres schema. Defaults to 'public'.")
    private String xmiMetaSchema; }