@Test void testGetOntologyTerm() { @SuppressWarnings("unchecked") Query<org.molgenis.ontology.core.meta.OntologyTerm> query = mock(Query.class, RETURNS_SELF); when(dataService.query(ONTOLOGY_TERM, org.molgenis.ontology.core.meta.OntologyTerm.class)) .thenReturn(query); when(query.eq(ONTOLOGY_TERM_IRI, "http: .thenReturn(ontologyTermEntity); String[] iris = {"http: OntologyTerm ontologyTerm = ontologyTermRepository.getOntologyTerm(iris); assertEquals( create("http: ontologyTerm); }
public OntologyTerm getOntologyTerm(String[] iris) { List<OntologyTerm> ontologyTerms = Lists.newArrayList(); for (String iri : iris) { org.molgenis.ontology.core.meta.OntologyTerm ontologyTermEntity = dataService .query(ONTOLOGY_TERM, org.molgenis.ontology.core.meta.OntologyTerm.class) .eq(ONTOLOGY_TERM_IRI, iri) .findOne(); OntologyTerm ontologyTerm = toOntologyTerm(ontologyTermEntity); if (ontologyTerm == null) { return null; } ontologyTerms.add(ontologyTerm); } return OntologyTerm.and(ontologyTerms.toArray(new OntologyTerm[0])); }
OntologyTermRepository { public OntologyTerm getOntologyTerm(String[] iris) { List<OntologyTerm> ontologyTerms = Lists.newArrayList(); for (String iri : iris) { org.molgenis.ontology.core.meta.OntologyTerm ontologyTermEntity = dataService .query(ONTOLOGY_TERM, org.molgenis.ontology.core.meta.OntologyTerm.class) .eq(ONTOLOGY_TERM_IRI, iri) .findOne(); OntologyTerm ontologyTerm = toOntologyTerm(ontologyTermEntity); if (ontologyTerm == null) { return null; } ontologyTerms.add(ontologyTerm); } return OntologyTerm.and(ontologyTerms.toArray(new OntologyTerm[0])); } }
OntologyTermRepository { public OntologyTerm getOntologyTerm(String[] iris) { List<OntologyTerm> ontologyTerms = Lists.newArrayList(); for (String iri : iris) { org.molgenis.ontology.core.meta.OntologyTerm ontologyTermEntity = dataService .query(ONTOLOGY_TERM, org.molgenis.ontology.core.meta.OntologyTerm.class) .eq(ONTOLOGY_TERM_IRI, iri) .findOne(); OntologyTerm ontologyTerm = toOntologyTerm(ontologyTermEntity); if (ontologyTerm == null) { return null; } ontologyTerms.add(ontologyTerm); } return OntologyTerm.and(ontologyTerms.toArray(new OntologyTerm[0])); } OntologyTermRepository(DataService dataService); }
OntologyTermRepository { public OntologyTerm getOntologyTerm(String[] iris) { List<OntologyTerm> ontologyTerms = Lists.newArrayList(); for (String iri : iris) { org.molgenis.ontology.core.meta.OntologyTerm ontologyTermEntity = dataService .query(ONTOLOGY_TERM, org.molgenis.ontology.core.meta.OntologyTerm.class) .eq(ONTOLOGY_TERM_IRI, iri) .findOne(); OntologyTerm ontologyTerm = toOntologyTerm(ontologyTermEntity); if (ontologyTerm == null) { return null; } ontologyTerms.add(ontologyTerm); } return OntologyTerm.and(ontologyTerms.toArray(new OntologyTerm[0])); } OntologyTermRepository(DataService dataService); List<OntologyTerm> findExcatOntologyTerms(
      List<String> ontologyIds, Set<String> terms, int pageSize); List<OntologyTerm> findOntologyTerms(
      List<String> ontologyIds, Set<String> terms, int pageSize); List<OntologyTerm> getAllOntologyTerms(String ontologyId); OntologyTerm getOntologyTerm(String[] iris); int getOntologyTermDistance(OntologyTerm ontologyTerm1, OntologyTerm ontologyTerm2); int calculateNodePathDistance(String nodePath1, String nodePath2); List<OntologyTerm> getChildren(OntologyTerm ontologyTerm); List<OntologyTerm> getChildOntologyTermsByNodePath(
      Entity ontologyEntity, Entity nodePathEntity); }
OntologyTermRepository { public OntologyTerm getOntologyTerm(String[] iris) { List<OntologyTerm> ontologyTerms = Lists.newArrayList(); for (String iri : iris) { org.molgenis.ontology.core.meta.OntologyTerm ontologyTermEntity = dataService .query(ONTOLOGY_TERM, org.molgenis.ontology.core.meta.OntologyTerm.class) .eq(ONTOLOGY_TERM_IRI, iri) .findOne(); OntologyTerm ontologyTerm = toOntologyTerm(ontologyTermEntity); if (ontologyTerm == null) { return null; } ontologyTerms.add(ontologyTerm); } return OntologyTerm.and(ontologyTerms.toArray(new OntologyTerm[0])); } OntologyTermRepository(DataService dataService); List<OntologyTerm> findExcatOntologyTerms(
      List<String> ontologyIds, Set<String> terms, int pageSize); List<OntologyTerm> findOntologyTerms(
      List<String> ontologyIds, Set<String> terms, int pageSize); List<OntologyTerm> getAllOntologyTerms(String ontologyId); OntologyTerm getOntologyTerm(String[] iris); int getOntologyTermDistance(OntologyTerm ontologyTerm1, OntologyTerm ontologyTerm2); int calculateNodePathDistance(String nodePath1, String nodePath2); List<OntologyTerm> getChildren(OntologyTerm ontologyTerm); List<OntologyTerm> getChildOntologyTermsByNodePath(
      Entity ontologyEntity, Entity nodePathEntity);  }