public Taxon initialize (final @Nonnull Taxon taxon) { getLookup().lookup(Concept.class).getSkosNarrowers().add(taxon.getLookup().lookup(Concept.class)); // as(Concept.class).getSkosNarrowers().add(taxon.as(Concept.class)); FIXME return taxon; } });
private void addStatement (final @Nonnull String uri, final @Nonnull String string) { final SesameManager em = (SesameManager)ElmoManagerThreadLocal.get(); final ResourceManager<Resource> rm = em.getResourceManager(); try { em.getConnection().add(rm.createResource(getLookup().lookup(Entity.class).getQName()), new URIImpl(uri), em.getLiteralManager().getLiteral(string)); } catch (RepositoryException e) { throw new RuntimeException(e); } }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @Nonnull public Id getScientificNameId() throws NotFoundException { 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(rm.createResource(getLookup().lookup(Entity.class).getQName()), new URIImpl(ElmoTaxonomyVocabulary.URI_SCIENTIFIC_NAME_ID), null); if (!triples.hasNext()) { throw new NotFoundException("scientificNameId"); } final Statement triple = triples.next(); final Literal uri = (Literal)triple.getObject(); return new Id(uri.stringValue()); } catch (RepositoryException e) { throw new RuntimeException(e); } }
final RepositoryResult<Statement> triples = em.getConnection().getStatements(rm.createResource(getLookup().lookup(Entity.class).getQName()), new URIImpl(ElmoTaxonomyVocabulary.URI_SCIENTIFIC_NAME_ID), null);