[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Thu Jan 29 19:12:58 UTC 2009


kawas
Thu Jan 29 14:12:58 EST 2009
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended
In directory dev.open-bio.org:/tmp/cvs-serv12590/src/main/org/biomoby/shared/extended

Modified Files:
	ServiceInstanceParser.java 
Log Message:
updated to reflect the fact that >= 0 test cases are available and not 0 or 1.
moby-live/Java/src/main/org/biomoby/shared/extended ServiceInstanceParser.java,1.25,1.26
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceInstanceParser.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceInstanceParser.java	2008/10/21 16:41:22	1.25
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceInstanceParser.java	2009/01/29 19:12:58	1.26
@@ -23,6 +23,7 @@
 
 import com.hp.hpl.jena.rdf.model.Model;
 import com.hp.hpl.jena.rdf.model.ModelFactory;
+import com.hp.hpl.jena.rdf.model.NodeIterator;
 import com.hp.hpl.jena.rdf.model.RDFNode;
 import com.hp.hpl.jena.rdf.model.RDFReader;
 import com.hp.hpl.jena.rdf.model.ResIterator;
@@ -254,17 +255,23 @@
 				
 				// get/set the unit test information for the service
 				if (hoResource.hasProperty(FetaVocabulary.hasUnitTest)) {
-					Resource utResource = hoResource.getProperty(FetaVocabulary.hasUnitTest).getResource();
+				    NodeIterator ni = model.listObjectsOfProperty(hoResource, FetaVocabulary.hasUnitTest);
+				    while (ni.hasNext()) {
+					RDFNode rdfNode = ni.nextNode();
+					if (!rdfNode.isResource())
+					    continue;
+					Resource node = (Resource)rdfNode;
 					MobyUnitTest mut = new MobyUnitTest();
-					if (utResource.hasProperty(FetaVocabulary.exampleInput)) 
-						mut.setExampleInput(utResource.getProperty(FetaVocabulary.exampleInput).getObject().toString());
-					if (utResource.hasProperty(FetaVocabulary.validOutputXML)) 
-						mut.setValidOutputXML(utResource.getProperty(FetaVocabulary.validOutputXML).getObject().toString());
-					if (utResource.hasProperty(FetaVocabulary.validXPath)) 
-						mut.setValidXPath(utResource.getProperty(FetaVocabulary.validXPath).getObject().toString());
-					if (utResource.hasProperty(FetaVocabulary.validREGEX)) 
-						mut.setValidREGEX(utResource.getProperty(FetaVocabulary.validREGEX).getObject().toString());
-					service.setUnitTest(mut);
+					    if (node.hasProperty(FetaVocabulary.exampleInput)) 
+						mut.setExampleInput(node.getProperty(FetaVocabulary.exampleInput).getObject().toString());
+					    if (node.hasProperty(FetaVocabulary.validOutputXML)) 
+						mut.setValidOutputXML(node.getProperty(FetaVocabulary.validOutputXML).getObject().toString());
+					    if (node.hasProperty(FetaVocabulary.validXPath)) 
+						mut.setValidXPath(node.getProperty(FetaVocabulary.validXPath).getObject().toString());
+					    if (node.hasProperty(FetaVocabulary.validREGEX)) 
+						mut.setValidREGEX(node.getProperty(FetaVocabulary.validREGEX).getObject().toString());
+					    service.addUnitTest(mut);
+				    }
 				}
 
 			}
@@ -969,7 +976,8 @@
 
 	public static void main(String[] args) throws MobyException, MalformedURLException, IOException {
 		// show how to use this class
-		ServiceInstanceParser p = new ServiceInstanceParser("http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances");
+		ServiceInstanceParser p = new ServiceInstanceParser("http://dev.biordf.net/~kawas/signatures/unittests/BIND_IdSearchGetFastaByCdd");
+		p.setUrl("file:///C:/Users/Eddie/Desktop/BIND_IdSearchGetFastaByCdd.txt");
 		MobyService[] services = p.getMobyServicesFromRDF();
 		System.out.println(services.length);
 		if (!p.isRDFValid()) {
@@ -982,6 +990,5 @@
 		for (int i = 0; i < services.length; i++) {
 			System.out.println((services[i].toString()));
 		}
-
 	}
 }




More information about the MOBY-guts mailing list