[MOBY-guts] biomoby commit

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


gss
Wed May 19 14:26:41 EDT 2004
Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/org/smoby/ref/tools/db
In directory pub.open-bio.org:/tmp/cvs-serv634/src/org/smoby/ref/tools/db

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

moby-live/S-MOBY/ref-impl/server/src/org/smoby/ref/tools/db StorageManager.java,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/org/smoby/ref/tools/db/StorageManager.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/org/smoby/ref/tools/db/StorageManager.java	2004/03/29 19:40:08	1.2
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/org/smoby/ref/tools/db/StorageManager.java	2004/05/19 18:26:41	1.3
@@ -1,10 +1,9 @@
 package org.smoby.ref.tools.db;
 
-import org.smoby.tools.common.*;
-import org.smoby.tools.common.graph.*;
+import org.smoby.graph.*;
+import org.smoby.graph.impl.MOBYProviderImpl;
 import org.smoby.ref.tools.*;
-import org.smoby.tools.common.vocabulary.*;
-
+import org.smoby.vocabulary.*;
 import com.hp.hpl.jena.db.*;
 import com.hp.hpl.jena.rdf.model.*;
 import com.hp.hpl.jena.shared.*;
@@ -65,28 +64,16 @@
      * are in the provider graph's namespace will be stored in the global repository,
      * and all statements from the provider graph are stored in a separate model
      * that has as its name the fully expanded URI of the provider.
-     * @param providerGraph the graph to store
+     * @param provider the Provider to store
      * @param lastModifiedDate when the graph was last modified
      * @throws StorageException if unable to access the database
      */
-	public void registerProviderGraph(MOBYGraph providerGraph, Date lastModifiedDate)
-        throws StorageException
-	{
-        registerGraph(providerGraph.getModel(),
-                      providerGraph.getProvider(),
-                      lastModifiedDate);
-	}
-    
-    public void registerGraph(Model graph, String uri, Date lastModifiedDate)
-        throws StorageException
-    {
-    	registerGraph(graph, graph.createResource(uri), lastModifiedDate);
-    }
-    
-    public void registerGraph(Model graph, Resource uri, Date lastModifiedDate)
+	public void registerProvider(MOBYProvider provider, Date lastModifiedDate)
         throws StorageException
 	{
+	    Model model = ((MOBYProviderImpl) provider).getUnderlying();
         Model dbModel = null;
+        Resource uri = model.createResource(provider.getURI());
         
         try
         {
@@ -114,7 +101,7 @@
             //
             String providerNameSpace = uri.getNameSpace();
             
-            for (StmtIterator it = graph.listStatements(); it.hasNext();)
+            for (StmtIterator it = model.listStatements(); it.hasNext();)
             {
                 Statement stmt = it.nextStatement();
                 Resource subject = stmt.getSubject();
@@ -132,8 +119,8 @@
             // Add to the database another model, with the provider URL as its name
             //
             Model providerModel = maker.createModel(uri.getURI());
-            providerModel.add(graph);
-            providerModel.setNsPrefixes(graph.getNsPrefixMap());
+            providerModel.add(model);
+            providerModel.setNsPrefixes(model.getNsPrefixMap());
             
             // Add a statement asserting when the model was added to the database
             //




More information about the MOBY-guts mailing list