org.molgenis.data.Entity.set()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中org.molgenis.data.Entity.set()方法的一些代码示例,展示了Entity.set()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.set()方法的具体详情如下:
包路径:org.molgenis.data.Entity
类名称:Entity
方法名:set

Entity.set介绍

暂无

代码示例

代码示例来源:origin: org.molgenis/molgenis-data-annotators

@Override
public void addSettings(String annotationSourceFileName)
{
  pluginSettings.set(fileLocationAttributeName, annotationSourceFileName);
}

代码示例来源:origin: org.molgenis/molgenis-genetics-diag

protected void createEntities(List<String> hpoTerms, Map<String, String> geneMap, Scanner rowScanner, String gene,
    int i, List<Entity> entities)
{
  Entity entity = geneNetworkScoreFactory.create();
  entity.set(GeneNetworkScoreMetaData.ENSEMBL_ID, gene);
  entity.set(GeneNetworkScoreMetaData.HPO, hpoTerms.get(i));
  entity.set(GeneNetworkScoreMetaData.SCORE, Double.parseDouble(rowScanner.next()));
  entity.set(GeneNetworkScoreMetaData.HUGO_SYMBOL, geneMap.get(gene));
  entities.add(entity);
}

代码示例来源:origin: org.molgenis/molgenis-data-annotators

private Entity getEmptyEffectsEntity(Entity sourceEntity, EntityType effectsEMD)
{
  Entity effect = new DynamicEntity(effectsEMD);
  effect.set(ID, idGenerator.generateId());
  effect.set(VARIANT, sourceEntity);
  return effect;
}

代码示例来源:origin: org.molgenis/molgenis-omx-biobankconnect

@Override
public Entity next()
{
  Entity entity = new MapEntity();
  entity.set(ONTOLOGY_IRI, ontologyLoader.getOntologyIRI());
  entity.set(ONTOLOGY_NAME, ontologyLoader.getOntologyName());
  entity.set(ENTITY_TYPE, TYPE_ONTOLOGY);
  return entity;
}

代码示例来源:origin: org.molgenis/molgenis-data-mapper

/**
 * Creates a new {@link DynamicEntity} for this MappingProject. Doesn't yet fill the {@link EntityMapping}s.
 */
private Entity toMappingTargetEntity(MappingTarget mappingTarget, List<Entity> entityMappingEntities)
{
  Entity mappingTargetEntity = new DynamicEntity(mappingTargetMetaData);
  mappingTargetEntity.set(MappingProjectMetaData.IDENTIFIER, mappingTarget.getIdentifier());
  mappingTargetEntity.set(MappingTargetMetaData.TARGET, mappingTarget.getTarget().getId());
  mappingTargetEntity.set(MappingTargetMetaData.ENTITY_MAPPINGS, entityMappingEntities);
  return mappingTargetEntity;
}

代码示例来源:origin: org.molgenis/molgenis-semantic-mapper

/**
 * Creates a new {@link DynamicEntity} for this MappingProject. Doesn't yet fill the {@link
 * EntityMapping}s.
 */
private Entity toMappingTargetEntity(
  MappingTarget mappingTarget, List<Entity> entityMappingEntities) {
 Entity mappingTargetEntity = new DynamicEntity(mappingTargetMetaData);
 mappingTargetEntity.set(MappingProjectMetaData.IDENTIFIER, mappingTarget.getIdentifier());
 mappingTargetEntity.set(MappingTargetMetaData.TARGET, mappingTarget.getTarget().getId());
 mappingTargetEntity.set(MappingTargetMetaData.ENTITY_MAPPINGS, entityMappingEntities);
 return mappingTargetEntity;
}

代码示例来源:origin: org.molgenis/molgenis-data-mapper

private Entity toEntityMappingEntity(EntityMapping entityMapping, List<Entity> attributeMappingEntities)
  {
    Entity entityMappingEntity = new DynamicEntity(entityMappingMetaData);
    entityMappingEntity.set(EntityMappingMetaData.IDENTIFIER, entityMapping.getIdentifier());
    entityMappingEntity.set(EntityMappingMetaData.SOURCE_ENTITY_TYPE, entityMapping.getName());
    entityMappingEntity.set(EntityMappingMetaData.TARGET_ENTITY_TYPE,
        entityMapping.getTargetEntityType() != null ? entityMapping.getTargetEntityType().getId() : null);
    entityMappingEntity.set(EntityMappingMetaData.ATTRIBUTE_MAPPINGS, attributeMappingEntities);
    return entityMappingEntity;
  }
}

代码示例来源:origin: org.molgenis/molgenis-ontology-core

private Entity addEntry(String term, PubMedTFEntity pubMedTFEntity, DataService dataService) {
 if (pubMedTFEntity == null) return null;
 // FIXME remove reference to getApplicationContext
 TermFrequencyMetaData termFrequencyEntityType =
   getApplicationContext().getBean(TermFrequencyMetaData.class);
 Entity entity = new DynamicEntity(termFrequencyEntityType);
 entity.set(TERM, term);
 entity.set(FREQUENCY, pubMedTFEntity.getFrequency());
 entity.set(OCCURRENCE, pubMedTFEntity.getOccurrence());
 dataService.add(TERM_FREQUENCY, entity);
 return entity;
}

代码示例来源:origin: org.molgenis/molgenis-ontology

@Override
 public Entity next() {
  Entity entity = iterator.next();
  if (isEmpty(entity.getString(ALLOWED_IDENTIFIER))) {
   DynamicEntity dynamicEntity = new DynamicEntity(getEntityType());
   dynamicEntity.set(entity);
   entity = dynamicEntity;
   entity.set(ALLOWED_IDENTIFIER, String.valueOf(count.incrementAndGet()));
  }
  return entity;
 }
};

代码示例来源:origin: org.molgenis/molgenis-settings

@Override
public void set(String attributeName, Object value) {
 Entity entity = getEntity();
 entity.set(attributeName, value);
 updateEntity(entity);
}

代码示例来源:origin: org.molgenis/molgenis-semantic-mapper

private void applyMappingToAttribute(
  AttributeMapping attributeMapping,
  Entity sourceEntity,
  Entity target,
  EntityType entityType,
  int depth) {
 String targetAttributeName = attributeMapping.getTargetAttribute().getName();
 Object typedValue = algorithmService.apply(attributeMapping, sourceEntity, entityType, depth);
 target.set(targetAttributeName, typedValue);
}

代码示例来源:origin: org.molgenis/molgenis-data-mapper

private void applyMappingToAttribute(AttributeMapping attributeMapping, Entity sourceEntity, Entity target,
    EntityType entityType)
{
  String targetAttributeName = attributeMapping.getTargetAttribute().getName();
  Object typedValue = algorithmService.apply(attributeMapping, sourceEntity, entityType);
  target.set(targetAttributeName, typedValue);
}

代码示例来源:origin: org.molgenis/molgenis-semantic-search

@Override
public void addAttributeTag(
  EntityType entityType, SemanticTag<Attribute, LabeledResource, LabeledResource> tag) {
 Entity entity = findAttributeEntity(entityType, tag.getSubject().getName());
 List<Entity> tags = new ArrayList<>();
 for (Entity tagEntity : entity.getEntities(AttributeMetadata.TAGS)) {
  tags.add(tagEntity);
 }
 tags.add(getTagEntity(tag));
 entity.set(AttributeMetadata.TAGS, tags);
 dataService.update(ATTRIBUTE_META_DATA, entity);
}

代码示例来源:origin: org.molgenis/molgenis-data-semanticsearch

@Override
public void addAttributeTag(EntityType entityType, SemanticTag<Attribute, LabeledResource, LabeledResource> tag)
{
  Entity entity = findAttributeEntity(entityType, tag.getSubject().getName());
  List<Entity> tags = new ArrayList<Entity>();
  for (Entity tagEntity : entity.getEntities(AttributeMetadata.TAGS))
  {
    tags.add(tagEntity);
  }
  tags.add(getTagEntity(tag));
  entity.set(AttributeMetadata.TAGS, tags);
  dataService.update(ATTRIBUTE_META_DATA, entity);
}

