use of org.molgenis.ontology.core.model.Ontology in project molgenis by molgenis.
the class OntologyTagServiceTest method testGetTagEntity.
@Test
public void testGetTagEntity() {
Tag expected = tagFactory.create();
expected.set(TagMetadata.ID, "1233");
expected.set(TagMetadata.OBJECT_IRI, "http://edamontology.org/data_3031");
expected.set(TagMetadata.LABEL, "Core data");
expected.set(TagMetadata.RELATION_IRI, "http://molgenis.org/biobankconnect/instanceOf");
expected.set(TagMetadata.RELATION_LABEL, "instanceOf");
expected.set(TagMetadata.CODE_SYSTEM, "http://edamontology.org");
OntologyTerm coreData = mock(OntologyTerm.class);
when(coreData.getIRI()).thenReturn("http://edamontology.org/data_3031");
when(coreData.getLabel()).thenReturn("Core data");
Ontology edamOntology = mock(Ontology.class);
when(edamOntology.getIRI()).thenReturn("http://edamontology.org");
SemanticTag<Object, OntologyTerm, Ontology> tag = new SemanticTag<>("1233", null, Relation.instanceOf, coreData, edamOntology);
when(tagRepository.getTagEntity("http://edamontology.org/data_3031", "Core data", Relation.instanceOf, "http://edamontology.org")).thenReturn(expected);
assertEquals(ontologyTagService.getTagEntity(tag), expected);
}
Aggregations