[MOBY-guts] biomoby commit

Gary Schlitz gss at pub.open-bio.org
Thu Jul 29 23:35:09 UTC 2004


gss
Thu Jul 29 19:35:09 EDT 2004
Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/smoby/parser
In directory pub.open-bio.org:/tmp/cvs-serv20966/src/org/smoby/parser

Modified Files:
	Parser.java 
Log Message:
Use new graph structure

moby-live/S-MOBY/ref-impl/core/src/org/smoby/parser Parser.java,1.6,1.7
===================================================================
RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/smoby/parser/Parser.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/smoby/parser/Parser.java	2004/07/19 18:21:36	1.6
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/smoby/parser/Parser.java	2004/07/29 23:35:09	1.7
@@ -4,7 +4,6 @@
 import java.net.*;
 import java.util.*;
 import org.smoby.graph.*;
-import org.smoby.graph.impl.*;
 import org.smoby.parser.*;
 import org.smoby.tools.ModelRetriever;
 import org.smoby.tools.Util;
@@ -179,7 +178,7 @@
         
         // Create and return an unordered collection of the parsed providers
         //
-        return MOBYObjectFactory.newUnorderedCollection(null, providers, null);
+        return new MOBYUnorderedCollection(null, providers, null);
     }
     
     /**
@@ -211,9 +210,9 @@
         // Create and return a new Provider object using the provider URI, name,
         // oneLineDescription, aboutURI, and collection of operatesOn subgraphs
         //
-        return MOBYObjectFactory.newProvider(
+        return new MOBYProvider(
             provider, name, oneLiner, aboutURI,
-            MOBYObjectFactory.newUnorderedCollection(provider, operatesOn, model),
+            new MOBYUnorderedCollection(provider, operatesOn, model),
             model);
     }
     
@@ -234,7 +233,7 @@
             // hasMapping property that leads to its mapping subgraph.
             //
             Resource hasMapping = getResourcePropertyValue(res, MOBY.hasMapping);
-            return MOBYObjectFactory.newGraph(res, parseHasMapping(hasMapping), model);
+            return new MOBYGraph(res, parseHasMapping(hasMapping), model);
         }
         else
         {
@@ -318,9 +317,9 @@
         
         // Create and return a Subject to describe this hasMapping subgraph
         //
-        return MOBYObjectFactory.newSubject(res,
-            MOBYObjectFactory.newFixedCollection(res, statements, model),
-            MOBYObjectFactory.newUnorderedCollection(res, directMappings, model),
+        return new MOBYSubject(res,
+            new MOBYFixedCollection(res, statements, model),
+            new MOBYUnorderedCollection(res, directMappings, model),
             collectionFor(res, nestedMappings),
             model);
     }
@@ -362,8 +361,8 @@
         // Create and return a new MOBYObject
         //
         Model model = res.getModel();
-        return MOBYObjectFactory.newObject(res,
-            MOBYObjectFactory.newFixedCollection(res, statements, model),
+        return new MOBYObject(res,
+            new MOBYFixedCollection(res, statements, model),
             collectionFor(res, nested), model);
     }
     
@@ -395,7 +394,7 @@
             if (isMobyProperty(p, model))
             {
                 MOBYPropertyValueStatement pvalStmt =
-                    MOBYObjectFactory.newPropertyValueStatement(stmt, model);
+                    new MOBYPropertyValueStatement(stmt, model);
                 
                 Statement s = p.getProperty(RDFS.range);
                 
@@ -403,15 +402,15 @@
                 {
                     Resource range = (Resource) s.getObject();
                     if (range.equals(XSD.date)) {
-                        pvalStmt.setConstraint(MOBYObjectFactory.newDateConstraint());
+                        pvalStmt.setConstraint(new MOBYDateConstraint());
                     } else if (range.equals(XSD.integer)) {
-                        pvalStmt.setConstraint(MOBYObjectFactory.newIntegerConstraint());
+                        pvalStmt.setConstraint(new MOBYIntegerConstraint());
                     } else if (range.equals(XSD.nonNegativeInteger)) {
                         pvalStmt.setConstraint(
-                            MOBYObjectFactory.newNonNegativeIntegerConstraint());
+                            new MOBYNonNegativeIntegerConstraint());
                     } else if (range.equals(XSD.nonPositiveInteger)) {
                         pvalStmt.setConstraint(
-                            MOBYObjectFactory.newNonPositiveIntegerConstraint());
+                            new MOBYNonPositiveIntegerConstraint());
                     }
                 }
                 
@@ -486,13 +485,13 @@
     private MOBYCollection collectionFor(Resource res, List elements)
     {
         if (isList(res)) {
-            return MOBYObjectFactory.newFixedCollection(res, elements, res.getModel());
+            return new MOBYFixedCollection(res, elements, res.getModel());
         } else if (isBag(res)) {
-            return MOBYObjectFactory.newUnorderedCollection(res, elements, res.getModel());
+            return new MOBYUnorderedCollection(res, elements, res.getModel());
         } else if (isSeq(res)) {
-            return MOBYObjectFactory.newOrderedCollection(res, elements, res.getModel());
+            return new MOBYOrderedCollection(res, elements, res.getModel());
         } else if (isAlt(res)) {
-            return MOBYObjectFactory.newEnumeration(res, elements, res.getModel());
+            return new MOBYEnumeration(res, elements, res.getModel());
         } else {
             return null;
         }




More information about the MOBY-guts mailing list