[MOBY-guts] biomoby commit

Gary Schlitz gss at pub.open-bio.org
Wed May 19 18:26:52 UTC 2004


gss
Wed May 19 14:26:52 EDT 2004
Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets
In directory pub.open-bio.org:/tmp/cvs-serv953/src/com/acmepubs/servlets

Modified Files:
	CitationSearchServlet.java 
Log Message:
Incorporation of new parser

moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets CitationSearchServlet.java,1.7,1.8
===================================================================
RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.java	2004/04/02 00:03:39	1.7
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.java	2004/05/19 18:26:52	1.8
@@ -2,17 +2,13 @@
 
 import java.io.*;
 import java.util.*;
-
 import javax.servlet.*;
 import javax.servlet.http.*;
-
-import org.go.vocabulary.Go;
-import org.smoby.tools.common.graph.MOBYGraph;
-import org.smoby.tools.common.vocabulary.MOBY;
-import org.smoby.tools.server.servlet.AbstractMobyServlet;
-import com.acmepubs.vocabulary.AcmePubs;
-
-import com.hp.hpl.jena.rdf.model.*;
+import org.go.vocabulary.*;
+import org.smoby.servlet.*;
+import org.smoby.graph.*;
+import org.smoby.vocabulary.*;
+import com.acmepubs.vocabulary.*;
 
 /**
  * This class is a concrete subclass of AbstractMobyServlet that illustrates
@@ -39,47 +35,47 @@
      * a gene symbol and returning a URL for querying the
      * SGD database for literature pertaining to that URL.
      */
-    protected void handleRequest(MOBYGraph graph)
+    protected void handleRequest(MOBYProvider graph)
     {
         // Retrieve the subject of the moby:operatesOn statement (there is only
     	// one operatesOn statement in a valid MOBY graph)
         //
-        Resource mobyGraphSubject = (Resource) graph.getOperatesOnStmt().getObject();
-        
-        // There may be multiple moby:hasMapping statements. For each one,
-        // map its geneSymbol to a literatureGuideURL
-        //
-        StmtIterator it = graph.getModel().listStatements(
-        		mobyGraphSubject, MOBY.hasMapping, (RDFNode) null);
-        
-        while (it.hasNext())
-        {
-    		try
-			{
-	        	Statement hasMappingStmt = it.nextStatement();
-	        	Resource mobySubject = (Resource) hasMappingStmt.getObject();
-	        	
-	        	Statement geneSymbolStmt =
-	        		getFirstStatement(graph, mobySubject, AcmePubs.geneSymbol, null);
-	        	
-    			String geneSymbol = geneSymbolStmt.getString();
-    			
-    			Statement mapsToStmt = 
-    				getFirstStatement(graph, mobySubject, MOBY.mapsTo, null);
-    			
-				Resource mobyObject = (Resource) mapsToStmt.getObject();
-				
-				Statement literatureGuideURLStmt =
-					getFirstStatement(graph, mobyObject, AcmePubs.literatureGuideURL, null);
-				
-				String baseURI = "http://db.yeastgenome.org/cgi-bin/SGD/reference/geneinfo.pl?locus=";
-				literatureGuideURLStmt.changeObject(baseURI + geneSymbol);
-        	}
-    		catch (Throwable t)
-			{
-    			// Something went wrong, so proceed to next hasMapping statement
-    		}
-        }
+//        Resource mobyGraphSubject = (Resource) graph.getOperatesOnStmt().getObject();
+//        
+//        // There may be multiple moby:hasMapping statements. For each one,
+//        // map its geneSymbol to a literatureGuideURL
+//        //
+//        StmtIterator it = graph.getModel().listStatements(
+//        		mobyGraphSubject, MOBY.hasMapping, (RDFNode) null);
+//        
+//        while (it.hasNext())
+//        {
+//    		try
+//			{
+//	        	Statement hasMappingStmt = it.nextStatement();
+//	        	Resource mobySubject = (Resource) hasMappingStmt.getObject();
+//	        	
+//	        	Statement geneSymbolStmt =
+//	        		getFirstStatement(graph, mobySubject, AcmePubs.geneSymbol, null);
+//	        	
+//    			String geneSymbol = geneSymbolStmt.getString();
+//    			
+//    			Statement mapsToStmt = 
+//    				getFirstStatement(graph, mobySubject, MOBY.mapsTo, null);
+//    			
+//				Resource mobyObject = (Resource) mapsToStmt.getObject();
+//				
+//				Statement literatureGuideURLStmt =
+//					getFirstStatement(graph, mobyObject, AcmePubs.literatureGuideURL, null);
+//				
+//				String baseURI = "http://db.yeastgenome.org/cgi-bin/SGD/reference/geneinfo.pl?locus=";
+//				literatureGuideURLStmt.changeObject(baseURI + geneSymbol);
+//        	}
+//    		catch (Throwable t)
+//			{
+//    			// Something went wrong, so proceed to next hasMapping statement
+//    		}
+//        }
     }
     
     /**




More information about the MOBY-guts mailing list