setDisplayNames(as(Entity.class), displayable); final Concept skosConcept = as(Concept.class); skosConcept.getSkosInSchemes().add(taxonomy.as(ConceptScheme.class)); addStatement(ElmoTaxonomyVocabulary.URI_SCIENTIFIC_NAME, scientificName); // FIXME: workaround because the @rdf annotation doesn't work addStatement(ElmoTaxonomyVocabulary.URI_SPECIFIC_EPITHET, specificEpithet); // FIXME: workaround because the @rdf annotation doesn't work addStatement(ElmoTaxonomyVocabulary.URI_SCIENTIFIC_NAME_ID, scientificNameId); // FIXME: workaround because the @rdf annotation of this.scientificNameId doesn't work addStatement(ElmoTaxonomyVocabulary.URI_TAXON_RANK, rankAsString); // FIXME: workaround because the @rdf annotation of this.rank doesn't work
/******************************************************************************************************************* * * {@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); } }
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; } });
new ArrayList<Taxon>(getAnonymousSynonym().findSynonyms().results()); if (as(Entity.class).getQName().equals(i.next().as(Entity.class).getQName()))
private static void setDisplayNames (final @Nonnull Entity entity, final @Nonnull LocalizedDisplayable displayable) { final SortedMap<String, Locale> sortedMap = new TreeMap<String, Locale>(); for (final Entry<Locale, String> entry : displayable.getDisplayNames().entrySet()) { if (!entry.getValue().equals("")) { sortedMap.put(languageCode(entry.getKey()), entry.getKey()); } } for (final Entry<String, Locale> entry : sortedMap.entrySet()) { final Locale locale = entry.getValue(); RDFUtils.setDisplayName(entity, displayable.getDisplayName(locale), locale); } }
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);