Codota Logo
EntityGraphOptions$Builder.build
Code IndexAdd Codota to your IDE (free)

How to use
build
method
in
uk.gov.dstl.baleen.graph.EntityGraphOptions$Builder

Best Java code snippets using uk.gov.dstl.baleen.graph.EntityGraphOptions$Builder.build (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: dstl/baleen

@Test
public void testValueCoerser() throws UIMAException {
 EntityGraphOptions options = EntityGraphOptions.builder().withValueCoercer((v) -> 1).build();
 EntityGraphFactory factory = createfactory(options);
 JCas jCas = JCasFactory.createJCas();
 JCasTestGraphUtil.populateJcas(jCas);
 Graph graph = factory.create(jCas);
 final GraphTraversalSource traversal = graph.traversal();
 traversal
   .V()
   .forEachRemaining(
     v -> {
      Set<Object> values =
        ElementHelper.propertyValueMap(v).values().stream().collect(Collectors.toSet());
      assertAllValuesCoerceTo1(v, values);
     });
 traversal
   .E()
   .forEachRemaining(
     v -> {
      Set<Object> values =
        ElementHelper.propertyValueMap(v).values().stream().collect(Collectors.toSet());
      assertTrue(values.contains(1) && values.size() == 1 || values.size() == 0);
     });
}
origin: dstl/baleen

@Test
public void testNoEvents() throws UIMAException {
 EntityGraphOptions options = EntityGraphOptions.builder().withEvents(false).build();
 EntityGraphFactory factory = createfactory(options);
 JCas jCas = JCasFactory.createJCas();
 JCasTestGraphUtil.populateJcas(jCas);
 Graph graph = factory.create(jCas);
 final GraphTraversalSource traversal = graph.traversal();
 assertEquals(3, traversal.V().hasLabel(ENTITY).count().next().intValue());
 assertEquals(0, traversal.V().hasLabel(EVENT).count().next().intValue());
 assertEquals(0, traversal.E().hasLabel(PARTICIPANT_IN).count().next().intValue());
 assertEquals(2, traversal.E().hasLabel(RELATION).count().next().intValue());
 assertEquals(3, IteratorUtils.count(graph.vertices()));
 assertEquals(2, IteratorUtils.count(graph.edges()));
}
origin: uk.gov.dstl.baleen/baleen-graph

@Override
public void doInitialize(UimaContext aContext) throws ResourceInitializationException {
 super.doInitialize(aContext);
 try {
  Set<Class<? extends Entity>> typeClasses = TypeUtils.getTypeClasses(Entity.class, typeNames);
  EntityGraphOptions.Builder builder =
    EntityGraphOptions.builder()
      .withContentHashAsId(contentHashAsId)
      .withEvents(outputEvents)
      .withStopFeatures(filterFeatures)
      .withAggregateProperties(aggregate)
      .withTypeClasses(typeClasses)
      .withMultiValueProperties(multiValueProperties)
      .withDefaultValueStrategy(createValueStrategy(defaultValueStrategyType))
      .withValueCoercer(valueCoercer);
  if (valueStrategyTypes != null) {
   for (int i = 0; i < valueStrategyTypes.length; i += 2) {
    builder.withValueStrategy(
      valueStrategyTypes[i], createValueStrategy(valueStrategyTypes[i + 1]));
   }
  }
  addOptions(builder);
  factory = new EntityGraphFactory(getMonitor(), builder.build());
 } catch (Exception e) {
  throw new ResourceInitializationException(e);
 }
}
origin: dstl/baleen

@Test
public void testStopFetures() throws UIMAException {
 EntityGraphOptions options = EntityGraphOptions.builder().withStopFeatures("gender").build();
 EntityGraphFactory factory = createfactory(options);
 JCas jCas = JCasFactory.createJCas();
 JCasTestGraphUtil.populateJcas(jCas);
 Graph graph = factory.create(jCas);
 final GraphTraversalSource traversal = graph.traversal();
 assertTrue(traversal.V().not(has("gender")).hasNext());
}
origin: dstl/baleen

@Override
public void doInitialize(UimaContext aContext) throws ResourceInitializationException {
 super.doInitialize(aContext);
 try {
  Set<Class<? extends Entity>> typeClasses = TypeUtils.getTypeClasses(Entity.class, typeNames);
  EntityGraphOptions.Builder builder =
    EntityGraphOptions.builder()
      .withContentHashAsId(contentHashAsId)
      .withEvents(outputEvents)
      .withStopFeatures(filterFeatures)
      .withAggregateProperties(aggregate)
      .withTypeClasses(typeClasses)
      .withMultiValueProperties(multiValueProperties)
      .withDefaultValueStrategy(createValueStrategy(defaultValueStrategyType))
      .withValueCoercer(valueCoercer);
  if (valueStrategyTypes != null) {
   for (int i = 0; i < valueStrategyTypes.length; i += 2) {
    builder.withValueStrategy(
      valueStrategyTypes[i], createValueStrategy(valueStrategyTypes[i + 1]));
   }
  }
  addOptions(builder);
  factory = new EntityGraphFactory(getMonitor(), builder.build());
 } catch (Exception e) {
  throw new ResourceInitializationException(e);
 }
}
origin: dstl/baleen

    .withValueStrategy("value", new Longest())
    .withValueStrategy("gender", new Mode<String>())
    .build();
EntityGraphFactory factory = createfactory(options);
origin: dstl/baleen

EntityGraphOptions.builder().withMultiValueProperties(true).build();
uk.gov.dstl.baleen.graphEntityGraphOptions$Builderbuild

Popular methods of EntityGraphOptions$Builder

  • withValueCoercer
    Use the given value coerser, defaults to the identity function
  • withEvents
    true to include events (default true)
  • withMultiValueProperties
    true to allow vertexes to have multiple property values (default false)
  • withStopFeatures
    set features to be ignored. Already include defaults from ConsumerUtils#getDefaultStopFeatures().
  • withValueStrategy
    Use the given types, defaults to all Entity types
  • <init>
  • withAggregateProperties
    Use the given types, defaults to all Entity types
  • withContentHashAsId
    true to use the content hash as id, false to use the hash of the source (default false)
  • withDefaultValueStrategy
    Use the given types, defaults to all Entity types
  • withTypeClasses
    Use the given types, defaults to all Entity types

Popular in Java

  • Parsing JSON documents to java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • Kernel (java.awt.image)
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JList (javax.swing)
  • Logger (org.slf4j)
    The main user interface to logging. It is expected that logging takes place through concrete impleme
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now