use of org.molgenis.data.semantic.LabeledResource in project molgenis by molgenis.
the class UntypedTagService method removeAttributeTag.
@Override
public void removeAttributeTag(EntityType entityType, SemanticTag<Attribute, LabeledResource, LabeledResource> removeTag) {
Attribute attribute = removeTag.getSubject();
Entity attributeEntity = findAttributeEntity(entityType, attribute.getName());
List<Entity> tags = new ArrayList<>();
for (Entity tagEntity : attributeEntity.getEntities(AttributeMetadata.TAGS)) {
SemanticTag<Attribute, LabeledResource, LabeledResource> tag = SemanticTag.asTag(attribute, tagEntity);
if (!removeTag.equals(tag)) {
tags.add(tagEntity);
}
}
attributeEntity.set(AttributeMetadata.TAGS, tags);
dataService.update(ATTRIBUTE_META_DATA, attributeEntity);
}
Aggregations