[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Sun Dec 9 03:43:22 UTC 2007


gordonp
Sat Dec  8 22:43:22 EST 2007
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared
In directory dev.open-bio.org:/tmp/cvs-serv4687/src/main/org/biomoby/shared

Modified Files:
	MobyService.java 
Log Message:
Changed makeshift LSID resolution to new default Moby Central in Calgary
moby-live/Java/src/main/org/biomoby/shared MobyService.java,1.21,1.22
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java	2007/12/07 20:24:03	1.21
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java	2007/12/09 03:43:22	1.22
@@ -523,29 +523,26 @@
 	String lsid = "urn:lsid:biomoby.org:serviceinstance:"+authority+","+name;
 	if(!serviceMap.containsKey(lsid)){
 	    try{
-		URL lsidResolver = new URL("http://mobycentral.icapture.ubc.ca/authority/lsid/ResolveLSID?lsid="+lsid);
+		// Note: when we properly implement LSID resolution in Java (hopefully soon), 
+		// the metadata resolution URL below will come from DNS SRV records...and we'll parse the XML
+		// rather than using a regex :-)
+		URL lsidResolver = new URL("http://moby.ucalgary.ca/authority/metadata/?lsid="+lsid);
 		Object o = getContent(lsidResolver);
 		if(!(o instanceof String)){
 		    System.err.println("Response for "+lsid + " was not a String, but a " + o.getClass());
 		}
 		String metadata = (String) o;
 
-		String redirectPattern = "latest>";
+		String redirectPattern = "latest>";
 		int redirectStringIndex = metadata.indexOf(redirectPattern+lsid);
 		String lsidFull = null;
 		if(redirectStringIndex != -1){
 		    int lsidFullIndex = redirectStringIndex+redirectPattern.length();
 		    lsidFull = metadata.substring(lsidFullIndex, lsidFullIndex+lsid.length()+21);
 		    //System.err.println("Retrieving full LSID " + lsidFull);
-		    lsidResolver = new URL("http://mobycentral.icapture.ubc.ca/authority/lsid/ResolveLSID?lsid="+lsidFull);
+		    lsidResolver = new URL("http://moby.ucalgary.ca/authority/metadata/?lsid="+lsidFull);
 		    metadata = getContent(lsidResolver);
 		}
-		metadata = Pattern.compile(".*(<\\?xml\\s.*RDF>).*", Pattern.DOTALL).matcher(metadata).replaceFirst("$1")
-		    .replaceAll(">",">")
-		    .replaceAll("&lt;","<")
-		    .replaceAll("&quot;", "\"")
-		    .replaceAll("&amp;", "&");
-		//System.err.println(metadata);
 
 		ServiceInstanceParser p = new ServiceInstanceParser();
 		services = p.getMobyServicesFromRDF(metadata);




More information about the MOBY-guts mailing list