Codota Logo
IEntityConverterFields.getExternalId
Code IndexAdd Codota to your IDE (free)

How to use
getExternalId
method
in
uk.gov.dstl.baleen.consumers.utils.IEntityConverterFields

Best Java code snippets using uk.gov.dstl.baleen.consumers.utils.IEntityConverterFields.getExternalId (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: dstl/baleen

private void addMentionProperties(Map<String, Object> mention, Traverser<Vertex> vt) {
 Vertex vertex = vt.get();
 mention
   .entrySet()
   .stream()
   .filter(property -> property.getValue() != null)
   .filter(property -> property.getKey() != fields.getExternalId())
   .forEach(property -> vertex.property(property.getKey(), coerce(property.getValue())));
}
origin: dstl/baleen

private void addRelationProperties(
  Map<String, Object> relation, Traverser<? extends Element> relationElement) {
 Element rel = relationElement.get();
 relation
   .entrySet()
   .stream()
   .filter(property -> property.getValue() != null)
   .filter(property -> property.getKey() != fields.getExternalId())
   .forEach(property -> setProperty(rel, property.getKey(), property.getValue()));
}
origin: uk.gov.dstl.baleen/baleen-graph

private void addRelationProperties(
  Map<String, Object> relation, Traverser<? extends Element> relationElement) {
 Element rel = relationElement.get();
 relation
   .entrySet()
   .stream()
   .filter(property -> property.getValue() != null)
   .filter(property -> property.getKey() != fields.getExternalId())
   .forEach(property -> setProperty(rel, property.getKey(), property.getValue()));
}
origin: uk.gov.dstl.baleen/baleen-graph

private void addMentionProperties(Map<String, Object> mention, Traverser<Vertex> vt) {
 Vertex vertex = vt.get();
 mention
   .entrySet()
   .stream()
   .filter(property -> property.getValue() != null)
   .filter(property -> property.getKey() != fields.getExternalId())
   .forEach(property -> vertex.property(property.getKey(), coerce(property.getValue())));
}
origin: dstl/baleen

/** Get the mongo db, collection and create some indexes */
@Override
public void doInitialize(UimaContext aContext) throws ResourceInitializationException {
 MongoDatabase db = mongoResource.getDB();
 entitiesCollection = db.getCollection(entitiesCollectionName);
 relationsCollection = db.getCollection(relationsCollectionName);
 documentsCollection = db.getCollection(documentsCollectionName);
 documentsCollection.createIndex(new Document(fields.getExternalId(), 1));
 entitiesCollection.createIndex(new Document(fields.getExternalId(), 1));
 relationsCollection.createIndex(new Document(fields.getExternalId(), 1));
 relationsCollection.createIndex(new Document(FIELD_DOCUMENT_ID, 1));
 entitiesCollection.createIndex(new Document(FIELD_DOCUMENT_ID, 1));
 stopFeatures = new HashSet<>();
 stopFeatures.add("uima.cas.AnnotationBase:sofa");
 stopFeatures.add("uk.gov.dstl.baleen.types.BaleenAnnotation:internalId");
}
origin: dstl/baleen

private void deleteAnyExistingContent(String documentId) {
 entitiesCollection.deleteMany(new Document(FIELD_DOCUMENT_ID, documentId));
 relationsCollection.deleteMany(new Document(FIELD_DOCUMENT_ID, documentId));
 documentsCollection.deleteMany(new Document(fields.getExternalId(), documentId));
}
origin: dstl/baleen

/** Get the mongo db, collection and create some indexes */
@Override
public void doInitialize(UimaContext aContext) throws ResourceInitializationException {
 MongoDatabase db = mongoResource.getDB();
 relationsCollection = db.getCollection(relationsCollectionName);
 relationsCollection.createIndex(new Document(fields.getExternalId(), 1));
 relationsCollection.createIndex(new Document(FIELD_SOURCE_VALUE, 1));
 relationsCollection.createIndex(new Document(FIELD_VALUE, 1));
 relationsCollection.createIndex(new Document(FIELD_TARGET_VALUE, 1));
 relationsCollection.createIndex(
   new Document(ImmutableMap.of(FIELD_SOURCE_VALUE, 1, FIELD_TARGET_VALUE, 1)));
 relationsCollection.createIndex(new Document(FIELD_DOCUMENT_ID, 1));
}
origin: dstl/baleen

/** Get the mongo db, collection and create some indexes */
@Override
public void doInitialize(UimaContext aContext) throws ResourceInitializationException {
 MongoDatabase db = mongoResource.getDB();
 eventsCollection = db.getCollection(eventsCollectionName);
 eventsCollection.createIndex(new Document(fields.getExternalId(), 1));
 eventsCollection.createIndex(new Document(FIELD_DOCUMENT_ID, 1));
 eventsCollection.createIndex(new Document(FIELD_TYPE, 1));
 eventsCollection.createIndex(new Document(FIELD_TYPES, 1));
 eventsCollection.createIndex(new Document(FIELD_TOKENS, 1));
 Set<String> stopFeatures = new HashSet<>();
 stopFeatures.add("uima.cas.AnnotationBase:sofa");
 stopFeatures.add("uk.gov.dstl.baleen.types.BaleenAnnotation:internalId");
 textClass = getTextClass();
}
origin: dstl/baleen

/**
 * Convert from a relation to a map.
 *
 * @param relation the relation to convert
 * @return a map containing the relation's fields (and history is required)
 */
public Map<String, Object> convertRelation(Relation relation) {
 Map<String, Object> map = new IgnoreEmptyKeyMapDecorator<>(Maps.newHashMap());
 convertFeatures(map, relation);
 if (outputHistory && documentHistory != null) {
  convertHistory(map, relation);
 }
 map.put(fields.getExternalId(), relation.getExternalId());
 return map;
}
origin: dstl/baleen

/**
 * Convert from an event to a map.
 *
 * @param event the relation to convert
 * @return a map containing the relation's fields (and history is required)
 */
public Map<String, Object> convertEvent(Event event) {
 Map<String, Object> map = new IgnoreEmptyKeyMapDecorator<>(Maps.newHashMap());
 convertFeatures(map, event);
 if (outputHistory && documentHistory != null) {
  convertHistory(map, event);
 }
 map.put(fields.getExternalId(), event.getExternalId());
 return map;
}
origin: dstl/baleen

/**
 * Convert from an entity to a map.
 *
 * @param entity the entity to convert
 * @return a map containing the entity's fields (and history is required)
 */
public Map<String, Object> convertEntity(Entity entity) {
 Map<String, Object> map = new IgnoreEmptyKeyMapDecorator<>(Maps.newHashMap());
 convertFeatures(map, entity);
 if (outputHistory && documentHistory != null) {
  convertHistory(map, entity);
 }
 map.put(fields.getExternalId(), entity.getExternalId());
 return map;
}
origin: uk.gov.dstl.baleen/baleen-graph

.stream()
.map(converter::convertEvent)
.filter(e -> !traversal.V(coerce(e.get(fields.getExternalId()))).hasNext())
.forEach(
  e -> {
     traversal
       .addV(EVENT)
       .property(T.id, coerce(e.get(fields.getExternalId())))
       .sideEffect(
         vt ->
             .stream()
             .filter(property -> property.getValue() != null)
             .filter(property -> property.getKey() != fields.getExternalId())
             .filter(property -> property.getKey() != "entities")
             .forEach(
origin: dstl/baleen

return new Document()
  .append(FIELD_DOCUMENT_ID, documentId)
  .append(fields.getExternalId(), ConsumerUtils.getExternalId(e.getValue()))
  .append(FIELD_LINKING, referenceTarget.getLinking())
  .append(
origin: uk.gov.dstl.baleen/baleen-graph

setIfValue(variables, fields.getExternalId(), getDocumentId(jCas));
origin: dstl/baleen

setIfValue(variables, fields.getExternalId(), getDocumentId(jCas));
origin: dstl/baleen

private void saveDocument(String documentId, JCas jCas) {
 Document doc = new Document();
 DocumentAnnotation da = getDocumentAnnotation(jCas);
 doc.append(fields.getExternalId(), documentId)
   .append(
     FIELD_DOCUMENT,
     new Document()
       .append(FIELD_DOCUMENT_TYPE, da.getDocType())
       .append(FIELD_DOCUMENT_SOURCE, da.getSourceUri())
       .append(FIELD_DOCUMENT_LANGUAGE, da.getLanguage())
       .append(FIELD_DOCUMENT_TIMESTAMP, new Date(da.getTimestamp()))
       .append(FIELD_DOCUMENT_CLASSIFICATION, da.getDocumentClassification())
       .append(FIELD_DOCUMENT_CAVEATS, toList(da.getDocumentCaveats()))
       .append(FIELD_DOCUMENT_RELEASABILITY, toList(da.getDocumentReleasability())));
 addPublishedIds(jCas, doc);
 addMetadata(jCas, doc);
 if (outputContent) {
  doc.append(FIELD_CONTENT, jCas.getDocumentText());
 }
 documentsCollection.insertOne(doc);
}
origin: uk.gov.dstl.baleen/baleen-graph

  traversal.V(sourceId).as(SOURCE).V(targetId).as(TARGET);
Object relationId = relation.get(fields.getExternalId());
origin: dstl/baleen

  traversal.V(sourceId).as(SOURCE).V(targetId).as(TARGET);
Object relationId = relation.get(fields.getExternalId());
origin: dstl/baleen

@SuppressWarnings("unchecked")
@Test
public void testReferenceTargets() throws AnalysisEngineProcessException {
 jCas.setDocumentText("Bill went to London. William came back.");
 String link = "http://test";
 Person p = Annotations.createPerson(jCas, 0, 4, "Bill");
 Person q = Annotations.createPerson(jCas, 21, 28, NAME_2);
 ReferenceTarget referenceTarget = Annotations.createReferenceTarget(jCas, p, q);
 referenceTarget.setLinking(link);
 ae.process(jCas);
 assertEquals(1, documents.count());
 assertEquals(1, entities.count());
 Document a = entities.find().first();
 assertEquals(2, ((List<Object>) a.get(Mongo.FIELD_ENTITIES)).size());
 assertEquals(2, ((List<Object>) a.get(Mongo.FIELD_ENTITIES)).size());
 assertEquals(link, a.getString(Mongo.FIELD_LINKING));
 assertEquals(
   ConsumerUtils.getExternalId(ImmutableList.of(p, q)), a.getString(fields.getExternalId()));
}
origin: dstl/baleen

    .toArray());
assertEquals(getDocumentAnnotation(jCas).getHash(), result.get(fields.getExternalId()));
uk.gov.dstl.baleen.consumers.utilsIEntityConverterFieldsgetExternalId

Popular methods of IEntityConverterFields

  • getHistory
  • getHistoryAction
  • getHistoryParameters
  • getHistoryReferrer
  • getHistoryTimestamp
  • getHistoryType
  • getType
  • getGeoJSON
  • getHistoryRecordable

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • orElseThrow (Optional)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JOptionPane (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
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