[MOBY-guts] biomoby commit

Gary Schiltz gss at pub.open-bio.org
Thu Oct 27 22:22:09 UTC 2005


gss
Thu Oct 27 18:22:09 EDT 2005
Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser
In directory pub.open-bio.org:/tmp/cvs-serv10259/src/org/semanticmoby/parser

Modified Files:
	Parser.java 
Log Message:
Refer to Resource rather than Service

s-moby/ref-impl/core/src/org/semanticmoby/parser Parser.java,1.6,1.7
===================================================================
RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser/Parser.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser/Parser.java	2005/10/09 01:33:06	1.6
+++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser/Parser.java	2005/10/27 22:22:08	1.7
@@ -48,7 +48,7 @@
      */
     public Parser(Model model) {
 
-        StmtIterator it = model.listStatements(null, RDF.type, MOBY.Service);
+        StmtIterator it = model.listStatements(null, RDF.type, MOBY.Resource);
 
         while (it.hasNext()) {
 
@@ -157,31 +157,31 @@
 
 
     /**
-     * Parse a MOBYService from the model. If the model contains multiple
-     * services, only one will be returned (at random), so if the model is
-     * expected to contain multiple services, then call parseServices() instead to get all the providers in a
+     * Parse a MOBYResource from the model. If the model contains multiple
+     * resources, only one will be returned (at random), so if the model is
+     * expected to contain multiple resources, then call parseResources() instead to get all the providers in a
      * MOBYCollection.
      */
-    public MOBYService parseService() throws NonCanonicalException {
+    public MOBYResource parseResource() throws NonCanonicalException {
 
-        List services = parseServices();
+        List resources = parseResources();
 
-        if (services.size() == 0) {
+        if (resources.size() == 0) {
 
             return null;
         } else {
 
-            return (MOBYService) services.iterator().next();
+            return (MOBYResource) resources.iterator().next();
         }
     }
 
 
     /**
-     * Parse and return an list of MOBYService objects
+     * Parse and return an list of MOBYResource objects
      */
-    public List parseServices() throws NonCanonicalException {
+    public List parseResources() throws NonCanonicalException {
 
-        ArrayList services = new ArrayList();
+        ArrayList resources = new ArrayList();
 
         Iterator  it = subModels.iterator();
 
@@ -189,24 +189,24 @@
 
             Model        model = (Model) it.next();
             StmtIterator it2 =
-                model.listStatements(null, RDF.type, MOBY.Service);
+                model.listStatements(null, RDF.type, MOBY.Resource);
 
             if (it2 != null) {
 
                 Statement stmt = it2.nextStatement();
-                services.add(parseService(stmt));
+                resources.add(parseResource(stmt));
             }
         }
 
-        return services;
+        return resources;
     }
 
 
     /**
-     * Parse a service starting from the given resource (i.e. a resource that
-     * is the subject of an rdf:type statement with object of moby:Service)
+     * Parse a resource starting from the given resource (i.e. a resource that
+     * is the subject of an rdf:type statement with object of moby:Resource)
      */
-    public MOBYService parseService(Statement typeStmt)
+    public MOBYResource parseResource(Statement typeStmt)
                              throws NonCanonicalException {
 
         Resource headResource = typeStmt.getSubject();
@@ -222,7 +222,7 @@
 
         Statement aboutURIStmt = model.getProperty(headResource, MOBY.aboutURI);
 
-        // A service can have multiple operatesOn properties, each of
+        // A resource can have multiple operatesOn properties, each of
         // which leads to a subgraph. Parse each of these subgraphs.
         //
         Map          operatesOn = new HashMap();
@@ -237,10 +237,10 @@
             operatesOn.put(operatesOnStmt, parseOperatesOn(r));
         }
 
-        // Create and return a new Service object using the service URI, name,
+        // Create and return a new Resource object using the resource URI, name,
         // oneLineDescription, aboutURI, and collection of operatesOn subgraphs
         //
-        return new MOBYService(model, typeStmt, nameStmt,
+        return new MOBYResource(model, typeStmt, nameStmt,
                                oneLineDescriptionStmt, aboutURIStmt, operatesOn);
     }
 




More information about the MOBY-guts mailing list