[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Wed Feb 27 14:54:09 UTC 2008


kawas
Wed Feb 27 09:54:09 EST 2008
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client
In directory dev.open-bio.org:/tmp/cvs-serv9742/Java/src/main/org/biomoby/client

Modified Files:
	CentralDigestCachedImpl.java 
Log Message:
fixed how the Relationship blocks are created
moby-live/Java/src/main/org/biomoby/client CentralDigestCachedImpl.java,1.27,1.28
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java	2008/02/26 20:49:18	1.27
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java	2008/02/27 14:54:09	1.28
@@ -546,11 +546,31 @@
 	    		"<authURI>"+d.getAuthority()+"</authURI>\n" + 
 	    		"<contactEmail>"+d.getEmailContact()+"</contactEmail>\n");
 	    // process HAS/HASA
+	    ArrayList<String> has = new ArrayList<String>();
+	    ArrayList<String> hasa = new ArrayList<String>();
 	    for (MobyRelationship relationship : d.getChildren()) {
-		sb.append("<Relationship relationshipType=\'urn:lsid:biomoby.org:objectrelation:"+(relationship.getRelationshipType() == Central.iHAS ? "has" : "hasa")+"\'>\n" + 
-				"<objectType articleName=\'"+relationship.getName()+"\' lsid=\'\'>"+relationship.getDataTypeName()+"</objectType>\n" + 
-				"</Relationship>\n");
+		if (relationship.getRelationshipType() == Central.iHAS) {
+		    has.add("<objectType articleName=\'"+relationship.getName()+"\' lsid=\'\'>"+relationship.getDataTypeName()+"</objectType>\n");
+		} else {
+		    hasa.add("<objectType articleName=\'"+relationship.getName()+"\' lsid=\'\'>"+relationship.getDataTypeName()+"</objectType>\n");
+		}
+	    }
+	    if (has.size() > 0) {
+		sb.append("<Relationship relationshipType=\'urn:lsid:biomoby.org:objectrelation:has\'>\n");
+		for (String s : has) {
+		    sb.append(s);
+		}
+		sb.append("</Relationship>\n");
+	    }
+	    has = null;
+	    if (hasa.size() > 0) {
+		sb.append("<Relationship relationshipType=\'urn:lsid:biomoby.org:objectrelation:hasa\'>\n");
+		for (String s : hasa) {
+		    sb.append(s);
+		}
+		sb.append("</Relationship>\n");
 	    }
+	    hasa = null;
 	    // set the isa - if it exists
 	    if (!d.getParentName().equals(""))
 		sb.append("<Relationship relationshipType=\'urn:lsid:biomoby.org:objectrelation:isa\'>\n" + 




More information about the MOBY-guts mailing list