Search in sources :

Example 1 with ATTRIBUTES

use of org.molgenis.data.meta.model.EntityTypeMetadata.ATTRIBUTES in project molgenis by molgenis.

the class UntypedTagService method findAttributeEntity.

private Entity findAttributeEntity(EntityType entityType, String attributeName) {
    Entity entityTypeEntity = dataService.findOneById(ENTITY_TYPE_META_DATA, entityType.getId());
    Optional<Entity> result = stream(entityTypeEntity.getEntities(ATTRIBUTES).spliterator(), false).filter(att -> attributeName.equals(att.getString(AttributeMetadata.NAME))).findFirst();
    return result.orElse(null);
}
Also used : ArrayListMultimap(com.google.common.collect.ArrayListMultimap) SemanticTag(org.molgenis.data.semantic.SemanticTag) LoggerFactory(org.slf4j.LoggerFactory) TagRepository(org.molgenis.semanticsearch.repository.TagRepository) QueryImpl(org.molgenis.data.support.QueryImpl) Multimap(com.google.common.collect.Multimap) RunAsSystem(org.molgenis.security.core.runas.RunAsSystem) ArrayList(java.util.ArrayList) Relation(org.molgenis.data.semantic.Relation) ENTITY_TYPE_META_DATA(org.molgenis.data.meta.model.EntityTypeMetadata.ENTITY_TYPE_META_DATA) Lists(com.google.common.collect.Lists) ImmutableList(com.google.common.collect.ImmutableList) Objects.requireNonNull(java.util.Objects.requireNonNull) LabeledResource(org.molgenis.data.semantic.LabeledResource) ATTRIBUTE_META_DATA(org.molgenis.data.meta.model.AttributeMetadata.ATTRIBUTE_META_DATA) Logger(org.slf4j.Logger) TagService(org.molgenis.semanticsearch.service.TagService) List(java.util.List) PACKAGE(org.molgenis.data.meta.model.PackageMetadata.PACKAGE) ATTRIBUTES(org.molgenis.data.meta.model.EntityTypeMetadata.ATTRIBUTES) StreamSupport.stream(java.util.stream.StreamSupport.stream) org.molgenis.data.meta.model(org.molgenis.data.meta.model) DataService(org.molgenis.data.DataService) Package(org.molgenis.data.meta.model.Package) Optional(java.util.Optional) UnknownEntityException(org.molgenis.data.UnknownEntityException) Entity(org.molgenis.data.Entity) Entity(org.molgenis.data.Entity)

Aggregations

ArrayListMultimap (com.google.common.collect.ArrayListMultimap)1 ImmutableList (com.google.common.collect.ImmutableList)1 Lists (com.google.common.collect.Lists)1 Multimap (com.google.common.collect.Multimap)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Objects.requireNonNull (java.util.Objects.requireNonNull)1 Optional (java.util.Optional)1 StreamSupport.stream (java.util.stream.StreamSupport.stream)1 DataService (org.molgenis.data.DataService)1 Entity (org.molgenis.data.Entity)1 UnknownEntityException (org.molgenis.data.UnknownEntityException)1 org.molgenis.data.meta.model (org.molgenis.data.meta.model)1 ATTRIBUTE_META_DATA (org.molgenis.data.meta.model.AttributeMetadata.ATTRIBUTE_META_DATA)1 ATTRIBUTES (org.molgenis.data.meta.model.EntityTypeMetadata.ATTRIBUTES)1 ENTITY_TYPE_META_DATA (org.molgenis.data.meta.model.EntityTypeMetadata.ENTITY_TYPE_META_DATA)1 Package (org.molgenis.data.meta.model.Package)1 PACKAGE (org.molgenis.data.meta.model.PackageMetadata.PACKAGE)1 LabeledResource (org.molgenis.data.semantic.LabeledResource)1 Relation (org.molgenis.data.semantic.Relation)1