Class OntologyTagServiceImpl
- java.lang.Object
-
- org.molgenis.semanticsearch.service.impl.OntologyTagServiceImpl
-
- All Implemented Interfaces:
OntologyTagService,TagService<org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology>
public class OntologyTagServiceImpl extends Object implements OntologyTagService
Service to tag metadata with ontology terms.
-
-
Constructor Summary
Constructors Constructor Description OntologyTagServiceImpl(org.molgenis.data.DataService dataService, org.molgenis.ontology.core.service.OntologyService ontologyService, TagRepository tagRepository, org.molgenis.data.populate.IdGenerator idGenerator, org.molgenis.data.meta.model.TagMetadata tagMetadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OntologyTagaddAttributeTag(String entity, String attribute, String relationIRI, List<String> ontologyTermIRIs)voidaddAttributeTag(org.molgenis.data.meta.model.EntityType entityType, org.molgenis.data.semantic.SemanticTag<org.molgenis.data.meta.model.Attribute,org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology> tag)Tags an attribute.voidaddEntityTag(org.molgenis.data.semantic.SemanticTag<org.molgenis.data.meta.model.EntityType,org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology> tag)Tags an entity.org.molgenis.data.EntitygetTagEntity(org.molgenis.data.semantic.SemanticTag<?,org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology> tag)com.google.common.collect.Multimap<org.molgenis.data.semantic.Relation,org.molgenis.ontology.core.model.OntologyTerm>getTagsForAttribute(org.molgenis.data.meta.model.EntityType entityType, org.molgenis.data.meta.model.Attribute attribute)Retrieves all tags for an attribute, and groups them by relationIterable<org.molgenis.data.semantic.SemanticTag<org.molgenis.data.meta.model.EntityType,org.molgenis.data.semantic.LabeledResource,org.molgenis.data.semantic.LabeledResource>>getTagsForEntity(org.molgenis.data.meta.model.EntityType entityType)Retrieves all tags for an entity.Iterable<org.molgenis.data.semantic.SemanticTag<org.molgenis.data.meta.model.Package,org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology>>getTagsForPackage(org.molgenis.data.meta.model.Package aPackage)Retrieves all tags for a packagevoidremoveAllTagsFromEntity(String entityTypeId)Removes all tags for a given entityvoidremoveAttributeTag(String entity, String attribute, String relationIRI, String ontologyTermIRI)voidremoveAttributeTag(org.molgenis.data.meta.model.EntityType entityType, org.molgenis.data.semantic.SemanticTag<org.molgenis.data.meta.model.Attribute,org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology> removeTag)Removes attribute tagvoidremoveEntityTag(org.molgenis.data.semantic.SemanticTag<org.molgenis.data.meta.model.EntityType,org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology> tag)Removes an entity tag.Map<String,OntologyTag>tagAttributesInEntity(String entity, Map<org.molgenis.data.meta.model.Attribute,org.molgenis.ontology.core.model.OntologyTerm> tags)
-
-
-
Constructor Detail
-
OntologyTagServiceImpl
public OntologyTagServiceImpl(org.molgenis.data.DataService dataService, org.molgenis.ontology.core.service.OntologyService ontologyService, TagRepository tagRepository, org.molgenis.data.populate.IdGenerator idGenerator, org.molgenis.data.meta.model.TagMetadata tagMetadata)
-
-
Method Detail
-
removeAttributeTag
public void removeAttributeTag(String entity, String attribute, String relationIRI, String ontologyTermIRI)
- Specified by:
removeAttributeTagin interfaceOntologyTagService
-
removeAttributeTag
public void removeAttributeTag(org.molgenis.data.meta.model.EntityType entityType, org.molgenis.data.semantic.SemanticTag<org.molgenis.data.meta.model.Attribute,org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology> removeTag)Description copied from interface:TagServiceRemoves attribute tag- Specified by:
removeAttributeTagin interfaceTagService<org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology>- Parameters:
entityType- the entity the tagged attribute sits onremoveTag- the tag to remove
-
getTagsForAttribute
public com.google.common.collect.Multimap<org.molgenis.data.semantic.Relation,org.molgenis.ontology.core.model.OntologyTerm> getTagsForAttribute(org.molgenis.data.meta.model.EntityType entityType, org.molgenis.data.meta.model.Attribute attribute)Description copied from interface:TagServiceRetrieves all tags for an attribute, and groups them by relation- Specified by:
getTagsForAttributein interfaceTagService<org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology>
-
getTagsForPackage
public Iterable<org.molgenis.data.semantic.SemanticTag<org.molgenis.data.meta.model.Package,org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology>> getTagsForPackage(org.molgenis.data.meta.model.Package aPackage)
Description copied from interface:TagServiceRetrieves all tags for a package- Specified by:
getTagsForPackagein interfaceTagService<org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology>
-
addAttributeTag
public void addAttributeTag(org.molgenis.data.meta.model.EntityType entityType, org.molgenis.data.semantic.SemanticTag<org.molgenis.data.meta.model.Attribute,org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology> tag)Description copied from interface:TagServiceTags an attribute.- Specified by:
addAttributeTagin interfaceTagService<org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology>- Parameters:
entityType- the entity the tagged attribute sits ontag- the tag to add
-
addAttributeTag
public OntologyTag addAttributeTag(String entity, String attribute, String relationIRI, List<String> ontologyTermIRIs)
- Specified by:
addAttributeTagin interfaceOntologyTagService
-
getTagEntity
public org.molgenis.data.Entity getTagEntity(org.molgenis.data.semantic.SemanticTag<?,org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology> tag)
-
removeAllTagsFromEntity
@Transactional public void removeAllTagsFromEntity(String entityTypeId)
Description copied from interface:TagServiceRemoves all tags for a given entity- Specified by:
removeAllTagsFromEntityin interfaceTagService<org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology>- Parameters:
entityTypeId- the name of the entity for which all tags should be removed
-
tagAttributesInEntity
@Transactional public Map<String,OntologyTag> tagAttributesInEntity(String entity, Map<org.molgenis.data.meta.model.Attribute,org.molgenis.ontology.core.model.OntologyTerm> tags)
- Specified by:
tagAttributesInEntityin interfaceOntologyTagService
-
addEntityTag
public void addEntityTag(org.molgenis.data.semantic.SemanticTag<org.molgenis.data.meta.model.EntityType,org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology> tag)
Description copied from interface:TagServiceTags an entity.- Specified by:
addEntityTagin interfaceTagService<org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology>- Parameters:
tag- the tag to add
-
removeEntityTag
public void removeEntityTag(org.molgenis.data.semantic.SemanticTag<org.molgenis.data.meta.model.EntityType,org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology> tag)
Description copied from interface:TagServiceRemoves an entity tag.- Specified by:
removeEntityTagin interfaceTagService<org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology>- Parameters:
tag- the tag to remove
-
getTagsForEntity
public Iterable<org.molgenis.data.semantic.SemanticTag<org.molgenis.data.meta.model.EntityType,org.molgenis.data.semantic.LabeledResource,org.molgenis.data.semantic.LabeledResource>> getTagsForEntity(org.molgenis.data.meta.model.EntityType entityType)
Description copied from interface:TagServiceRetrieves all tags for an entity.- Specified by:
getTagsForEntityin interfaceTagService<org.molgenis.ontology.core.model.OntologyTerm,org.molgenis.ontology.core.model.Ontology>
-
-