From: <car...@us...> - 2010-01-15 19:46:26
|
Revision: 3038 http://obo.svn.sourceforge.net/obo/?rev=3038&view=rev Author: cartik73 Date: 2010-01-15 19:46:19 +0000 (Fri, 15 Jan 2010) Log Message: ----------- Changed code to improve the translations of the labels of relational qualities associated with secondary entities Modified Paths: -------------- OBD-WS/trunk/src/org/obd/ws/resources/PhenotypeDetailsResource.java OBD-WS/trunk/src/org/obd/ws/resources/PhenotypeSummaryResource.java OBD-WS/trunk/src/org/obd/ws/util/TaxonomyBuilder.java OBD-WS/trunk/src/org/phenoscape/obd/OBDQuery.java Modified: OBD-WS/trunk/src/org/obd/ws/resources/PhenotypeDetailsResource.java =================================================================== --- OBD-WS/trunk/src/org/obd/ws/resources/PhenotypeDetailsResource.java 2010-01-15 18:26:23 UTC (rev 3037) +++ OBD-WS/trunk/src/org/obd/ws/resources/PhenotypeDetailsResource.java 2010-01-15 19:46:19 UTC (rev 3038) @@ -360,7 +360,10 @@ String relatedEntity = phenotype.getRelatedEntity(); if(relatedEntityId != null && relatedEntity != null){ qualityObj.put("id", qualityId + "^OBO_REL:towards(" + relatedEntityId + ")"); - qualityObj.put("name", quality + " towards " + relatedEntity); + if(quality.trim().endsWith("from") || quality.trim().endsWith("to") || quality.trim().endsWith("with")) + qualityObj.put("name", quality + " " + relatedEntity); + else + qualityObj.put("name", quality + " towards " + relatedEntity); } else{ qualityObj.put("id", qualityId); Modified: OBD-WS/trunk/src/org/obd/ws/resources/PhenotypeSummaryResource.java =================================================================== --- OBD-WS/trunk/src/org/obd/ws/resources/PhenotypeSummaryResource.java 2010-01-15 18:26:23 UTC (rev 3037) +++ OBD-WS/trunk/src/org/obd/ws/resources/PhenotypeSummaryResource.java 2010-01-15 19:46:19 UTC (rev 3038) @@ -312,8 +312,12 @@ Set<String> qAnnots = annots.get(2); Set<String> pAnnots = annots.get(3); - if(relatedEntityId != null && relatedEntity != null) - qAnnots.add(qualityId + "^OBO_REL:towards(" + relatedEntityId + ")\t" + quality + " towards " + relatedEntity); + if(relatedEntityId != null && relatedEntity != null){ + if(quality.trim().endsWith("from") || quality.trim().endsWith("to") || quality.trim().endsWith("with")) + qAnnots.add(qualityId + "^OBO_REL:towards(" + relatedEntityId + ")\t" + quality + " " + relatedEntity); + else + qAnnots.add(qualityId + "^OBO_REL:towards(" + relatedEntityId + ")\t" + quality + " towards " + relatedEntity); + } else if(count != null) qAnnots.add(qualityId + "^PHENOSCAPE:has_count(" + count + ")\t" + quality + " of " + count); else Modified: OBD-WS/trunk/src/org/obd/ws/util/TaxonomyBuilder.java =================================================================== --- OBD-WS/trunk/src/org/obd/ws/util/TaxonomyBuilder.java 2010-01-15 18:26:23 UTC (rev 3037) +++ OBD-WS/trunk/src/org/obd/ws/util/TaxonomyBuilder.java 2010-01-15 19:46:19 UTC (rev 3038) @@ -199,6 +199,7 @@ private List<PhenotypeDTO> consolidateReifIds(PhenotypeDTO phenotype, List<PhenotypeDTO> listOfEqcrLists, boolean isLeafNode) { for (PhenotypeDTO otherPhenotype : listOfEqcrLists) { if(isPhenotypeSameAsEqcrList(phenotype, otherPhenotype)){ + int index = listOfEqcrLists.indexOf(otherPhenotype); if(isLeafNode){ for (String id : phenotype.getReifIds()) { otherPhenotype.addReifId(id); @@ -214,6 +215,8 @@ otherPhenotype.removeReifId(id); } } + listOfEqcrLists.remove(index); + listOfEqcrLists.add(index, otherPhenotype); return listOfEqcrLists; } } Modified: OBD-WS/trunk/src/org/phenoscape/obd/OBDQuery.java =================================================================== --- OBD-WS/trunk/src/org/phenoscape/obd/OBDQuery.java 2010-01-15 18:26:23 UTC (rev 3037) +++ OBD-WS/trunk/src/org/phenoscape/obd/OBDQuery.java 2010-01-15 19:46:19 UTC (rev 3038) @@ -75,6 +75,7 @@ POSTCOMP_RELATIONS.put("posterior_to", "posterior to"); POSTCOMP_RELATIONS.put("BSPO:0000099", "posterior to"); POSTCOMP_RELATIONS.put("adjacent_to", "adjacent to"); + POSTCOMP_RELATIONS.put("OBO_REL:adjacent_to", "adjacent to"); } /** @@ -206,9 +207,12 @@ if(quality == null || quality.length() == 0){ quality = semanticLabel(qualityId); } - if(relEntity != null) - quality += " towards " + relEntity; - + if(relEntityId != null && relEntity != null){ + if(quality.trim().endsWith("from") || quality.trim().endsWith("to") || quality.trim().endsWith("with")) + quality += " " + relEntity; + else + quality += " towards " + relEntity; + } dto.setEntityId(entityId); dto.setEntity(entity); dto.setQualityId(qualityId); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |