[MOBY-guts] biomoby commit

Gary Schlitz gss at pub.open-bio.org
Fri Apr 2 00:03:19 UTC 2004


gss
Thu Apr  1 19:03:19 EST 2004
Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet
In directory pub.open-bio.org:/tmp/cvs-serv8570/ref-impl/core/org/smoby/tools/server/servlet

Modified Files:
	AbstractMobyServlet.java 
Log Message:
Major commit just before MOBY meeting at CSHL

moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet AbstractMobyServlet.java,1.5,1.6
===================================================================
RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet/AbstractMobyServlet.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet/AbstractMobyServlet.java	2004/04/01 00:23:46	1.5
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet/AbstractMobyServlet.java	2004/04/02 00:03:19	1.6
@@ -93,6 +93,26 @@
     }
     
     /**
+     * Helper method for returning the first statement (if any) from a source
+     * graph's model, that has the given subject, predicate, and object.
+     * @param source graph from which the model should be queried
+     * @param subject subject of the matching statement
+     * @param predicate predicate of the matching statement
+     * @param object object of the matching statement
+     * @return the first matching statement
+     */
+    protected Statement getFirstStatement(
+    	MOBYGraph source, Resource subject, Property predicate, RDFNode object)
+	{
+    	StmtIterator it = source.getModel().listStatements(subject, predicate, object);
+    	if (it.hasNext()) {
+    		return it.nextStatement();
+    	} else {
+    		return null;
+    	}
+    }
+    
+    /**
      * By MOBY convention, an HTTP POST equates to a request for the service
      * provided by a provider.
      */




More information about the MOBY-guts mailing list