[MOBY-guts] biomoby commit

senger@ebi.ac.uk senger at pub.open-bio.org
Fri Sep 24 19:52:56 UTC 2004


senger
Fri Sep 24 15:52:56 EDT 2004
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client
In directory pub.open-bio.org:/tmp/cvs-serv32055/src/main/org/biomoby/client

Modified Files:
	CentralImpl.java Graphviz.java 
Log Message:
signatureURL was missing in service response object

moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.15,1.16 Graphviz.java,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java	2004/09/23 10:20:29	1.15
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java	2004/09/24 19:52:55	1.16
@@ -407,8 +407,9 @@
      *    <Service authURI="authority.URI.here" serviceName="MyService">
      *      <serviceType>Service_Ontology_Term</serviceType>
      *      <Category>moby</Category> <!-- or 'cgi' or 'soap' -->
-     *      <URL>http://service.endpoint.here/scriptname</URL>
      *      <contactEmail>your at email.addy.here</contactEmail>
+     *      <signatureURL>http://service.RDF.here</signatureURL>
+     *      <URL>http://service.endpoint.here/scriptname</URL>
      *      <authoritative>1</authoritative>
      *      <Input>
      *           <!-- one or more Simple and/or Complex Primary articles -->
@@ -453,6 +454,8 @@
 		    service.setCategory (children.item (j).getFirstChild().getNodeValue());
 		} else if (nodeName.equals ("URL")) {
 		    service.setURL (children.item (j).getFirstChild().getNodeValue());
+		} else if (nodeName.equals ("signatureURL")) {
+		    service.setSignatureURL (children.item (j).getFirstChild().getNodeValue());
 		} else if (nodeName.equals ("contactEmail")) {
 		    service.setEmailContact (children.item (j).getFirstChild().getNodeValue());
 		} else if (nodeName.equals ("serviceType")) {

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/Graphviz.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/Graphviz.java	2004/09/22 21:11:17	1.3
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/Graphviz.java	2004/09/24 19:52:56	1.4
@@ -93,8 +93,8 @@
 		    edgeAttrs.append ("]");
 		}
 		buf.append ("\t" +
-			    edge.sourceService.getName() + " -> " +
-			    edge.targetService.getName() +
+			    quoteIt (edge.sourceService.getName()) + " -> " +
+			    quoteIt (edge.targetService.getName()) +
 			    new String (edgeAttrs) + "\n");
 	    }
 	}
@@ -132,15 +132,15 @@
 	    String[] parents = type.getParentNames();
 	    for (int i = 0; i < parents.length; i++) {
 		buf.append ("\t");
-		buf.append (trName (Utils.pureName (parents[i])));
+		buf.append (quoteIt (trName (Utils.pureName (parents[i]))));
 		buf.append (" -> ");
-		buf.append (trName (name));
+		buf.append (quoteIt (trName (name)));
 		buf.append (";\n");
 	    }
 	    MobyRelationship[] children = type.getChildren();
 	    if (children.length > 0) {
 		String dummyName = trName (name) + "_HASA";
-		buf.append ("\t" + trName (name) + " -> " + dummyName);
+		buf.append ("\t" + quoteIt (trName (name)) + " -> " + quoteIt (dummyName));
 		buf.append (" [style=dotted,dir=forward,arrowhead=none,arrowtail=ediamond];\n");
 		StringBuffer hasaBuf = new StringBuffer();
 		for (int i = 0; i < children.length; i++) {
@@ -150,7 +150,7 @@
 			childType = "n/a";  // should not happen I guess
 		    hasaBuf.append (" | {" + childType + "|" + childName + "}");
 		}
-		buf.append ("\t" + dummyName + " [shape=record, label=\"HAS[A]");
+		buf.append ("\t" + quoteIt (dummyName) + " [shape=record, label=\"HAS[A]");
 		buf.append (hasaBuf);
 		buf.append ("\"];\n");
 	    }
@@ -187,9 +187,9 @@
 	    String[] parents = type.getParentNames();
 	    for (int i = 0; i < parents.length; i++) {
 		buf.append ("\t");
-		buf.append (trName (Utils.pureName (parents[i])).toLowerCase());
+		buf.append (quoteIt (trName (Utils.pureName (parents[i])).toLowerCase()));
 		buf.append (" -> ");
-		buf.append (trName (name).toLowerCase());
+		buf.append (quoteIt (trName (name).toLowerCase()));
 		buf.append (";\n");
 	    }
 	}
@@ -219,4 +219,16 @@
 	return name.replace ('-', '_');
     }
 
+    /*************************************************************************
+     * Surround given text by quotes. This will prevent errors
+     * encoutered by 'dot' when names have whitespaces or when they
+     * are identical to the 'dot's keywords (such as 'edge').
+     *
+     * @param name to be quoted
+     * @return changed 'name'
+     *************************************************************************/
+    public static String quoteIt (String name) {
+	return "\"" + name + "\"";
+    }
+
 }




More information about the MOBY-guts mailing list