From: <rv...@us...> - 2011-08-25 14:29:25
|
Revision: 943 http://treebase.svn.sourceforge.net/treebase/?rev=943&view=rev Author: rvos Date: 2011-08-25 14:29:19 +0000 (Thu, 25 Aug 2011) Log Message: ----------- Added skos:historyNote to keep track of which version of the converter we're using Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java Property Changed: ---------------- 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 2011-08-25 14:24:16 UTC (rev 942) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2011-08-25 14:29:19 UTC (rev 943) @@ -177,7 +177,11 @@ public CategoricalMatrix fromTreeBaseToXml(StandardMatrix tbMatrix) { OTUs xmlOTUs = getOTUsById(tbMatrix.getTaxa().getId()); CategoricalMatrix xmlMatrix = getDocument().createCategoricalMatrix(xmlOTUs); + + // attach base uri and history note + getDocument().addAnnotationValue("skos:historyNote", Constants.SKOSURI, "Mapped from TreeBASE schema using NexmlMatrixConverter $Rev$"); xmlMatrix.setBaseURI(mMatrixBaseURI); + List<List<DiscreteCharState>> tbStateLabels = tbMatrix.getStateLabels(); List<MatrixColumn> tbColumns = tbMatrix.getColumnsReadOnly(); for ( int i = 0; i < tbColumns.size(); i++ ) { @@ -226,8 +230,9 @@ xmlStateSet = ((MolecularMatrix)xmlMatrix).getProteinCharacterStateSet(); } - // attach base uri + // attach base uri and history note xmlMatrix.setBaseURI(mMatrixBaseURI); + getDocument().addAnnotationValue("skos:historyNote", Constants.SKOSURI, "Mapped from TreeBASE schema using NexmlMatrixConverter $Rev$"); // lookup the equivalent state in tb and attach identifiers for(StateSet tbStateSet : tbMatrix.getStateSets() ) { @@ -259,7 +264,11 @@ public org.nexml.model.ContinuousMatrix fromTreeBaseToXml(ContinuousMatrix tbMatrix) { OTUs xmlOTUs = getOTUsById(tbMatrix.getTaxa().getId()); org.nexml.model.ContinuousMatrix xmlMatrix = getDocument().createContinuousMatrix(xmlOTUs); + + // attach base uri and history note xmlMatrix.setBaseURI(mMatrixBaseURI); + getDocument().addAnnotationValue("skos:historyNote", Constants.SKOSURI, "Mapped from TreeBASE schema using NexmlMatrixConverter $Rev$"); + for ( MatrixColumn tbColumn : tbMatrix.getColumnsReadOnly() ) { org.nexml.model.Character xmlCharacter = xmlMatrix.createCharacter(); PhyloChar tbCharacter = tbColumn.getCharacter(); Property changes on: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java ___________________________________________________________________ Added: svn:keywords + Rev This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |