[MOBY-guts] biomoby commit

Gary Schlitz gss at pub.open-bio.org
Mon Mar 29 19:35:51 UTC 2004


gss
Mon Mar 29 14:35:51 EST 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-serv22797/src/com/acmepubs/servlets

Modified Files:
	CitationSearchServlet.java 
Log Message:
Fixed description graph

moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets CitationSearchServlet.java,1.3,1.4
===================================================================
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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.java	2004/03/27 01:17:45	1.3
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.java	2004/03/29 19:35:51	1.4
@@ -9,9 +9,8 @@
 import org.smoby.tools.common.graph.MOBYGraph;
 import org.smoby.tools.server.servlet.AbstractMobyServlet;
 
-import com.hp.hpl.jena.rdf.model.Model;
-import com.hp.hpl.jena.rdf.model.Resource;
-import com.hp.hpl.jena.rdf.model.StmtIterator;
+import com.acmepubs.vocabulary.AcmePubs;
+import com.hp.hpl.jena.rdf.model.*;
 
 /**
  * This class is a concrete subclass of AbstractMobyServlet that illustrates
@@ -41,11 +40,40 @@
     protected void handleRequest(MOBYGraph graph)
     {
         Model model = graph.getModel();
+        
+        // Retrieve the subject of the moby:mapsTo statement
+        //
         Resource subject = graph.getMapsToStmt().getSubject();
-//        StmtIterator it = model.listStatements(subject, AcmePubs.geneID, null);
-//        
-//        while (it.hasNext())
-//        String geneID = graph.getMapsToStmt().getObject().toString();
+        
+        // Retrieve the subject of the acmepubs:geneID statement
+        //
+        StmtIterator it = model.listStatements(
+        	subject, AcmePubs.geneID, (String) null);
+        
+        if (it.hasNext())
+        {
+        	Statement s = it.nextStatement();
+        	String geneID = s.getString();
+        	String pubDate = getPubDate(geneID);
+        	if (pubDate != null)
+        	{
+        		StmtIterator it2 = model.listStatements(
+        			(Resource) graph.getMapsToStmt().getObject(),
+					AcmePubs.pubDate,
+					(RDFNode) null);
+        		
+        		if (it2.hasNext())
+        		{
+        			Statement s2 = it2.nextStatement();
+        			
+        		}
+        	}
+        }
+    }
+    
+    private String getPubDate(String geneID)
+	{
+    	return "";
     }
     
     /**




More information about the MOBY-guts mailing list