[MOBY-guts] biomoby commit

Eddie Kawas kawas at pub.open-bio.org
Tue Aug 2 05:19:57 UTC 2005


kawas
Tue Aug  2 01:19:57 EDT 2005
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier
In directory pub.open-bio.org:/tmp/cvs-serv30997/org/biomoby/registry/rdfagent/verifier

Modified Files:
	DataMngr.java ServiceDescrParser.java 
Log Message:
Fixed the all the bugs detected by my driver, except for the ability to remove all inputs when no outputs exist when a secondary input exists.
Ed

moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier DataMngr.java,1.11,1.12 ServiceDescrParser.java,1.8,1.9
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/DataMngr.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/DataMngr.java	2005/07/29 22:19:05	1.11
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/DataMngr.java	2005/08/02 05:19:57	1.12
@@ -216,7 +216,7 @@
 
     public static void processService(Hashtable servSign, Hashtable servInp,
             Hashtable servOut, String servname, String authURI, String signURL) {
-
+        
         Connection con = DBConnector.getConnection();
         String servName = "";
         String cat = "moby";
@@ -333,30 +333,7 @@
                     || !authoritative.equals(signature.getAuthoritative())
                     || !authuri.equals(authURI)) {
 
-                //TODO
-                Log.info("Updating the service '" + servName
-                        + "' since the RDF document has been modified.");
                 if (signatureURL.equals("NNN")) {
-                    Log.info("sig == NNN" + signURL);
-                    Log
-                            .info("<servName,cat,stype,authuri,url,email,desc,authoritative,signURL>=<"
-                                    + servName
-                                    + ","
-                                    + cat
-                                    + ","
-                                    + stype
-                                    + ","
-                                    + authuri
-                                    + ","
-                                    + url
-                                    + ","
-                                    + email
-                                    + ","
-                                    + desc
-                                    + ","
-                                    + authoritative
-                                    + ","
-                                    + signURL + ">");
                     int res = updSign(servName, cat, stype, authuri, url,
                             email, desc, authoritative, signURL);
                     if (res == 1) {
@@ -372,7 +349,6 @@
                     }
 
                 } else {
-                    Log.info("sig != NNN");
                     int res = updSign(servName, cat, stype, authuri, url,
                             email, desc, authoritative, signatureURL);
                     if (res == 1) {
@@ -412,10 +388,13 @@
             if (delRow("simple_input", servInstId) == 1)
                 dels = 1;
         }
+
+        // check if there is at lease one simple input
         if (!servInp.containsKey("siminp1")) {
             if (delRow("simple_input", servInstId) == 1)
                 dels = 1;            
         }
+        // check if there is at least one collection input
         if (!servInp.containsKey("colinp1")) {
             delCollectionMember("input", servInstId);
             if (delRow("collection_input", servInstId) == 1)
@@ -568,6 +547,8 @@
                 Report.doWrite("collection_input_id: " + colId);
                 //					Log.info("collection_input_id: "+colId);
             }
+            // TODO - made this change to clear the collection input id
+            colId = 0;
         }
 
         Report.doWrite("service_instance_id: " + servInstId);
@@ -628,7 +609,6 @@
                 Report.doWrite("Simple output " + so);
                 Report.add("Simple output " + so + ":");
 
-                //TODO bug #13 here?
                 if (delsout == 0) {
                     delRow("simple_output", servInstId); // delete from
                     // simple_output table
@@ -652,23 +632,23 @@
                     if (col_art.equals(" ")) {
                         col_art = null;
                     }
-                }
+                } else
                 if (ob1.equals("articleName")) {
                     art = simple.get(ob1).toString();
                     if (art.equals(" ")) {
                         art = null;
                     }
-                }
+                } else 
                 if (ob1.equals("object_type_uri")) {
                     obt = simple.get(ob1).toString();
-                }
+                } else
                 if (ob1.equals("namespace_type_uris")) {
                     nst = simple.get(ob1).toString();
                 }
             }
 
             if (simcol.equals("colout")) {
-
+                //TODO bug 36 here? 
                 insIntoCol("collection_output", col_art, servInstId); // insert
                 // the row
                 // into
@@ -681,6 +661,7 @@
                 art = null;
                 obt = null;
                 nst = null;
+                col_art = null;
             }
             // TODO bug #11 here - fixed
             if (simcol.equals("simout")) {
@@ -694,6 +675,7 @@
                 Report.doWrite("collection_output_id: " + colOutId);
                 //                  Log.info("collection_output_id: "+coloutId);
             }
+            colOutId = null;
         }
         //	return serv;
     }

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/ServiceDescrParser.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/ServiceDescrParser.java	2005/07/29 22:17:39	1.8
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/ServiceDescrParser.java	2005/08/02 05:19:57	1.9
@@ -377,6 +377,7 @@
                             | type.equals(RDF.Bag)) {
                         //					if (l3Res.hasProperty(RDF.type,RDF.Bag) &&
                         // l3Res.hasProperty(RDF.li(1))){
+                        
                         if (l3Res.hasProperty(RDF.li(1))) {
                             StmtIterator p34iter = l3Res.listProperties();
                             if (l3Res.hasProperty(MP.articleName)) {
@@ -385,6 +386,8 @@
                                 String[] rezNode = col_artName.split(":http:");
                                 col_artName = rezNode[0];
                                 colinp.put("col_articleName", col_artName);
+                            } else if (colinp.containsKey("col_articleName")) {
+                                colinp.remove("col_articleName");
                             }
                             while (p34iter.hasNext()) {
                                 Statement l4iter = p34iter.nextStatement();
@@ -446,20 +449,21 @@
                                                         .toString());
                                                 colinp.put(name, lsid_nsp);
                                             } else if (name.equals("articleName")) {
-                                                colinp.put(name, l5Node.getName());
+                                                colinp.put(name, rezNode[0]);
                                             }else {
                                                 colinp.put(name, l5Node);
                                             }
                                         }
-                                        input.put("colinp" + cin, colinp);
-                                        cin += 1;
+                                        input.put("colinp" + cin++, colinp);
                                         Enumeration num = colinp.keys();
-                                        String col_name = (String)colinp.get("col_articleName");
+                                        String col_name = null;
+                                        if (colinp.containsKey("col_articleName"))
+                                            col_name = (String)colinp.get("col_articleName");
                                         colinp = new Hashtable();
-                                        colinp.put("col_articleName", col_name);
+                                        if (col_name != null)
+                                            colinp.put("col_articleName", col_name);
                                     }
                                 }
-
                             }
                         } else {
                             collection = "error";
@@ -647,6 +651,8 @@
                                 String[] rezNode = col_artName.split(":http:");
                                 col_artName = rezNode[0];
                                 colout.put("col_articleName", col_artName);
+                            }  else if (colout.containsKey("col_articleName")) {
+                                colout.remove("col_articleName");
                             }
                             while (p34iter.hasNext()) {
                                 Statement l4iter = p34iter.nextStatement();
@@ -713,13 +719,14 @@
                                                 colout.put(name, l5Node);
                                             }
                                         }
-                                        //TODO BUG here. colout should be 'new' and not recycled
-                                        output.put("colout" + co, colout);
-                                        co += 1;
-                                        Enumeration num = colout.keys();
-                                        String col_name = (String)colout.get("col_articleName");
+                                        output.put("colout" + co++, colout);
+                                        Enumeration num = colout.keys(); //why?
+                                        String col_name = null;
+                                        if (colout.containsKey("col_articleName"))
+                                            col_name = (String)colout.get("col_articleName");
                                         colout = new Hashtable();
-                                        colout.put("col_articleName", col_name);
+                                        if (col_name != null)
+                                            colout.put("col_articleName", col_name);
                                     }
                                 }
 
@@ -742,7 +749,6 @@
         } catch (Exception e) {
             Log.warning("Failed (ServiceDescrParser.java-getOutput): " + e);
         }
-        //System.out.println("output = "+output);
         return output;
     }
 




More information about the MOBY-guts mailing list