@Test public void testDocumentGraphMetadataHasContentFromJCas() throws UIMAException { DocumentGraphOptions options = DocumentGraphOptions.builder().withContent(true).build(); DocumentGraphFactory factory = createfactory(options); JCas jCas = JCasFactory.createJCas(); JCasTestGraphUtil.populateJcas(jCas); Graph graph = factory.create(jCas); Variables variables = graph.variables(); assertEquals(JCasTestGraphUtil.CONTENT, variables.get(FIELD_CONTENT).orElse("")); }
@Override public void doInitialize(UimaContext aContext) throws ResourceInitializationException { super.doInitialize(aContext); Set<Class<? extends Entity>> typeClasses = TypeUtils.getTypeClasses(Entity.class, typeNames); DocumentGraphOptions.Builder builder = DocumentGraphOptions.builder() .withContentHashAsId(contentHashAsId) .withContent(outputContent) .withMeta(outputMeta) .withReferenceTargets(outputReferents) .withRelations(outputRelations) .withRelationsAsLinks(outputRelationsAsLinks) .withEvents(outputEvents) .withDocument(outputDocument) .withStopFeatures(filterFeatures) .withValueCoercer(valueCoercer) .withTypeClasses(typeClasses); addOptions(builder); factory = new DocumentGraphFactory(getMonitor(), builder.build()); }
@Override public void doInitialize(UimaContext aContext) throws ResourceInitializationException { super.doInitialize(aContext); Set<Class<? extends Entity>> typeClasses = TypeUtils.getTypeClasses(Entity.class, typeNames); DocumentGraphOptions.Builder builder = DocumentGraphOptions.builder() .withContentHashAsId(contentHashAsId) .withContent(outputContent) .withMeta(outputMeta) .withReferenceTargets(outputReferents) .withRelations(outputRelations) .withRelationsAsLinks(outputRelationsAsLinks) .withEvents(outputEvents) .withDocument(outputDocument) .withStopFeatures(filterFeatures) .withValueCoercer(valueCoercer) .withTypeClasses(typeClasses); addOptions(builder); factory = new DocumentGraphFactory(getMonitor(), builder.build()); }