You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
(1) |
Apr
(14) |
May
(36) |
Jun
(148) |
Jul
(33) |
Aug
(2) |
Sep
(17) |
Oct
(42) |
Nov
(137) |
Dec
(88) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(89) |
Feb
(80) |
Mar
(217) |
Apr
(76) |
May
(5) |
Jun
(39) |
Jul
(35) |
Aug
(4) |
Sep
(7) |
Oct
(14) |
Nov
(12) |
Dec
(9) |
2011 |
Jan
(6) |
Feb
(4) |
Mar
(11) |
Apr
(55) |
May
(90) |
Jun
(39) |
Jul
(15) |
Aug
(15) |
Sep
(23) |
Oct
(12) |
Nov
(17) |
Dec
(20) |
2012 |
Jan
(22) |
Feb
(63) |
Mar
|
Apr
(1) |
May
(6) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(3) |
Feb
(6) |
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <rv...@us...> - 2010-03-15 01:32:57
|
Revision: 589 http://treebase.svn.sourceforge.net/treebase/?rev=589&view=rev Author: rvos Date: 2010-03-15 01:32:50 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Now stores the URIs for Annotation predicates Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/Constants.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/Constants.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/Constants.java 2010-03-15 01:31:23 UTC (rev 588) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/Constants.java 2010-03-15 01:32:50 UTC (rev 589) @@ -1,7 +1,16 @@ package org.cipres.treebase; +import java.net.URI; + public class Constants { public static final int MIN_INTERESTING_PHYLOCHAR_ID = 7; + public static final URI DwCURI = URI.create("http://rs.tdwg.org/dwc/terms/"); + public static final URI TBTermsURI = URI.create("http://treebase.org/terms#"); + public static final URI DCTermsURI = URI.create("http://purl.org/dc/terms/"); + public static final URI DCURI = URI.create("http://purl.org/dc/elements/1.1/"); + public static final URI PrismURI = URI.create("http://prismstandard.org/namespaces/1.2/basic/"); + public static final URI BaseURI = URI.create("http://purl.org/PHYLO/TREEBASE/PHYLOWS/"); + public static final URI OWLURI = URI.create("http://www.w3.org/2002/07/owl#"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:31:30
|
Revision: 588 http://treebase.svn.sourceforge.net/treebase/?rev=588&view=rev Author: rvos Date: 2010-03-15 01:31:23 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Changed Annotatable to NexmlWritable Removed Paths: ------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/Annotatable.java Deleted: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/Annotatable.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/Annotatable.java 2010-03-15 01:30:17 UTC (rev 587) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/Annotatable.java 2010-03-15 01:31:23 UTC (rev 588) @@ -1,5 +0,0 @@ -package org.cipres.treebase.domain; - -public interface Annotatable { - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:30:23
|
Revision: 587 http://treebase.svn.sourceforge.net/treebase/?rev=587&view=rev Author: rvos Date: 2010-03-15 01:30:17 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Now extends NexmlWritable. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/TBPersistable.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/TBPersistable.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/TBPersistable.java 2010-03-15 01:29:35 UTC (rev 586) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/TBPersistable.java 2010-03-15 01:30:17 UTC (rev 587) @@ -1,8 +1,6 @@ package org.cipres.treebase.domain; -import javax.persistence.Transient; - import org.cipres.treebase.NamespacedGUID; import org.cipres.treebase.PhyloWSPath; import org.cipres.treebase.TreebaseIDString; @@ -15,7 +13,7 @@ * @author Jin Ruan * */ -public interface TBPersistable { +public interface TBPersistable extends NexmlWritable { /** * Default column length for the String type in the database. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:29:41
|
Revision: 586 http://treebase.svn.sourceforge.net/treebase/?rev=586&view=rev Author: rvos Date: 2010-03-15 01:29:35 +0000 (Mon, 15 Mar 2010) Log Message: ----------- A simple interface for objects that are writable in nexml, and hence, for convenience, should have a uniform way to give their label (name/title/etc.) and semantic annotations. Added Paths: ----------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/NexmlWritable.java Copied: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/NexmlWritable.java (from rev 567, trunk/treebase-core/src/main/java/org/cipres/treebase/domain/Annotatable.java) =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/NexmlWritable.java (rev 0) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/NexmlWritable.java 2010-03-15 01:29:35 UTC (rev 586) @@ -0,0 +1,8 @@ +package org.cipres.treebase.domain; + +import java.util.List; + +public interface NexmlWritable { + public List<Annotation> getAnnotations (); + public String getLabel(); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:28:37
|
Revision: 585 http://treebase.svn.sourceforge.net/treebase/?rev=585&view=rev Author: rvos Date: 2010-03-15 01:28:29 +0000 (Mon, 15 Mar 2010) Log Message: ----------- This is a simple object that holds just enough to create a semantic annotation in nexml, or a triple in rdf. Added Paths: ----------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/Annotation.java Added: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/Annotation.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/Annotation.java (rev 0) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/Annotation.java 2010-03-15 01:28:29 UTC (rev 585) @@ -0,0 +1,55 @@ +package org.cipres.treebase.domain; + +import java.net.URI; + +public class Annotation { + private URI mURI; + private String mProperty; + private Object mValue; + + /** + * + * @param uri + * @param property + * @param value + */ + public Annotation (URI uri, String property, Object value) { + mURI = uri; + mProperty = property; + mValue = value; + } + + /** + * + * @return + */ + public URI getURI() { // XXX change me to getUri + return mURI; + } + + /** + * + * @return + */ + public String getProperty () { + return mProperty; + } + + /** + * + * @return + */ + public Object getValue() { + return mValue; + } + + /** + * + * @return + */ + public String getPrefix() { + String[] curie = mProperty.split(":"); + return curie[0]; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:25:54
|
Revision: 584 http://treebase.svn.sourceforge.net/treebase/?rev=584&view=rev Author: rvos Date: 2010-03-15 01:25:48 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getAnnotations() and getLabel() for nexml and rdf serialization. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java 2010-03-15 01:20:38 UTC (rev 583) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java 2010-03-15 01:25:48 UTC (rev 584) @@ -2,19 +2,22 @@ package org.cipres.treebase.domain; import java.io.Serializable; +import java.net.URI; +import java.util.ArrayList; import java.util.Comparator; - +import java.util.List; import javax.persistence.Column; import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.MappedSuperclass; import javax.persistence.Transient; import javax.persistence.Version; +import org.cipres.treebase.Constants; import org.cipres.treebase.NamespacedGUID; import org.cipres.treebase.PhyloWSPath; import org.cipres.treebase.TreebaseIDString; +import org.cipres.treebase.TreebaseUtil; import org.hibernate.annotations.GenericGenerator; /** @@ -100,5 +103,30 @@ public PhyloWSPath getPhyloWSPath() { return new PhyloWSPath(this); } + + /* + * (non-Javadoc) + * @see org.cipres.treebase.domain.Annotatable#getAnnotations() + */ + @Transient + public List<Annotation> getAnnotations() { + // This is called by child classes using super.getAnnotations() + // to get the common annotations out of the way + List<Annotation> annotations = new ArrayList<Annotation>(); + URI uri = URI.create(TreebaseUtil.getPurlDomain()+getPhyloWSPath()); + annotations.add(new Annotation(Constants.OWLURI,"owl:sameAs",uri)); + return annotations; + } + /* + * (non-Javadoc) + * @see org.cipres.treebase.domain.NexmlWritable#getLabel() + */ + @Transient + public String getLabel() { + // This is overridden by child classes that want a name/title/label + // to be serialized in nexml or rdf + return null; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:20:44
|
Revision: 583 http://treebase.svn.sourceforge.net/treebase/?rev=583&view=rev Author: rvos Date: 2010-03-15 01:20:38 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getLabel() for nexml and rdf serialization. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeBlock.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeBlock.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeBlock.java 2010-03-15 01:17:38 UTC (rev 582) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeBlock.java 2010-03-15 01:20:38 UTC (rev 583) @@ -276,5 +276,10 @@ return tlSet == null ? new ArrayList<TaxonLabel>() : tlSet.getTaxonLabelsReadOnly(); } + + @Transient + public String getLabel() { + return getTitle(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:17:47
|
Revision: 582 http://treebase.svn.sourceforge.net/treebase/?rev=582&view=rev Author: rvos Date: 2010-03-15 01:17:38 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getLabel() for nexml and rdf serialization. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTreeNode.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTreeNode.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTreeNode.java 2010-03-15 01:16:43 UTC (rev 581) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTreeNode.java 2010-03-15 01:17:38 UTC (rev 582) @@ -585,4 +585,10 @@ public boolean haveABCTopology(PhyloTreeNode n1, PhyloTreeNode n2) { return ! n1.nearestCommonAncestor(n2).isAncestorOf(this); } + + @Override + @Transient + public String getLabel() { + return getTaxonLabelAsString(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:16:49
|
Revision: 581 http://treebase.svn.sourceforge.net/treebase/?rev=581&view=rev Author: rvos Date: 2010-03-15 01:16:43 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getAnnotations() for nexml and rdf serialization. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2010-03-15 01:15:19 UTC (rev 580) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2010-03-15 01:16:43 UTC (rev 581) @@ -4,6 +4,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.Iterator; +import java.util.List; import java.util.Set; import javax.persistence.AttributeOverride; @@ -25,9 +26,11 @@ import mesquite.lib.MesquiteDouble; import mesquite.lib.StringUtil; +import org.cipres.treebase.Constants; import org.cipres.treebase.TreebaseIDString; import org.cipres.treebase.TreebaseUtil; import org.cipres.treebase.domain.AbstractPersistedObject; +import org.cipres.treebase.domain.Annotation; import org.cipres.treebase.domain.TBPersistable; import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.taxon.TaxonLabel; @@ -227,6 +230,7 @@ * * @return String */ + @Override @Column(name = "Label", length = TBPersistable.COLUMN_LENGTH_STRING) public String getLabel() { return mLabel; @@ -778,4 +782,26 @@ setRootNode(null); setNewickString(null); } + + @Transient + public List<Annotation> getAnnotations() { + List<Annotation> annotations = super.getAnnotations(); + if ( null != getId() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.tree", getId())); + } + if ( null != getKindDescription() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:kind.tree", getKindDescription())); + } + if ( null != getTypeDescription() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:type.tree", getTypeDescription())); + } + if ( null != getQualityDescription() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:quality.tree", getQualityDescription())); + } + if ( null != getnTax() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:ntax.tree", getnTax())); + } + return annotations; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:15:25
|
Revision: 580 http://treebase.svn.sourceforge.net/treebase/?rev=580&view=rev Author: rvos Date: 2010-03-15 01:15:19 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getLabel() for nexml and rdf serialization. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonVariant.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonVariant.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonVariant.java 2010-03-15 01:14:39 UTC (rev 579) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonVariant.java 2010-03-15 01:15:19 UTC (rev 580) @@ -9,6 +9,7 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; +import javax.persistence.Transient; import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Cache; @@ -169,4 +170,9 @@ public void setTB1LegacyId(Integer legacyId) { mTB1LegacyId = legacyId; } + + @Transient + public String getLabel() { + return getFullName(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:14:45
|
Revision: 579 http://treebase.svn.sourceforge.net/treebase/?rev=579&view=rev Author: rvos Date: 2010-03-15 01:14:39 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getLabel() for nexml and rdf serialization. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabelSet.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabelSet.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabelSet.java 2010-03-15 01:14:03 UTC (rev 578) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabelSet.java 2010-03-15 01:14:39 UTC (rev 579) @@ -252,5 +252,10 @@ pBuilder.append("\n"); } } + + @Transient + public String getLabel() { + return getTitle(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:14:09
|
Revision: 578 http://treebase.svn.sourceforge.net/treebase/?rev=578&view=rev Author: rvos Date: 2010-03-15 01:14:03 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getAnnotations() and getLabel() for nexml and rdf serialization. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabel.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabel.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabel.java 2010-03-15 01:13:21 UTC (rev 577) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabel.java 2010-03-15 01:14:03 UTC (rev 578) @@ -1,5 +1,9 @@ package org.cipres.treebase.domain.taxon; +import java.net.URI; +import java.util.List; +import java.util.Set; + import javax.persistence.AttributeOverride; import javax.persistence.CascadeType; import javax.persistence.Column; @@ -10,8 +14,12 @@ import javax.persistence.Table; import javax.persistence.Transient; +import org.cipres.treebase.Constants; +import org.cipres.treebase.TreebaseUtil; import org.cipres.treebase.domain.AbstractPersistedObject; +import org.cipres.treebase.domain.Annotation; import org.cipres.treebase.domain.TBPersistable; +import org.cipres.treebase.domain.admin.Person; import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.study.Submission; import org.hibernate.annotations.BatchSize; @@ -194,4 +202,35 @@ } return result; } + + @Transient + public List<Annotation> getAnnotations() { + List<Annotation> annotations = super.getAnnotations(); + if ( null != getNcbiTaxID() ) { + StringBuilder urlString = new StringBuilder(TreebaseUtil.getPurlDomain()); + getPhyloWSPath().getPath(urlString).append("NCBI:").append(getNcbiTaxID()); + annotations.add(new Annotation(Constants.DCTermsURI, "dc:relation", URI.create(urlString.toString()))); + annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.ncbi", "NCBI:" + getNcbiTaxID())); + annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.taxon", getTaxonVariant().getTaxon().getId())); + annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.taxonLabel", getId())); + annotations.add(new Annotation(Constants.TBTermsURI, "tb:title.taxon", getTaxonVariant().getTaxon().getName())); + } + TaxonVariant tv = getTaxonVariant(); + if ( null != tv ) { + if ( null != tv.getNamebankID() ) { + StringBuilder urlString = new StringBuilder(TreebaseUtil.getPurlDomain()); + getPhyloWSPath().getPath(urlString).append("uBio:").append(tv.getNamebankID()); + annotations.add(new Annotation(Constants.DCTermsURI, "dc:relation", URI.create(urlString.toString()))); + annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.ubio", "uBio:" + tv.getNamebankID())); + annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.taxonVariant", tv.getId())); + annotations.add(new Annotation(Constants.TBTermsURI, "tb:title.taxonVariant", tv.getFullName())); + } + } + return annotations; + } + + @Transient + public String getLabel() { + return getTaxonLabel(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:13:28
|
Revision: 577 http://treebase.svn.sourceforge.net/treebase/?rev=577&view=rev Author: rvos Date: 2010-03-15 01:13:21 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getLabel() for nexml and rdf serialization. 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-15 01:12:42 UTC (rev 576) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/Taxon.java 2010-03-15 01:13:21 UTC (rev 577) @@ -13,6 +13,7 @@ import javax.persistence.JoinColumn; import javax.persistence.OneToMany; import javax.persistence.Table; +import javax.persistence.Transient; import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Cache; @@ -239,5 +240,10 @@ public void setForeignLinks(Collection<TaxonLink> pNewForeignLinks) { mForeignLinks = pNewForeignLinks; } + + @Transient + public String getLabel() { + return getName(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:12:48
|
Revision: 576 http://treebase.svn.sourceforge.net/treebase/?rev=576&view=rev Author: rvos Date: 2010-03-15 01:12:42 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getAnnotations() and getLabel() for nexml and rdf serialization. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java 2010-03-15 01:11:43 UTC (rev 575) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java 2010-03-15 01:12:42 UTC (rev 576) @@ -26,8 +26,11 @@ import javax.persistence.Transient; import org.apache.log4j.Logger; +import org.cipres.treebase.Constants; +import org.cipres.treebase.ContextManager; import org.cipres.treebase.TreebaseUtil; import org.cipres.treebase.domain.AbstractPersistedObject; +import org.cipres.treebase.domain.Annotation; import org.cipres.treebase.domain.TBPersistable; import org.cipres.treebase.domain.admin.Person; import org.cipres.treebase.domain.admin.User; @@ -38,6 +41,8 @@ import org.cipres.treebase.domain.taxon.TaxonVariant; import org.cipres.treebase.domain.tree.PhyloTree; import org.cipres.treebase.domain.tree.TreeBlock; +import org.hibernate.Session; +import org.hibernate.SessionFactory; import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; @@ -46,6 +51,7 @@ import org.hibernate.annotations.Index; import org.hibernate.annotations.IndexColumn; import org.jdom.Element; +import org.nexml.model.Document; @Entity @Table(name = "STUDY") @@ -685,4 +691,54 @@ } return treeBlocks; } + + @Override + @Transient + public String getLabel() { + if ( null != getCitation() ) { + return getCitation().getTitle(); + } + return getName(); + } + + @Transient + public List<Annotation> getAnnotations() { + List<Annotation> annotations = super.getAnnotations(); + annotations.add(new Annotation(Constants.PrismURI,"prism:section","Study")); + annotations.add(new Annotation(Constants.TBTermsURI,"tb:identifier.study",getId().toString())); + annotations.add(new Annotation(Constants.TBTermsURI,"tb:identifier.study.tb1",getTB1StudyID())); + if ( null != getName() ) { + annotations.add(new Annotation(Constants.TBTermsURI,"tb:title.study",getName())); + } + if ( null != getReleaseDate() ) { + annotations.add(new Annotation(Constants.DCURI,"dc:date",getReleaseDate().toString())); + } + if ( null != getSubmission() ) { + if ( null != getSubmission().getSubmitter() ) { +// annotations.add(new Annotation(Constants.DCURI,"dc:creator",getSubmission().getSubmitter().getPerson().getFullNameCitationStyle())); + } + if ( null != getSubmission().getCreateDate() ) { + annotations.add(new Annotation(Constants.PrismURI,"prism:creationDate",getSubmission().getCreateDate().toString())); + } + } + if ( null != getCitation() ) { + try { + List<Annotation> citationAnnotations = getCitation().getAnnotations(); + Annotation deleteme = null; + for ( Annotation anno : citationAnnotations ) { + if ( anno.getProperty().equals("owl:sameAs") ) { + deleteme = anno; + } + } + if ( null != deleteme ) { + citationAnnotations.remove(deleteme); + } + annotations.addAll(citationAnnotations); + } 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. |
From: <rv...@us...> - 2010-03-15 01:11:50
|
Revision: 575 http://treebase.svn.sourceforge.net/treebase/?rev=575&view=rev Author: rvos Date: 2010-03-15 01:11:43 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getAnnotations() for nexml and rdf serialization. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java 2010-03-15 01:08:05 UTC (rev 574) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java 2010-03-15 01:11:43 UTC (rev 575) @@ -3,6 +3,7 @@ import java.util.ArrayList; import java.util.Calendar; +import java.util.Collection; import java.util.List; import javax.persistence.AttributeOverride; @@ -23,12 +24,18 @@ import javax.persistence.Table; import javax.persistence.Transient; +import org.hibernate.Session; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.IndexColumn; import org.springframework.beans.BeanUtils; +import org.cipres.treebase.Constants; +import org.cipres.treebase.ContextManager; import org.cipres.treebase.domain.AbstractPersistedObject; +import org.cipres.treebase.domain.Annotation; import org.cipres.treebase.domain.TBPersistable; import org.cipres.treebase.domain.admin.Person; @@ -302,15 +309,15 @@ /** * Get an ordered list of authors. - * + * @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "studyCache") * @return - */ + */ @ManyToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST}) @JoinTable(name = "CITATION_AUTHOR", joinColumns = {@JoinColumn(name = "CITATION_ID")}) - @IndexColumn(name = "AUTHOR_ORDER") - @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "studyCache") + @IndexColumn(name = "AUTHOR_ORDER") + @Fetch(FetchMode.JOIN) public List<Person> getAuthors() { - return mAuthors; + return mAuthors; // The fetch annotation prevents org.hibernate.LazyInitializationException } /** @@ -492,6 +499,25 @@ } @Transient + private String getAuthorsAsString() { + StringBuilder authorsCitationStyle = new StringBuilder(); + List<Person> authors = getAuthors(); + int size = authors.size(); + if (size > 0) { + for ( int i = 0; i < size; i++ ) { + authorsCitationStyle.append(authors.get(i).getFullNameCitationStyle()); + if ( size > 1 && i == size - 2 ) { + authorsCitationStyle.append(", & "); + } + else if (size > 1 && i < size - 2) { + authorsCitationStyle.append(", "); + } + } + } + return authorsCitationStyle.toString(); + } + + @Transient public String getAuthorsAsBibtex() { return catPersonsBibtex(getAuthors()); } @@ -647,5 +673,56 @@ protected void getDetailedPublicationInformation(StringBuilder pBuilder, boolean pGenerateHtml) { } + + @Transient + public List<Annotation> getAnnotations() { + List<Annotation> annotations = super.getAnnotations(); + annotations.add(new Annotation(Constants.DCTermsURI,"dcterms:bibliographicCitation",getAuthorsCitationStyleWithoutHtml())); + annotations.add(new Annotation(Constants.DCURI,"dc:title",getTitle())); + annotations.add(new Annotation(Constants.DCURI,"dc:creator",getAuthorsAsString())); + for ( Person person : getAuthors() ) { + String personName = person.getFullNameCitationStyle(); + annotations.add(new Annotation(Constants.DCURI,"dc:contributor",personName)); + } + try { + if ( null != getPublishYear() ) { + annotations.add(new Annotation(Constants.PrismURI,"prism:publicationDate",getPublishYear().toString())); + } + if ( null != getDoi() ) { + annotations.add(new Annotation(Constants.PrismURI,"prism:doi",getDoi())); + } + if ( null != getPages() ) { + String[] pages = getPages().split("\\-"); + if ( pages.length == 2 ) { + annotations.add(new Annotation(Constants.PrismURI,"prism:startingPage",pages[0])); + annotations.add(new Annotation(Constants.PrismURI,"prism:endingPage",pages[1])); + annotations.add(new Annotation(Constants.PrismURI,"prism:pageRange",getPages())); + } + } + if ( null != getKeywords() ) { + String[] keywords = getKeywords().split(", "); + for ( int i = 0; i < keywords.length; i++ ) { + annotations.add(new Annotation(Constants.DCURI,"dc:subject",keywords[i])); + } + } + if ( this instanceof ArticleCitation ) { + ArticleCitation ac = (ArticleCitation)this; + String journal = ac.getJournal(); + if ( null != journal ) { + annotations.add(new Annotation(Constants.PrismURI,"prism:publicationName",journal)); + annotations.add(new Annotation(Constants.DCURI,"dc:publisher",journal)); + } + if ( null != ac.getVolume() ) { + annotations.add(new Annotation(Constants.PrismURI,"prism:volume",ac.getVolume())); + } + if ( null != ac.getIssue() ) { + annotations.add(new Annotation(Constants.PrismURI,"prism:number",ac.getIssue())); + } + } + } 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. |
From: <rv...@us...> - 2010-03-15 01:08:12
|
Revision: 574 http://treebase.svn.sourceforge.net/treebase/?rev=574&view=rev Author: rvos Date: 2010-03-15 01:08:05 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Now calls getAnnotations() to let the object decide what metadata to add as opposed to fiddling with the object here. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUConverter.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockConverter.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUConverter.java 2010-03-15 01:07:17 UTC (rev 573) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUConverter.java 2010-03-15 01:08:05 UTC (rev 574) @@ -1,12 +1,9 @@ package org.cipres.treebase.domain.nexus.nexml; -import java.net.URI; - import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.taxon.TaxonLabel; import org.cipres.treebase.domain.taxon.TaxonLabelHome; import org.cipres.treebase.domain.taxon.TaxonLabelSet; -import org.cipres.treebase.domain.taxon.TaxonVariant; import org.nexml.model.Document; import org.nexml.model.OTU; import org.nexml.model.OTUs; @@ -81,26 +78,6 @@ xmlOTU.setLabel(taxonLabel.getTaxonLabel()); } attachTreeBaseID(xmlOTU,taxonLabel,TaxonLabel.class); - if ( null != taxonLabel.getNcbiTaxID() ) { - StringBuilder urlString = new StringBuilder(getDocument().getBaseURI().toString()); - taxonLabel.getPhyloWSPath().getPath(urlString).append("NCBI:").append(taxonLabel.getNcbiTaxID()); - xmlOTU.addAnnotationValue("dc:relation", mDCURI, URI.create(urlString.toString())); - xmlOTU.addAnnotationValue("tb:identifier.ncbi", mTBTermsURI, "NCBI:" + taxonLabel.getNcbiTaxID()); - xmlOTU.addAnnotationValue("tb:identifier.taxon", mTBTermsURI, taxonLabel.getTaxonVariant().getTaxon().getId()); - xmlOTU.addAnnotationValue("tb:identifier.taxonLabel", mTBTermsURI, taxonLabel.getId()); - xmlOTU.addAnnotationValue("tb:title.taxon", mTBTermsURI, taxonLabel.getTaxonVariant().getTaxon().getName()); - } - TaxonVariant tv = taxonLabel.getTaxonVariant(); - if ( null != tv ) { - if ( null != tv.getNamebankID() ) { - StringBuilder urlString = new StringBuilder(getDocument().getBaseURI().toString()); - taxonLabel.getPhyloWSPath().getPath(urlString).append("uBio:").append(tv.getNamebankID()); - xmlOTU.addAnnotationValue("dc:relation", mDCURI, URI.create(urlString.toString())); - xmlOTU.addAnnotationValue("tb:identifier.ubio", mTBTermsURI, "uBio:" + tv.getNamebankID()); - xmlOTU.addAnnotationValue("tb:identifier.taxonVariant", mTBTermsURI, tv.getId()); - xmlOTU.addAnnotationValue("tb:title.taxonVariant", mTBTermsURI, tv.getFullName()); - } - } return xmlOTU; } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockConverter.java 2010-03-15 01:07:17 UTC (rev 573) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockConverter.java 2010-03-15 01:08:05 UTC (rev 574) @@ -3,6 +3,7 @@ import java.util.Iterator; import java.util.Set; +import org.cipres.treebase.Constants; import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.taxon.TaxonLabel; import org.cipres.treebase.domain.taxon.TaxonLabelHome; @@ -84,21 +85,6 @@ if ( null != phyloTree.getLabel() ) { xmlTree.setLabel(phyloTree.getLabel()); } - if ( null != phyloTree.getId() ) { - xmlTree.addAnnotationValue("tb:identifier.tree", mTBTermsURI, phyloTree.getId()); - } - if ( null != phyloTree.getKindDescription() ) { - xmlTree.addAnnotationValue("tb:kind.tree", mTBTermsURI, phyloTree.getKindDescription()); - } - if ( null != phyloTree.getTypeDescription() ) { - xmlTree.addAnnotationValue("tb:type.tree", mTBTermsURI, phyloTree.getTypeDescription()); - } - if ( null != phyloTree.getQualityDescription() ) { - xmlTree.addAnnotationValue("tb:quality.tree", mTBTermsURI, phyloTree.getQualityDescription()); - } - if ( null != phyloTree.getnTax() ) { - xmlTree.addAnnotationValue("tb:ntax.tree", mTBTermsURI, phyloTree.getnTax()); - } attachTreeBaseID(xmlTree, phyloTree,PhyloTree.class); copyTreeBaseTree(phyloTree, xmlTree); return xmlTree; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:07:24
|
Revision: 573 http://treebase.svn.sourceforge.net/treebase/?rev=573&view=rev Author: rvos Date: 2010-03-15 01:07:17 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Now calls getAnnotations() to let the object decide what metadata to add as opposed to fiddling with the object here. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlObjectConverter.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlObjectConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlObjectConverter.java 2010-03-15 01:06:19 UTC (rev 572) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlObjectConverter.java 2010-03-15 01:07:17 UTC (rev 573) @@ -1,15 +1,14 @@ package org.cipres.treebase.domain.nexus.nexml; import java.net.URI; -import java.net.URISyntaxException; import java.text.CharacterIterator; import java.text.StringCharacterIterator; import java.util.Iterator; import java.util.Set; import org.apache.log4j.Logger; +import org.cipres.treebase.Constants; import org.cipres.treebase.TreebaseIDString; -import org.cipres.treebase.NamespacedGUID; import org.cipres.treebase.TreebaseIDString.MalformedTreebaseIDString; import org.cipres.treebase.domain.TBPersistable; import org.cipres.treebase.domain.nexus.AbstractNexusConverter; @@ -23,17 +22,9 @@ public class NexmlObjectConverter extends AbstractNexusConverter { private Logger logger = Logger.getLogger(NexmlObjectConverter.class); - protected static URI mDCURI; - protected static URI mPrismURI; - protected static URI mTBTermsURI; - protected static URI mDwCURI; - protected URI mBaseURI; - private static String mDwCString = "http://rs.tdwg.org/dwc/terms/"; - private static String mTBTermsString = "http://treebase.org/terms#"; - private static String mDCURIString = "http://purl.org/dc/terms/"; - private static String mPrismURIString = "http://prismstandard.org/namespaces/1.2/basic/"; - private static String mBaseURIString = "http://purl.org/PHYLO/TREEBASE/PHYLOWS/"; - private static String mDCIdentifier = "dcterms:identifier"; + protected URI mBaseURI = Constants.BaseURI; +// private static String mBaseURIString = "http://purl.org/PHYLO/TREEBASE/PHYLOWS/"; +// private static String mDCIdentifier = "dcterms:identifier"; public static String TreeBASE2Prefix = "TreeBASE2"; private Document mDocument; @@ -43,21 +34,8 @@ * @param taxonLabelHome */ public NexmlObjectConverter(Study study, TaxonLabelHome taxonLabelHome, Document document, String baseURI) { - try { - mDCURI = new URI(mDCURIString); - mPrismURI = new URI(mPrismURIString); - mTBTermsURI = new URI(mTBTermsString); - mDwCURI = new URI(mDwCString); - if ( null != baseURI ) { - mBaseURI = new URI(baseURI); - } - else { - mBaseURI = new URI(mBaseURIString); - } - } catch (URISyntaxException e) { - e.printStackTrace(); - } if ( null != baseURI ) { + mBaseURI = URI.create(baseURI); document.setBaseURI(mBaseURI); } setTaxonLabelHome(taxonLabelHome); @@ -75,10 +53,10 @@ * @param tbPersistable * @return */ - private String makeNamespacedID (TBPersistable tbPersistable,Class<?> persistableClass) { - TreebaseIDString tbIDString = new TreebaseIDString(persistableClass,tbPersistable.getId()); - return tbIDString.getNamespacedGUID().toString(); - } +// private String makeNamespacedID (TBPersistable tbPersistable,Class<?> persistableClass) { +// TreebaseIDString tbIDString = new TreebaseIDString(persistableClass,tbPersistable.getId()); +// return tbIDString.getNamespacedGUID().toString(); +// } /** * @@ -88,9 +66,12 @@ protected void attachTreeBaseID(Annotatable annotatable,TBPersistable tbPersistable,Class<?> persistableClass) { if ( null != tbPersistable.getId() ) { //attachAnnotation(mDCIdentifier,makeNamespacedID(tbPersistable,persistableClass),mDCURI,annotatable); - String uriString = getDocument().getBaseURI().toString() + tbPersistable.getPhyloWSPath().toString(); - annotatable.addAnnotationValue("tb:resource",mTBTermsURI, URI.create(uriString)); - annotatable.addAnnotationValue("dcterms:relation",mDCURI, URI.create(uriString)); +// String uriString = getDocument().getBaseURI().toString() + tbPersistable.getPhyloWSPath().toString(); +// annotatable.addAnnotationValue("owl:sameAs",Constants.OWLURI, URI.create(uriString)); +// annotatable.addAnnotationValue("dcterms:relation",Constants.DCURI, URI.create(uriString)); + for ( org.cipres.treebase.domain.Annotation anno : tbPersistable.getAnnotations() ) { + annotatable.addAnnotationValue(anno.getProperty(), anno.getURI(), anno.getValue()); + } } } @@ -117,7 +98,7 @@ // dc:identifier predicate in a nexml meta annotation, // e.g. <meta property="dc:identifier" content="TB2:Tr231"/> // this will return something that stringifies to TB2:Tr231 - Set<Object> dublinCoreRelationObjects = annotatable.getRelValues("dcterms:relation"); + Set<Object> dublinCoreRelationObjects = annotatable.getRelValues("owl:sameAs"); Iterator<Object> objectIterator = dublinCoreRelationObjects.iterator(); while ( objectIterator.hasNext() ) { URI relationURI = (URI)objectIterator.next(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:06:25
|
Revision: 572 http://treebase.svn.sourceforge.net/treebase/?rev=572&view=rev Author: rvos Date: 2010-03-15 01:06:19 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Now calls getAnnotations() to let the object decide what metadata to add. Where we add metadata here, we use the URIs from the Constants class as opposed to hardcoding them here. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2010-03-15 01:04:39 UTC (rev 571) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2010-03-15 01:06:19 UTC (rev 572) @@ -4,6 +4,7 @@ import java.util.List; import java.util.Set; +import org.cipres.treebase.Constants; import org.cipres.treebase.dao.jdbc.ContinuousMatrixElementJDBC; import org.cipres.treebase.dao.jdbc.ContinuousMatrixJDBC; import org.cipres.treebase.dao.jdbc.DiscreteMatrixElementJDBC; @@ -179,9 +180,9 @@ if ( null != tbState.getDescription() ) { xmlState.setLabel(tbState.getDescription()); } - if ( null != tbState.getNotes() ) { - ((Annotatable)xmlState).addAnnotationValue("dcterms:description", mDCURI, tbState.getNotes()); - } +// if ( null != tbState.getNotes() ) { +// ((Annotatable)xmlState).addAnnotationValue("dcterms:description", Constants.DCURI, tbState.getNotes()); +// } attachTreeBaseID((Annotatable)xmlState,tbState,DiscreteCharState.class); } org.nexml.model.Character xmlCharacter = xmlMatrix.createCharacter(xmlStateSet); @@ -222,7 +223,7 @@ org.nexml.model.Character xmlCharacter = xmlMatrix.createCharacter(xmlStateSet); PhyloChar tbCharacter = tbColumn.getCharacter(); if ( null != tbCharacter.getDescription() && ! tbCharacter.getDescription().equals(tbDataType) ) { - ((Annotatable)xmlCharacter).addAnnotationValue("dcterms:description", mDCURI, tbCharacter.getDescription()); + ((Annotatable)xmlCharacter).addAnnotationValue("dcterms:description", Constants.DCTermsURI, tbCharacter.getDescription()); } if ( null != tbCharacter.getId() && tbCharacter.getId() != 2 ) { // XXX is PhyloChar.id 2 some sort of magic number? attachTreeBaseID((Annotatable)xmlCharacter,tbCharacter,PhyloChar.class); @@ -245,7 +246,7 @@ org.nexml.model.Character xmlCharacter = xmlMatrix.createCharacter(); PhyloChar tbCharacter = tbColumn.getCharacter(); if ( null != tbCharacter.getDescription() ) { - ((Annotatable)xmlCharacter).addAnnotationValue("dcterms:description", mDCURI, tbCharacter.getDescription()); + ((Annotatable)xmlCharacter).addAnnotationValue("dcterms:description", Constants.DCTermsURI, tbCharacter.getDescription()); } attachTreeBaseID((Annotatable)xmlCharacter,tbCharacter,PhyloChar.class); } @@ -275,10 +276,6 @@ } xmlMatrix.setLabel(tbMatrix.getTitle()); attachTreeBaseID((Annotatable)xmlMatrix, tbMatrix,Matrix.class); - ((Annotatable)xmlMatrix).addAnnotationValue("tb:type.matrix", mTBTermsURI, tbMatrix.getDataType().getDescription()); - ((Annotatable)xmlMatrix).addAnnotationValue("tb:ntax.matrix", mTBTermsURI, tbMatrix.getnTax()); - ((Annotatable)xmlMatrix).addAnnotationValue("tb:nchar.matrix", mTBTermsURI, tbMatrix.getnChar()); - ((Annotatable)xmlMatrix).addAnnotationValue("tb:identifier.matrix", mTBTermsURI, tbMatrix.getId()); return xmlMatrix; } @@ -310,10 +307,10 @@ for ( RowSegment tbSegment : tbSegments ) { if ( tbSegment.getStartIndex() <= charIndex && charIndex <= tbSegment.getEndIndex() ) { if ( tbSegment.getSpecimenLabel().getLatitude() != null ) { - ((Annotatable)xmlCell).addAnnotationValue("DwC:DecimalLatitude", mDwCURI, tbSegment.getSpecimenLabel().getLatitude()); + ((Annotatable)xmlCell).addAnnotationValue("DwC:DecimalLatitude", Constants.DwCURI, tbSegment.getSpecimenLabel().getLatitude()); } if ( tbSegment.getSpecimenLabel().getLongitude() != null ) { - ((Annotatable)xmlCell).addAnnotationValue("DwC:DecimalLongitude", mDwCURI, tbSegment.getSpecimenLabel().getLongitude()); + ((Annotatable)xmlCell).addAnnotationValue("DwC:DecimalLongitude", Constants.DwCURI, tbSegment.getSpecimenLabel().getLongitude()); } /* if ( tbSegment.getSpecimenLabel().getGenBankAccession() != null ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:04:45
|
Revision: 571 http://treebase.svn.sourceforge.net/treebase/?rev=571&view=rev Author: rvos Date: 2010-03-15 01:04:39 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Now calls getAnnotations() to let the object decide what metadata to add as opposed to fiddling with the object here. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlDocumentConverter.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlDocumentConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlDocumentConverter.java 2010-03-15 01:02:39 UTC (rev 570) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlDocumentConverter.java 2010-03-15 01:04:39 UTC (rev 571) @@ -1,10 +1,11 @@ package org.cipres.treebase.domain.nexus.nexml; -import org.cipres.treebase.domain.admin.Person; +//import org.cipres.treebase.Constants; +//import org.cipres.treebase.domain.admin.Person; import org.cipres.treebase.domain.matrix.CharacterMatrix; import org.cipres.treebase.domain.nexus.NexusDataSet; -import org.cipres.treebase.domain.study.ArticleCitation; -import org.cipres.treebase.domain.study.Citation; +//import org.cipres.treebase.domain.study.ArticleCitation; +//import org.cipres.treebase.domain.study.Citation; import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.taxon.TaxonLabelHome; import org.cipres.treebase.domain.taxon.TaxonLabelSet; @@ -91,55 +92,11 @@ /** * - * @param citation - * @param document - */ - private void copyCitationMetadata(Citation citation,Document document) { - attachAnnotation("dcterms:bibliographicCitation",citation.getAuthorsCitationStyleWithoutHtml(),mDCURI,document); - if ( null != citation.getTitle() ) { - attachAnnotation("tb:title.study",citation.getTitle(),mTBTermsURI,document); - } - if ( null != citation.getPublishYear() ) { - attachAnnotation("prism:publicationDate",citation.getPublishYear().toString(),mPrismURI,document); - } - if ( null != citation.getDoi() ) { - attachAnnotation("prism:doi",citation.getDoi(),mPrismURI,document); - } - if ( null != citation.getPages() ) { - String[] pages = citation.getPages().split("\\-"); - if ( pages.length == 2 ) { - attachAnnotation("prism:startingPage",pages[0],mPrismURI,document); - attachAnnotation("prism:endingPage",pages[1],mPrismURI,document); - attachAnnotation("prism:pageRange",citation.getPages(),mPrismURI,document); - } - } - if ( null != citation.getKeywords() ) { - String[] keywords = citation.getKeywords().split(", "); - for ( int i = 0; i < keywords.length; i++ ) { - attachAnnotation("dcterms:subject",keywords[i],mDCURI,document); - } - } - if ( citation instanceof ArticleCitation ) { - ArticleCitation ac = (ArticleCitation)citation; - if ( null != ac.getJournal() ) { - attachAnnotation("prism:publicationName",ac.getJournal(),mPrismURI,document); - } - if ( null != ac.getVolume() ) { - attachAnnotation("prism:volume",ac.getVolume(),mPrismURI,document); - } - if ( null != ac.getIssue() ) { - attachAnnotation("prism:number",ac.getIssue(),mPrismURI,document); - } - } - } - - /** - * * @param pStudy * @return */ public Document fromTreeBaseToXml(Study pStudy) { - copyMetadata(pStudy); + attachTreeBaseID(getDocument(), pStudy,Study.class); NexmlOTUConverter noc = new NexmlOTUConverter(getStudy(),getTaxonLabelHome(),getDocument()); for ( TaxonLabelSet taxonLabelSet : pStudy.getTaxonLabelSets() ) { @@ -161,37 +118,4 @@ return getDocument(); } - private void copyMetadata(Study pStudy) { - attachTreeBaseID(getDocument(), pStudy,Study.class); - attachAnnotation("tb:identifier.study",pStudy.getId().toString(), mTBTermsURI, getDocument()); - attachAnnotation("tb:identifier.study.tb1",pStudy.getTB1StudyID(), mTBTermsURI, getDocument()); - if ( null != pStudy.getName() ) { - attachAnnotation("tb:title.study", pStudy.getName(), mTBTermsURI, getDocument()); - } - for ( Person person : pStudy.getAuthors() ) { - String personName = person.getFullNameCitationStyle(); - attachAnnotation("dcterms:contributor",personName,mDCURI,getDocument()); - } - if ( null != pStudy.getReleaseDate() ) { - attachAnnotation("prism:embargoDate",pStudy.getReleaseDate().toString(),mPrismURI,getDocument()); - } - if ( null != pStudy.getSubmission() ) { - if ( null != pStudy.getSubmission().getSubmitter() ) { - attachAnnotation( - "dcterms:creator", - pStudy.getSubmission().getSubmitter().getPerson().getFullNameCitationStyle(), - mDCURI, - getDocument() - ); - } - if ( null != pStudy.getSubmission().getCreateDate() ) { - attachAnnotation("prism:creationDate",pStudy.getSubmission().getCreateDate().toString(),mPrismURI,getDocument()); - } - } - if ( null != pStudy.getCitation() ) { - //attachAnnotation("dc:abstract",forXML(pStudy.getCitation().getAbstract()), mDCURI,getDocument()); - copyCitationMetadata(pStudy.getCitation(),getDocument()); - } - } - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:02:46
|
Revision: 570 http://treebase.svn.sourceforge.net/treebase/?rev=570&view=rev Author: rvos Date: 2010-03-15 01:02:39 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getLabel() for nexml and rdf serialization. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PhyloChar.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PhyloChar.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PhyloChar.java 2010-03-15 01:01:33 UTC (rev 569) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PhyloChar.java 2010-03-15 01:02:39 UTC (rev 570) @@ -81,5 +81,10 @@ public boolean isInteresting() { return getId() >= Constants.MIN_INTERESTING_PHYLOCHAR_ID; } + + @Transient + public String getLabel() { + return getDescription(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:01:40
|
Revision: 569 http://treebase.svn.sourceforge.net/treebase/?rev=569&view=rev Author: rvos Date: 2010-03-15 01:01:33 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getAnnotations() and getLabel() for nexml and rdf serialization. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/DiscreteCharState.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/DiscreteCharState.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/DiscreteCharState.java 2010-03-15 01:00:44 UTC (rev 568) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/DiscreteCharState.java 2010-03-15 01:01:33 UTC (rev 569) @@ -1,5 +1,8 @@ package org.cipres.treebase.domain.matrix; +import java.util.List; +import java.util.Set; + import javax.persistence.AttributeOverride; import javax.persistence.CascadeType; import javax.persistence.Column; @@ -7,11 +10,14 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; +import javax.persistence.Transient; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import org.cipres.treebase.Constants; import org.cipres.treebase.domain.AbstractPersistedObject; +import org.cipres.treebase.domain.Annotation; import org.cipres.treebase.domain.TBPersistable; /** @@ -114,5 +120,19 @@ public void setNotes(String pNewNotes) { mNotes = pNewNotes; } + + @Transient + public List<Annotation> getAnnotations() { + List<Annotation> annotations = super.getAnnotations(); + if ( null != getNotes() ) { + annotations.add(new Annotation(Constants.DCTermsURI,"dcterms:description",getNotes())); + } + return annotations; + } + + @Transient + public String getLabel() { + return getDescription(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:00:51
|
Revision: 568 http://treebase.svn.sourceforge.net/treebase/?rev=568&view=rev Author: rvos Date: 2010-03-15 01:00:44 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getAnnotations() and getLabel() for nexml and rdf serialization. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java 2010-03-12 23:44:43 UTC (rev 567) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java 2010-03-15 01:00:44 UTC (rev 568) @@ -31,7 +31,9 @@ import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollectionOption; +import org.cipres.treebase.Constants; import org.cipres.treebase.TreebaseUtil; +import org.cipres.treebase.domain.Annotation; import org.cipres.treebase.domain.taxon.TaxonLabel; /** @@ -931,4 +933,20 @@ @Override @Transient public boolean isCharacterMatrix() { return true; } + + @Transient + public List<Annotation> getAnnotations() { + List<Annotation> annotations = super.getAnnotations(); + annotations.add(new Annotation(Constants.TBTermsURI,"tb:type.matrix",getDataType().getDescription())); + annotations.add(new Annotation(Constants.TBTermsURI,"tb:ntax.matrix",getnTax())); + annotations.add(new Annotation(Constants.TBTermsURI,"tb:nchar.matrix",getnChar())); + annotations.add(new Annotation(Constants.TBTermsURI,"tb:identifier.matrix",getId())); + return annotations; + } + + @Transient + public String getLabel() { + return getTitle(); + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2010-03-14 20:37:50
|
Bugs item #2962651, was opened at 2010-03-03 09:51 Message generated for change (Comment added) made by sfrgpiel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2962651&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: data Group: None Status: Open Priority: 5 Private: No Submitted By: William Piel (sfrgpiel) Assigned to: Mark Dominus (mjdominus) Summary: Corrupted dataset Initial Comment: The attached dataset needs to replace TB2: S1984, M3076. It includes an additional tree "Big Tree" which just needs to be added to the analysis. ---------------------------------------------------------------------- >Comment By: William Piel (sfrgpiel) Date: 2010-03-14 16:37 Message: Another dataset to fix: -- S2377 Legacy S1934 -- M2985 (L M4864) and Tr5020 and Tr5021 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2962651&group_id=248804 |
From: SourceForge.net <no...@so...> - 2010-03-12 23:47:13
|
Bugs item #2960840, was opened at 2010-02-28 20:05 Message generated for change (Comment added) made by rvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2960840&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: ui Group: None Status: Open Priority: 8 Private: No Submitted By: William Piel (sfrgpiel) Assigned to: Rutger Vos (rvos) Summary: PhyloWS API Issues Need Fixing Initial Comment: A couple of things should be fixed with PhyloWS, some are higher value than others. I would rank items 1 and 4 at level "9," with the other ones lower (but if they are low-hanging easy fixes, it would be great to fix them before the release). 1. Failure with Safari RSS browser: Originally we thought that this failed because RSS results are not delivered with <?xml version="1.0" encoding="utf-8"?> at the top -- but that's not the case. 2. The initial url (e.g. http://purl.org/phylo/treebase/phylows/taxon/find?query=dcterms.title==%22Homo%20sapiens%22&recordSchema=study&format=rss1) uses purl.org but returns a list where the domains change from purl.org to nescent.org -- I'd rather that we not proliferate synonymous URIs that have different domains. Let's keep all "/phylows/" urls with the purl.org domain. 3. Let's add some verbiage to each RSS 1.0 result so that a minium synopsis of readable info is provided to users of RSS browsers. For studies, provide the citation; for matrices, provide matrix name and data type; for trees, provide tree name, tree title, tree type; for taxa, provide the taxon name. So, for example, while the current implementation looks like this: <item rdf:about="http://treebase-dev.nescent.org:6666/treebase-web/phylows/study/TB2:S1925"> <title>TB2:S1925</title> <link>http://treebase-dev.nescent.org:6666/treebase-web/phylows/study/TB2:S1925</link> <description>TB2:S1925</description> </item> ...We need to be more verbose, not only in the <description> so that the user reading the RSS feed has some idea what it is about, but also in the <prism> and <dc> contents, so that machines reading this feed can do something useful with it. In the case of a study, let's return this: <item rdf:about="http://purl.org/phylo/treebase/phylows/study/TB2:S1925"> <title><![CDATA[[Study] Phylogenetic study of clavicipitaceous fungi using acetaldehyde dehydrogenase gene sequences]]></title> <link>http://purl.org/phylo/treebase/phylows/study/TB2:S1925</link> <description><![CDATA[Tanaka, E. and C. Tanaka. 2008. Phylogenetic study of clavicipitaceous fungi using acetaldehyde dehydrogenase gene sequences. Mycoscience, 49(20): 115-125.]]></description> <dc:creator><![CDATA[Tanaka, E.; Tanaka, C.]]></dc:creator> <dc:date>2007-01-01</dc:date> <dc:subject><![CDATA[Phylogenies]]></dc:subject> <dc:title><![CDATA[[Study] Phylogenetic study of clavicipitaceous fungi using acetaldehyde dehydrogenase gene sequences]]></dc:title> <dc:publisher>Mycoscience</dc:publisher> <prism:publicationName>Mycoscience</prism:publicationName> <prism:contributor>Tanaka, Eiji</prism:contributor> <prism:contributor>Tanaka, Chihiro</prism:contributor> <prism:volume>49</prism:volume> <prism:pageRange>115-125</prism:pageRange> <prism:startingPage>115</prism:startingPage> <prism:endingPage>125</prism:endingPage> <prism:doi>10.1007/s10267-007-0401-5</prism:doi> <dcterms:bibliographicCitation>Tanaka, E. and C. Tanaka. 2008. Phylogenetic study of clavicipitaceous fungi using acetaldehyde dehydrogenase gene sequences. Mycoscience, 49(20): 115-125.</dcterms:bibliographicCitation> <prism:publicationDate>2007-01-01</prism:publicationDate> <prism:section>Study</prism:section> </item> 4. PhyloWS requests that search on taxa to return a list of trees are so slow as to be unusable. This problem may be fixed by Youjun, seeing as it is also slow in the web GUI interface and Youjun is tackling the problem there. http://purl.org/phylo/treebase/phylows/taxon/find?query=dcterms.title==%22Homo%20sapiens%22&recordSchema=tree&format=rss1 5. My understanding is that our /phylows/study/find? queries do not support searching on the journal name of an article. It would be great if this were offered because that would let us give journal editors RSS feeds into their own data. ---------------------------------------------------------------------- >Comment By: Rutger Vos (rvos) Date: 2010-03-12 23:47 Message: 1. I think this might be due to the extension(!), I created a mapping so that we give these feeds a .rdf extension and with mime-type application/rss+xml. They now render as expected. 2. we now use purls throughout. 3. this is much harder to do than you'd think. I'll try. 4. this has been fixed already, apparently. 5. we can now use prism.publicationName as a search predicate. I've committed this progress so far, but it has not been reloaded on the server yet. ---------------------------------------------------------------------- Comment By: Hilmar Lapp (hlapp) Date: 2010-03-10 18:25 Message: Downgrading to priority 8 as per conversation with Bill. Itrem #4 has been ifxed already. ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2010-03-01 16:09 Message: Ok, I'll work on this. ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2010-03-01 16:09 Message: Thanks for reporting this bug. We'll look into it as soon as possible. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2960840&group_id=248804 |
From: <rv...@us...> - 2010-03-12 23:44:50
|
Revision: 567 http://treebase.svn.sourceforge.net/treebase/?rev=567&view=rev Author: rvos Date: 2010-03-12 23:44:43 +0000 (Fri, 12 Mar 2010) Log Message: ----------- Skeleton for an interface for objects that contain annotations which can be serialized into rss feeds. Added Paths: ----------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/Annotatable.java Added: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/Annotatable.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/Annotatable.java (rev 0) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/Annotatable.java 2010-03-12 23:44:43 UTC (rev 567) @@ -0,0 +1,5 @@ +package org.cipres.treebase.domain; + +public interface Annotatable { + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |