From: <rv...@us...> - 2010-03-16 16:47:30
|
Revision: 598 http://treebase.svn.sourceforge.net/treebase/?rev=598&view=rev Author: rvos Date: 2010-03-16 16:47:24 +0000 (Tue, 16 Mar 2010) Log Message: ----------- Added getAnnotations() method, which returns skos: predicates to link to ubio and ncbi. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/Taxon.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/Taxon.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/Taxon.java 2010-03-16 16:46:12 UTC (rev 597) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/Taxon.java 2010-03-16 16:47:24 UTC (rev 598) @@ -5,6 +5,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.List; import javax.persistence.AttributeOverride; import javax.persistence.CascadeType; @@ -20,7 +21,9 @@ import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Index; +import org.cipres.treebase.Constants; import org.cipres.treebase.domain.AbstractPersistedObject; +import org.cipres.treebase.domain.Annotation; import org.cipres.treebase.domain.TBPersistable; /** @@ -245,5 +248,23 @@ public String getLabel() { return getName(); } + + @Transient + public List<Annotation> getAnnotations() { + List<Annotation> annotations = super.getAnnotations(); + try { + if ( null != getNcbiTaxId() ) { + annotations.add(new Annotation(Constants.SKOSURI,"skos:exactMatch",Constants.NCBITaxonomyBase + getNcbiTaxId())); + annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.ncbi", getNcbiTaxId())); + } + if ( null != getUBioNamebankId() ) { + annotations.add(new Annotation(Constants.SKOSURI,"skos:exactMatch",Constants.uBioBase + getUBioNamebankId())); + annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.ubio", getUBioNamebankId())); + } + } catch ( Exception e ) { + e.printStackTrace(); + } + return annotations; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |