[MOBY-guts] biomoby commit

Eddie Kawas kawas at pub.open-bio.org
Tue Jul 19 15:54:02 UTC 2005


kawas
Tue Jul 19 11:54:02 EDT 2005
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder
In directory pub.open-bio.org:/tmp/cvs-serv20945/org/biomoby/client/rdf/builder

Modified Files:
	ServiceInstanceRDF.java RDFConfigure.java 
Log Message:
changed the way certain properties are accessed. Also updated the registry domain. ofType predicate added to datatypes as well.

moby-live/Java/src/main/org/biomoby/client/rdf/builder ServiceInstanceRDF.java,1.4,1.5 RDFConfigure.java,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java	2005/06/09 17:35:59	1.4
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java	2005/07/19 15:54:02	1.5
@@ -15,13 +15,13 @@
 import org.biomoby.registry.properties.MobyProperties;
 import org.biomoby.shared.Central;
 import org.biomoby.shared.MobyData;
-import org.biomoby.shared.data.MobyDataSecondaryInstance;
 import org.biomoby.shared.MobyException;
 import org.biomoby.shared.MobyNamespace;
 import org.biomoby.shared.MobyPrimaryDataSet;
 import org.biomoby.shared.MobyPrimaryDataSimple;
 import org.biomoby.shared.MobySecondaryData;
 import org.biomoby.shared.MobyService;
+import org.biomoby.shared.data.MobyDataSecondaryInstance;
 
 import com.hp.hpl.jena.rdf.model.Bag;
 import com.hp.hpl.jena.rdf.model.Model;
@@ -296,8 +296,8 @@
                     .getURL()));
             subject.addProperty(DC.identifier, model
                     .createTypedLiteral("urn:lsid:"
-                            + properties.getProperty("lsid_domain")
-                            + ":serviceinstance:" + services[i].getAuthority()
+                            + MobyProperties.SERVICE_INSTANCE_PROPERTIES().getProperty("lsid_authority") +":"
+                            + MobyProperties.SERVICE_INSTANCE_PROPERTIES().getProperty("lsid_namespace") +":"+ services[i].getAuthority()
                             + "," + services[i].getName()));
             subject.addProperty(Predicates.performs_task, model
                     .createResource(SRV + services[i].getType()));
@@ -488,7 +488,7 @@
 
         return stream.getOutput();
     }
-
+  
     /*
      * convenience method that adds a resource to a model
      */

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/RDFConfigure.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/RDFConfigure.java	2005/05/31 18:11:07	1.2
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/RDFConfigure.java	2005/07/19 15:54:02	1.3
@@ -132,6 +132,14 @@
                 str = str.substring(0, str.indexOf("~"));
             newResource.addProperty(RDFS.label, rdf.createLiteral(str, "en"));
         }
+        // TODO - add the ofType property if it exists
+        if (sourceResource.hasProperty(Predicates.ofType)) {
+            String str = sourceResource.getProperty(Predicates.ofType).getObject()
+                    .toString();
+            if (str.indexOf("~") != -1)
+                str = str.substring(0, str.indexOf("~"));
+            newResource.addProperty(Predicates.ofType, str);
+        }
         if (sourceResource.hasProperty(RDFS.subClassOf)) {
             String parent = sourceResource.getProperty(RDFS.subClassOf)
                     .getObject().asNode().getURI();
@@ -447,6 +455,11 @@
         return false;
     }
 
+    public static void main(String[] args) throws IOException {
+		RDFConfigure rdfc = new RDFConfigure("http://biomoby.org/RESOURCES/MOBY-S/Objects#");
+		System.out.println(new String(rdfc.retrieveObjectRDF("http://biomoby.org/RESOURCES/MOBY-S/Objects#MSF_DIRECT_DNA")));
+		
+	}
     class FilteredStream extends FilterOutputStream {
         StringBuffer sb = null;
 




More information about the MOBY-guts mailing list