代码示例来源:origin: org.molgenis/molgenis-semantic-search

@Override
public void addAttributeTag(
  EntityType entityType, SemanticTag<Attribute, OntologyTerm, Ontology> tag) {
 Entity entity = findAttributeEntity(entityType.getId(), tag.getSubject().getName());
 List<Entity> tags = new ArrayList<>();
 for (Entity tagEntity : entity.getEntities(AttributeMetadata.TAGS)) {
  tags.add(tagEntity);
 }
 tags.add(getTagEntity(tag));
 entity.set(AttributeMetadata.TAGS, tags);
 dataService.update(ATTRIBUTE_META_DATA, entity);
}

代码示例来源:origin: org.molgenis/molgenis-data-semanticsearch

@Override
public void addAttributeTag(EntityType entityType, SemanticTag<Attribute, OntologyTerm, Ontology> tag)
{
  Entity entity = findAttributeEntity(entityType.getId(), tag.getSubject().getName());
  List<Entity> tags = new ArrayList<Entity>();
  for (Entity tagEntity : entity.getEntities(AttributeMetadata.TAGS))
  {
    tags.add(tagEntity);
  }
  tags.add(getTagEntity(tag));
  entity.set(AttributeMetadata.TAGS, tags);
  dataService.update(ATTRIBUTE_META_DATA, entity);
}

代码示例来源:origin: org.molgenis/molgenis-jobs

private void tryUpdate(JobExecution jobExecution) {
  Entity jobExecutionCopy = new DynamicEntity(jobExecution.getEntityType());
  jobExecutionCopy.set(jobExecution);

  try {
   dataService.update(jobExecutionCopy.getEntityType().getId(), jobExecutionCopy);
  } catch (Exception ex) {
   LOG.warn("Error updating job execution", ex);
  }
 }
}

代码示例来源:origin: org.molgenis/molgenis-data-semanticsearch

@Override
public void removeAttributeTag(String entity, String attribute, String relationIRI, String ontologyTermIRI)
{
  Entity attributeEntity = findAttributeEntity(entity, attribute);
  Iterable<Entity> tags = attributeEntity.getEntities(AttributeMetadata.TAGS);
  Iterable<Entity> newTags = Iterables.filter(tags, e -> !isSameTag(relationIRI, ontologyTermIRI, e));
  attributeEntity.set(AttributeMetadata.TAGS, newTags);
  dataService.update(ATTRIBUTE_META_DATA, attributeEntity);
  updateEntityTypeEntityWithNewAttributeEntity(entity, attribute, attributeEntity);
}

代码示例来源:origin: org.molgenis/molgenis-data-mapper

private Entity applyMappingToEntity(EntityMapping sourceMapping, Entity sourceEntity, EntityType targetMetaData)
{
  Entity target = new DynamicEntity(targetMetaData);
  if (targetMetaData.getAttribute(SOURCE) != null)
  {
    target.set(SOURCE, sourceMapping.getName());
  }
  sourceMapping.getAttributeMappings().forEach(
      attributeMapping -> applyMappingToAttribute(attributeMapping, sourceEntity, target,
          sourceMapping.getSourceEntityType()));
  return target;
}

代码示例来源:origin: org.molgenis/molgenis-one-click-importer

private void setRowValueForAttribute(Entity row, int index, Column column) {
 String attributeName = oneClickImporterNamingService.asValidColumnName(column.getName());
 Object dataValue = column.getDataValues().get(index);
 EntityType rowType = row.getEntityType();
 Attribute attribute = rowType.getAttribute(attributeName);
 Object castedValue =
   oneClickImporterService.castValueAsAttributeType(dataValue, attribute.getDataType());
 row.set(attributeName, castedValue);
}

相关文章