return new ElmoFinder<Taxon>(synonyms); return new ElmoFinder<Taxon>(Collections.<Taxon>emptyList());
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Nonnull @Override public Finder<Taxon> findSubTaxa() { try { log.debug("findSubTaxa() - {}", getDisplayName()); final List<Taxon> result = new ArrayList<Taxon>(); for (final Concept skosConcept : as(Concept.class).getSkosNarrowers()) { final QName id = skosConcept.getQName(); final InternalElmoTaxon concept = ((ElmoTaxonomy)taxonomy).conceptFactory.find(id); concept.setBindings(repository, taxonomy); result.add(concept); } return new ElmoFinder<Taxon>(result); } catch (NotFoundException e) { throw new RuntimeException(e); } }
@Override @Nonnull public Finder<Taxon> findSynonyms() { try // FIXME: workaround because the @rdf annotation of this.synonym doesn't work { final SesameManager em = (SesameManager)ElmoManagerThreadLocal.get(); final ResourceManager<Resource> rm = em.getResourceManager(); final RepositoryResult<Statement> triples = em.getConnection().getStatements(null, new URIImpl(ElmoTaxonomyVocabulary.URI_SCIENTIFIC_NAME_ID), rm.createResource(getLookup().lookup(Entity.class).getQName())); final List<Taxon> synonyms = new ArrayList<Taxon>(); while (triples.hasNext()) { final URI uri = (URI)triples.next().getSubject(); synonyms.add(((InternalElmoTaxonomy)taxonomy)._findConcept(uri.stringValue())); } return new ElmoFinder<Taxon>(synonyms); } catch (NotFoundException e) { throw new RuntimeException(e); } catch (RepositoryException e) { throw new RuntimeException(e); } }