From senger at pub.open-bio.org Thu Apr 1 11:41:03 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu Apr 1 11:33:37 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404011641.i31Gf3t6006392@pub.open-bio.org> senger Thu Apr 1 11:41:03 EST 2004 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv6373/src/Clients Modified Files: MobyGraphs.java Log Message: moby-live/Java/src/Clients MobyGraphs.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2003/11/25 13:18:10 1.3 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2004/04/01 16:41:03 1.4 @@ -179,13 +179,18 @@ } edges = FilterServices.filter (edges, authorities, serviceNames, depth); - String[] pathEnds = cmd.getParam ("-path", 2); - if (pathEnds.length == 2) + if (cmd.hasParam ("-path")) { + String[] pathEnds = cmd.getParam ("-path", 2); + if (pathEnds[0] == null || pathEnds[1] == null) { + System.err.println ("Missing value for parameter '-path'. It should be followed by two service names."); + System.exit (1); + } edges = FilterServices.pathes (edges, pathEnds[0], pathEnds[1]); - if (edges == null) { - System.err.println ("No connection found between '" + - pathEnds[0] + "' and '" + pathEnds[1] + "'"); - System.exit(1); + if (edges == null) { + System.err.println ("No connection found between '" + + pathEnds[0] + "' and '" + pathEnds[1] + "'"); + System.exit(1); + } } // create a graph (in whatever format) From senger at pub.open-bio.org Thu Apr 1 11:41:03 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu Apr 1 11:33:37 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404011641.i31Gf3Vp006415@pub.open-bio.org> senger Thu Apr 1 11:41:03 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv6373/src/main/org/biomoby/client Modified Files: CentralImpl.java ServiceConnections.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.7,1.8 ServiceConnections.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/03/09 00:20:13 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 16:41:03 1.8 @@ -587,8 +587,12 @@ NodeList children = elem.getChildNodes(); for (int j = 0; j < children.getLength(); j++) { if (children.item (j).getNodeName().equals ("Description")) { - results.put (elem.getAttribute ("name"), - children.item (j).getFirstChild().getNodeValue()); + String desc; + if (children.item (j).getFirstChild() == null) + desc = ""; + else + desc = children.item (j).getFirstChild().getNodeValue(); + results.put (elem.getAttribute ("name"), desc); break; } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java 2003/10/17 13:13:34 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java 2004/04/01 16:41:03 1.2 @@ -69,7 +69,7 @@ Hashtable dataTypesTable = new Hashtable(); for (int i = 0; i < dataTypes.length; i++) { MobyDataType dataType = dataTypes[i]; - dataTypesTable.put (dataType.getName().toLowerCase(), dataType); + dataTypesTable.put (Utils.pureName (dataType.getName()).toLowerCase(), dataType); } // here we are going to build the resulting edges @@ -117,12 +117,13 @@ // ...find the data type of this output String dataTypeName = output.getDataType().getName(); MobyDataType dataType = - (MobyDataType)dataTypesTable.get (dataTypeName.toLowerCase()); + (MobyDataType)dataTypesTable.get (Utils.pureName (dataTypeName).toLowerCase()); if (dataType == null) { // this means that there is something wrong with the Moby central registration System.err.println ("Service " + name + " has an unknown output data type '" + Utils.pureName (dataTypeName) + "'"); + System.err.println ("\tLSID: " + dataTypeName); continue; } @@ -239,10 +240,11 @@ String connector = null; MobyDataType outputType = - (MobyDataType)dataTypes.get (output.getDataType().getName().toLowerCase()); - - String outputName = outputType.getName(); - String inputName = input.getDataType().getName(); + (MobyDataType)dataTypes.get (Utils.pureName (output.getDataType().getName()).toLowerCase()); + if (outputType == null) // strange... + return null; + String outputName = Utils.pureName (outputType.getName()); + String inputName = Utils.pureName (input.getDataType().getName()); if (outputName.equals (inputName)) connector = outputName; @@ -275,7 +277,9 @@ if (inputName.equals (parents[i])) return true; MobyDataType outputType = - (MobyDataType)dataTypes.get (parents[i].toLowerCase()); + (MobyDataType)dataTypes.get (Utils.pureName (parents[i]).toLowerCase()); + if (outputType == null) // strange? + return false; if (findMatchInParents (outputType.getParentNames(), inputName, dataTypes)) return true; } From gordonp at pub.open-bio.org Thu Apr 1 12:30:08 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Thu Apr 1 12:36:53 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404011730.i31HU8PW006626@pub.open-bio.org> gordonp Thu Apr 1 12:30:08 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv6601 Modified Files: CentralImpl.java Log Message: Implements response caching, and uses JAXP DocumentBuilder to harness a XML parser in a more platform independent way moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 16:41:03 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 17:30:08 1.9 @@ -61,11 +61,12 @@ public class CentralImpl implements Central { - + private Hashtable cache; // To not call MOBY Central everytime the same method is called private URL endpoint; private String uri; - private ParserWrapper parser; + private javax.xml.parsers.DocumentBuilder docBuilder; private boolean debug = false; + private boolean useCache = true; /** Default location (endpoint) of a Moby registry. */ // public static final String DEFAULT_ENDPOINT = "http://mobycentral.cbr.nrc.ca/cgi-bin/MOBY-Central.pl"; @@ -118,8 +119,18 @@ } this.uri = namespace; - // instantiate a DOM parser - parser = Utils.getDOMParser(); + // This method should work on almost all platforms to get an XML parser instance + try { + javax.xml.parsers.DocumentBuilderFactory dbf = + javax.xml.parsers.DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + docBuilder = dbf.newDocumentBuilder(); + } catch (Exception e) { + throw new MobyException ("Could not configure an XML parser: " + e); + } + + cache = new Hashtable(); + useCache = true; } /************************************************************************* @@ -192,8 +203,11 @@ String id = "", success = "0", message = ""; // parse returned XML - Document document = parser.parse (new StringReader (xml)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(xml));} + catch(Exception e){throw new MobyException(e.toString());} Element root = document.getDocumentElement(); + NodeList children = root.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { if (children.item (i).getNodeType() != Node.ELEMENT_NODE) @@ -403,8 +417,11 @@ *************************************************************************/ protected MobyService[] extractServices (String xml) throws MobyException { + + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(xml));} + catch(Exception e){throw new MobyException(e.toString());} - Document document = parser.parse (new StringReader (xml)); NodeList list = document.getElementsByTagName ("Service"); MobyService[] results = new MobyService [list.getLength()]; for (int i = 0; i < list.getLength(); i++) { @@ -491,18 +508,31 @@ *************************************************************************/ public Map getServiceNames() throws MobyException { + + // First, check to se if we have the values cached from a previous call + // in this instance + if(useCache && cache.containsKey("retrieveServiceNames")) + return (Map) cache.get("retrieveServiceNames"); + String result = (String)doCall ("retrieveServiceNames", new Object[] {}); // parse returned XML Map results = new HashMap(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("serviceName"); for (int i = 0; i < list.getLength(); i++) { Element elem = (Element)list.item (i); results.put (elem.getAttribute ("name"), elem.getAttribute ("authURI")); } + + // Add this data to the cache in case we get called again + if(useCache) + cache.put("retrieveServiceNames", results); return results; } @@ -516,15 +546,27 @@ *************************************************************************/ public String[] getProviders() throws MobyException { + + // First, see if we have the values cached from a previous call in this instance + if(useCache && cache.containsKey("retrieveServiceProviders")) + return (String[]) cache.get("retrieveServiceProviders"); + String result = (String)doCall ("retrieveServiceProviders", new Object[] {}); // parse returned XML - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("serviceProvider"); String[] results = new String [list.getLength()]; for (int i = 0; i < list.getLength(); i++) results[i] = ((Element)list.item (i)).getAttribute ("name"); + + // Add this data to the cache in case we get called again + if(useCache) + cache.put("retrieveServiceProviders", results); return results; } @@ -541,12 +583,19 @@ *************************************************************************/ public Map getServiceTypes() throws MobyException { + // First, see if we have the values cached from a previous call in this instance + if(useCache && cache.containsKey("retrieveServiceTypes")) + return (Map) cache.get("retrieveServiceTypes"); + String result = (String)doCall ("retrieveServiceTypes", new Object[] {}); // parse returned XML Map results = new HashMap(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("serviceType"); for (int i = 0; i < list.getLength(); i++) { Element elem = (Element)list.item (i); @@ -559,6 +608,10 @@ } } } + + // Add this data to the cache in case we get called again + if(useCache) + cache.put("retrieveServiceTypes", results); return results; } @@ -575,28 +628,43 @@ *************************************************************************/ public Map getNamespaces() throws MobyException { + + // First, see if we have the values cached from a previous call in this instance + if(useCache && cache.containsKey("retrieveNamespaces")) + return (Map) cache.get("retrieveNamespaces"); + String result = (String)doCall ("retrieveNamespaces", new Object[] {}); // parse returned XML Map results = new HashMap(); - Document document = parser.parse (new StringReader (result)); - NodeList list = document.getElementsByTagName ("Namespace"); - for (int i = 0; i < list.getLength(); i++) { + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + + NodeList list = document.getDocumentElement().getElementsByTagName ("Namespace"); + if(list == null || list.getLength() == 0){ + throw new MobyException("Could not find Namespace children of response root node " + + document.getDocumentElement()); + } + int length = list.getLength(); + for (int i = 0; i < length; i++) { Element elem = (Element)list.item (i); - NodeList children = elem.getChildNodes(); - for (int j = 0; j < children.getLength(); j++) { - if (children.item (j).getNodeName().equals ("Description")) { - String desc; - if (children.item (j).getFirstChild() == null) - desc = ""; - else - desc = children.item (j).getFirstChild().getNodeValue(); - results.put (elem.getAttribute ("name"), desc); - break; - } + NodeList children = elem.getElementsByTagName("Description"); + if(children.item(0).hasChildNodes()){ + children.item(0).normalize(); + results.put (elem.getAttribute ("name"), + children.item(0).getFirstChild().getNodeValue()); + } + else{ + // No description provided + results.put (elem.getAttribute ("name"), ""); } } + + // Add this data to the cache in case we get called again + if(useCache) + cache.put("retrieveNamespaces", results); return results; } @@ -613,12 +681,19 @@ *************************************************************************/ public Map getDataTypeNames() throws MobyException { + // First, see if we have the values cached from a previous call in this instance + if(useCache && cache.containsKey("retrieveObjectNames")) + return (Map) cache.get("retrieveObjectNames"); + String result = (String)doCall ("retrieveObjectNames", new Object[] {}); // parse returned XML Map results = new HashMap(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("Object"); for (int i = 0; i < list.getLength(); i++) { Element elem = (Element)list.item (i); @@ -631,6 +706,9 @@ } } } + + if(useCache) + cache.put("retrieveObjectNames", results); return results; } @@ -655,6 +733,11 @@ *************************************************************************/ public MobyDataType getDataType (String dataTypeName) throws MobyException, NoSuccessException { + + // See if we've already retrieved the DataType and cached it + if(cache.containsKey("retrieveObjectDefinition"+dataTypeName)) + return (MobyDataType) cache.get("retrieveObjectDefinition"+dataTypeName); + String result = (String)doCall ("retrieveObjectDefinition", new Object[] { @@ -664,7 +747,10 @@ }); // parse returned XML - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("retrieveObjectDefinition"); if (list == null || list.getLength() == 0) throw new NoSuccessException ("Data Type name was not founnd.", @@ -717,6 +803,7 @@ } } } + cache.put("retrieveObjectDefinition"+dataTypeName, data); return data; } @@ -778,6 +865,11 @@ *************************************************************************/ public String getServiceWSDL (String serviceName, String authority) throws MobyException, NoSuccessException { + // See if we've already retrieved the DataType and cached it + String cacheKey = "getServiceWSDL" + serviceName + ":" + authority; + if(cache.containsKey(cacheKey)) + return (String) cache.get(cacheKey); + String result = (String)doCall ("retrieveService", new Object[] { @@ -787,12 +879,17 @@ }); // parse returned XML - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + Element service = document.getDocumentElement(); Node wsdl = service.getFirstChild(); if (wsdl == null) throw new NoSuccessException ("Service not found OR WSDL is not available.", serviceName + " (" + authority + ")"); + if(useCache) + cache.put(cacheKey, wsdl.getNodeValue()); return wsdl.getNodeValue(); } @@ -1051,14 +1148,20 @@ if (pattern == null) pattern = new MobyService ("dummy"); - String result = - (String)doCall ("findService", - new Object[] { + String[] query = new String[] { "" + buildQueryObject (pattern, keywords, true, true, false) + "" - }); - return extractServices (result); + }; + if(useCache && cache.containsKey("findService"+query[0])) + return (MobyService[]) cache.get("findService"+query[0]); + + String result = (String) doCall ("findService", query); + MobyService[] services = extractServices (result); + + if(useCache) + cache.put("findService"+query[0], services); + return services; } /************************************************************************** @@ -1106,6 +1209,10 @@ public String[] getServiceTypeRelationships (String serviceTypeName, boolean expand) throws MobyException { + String cacheKey = "Relationships" + serviceTypeName + ":" + expand; + if(useCache && cache.containsKey(cacheKey)) + return (String[]) cache.get(cacheKey); + String result = (String)doCall ("Relationships", new Object[] { @@ -1118,7 +1225,10 @@ // parse returned XML Vector v = new Vector(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("Relationship"); for (int i = 0; i < list.getLength(); i++) { Element elem = (Element)list.item (i); @@ -1131,6 +1241,9 @@ } String[] results = new String [v.size()]; v.copyInto (results); + + if(useCache) + cache.put(cacheKey, results); return results; } @@ -1151,6 +1264,10 @@ *************************************************************************/ public Map getDataTypeRelationships (String dataTypeName) throws MobyException { + String cacheKey = "getDataTypeRelationships"+dataTypeName; + if(useCache && cache.containsKey(cacheKey)) + return (Map) cache.get(cacheKey); + String result = (String)doCall ("Relationships", new Object[] { @@ -1165,7 +1282,10 @@ // parse returned XML Map results = new HashMap(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("Relationship"); for (int i = 0; i < list.getLength(); i++) { @@ -1182,6 +1302,9 @@ v.copyInto (names); results.put (relType, names); } + + if(useCache) + cache.put(cacheKey, results); return results; } @@ -1199,6 +1322,10 @@ public String[] getDataTypeRelationships (String dataTypeName, String relationshipType) throws MobyException { + String cacheKey = "getDataTypeRelationships" + dataTypeName + ":" + relationshipType; + if(useCache && cache.containsKey(cacheKey)) + return (String[]) cache.get(cacheKey); + String result = (String)doCall ("Relationships", new Object[] { @@ -1211,7 +1338,10 @@ // parse returned XML Vector v = new Vector(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("Relationship"); // it should always be just one element in this list @@ -1226,7 +1356,29 @@ } String[] results = new String [v.size()]; v.copyInto (results); + + if(useCache) + cache.put(cacheKey, results); return results; } + /** + * By default, caching is enabled to reduce network traffic and XML parsing. Setting + * this to false will clear the cache, and not cache any further calls unless it is + * set to true again. + * + * @param shouldCache whether retrieveXXX call results should be cached in case they are called again (i.e. don't requery MobyCentral every time) + */ + public void setCacheMode(boolean shouldCache){ + useCache = shouldCache; + if(!useCache) + cache.clear(); + } + + /** + * @return whether retrieveXXX calls will cache their responses + */ + public boolean getCacheMode(){ + return useCache; + } } From senger at pub.open-bio.org Thu Apr 1 16:03:42 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu Apr 1 15:56:15 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012103.i31L3gJf007111@pub.open-bio.org> senger Thu Apr 1 16:03:42 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv7084/src/main/org/biomoby/client Modified Files: FileCache.java GraphsServlet.java ServletFileCache.java Log Message: moby-live/Java/src/main/org/biomoby/client FileCache.java,1.2,1.3 GraphsServlet.java,1.4,1.5 ServletFileCache.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/FileCache.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/FileCache.java 2003/11/09 01:05:02 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/FileCache.java 2004/04/01 21:03:42 1.3 @@ -1,6 +1,6 @@ // FileCache.java // -// A cache used for a data produced by a servlet. +// A cache storing data in files. // // senger@ebi.ac.uk // November 2003 @@ -37,7 +37,10 @@ // given 'rootDirname) protected static String startingDir; - /************************************************************************** + // index of cached files (TBD: put it also in a file?) + Hashtable index = new Hashtable(); + + /************************************************************************** * To be used by the inheriting classes. **************************************************************************/ protected FileCache() { @@ -49,14 +52,14 @@ * Constructor specifying where to create files with the cached * objects. Use this constructor if you cannot store them in the * context of the calling servlet (usually because of the - * unsifficient write permissions). The cache files will created in + * unsifficient write permissions). The cache files will be stored in * *
      * /cache/
      * 
* * The all not yet existing directories (for example the last - * 'cache' diorectory) will be created for you. + * 'cache' directory) will be created for you. *

* * 'rootURLName' is used by method {@link #getURL} to return back @@ -75,7 +78,11 @@ static final char CLEAR_CHAR = '_'; /************************************************************************** * It creates an 'id' in the form: - * rootName / semanticType / prop1_prop2_... (time).syntaxType + * rootName / semanticType / { prop1_prop2_... } (time).syntaxType + * + * The part between { and } (inclusive) will be replaced by a + * unique shorter string in order to create a reasonably long real + * file name. **************************************************************************/ public String createId (String rootName, String semanticType, String syntaxType, @@ -94,10 +101,13 @@ ps[++i] = it.next().toString(); } Arrays.sort (ps); + buf.append ("{"); for (int i = 0; i < ps.length; i++) { buf.append (CLEAR_CHAR); - buf.append (clean (ps[i].toString())); +// buf.append (clean (ps[i].toString())); + buf.append (ps[i].toString()); } + buf.append ("}"); buf.append ("(" + lastModified + ")"); buf.append ("."); buf.append (clean (syntaxType)); @@ -235,6 +245,20 @@ * dir (as set in a constructor). **************************************************************************/ protected String getRelativeFilename (String id) { - return fileSeparator + startingDir + fileSeparator + id; + String fileName = (String)index.get (id); + if (fileName == null) { + int posFrom = id.indexOf ("{"); + int posTo = id.indexOf ("}"); + StringBuffer buf = new StringBuffer(); + buf.append (fileSeparator); + buf.append (startingDir); + buf.append (fileSeparator); + buf.append (id.substring (0, posFrom)); + buf.append (clean (new java.rmi.server.UID().toString())); + buf.append (id.substring (posTo+1)); + fileName = new String (buf); + index.put (id, fileName); + } + return fileName; } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.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/GraphsServlet.java 2003/11/25 13:18:10 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2004/04/01 21:03:42 1.5 @@ -491,7 +491,7 @@ h.gen (TD, radios[0]) + h.gen (TD, - "Show all services and all connections")) + + "Show all services and all connections " + h.gen (EM, "(very long and big)"))) + h.gen (TR, h.gen (TD, new String[] { VALIGN, "top" }, radios[1]) + =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServletFileCache.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServletFileCache.java 2003/11/08 00:27:24 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServletFileCache.java 2004/04/01 21:03:42 1.2 @@ -40,11 +40,11 @@ * * * The not existing directories (for example the last 'cache' - * diorectory) will be created for you. + * directory) will be created for you. * * The 'contextPath' is a path (relative to the servlet context) * where the cached files will be created (actually starting from - * here, because they may be created ina deeper directory + * here, because they may be created in a deeper directory * structure. Usually you get it in the calling servlet from the * request by method request.getContextPath(). The 'contextPath' * starts with a "/" character but does not end with a "/" From mwilkinson at pub.open-bio.org Thu Apr 1 16:23:48 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu Apr 1 16:16:19 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012123.i31LNmaC007236@pub.open-bio.org> mwilkinson Thu Apr 1 16:23:47 EST 2004 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv7213/MOBY/Client Modified Files: Service.html Service.pm Log Message: update the execute method to allow multiple inputs to a single invocation. Documentation updated. Fixed bug of articleName attribute being attached to the wrong XML element moby-live/Perl/MOBY/Client Service.html,1.3,1.4 Service.pm,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.html 2003/08/06 14:31:21 1.3 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.html 2004/04/01 21:23:47 1.4 @@ -2,7 +2,7 @@ MOBY::Client::Service - an object for communicating with MOBY Services - + @@ -95,12 +95,21 @@ input is named "object1" in both cases. $Service->execute(XMLinputlist => [ - ['collection1', [ + ['', [ '<Object namespace="blah" id="123"/>', '<Object namespace="blah" id="234"/>'] ]); This would invoke the service once with a collection of sequence inputs - called "collection1" + that are not required to be named ('') +

+                $Service->execute(XMLinputlist => [
+                                 [
+                             'input1', '<Object namespace="blah" id="123"/>',
+                             'input2', '<Object namespace="blah" id="234"/>',
+                             ]
+                              ]);
+                This would cause a single invocation of a service requiring
+                two input parameters named "input1" and "input2"

ServiceName

=================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2004/01/05 21:29:08 1.7 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2004/04/01 21:23:47 1.8 @@ -165,12 +165,21 @@ input is named "object1" in both cases. $Service->execute(XMLinputlist => [ - ['collection1', [ + ['', [ '', ''] ]); This would invoke the service once with a collection of sequence inputs - called "collection1" + that are not required to be named ('') + + $Service->execute(XMLinputlist => [ + [ + 'input1', '', + 'input2', '', + ] + ]); + This would cause a single invocation of a service requiring + two input parameters named "input1" and "input2" =cut @@ -183,20 +192,25 @@ my $data; foreach (@inputs){ return "ERROR: expected listref [articleName, XML] for data element" unless (ref($_) =~ /array/i); - my ($articleName, $XML) = @{$_}; my $qID = $self->_nextQueryID; - if (!(ref($XML)=~/array/i)){ - $articleName ||=""; - $XML ||= ""; - $data .= "\n$XML\n\n"; - } elsif (ref($XML)=~/array/i){ - my @objs = @{$XML}; - $data .="\n"; - foreach (@objs){ - $data .= "$_\n"; - } - $data .="\n\n" - } + $data .= ""; + while (my ($articleName, $XML) = splice (@{$_}, 0, 2)){ + if (!(ref($XML)=~/array/i)){ + $articleName ||=""; + $XML ||= ""; + $data .= "\n$XML\n\n"; + + # need to do this for collections also!!!!!! + } elsif (ref($XML)=~/array/i){ + my @objs = @{$XML}; + $data .="\n"; + foreach (@objs){ + $data .= "$_\n"; + } + $data .="\n"; + } + } + $data .="\n"; } $data = " From senger at pub.open-bio.org Thu Apr 1 18:24:27 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu Apr 1 18:16:58 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012324.i31NORH0007750@pub.open-bio.org> senger Thu Apr 1 18:24:26 EST 2004 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv7731/docs Modified Files: ChangeLog Log Message: moby-live/Java/docs ChangeLog,1.9,1.10 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/03/09 00:20:13 1.9 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/04/01 23:24:26 1.10 @@ -1,8 +1,20 @@ +2004-04-02 Martin Senger + + * Fixed producing graphs to deal with situation that some Moby + methods return simple names and some full LSIDs. + + * Fixed servlet producing graphs (proxy is set now correctly, + cached files have no longer too long names). + 2004-03-08 Martin Senger * Fixed extracting URL and emailContact from a service response object. +2004-01-15 Martin Senger + + * Fixed: better error reporting when am empty result is returned. + 2003-11-24 Martin Senger * Added graphs of service types. From senger at pub.open-bio.org Thu Apr 1 18:24:27 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu Apr 1 18:16:58 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012324.i31NOR4d007795@pub.open-bio.org> senger Thu Apr 1 18:24:27 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv7731/src/main/org/biomoby/shared Modified Files: MobyService.java Log Message: moby-live/Java/src/main/org/biomoby/shared MobyService.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2003/09/24 14:33:37 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2004/04/01 23:24:27 1.2 @@ -170,6 +170,7 @@ } public boolean equals (MobyService anotherOne) { + if (anotherOne == null) return false; return this.name.equals (anotherOne.getName()); } From senger at pub.open-bio.org Thu Apr 1 18:24:27 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu Apr 1 18:16:58 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012324.i31NOR54007774@pub.open-bio.org> senger Thu Apr 1 18:24:27 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv7731/src/main/org/biomoby/client Modified Files: CentralImpl.java GraphsServlet.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.9,1.10 GraphsServlet.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 17:30:08 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 23:24:26 1.10 @@ -1174,6 +1174,10 @@ result = doCall (methodName, new Object[] { }); else result = doCall (methodName, new Object[] { inputXML }); + + if (result == null) + throw new MobyException ("Returned result is null."); + if (result instanceof String) return (String)result; if (result instanceof String[]) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2004/04/01 21:03:42 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2004/04/01 23:24:27 1.6 @@ -205,7 +205,7 @@ for (Enumeration en = context.getInitParameterNames(); en.hasMoreElements(); ) { String name = (String)en.nextElement(); if (name != null) - initParams.put (name.toLowerCase(), context.getInitParameter (name)); + initParams.put (name, context.getInitParameter (name)); } // then read config parameters (scope: this servlet) - they may overwrite @@ -213,7 +213,7 @@ for (Enumeration en = getInitParameterNames(); en.hasMoreElements(); ) { String name = (String)en.nextElement(); if (name != null) - initParams.put (name.toLowerCase(), getInitParameter (name)); + initParams.put (name, getInitParameter (name)); } // read some suggested defaults from the init parameters @@ -869,6 +869,7 @@ // do this only the first time if (registry == null) { registry = new CentralImpl (endpoint, namespace); + ((CentralImpl)registry).setCacheMode (false); registry.setDebug (debug); } From gss at pub.open-bio.org Thu Apr 1 18:59:40 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:52:12 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31Nxeh3008031@pub.open-bio.org> gss Thu Apr 1 18:59:40 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/config-files Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files added to the repository moby-live/S-MOBY/ref-impl/config-files - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:40 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:52:13 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxeCB008049@pub.open-bio.org> gss Thu Apr 1 18:59:40 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:52:13 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfZh008086@pub.open-bio.org> gss Thu Apr 1 18:59:40 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:52:15 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfNQ008145@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:52:15 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31Nxf4v008171@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/queries In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/queries Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/queries added to the repository moby-live/S-MOBY/ref-impl/queries - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:40 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:52:23 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31Nxewk008068@pub.open-bio.org> gss Thu Apr 1 18:59:40 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:52:23 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31Nxf9x008190@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/queries/discovery Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery added to the repository moby-live/S-MOBY/ref-impl/queries/discovery - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:52:24 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfmQ008127@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:52:24 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfpH008108@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:52:25 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfA9008234@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref added to the repository moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:52:25 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfIJ008252@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets added to the repository moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:52:25 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfbP008208@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/queries/engage Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage added to the repository moby-live/S-MOBY/ref-impl/queries/engage - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:42 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:52:26 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxgYH008294@pub.open-bio.org> gss Thu Apr 1 18:59:42 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools added to the repository moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:42 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:52:26 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxgOr008314@pub.open-bio.org> gss Thu Apr 1 18:59:42 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db added to the repository moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:42 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:52:26 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxgVx008275@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev added to the repository moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 19:01:23 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:53:53 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020001.i3201NBN008511@pub.open-bio.org> gss Thu Apr 1 19:01:23 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/db In directory pub.open-bio.org:/tmp/cvs-serv8489/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/db Removed Files: CitationDB.java Log Message: No longer needed moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/db CitationDB.java,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/db/RCS/CitationDB.java,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 19:02:04 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:54:34 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020002.i32024CM008540@pub.open-bio.org> gss Thu Apr 1 19:02:03 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files In directory pub.open-bio.org:/tmp/cvs-serv8519/ref-impl/config-files Added Files: for-tomcat-conf-server.xml for-tomcat-conf-catalina.properties Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/config-files for-tomcat-conf-server.xml,NONE,1.1 for-tomcat-conf-catalina.properties,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 19:03:19 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:55:50 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020003.i3203JpJ008595@pub.open-bio.org> gss Thu Apr 1 19:03:19 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet In directory pub.open-bio.org:/tmp/cvs-serv8570/ref-impl/core/org/smoby/tools/server/servlet Modified Files: AbstractMobyServlet.java Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet AbstractMobyServlet.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet/AbstractMobyServlet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet/AbstractMobyServlet.java 2004/04/01 00:23:46 1.5 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet/AbstractMobyServlet.java 2004/04/02 00:03:19 1.6 @@ -93,6 +93,26 @@ } /** + * Helper method for returning the first statement (if any) from a source + * graph's model, that has the given subject, predicate, and object. + * @param source graph from which the model should be queried + * @param subject subject of the matching statement + * @param predicate predicate of the matching statement + * @param object object of the matching statement + * @return the first matching statement + */ + protected Statement getFirstStatement( + MOBYGraph source, Resource subject, Property predicate, RDFNode object) + { + StmtIterator it = source.getModel().listStatements(subject, predicate, object); + if (it.hasNext()) { + return it.nextStatement(); + } else { + return null; + } + } + + /** * By MOBY convention, an HTTP POST equates to a request for the service * provided by a provider. */ From gss at pub.open-bio.org Thu Apr 1 19:03:27 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:55:58 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020003.i3203Rnp008624@pub.open-bio.org> gss Thu Apr 1 19:03:27 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager In directory pub.open-bio.org:/tmp/cvs-serv8603/ref-impl/example-clients/SimpleEngager Added Files: SimpleProviderEngagerPanel$1.class SimpleProviderEngagerPanel$3.class SimpleProviderEngagerPanel$2.class SimpleProviderEngagerPanel.class Log Message: moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager SimpleProviderEngagerPanel$1.class,NONE,1.1 SimpleProviderEngagerPanel$3.class,NONE,1.1 SimpleProviderEngagerPanel$2.class,NONE,1.1 SimpleProviderEngagerPanel.class,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 19:03:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:56:10 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020003.i3203ddJ008665@pub.open-bio.org> gss Thu Apr 1 19:03:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv8639/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary Modified Files: AcmePubs.java Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary AcmePubs.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary/AcmePubs.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary/AcmePubs.java 2004/03/30 22:24:28 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary/AcmePubs.java 2004/04/02 00:03:39 1.3 @@ -1,7 +1,6 @@ package com.acmepubs.vocabulary; -import org.smoby.tools.common.vocabulary.VocabularyDescription; -import com.hp.hpl.jena.graph.*; +import org.smoby.tools.common.vocabulary.*; import com.hp.hpl.jena.rdf.model.*; public class AcmePubs extends VocabularyDescription @@ -11,6 +10,6 @@ return "http://www.acmepubs.com:8080/"; } - public static final Property geneID = property(getURI(), "geneID"); - public static final Property pubDate = property(getURI(), "pubDate"); + public static final Property geneSymbol = property(getURI(), "geneSymbol"); + public static final Property literatureGuideURL = property(getURI(), "literatureGuideURL"); } From gss at pub.open-bio.org Thu Apr 1 19:03:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:56:11 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020003.i3203d4k008684@pub.open-bio.org> gss Thu Apr 1 19:03:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets In directory pub.open-bio.org:/tmp/cvs-serv8639/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets Modified Files: CitationSearchServlet.java Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets CitationSearchServlet.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.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/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.java 2004/04/01 00:33:35 1.6 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.java 2004/04/02 00:03:39 1.7 @@ -6,12 +6,12 @@ import javax.servlet.*; import javax.servlet.http.*; +import org.go.vocabulary.Go; import org.smoby.tools.common.graph.MOBYGraph; import org.smoby.tools.common.vocabulary.MOBY; import org.smoby.tools.server.servlet.AbstractMobyServlet; - -import com.acmepubs.db.CitationDB; import com.acmepubs.vocabulary.AcmePubs; + import com.hp.hpl.jena.rdf.model.*; /** @@ -36,125 +36,50 @@ /** * Handle a request for a citation search by looking up - * a gene symbol and returning a list of publication - * abstracts. In this simplistic first cut, only look - * at the first "hasMapping" property, find the "geneID" - * property value as a lookup value, and for each matching - * publication date past the first one, create a copy of - * the entire subgraph and fill in its "pubDate" property. + * a gene symbol and returning a URL for querying the + * SGD database for literature pertaining to that URL. */ protected void handleRequest(MOBYGraph graph) { - // Retrieve the subject of the moby:mapsTo statement + // Retrieve the subject of the moby:operatesOn statement (there is only + // one operatesOn statement in a valid MOBY graph) // Resource mobyGraphSubject = (Resource) graph.getOperatesOnStmt().getObject(); - // Get the subject of the first hasMapping statement (the only one - // considered in this first cut) + // There may be multiple moby:hasMapping statements. For each one, + // map its geneSymbol to a literatureGuideURL // - Resource start = graph.getModel() - .listStatements(mobyGraphSubject, MOBY.hasMapping, (RDFNode) null) - .nextStatement().getSubject(); + StmtIterator it = graph.getModel().listStatements( + mobyGraphSubject, MOBY.hasMapping, (RDFNode) null); - // Retrieve the subgraph that is "reachable" from the subject of the - // first hasMapping statement. - // - Model subgraph = ModelFactory.createDefaultModel(); - subgraph.setNsPrefixes(graph.getModel().getNsPrefixMap()); - addReachableStatements(start, graph.getModel(), subgraph); - - // Find the "geneID" statement in the subgraph; if there isn't one, - // then we can't handle it (really should throw an exception...) - // - StmtIterator it = subgraph.listStatements(null, AcmePubs.geneID, (RDFNode) null); - if (! it.hasNext()) return; - - // Get the object of the geneID statement; if it isn't a String, then - // again we can't handle it. - // - String geneID = null; - try { - geneID = it.nextStatement().getString(); - } catch (Throwable t) { - return; - } - - // Look up the gene symbol; if not found, then there's nothing to do - // - List pubDates = CitationDB.getCitations(geneID); - if (pubDates == null) return; - - // For each publication date found, replace the object of the pubDate - // statement with the publication date in the subgraph (for the first - // pub date) or in a copy (for subsequent pub dates) - // - int i = 0; - for (Iterator iter = pubDates.iterator(); iter.hasNext(); i++) - { - String pubDate = iter.next().toString(); - - // In the first match, we use the subgraph pulled from the original - // graph; in additional matches, we use a copy (whose statements have - // to be added to the original model) - // - if (i > 0) - { - subgraph = copyModel(subgraph); - graph.getModel().add(subgraph); - } - - // Find the "pubDate" statement in the subgraph; if there isn't one, - // then we can't handle it (really should throw an exception...) - // - it = subgraph.listStatements(null, AcmePubs.pubDate, (RDFNode) null); - if (! it.hasNext()) return; - - // Replace the object of the pubDate statement with a literal value, - // namely the publication date - // - Statement stmt = it.nextStatement(); - stmt.changeObject(pubDate); - } - } - - protected Model copyModel(Model model) - { - Model copy = ModelFactory.createDefaultModel(); - copy.setNsPrefixes(model.getNsPrefixMap()); - for (StmtIterator it = model.listStatements(); it.hasNext();) - { - Statement stmt = it.nextStatement(); - copy.add(copy.createStatement( - stmt.getSubject(), - stmt.getPredicate(), - stmt.getObject())); - } - return copy; - } - - /** - * Add to a model the depth-first traversal - * of a source graph starting from a given subject - * @param subject the resource that is the starting poing - * @param source the model containing a set of statements from which to add - * @param subgraph the model to which to add reachable statements - */ - protected void addReachableStatements(Resource subject, Model source, Model subgraph) - { - StmtIterator it = source.listStatements(subject, null, (RDFNode) null); - while (it.hasNext()) - { - Statement stmt = it.nextStatement(); - if (! subgraph.contains(stmt)) - { - subgraph.add(stmt); - addReachableStatements(stmt.getSubject(), source, subgraph); - addReachableStatements(stmt.getPredicate(), source, subgraph); - if (stmt.getObject() instanceof Resource) { - addReachableStatements((Resource) stmt.getObject(), source, subgraph); - } + while (it.hasNext()) + { + try + { + Statement hasMappingStmt = it.nextStatement(); + Resource mobySubject = (Resource) hasMappingStmt.getObject(); + + Statement geneSymbolStmt = + getFirstStatement(graph, mobySubject, AcmePubs.geneSymbol, null); + + String geneSymbol = geneSymbolStmt.getString(); + + Statement mapsToStmt = + getFirstStatement(graph, mobySubject, MOBY.mapsTo, null); + + Resource mobyObject = (Resource) mapsToStmt.getObject(); + + Statement literatureGuideURLStmt = + getFirstStatement(graph, mobyObject, AcmePubs.literatureGuideURL, null); + + String baseURI = "http://db.yeastgenome.org/cgi-bin/SGD/reference/geneinfo.pl?locus="; + literatureGuideURLStmt.changeObject(baseURI + geneSymbol); + } + catch (Throwable t) + { + // Something went wrong, so proceed to next hasMapping statement } - } + } } /** From gss at pub.open-bio.org Thu Apr 1 19:03:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:56:11 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020003.i3203dBB008705@pub.open-bio.org> gss Thu Apr 1 19:03:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com In directory pub.open-bio.org:/tmp/cvs-serv8639/ref-impl/example-providers/acmepubs.com Modified Files: .classpath Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com .classpath,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/.classpath,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/.classpath 2004/03/18 23:52:50 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/.classpath 2004/04/02 00:03:39 1.3 @@ -5,6 +5,9 @@ + + + From gss at pub.open-bio.org Thu Apr 1 19:04:21 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:56:53 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020004.i3204L20008768@pub.open-bio.org> gss Thu Apr 1 19:04:21 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv8739/ref-impl/example-providers/megapubs.com/WebRoot Modified Files: citationSearch.rdf citationSearch.n3 Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot citationSearch.rdf,1.3,1.4 citationSearch.n3,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.rdf,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.rdf 2004/03/30 23:54:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.rdf 2004/04/02 00:04:21 1.4 @@ -1,32 +1,28 @@ + xmlns:moby="http://www.s-moby.org:8080/terms#" + xmlns:sgd="http://www.sgd.org:8080/terms#" > + + + + + - - + - - - - - + - + + - - - - - - - + @@ -34,9 +30,14 @@ Cool new search - - + + - + + + + + + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.n3 2004/03/30 23:54:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.n3 2004/04/02 00:04:21 1.4 @@ -1,7 +1,8 @@ @prefix pubs: . @prefix xsd: . @prefix megapubs: . -@prefix mygrid: . +@prefix go: . +@prefix sgd: . @prefix moby: . @prefix rdfs: . @prefix rdf: . @@ -17,20 +18,20 @@ moby:hasMapping _:bnode2 . _:bnode2 - a moby:Subject, mygrid:gene_id ; + a moby:Subject, go:GeneSymbol ; moby:mapsTo _:bnode3 ; - megapubs:geneID _:bnode4 . + megapubs:geneSymbol _:bnode4 . _:bnode3 - a moby:Object, pubs:PubAbstract ; - megapubs:pubDate _:bnode6 . + a moby:Object, sgd:LiteratureGuide ; + megapubs:literatureGuideURL _:bnode6 . -megapubs:geneID +megapubs:geneSymbol a owl:DataTypeProperty ; - rdfs:domain mygrid:gene_id ; + rdfs:domain go:GeneSymbol ; rdfs:range xsd:string . -megapubs:pubDate +megapubs:literatureGuideURL a owl:DataTypeProperty ; - rdfs:domain pubs:PubAbstract ; - rdfs:range xsd:date . + rdfs:domain sgd:LiteratureGuide ; + rdfs:range xsd:anyURI . \ No newline at end of file From gss at pub.open-bio.org Thu Apr 1 19:04:21 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:56:53 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020004.i3204LYU008787@pub.open-bio.org> gss Thu Apr 1 19:04:21 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv8739/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary Modified Files: MegaPubs.java Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary MegaPubs.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary/MegaPubs.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary/MegaPubs.java 2004/03/30 23:54:26 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary/MegaPubs.java 2004/04/02 00:04:21 1.2 @@ -1,6 +1,6 @@ package com.megapubs.vocabulary; -import org.smoby.tools.common.vocabulary.VocabularyDescription; -import com.hp.hpl.jena.graph.*; + +import org.smoby.tools.common.vocabulary.*; import com.hp.hpl.jena.rdf.model.*; public class MegaPubs extends VocabularyDescription @@ -10,6 +10,6 @@ return "http://www.megapubs.com:8080/"; } - public static final Property geneID = property(getURI(), "geneID"); - public static final Property pubDate = property(getURI(), "pubDate"); + public static final Property geneSymbol = property(getURI(), "geneSymbol"); + public static final Property literatureGuideURL = property(getURI(), "literatureGuideURL"); } From gss at pub.open-bio.org Thu Apr 1 19:05:06 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:57:38 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020005.i32056lu008825@pub.open-bio.org> gss Thu Apr 1 19:05:06 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src In directory pub.open-bio.org:/tmp/cvs-serv8800/ref-impl/server/src Modified Files: smoby.properties Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/server/src smoby.properties,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties 2004/03/27 01:27:51 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties 2004/04/02 00:05:06 1.3 @@ -1,11 +1,20 @@ # Database information section # -# DB_DRIVER_CLASS_NAME = org.postgresql.Driver -DB_DRIVER_CLASS_NAME = com.mysql.jdbc.Driver + +# Common values for MySQL and PostgreSQL +# DB_USER_ID = smobydev DB_PASSWORD = -# DB_URL = jdbc:postgresql://localhost/smoby-dev -DB_URL = jdbc:mysql://localhost/smoby-dev -# DB_TYPE = PostgreSQL -DB_TYPE = MySQL -DB_REPOSITORY_NAME = gss-test \ No newline at end of file +DB_DRIVER_CLASS_NAME = com.mysql.jdbc.Driver +DB_REPOSITORY_NAME = smoby-dev + +# Uncomment if using MySQL +# +# DB_URL = jdbc:mysql://localhost/smoby-dev +# DB_TYPE = MySQL + +# Uncomment if using PostgreSQL +# +DB_DRIVER_CLASS_NAME = org.postgresql.Driver +DB_TYPE = PostgreSQL +DB_URL = jdbc:postgresql://localhost/smoby-dev \ No newline at end of file From gss at pub.open-bio.org Thu Apr 1 19:05:16 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:57:47 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020005.i3205G0b008854@pub.open-bio.org> gss Thu Apr 1 19:05:16 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery In directory pub.open-bio.org:/tmp/cvs-serv8833/ref-impl/queries/discovery Added Files: query.n3 query.rdf Log Message: moby-live/S-MOBY/ref-impl/queries/discovery query.n3,NONE,1.1 query.rdf,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 19:05:16 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 18:57:47 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020005.i3205Gve008869@pub.open-bio.org> gss Thu Apr 1 19:05:16 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage In directory pub.open-bio.org:/tmp/cvs-serv8833/ref-impl/queries/engage Added Files: engage-acmepubs-citationSearch.n3 engage-megapubs-citationSearch.rdf engage-megapubs-citationSearch.n3 engage-acmepubs-citationSearch.rdf Log Message: moby-live/S-MOBY/ref-impl/queries/engage engage-acmepubs-citationSearch.n3,NONE,1.1 engage-megapubs-citationSearch.rdf,NONE,1.1 engage-megapubs-citationSearch.n3,NONE,1.1 engage-acmepubs-citationSearch.rdf,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 19:08:26 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 19:00:57 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020008.i3208QCs009022@pub.open-bio.org> gss Thu Apr 1 19:08:26 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes In directory pub.open-bio.org:/tmp/cvs-serv8997/ref-impl/server/WebRoot/WEB-INF/classes Added Files: smoby.properties log4j.properties Log Message: moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes smoby.properties,1.2,1.3 log4j.properties,NONE,1.1 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/smoby.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/smoby.properties 2004/03/20 00:33:08 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/smoby.properties 2004/04/02 00:08:26 1.3 @@ -1,8 +1,20 @@ # Database information section # -DB_DRIVER_CLASS_NAME = org.postgresql.Driver + +# Common values for MySQL and PostgreSQL +# DB_USER_ID = smobydev DB_PASSWORD = -DB_URL = jdbc:postgresql://localhost/smoby-dev +DB_DRIVER_CLASS_NAME = com.mysql.jdbc.Driver +DB_REPOSITORY_NAME = smoby-dev + +# Uncomment if using MySQL +# +# DB_URL = jdbc:mysql://localhost/smoby-dev +# DB_TYPE = MySQL + +# Uncomment if using PostgreSQL +# +DB_DRIVER_CLASS_NAME = org.postgresql.Driver DB_TYPE = PostgreSQL -DB_REPOSITORY_NAME = gss-test \ No newline at end of file +DB_URL = jdbc:postgresql://localhost/smoby-dev \ No newline at end of file From gss at pub.open-bio.org Thu Apr 1 19:45:31 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 19:38:01 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020045.i320jVOk009344@pub.open-bio.org> gss Thu Apr 1 19:45:31 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager In directory pub.open-bio.org:/tmp/cvs-serv9316 Added Files: .cvsignore Removed Files: SimpleProviderEngagerPanel$2.class SimpleProviderEngagerPanel$3.class SimpleProviderEngagerPanel.class SimpleProviderEngagerPanel$1.class Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager .cvsignore,NONE,1.1 SimpleProviderEngagerPanel$2.class,1.1,NONE SimpleProviderEngagerPanel$3.class,1.1,NONE SimpleProviderEngagerPanel.class,1.1,NONE SimpleProviderEngagerPanel$1.class,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager/RCS/SimpleProviderEngagerPanel.class,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager/RCS/SimpleProviderEngagerPanel.class,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager/RCS/SimpleProviderEngagerPanel.class,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager/RCS/SimpleProviderEngagerPanel.class,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 19:55:59 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 19:48:29 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020055.i320txLR009423@pub.open-bio.org> gss Thu Apr 1 19:55:59 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core In directory pub.open-bio.org:/tmp/cvs-serv9398 Modified Files: .project Log Message: Change output folder moby-live/S-MOBY/ref-impl/core .project,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.project,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.project 2004/03/27 01:14:22 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.project 2004/04/02 00:55:59 1.4 @@ -16,4 +16,11 @@ org.eclipse.jdt.core.javanature + + + classes + 2 + C:/Tomcat5.0/shared/classes/from-smoby-core + + From gss at pub.open-bio.org Thu Apr 1 19:57:05 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 19:49:36 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020057.i320v57B009454@pub.open-bio.org> gss Thu Apr 1 19:57:05 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv9433/WebRoot Added Files: terms terms.n3 index.html Log Message: Moved moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot terms,NONE,1.1 terms.n3,NONE,1.1 index.html,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 20:00:19 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 19:52:49 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020100.i3210Jml009608@pub.open-bio.org> gss Thu Apr 1 20:00:19 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF In directory pub.open-bio.org:/tmp/cvs-serv9569/WebRoot/WEB-INF Added Files: .cvsignore Log Message: Moved moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF .cvsignore,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 20:00:19 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 19:52:50 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020100.i3210Jn6009593@pub.open-bio.org> gss Thu Apr 1 20:00:19 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org In directory pub.open-bio.org:/tmp/cvs-serv9569 Removed Files: terms terms.n3 index.html Log Message: Moved moby-live/S-MOBY/ref-impl/example-providers/go.org terms,1.1,NONE terms.n3,1.1,NONE index.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/RCS/terms,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/RCS/terms.n3,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/RCS/index.html,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 20:01:12 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 19:53:42 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020101.i3211C56009691@pub.open-bio.org> gss Thu Apr 1 20:01:12 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org In directory pub.open-bio.org:/tmp/cvs-serv9667 Removed Files: index.html terms terms.n3 Log Message: Moved moby-live/S-MOBY/ref-impl/example-providers/sgd.org index.html,1.1,NONE terms,1.1,NONE terms.n3,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/RCS/index.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/RCS/terms,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/RCS/terms.n3,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 20:21:06 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 20:13:37 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020121.i321L60f010234@pub.open-bio.org> gss Thu Apr 1 20:21:06 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv10213/WebRoot Added Files: terms terms.n3 index.html Log Message: Moved moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot terms,NONE,1.1 terms.n3,NONE,1.1 index.html,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 20:24:59 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu Apr 1 20:17:28 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020124.i321Oxbi010272@pub.open-bio.org> gss Thu Apr 1 20:24:59 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src In directory pub.open-bio.org:/tmp/cvs-serv10247/src Modified Files: smoby.properties Log Message: Fixed properties file moby-live/S-MOBY/ref-impl/server/src smoby.properties,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties 2004/04/02 00:05:06 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties 2004/04/02 01:24:59 1.4 @@ -5,11 +5,11 @@ # DB_USER_ID = smobydev DB_PASSWORD = -DB_DRIVER_CLASS_NAME = com.mysql.jdbc.Driver DB_REPOSITORY_NAME = smoby-dev # Uncomment if using MySQL # +# DB_DRIVER_CLASS_NAME = com.mysql.jdbc.Driver # DB_URL = jdbc:mysql://localhost/smoby-dev # DB_TYPE = MySQL From gordonp at pub.open-bio.org Fri Apr 2 11:40:23 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Fri Apr 2 11:32:53 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404021640.i32GeN2R013343@pub.open-bio.org> gordonp Fri Apr 2 11:40:23 EST 2004 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv13318/docs Modified Files: ChangeLog Log Message: Revised documentation, interfaces and classes pertaining to XML parsing and server cache to reflect new parsing and caching schemes moby-live/Java/docs ChangeLog,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/04/01 23:24:26 1.10 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/04/02 16:40:23 1.11 @@ -1,3 +1,9 @@ +2004-04-02 Paul Gordon + + * Changed XML parsing to JAXP based interface that works on more platforms + + * Implemented Central response caching to reduce network and XML parsing loads + 2004-04-02 Martin Senger * Fixed producing graphs to deal with situation that some Moby From gordonp at pub.open-bio.org Fri Apr 2 11:40:23 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Fri Apr 2 11:32:54 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404021640.i32GeNaY013386@pub.open-bio.org> gordonp Fri Apr 2 11:40:23 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv13318/src/main/org/biomoby/shared Modified Files: Central.java Utils.java Log Message: Revised documentation, interfaces and classes pertaining to XML parsing and server cache to reflect new parsing and caching schemes moby-live/Java/src/main/org/biomoby/shared Central.java,1.3,1.4 Utils.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2003/11/25 13:18:11 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2004/04/02 16:40:23 1.4 @@ -323,4 +323,15 @@ *************************************************************************/ void setDebug (boolean debug); + /************************************************************************** + * Set whether the server responses should cached or not to speedup + * multiple calls for the same data. + * @param shouldCache if set to false, any previously cached documents should be deleted + *************************************************************************/ + void setCacheMode(boolean shouldCache); + + /************************************************************************** + * Reports whether server responses are being cached or not. + *************************************************************************/ + boolean getCacheMode(); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java 2003/11/25 13:18:11 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java 2004/04/02 16:40:23 1.4 @@ -7,8 +7,6 @@ package org.biomoby.shared; -import org.biomoby.shared.dom.*; - import org.apache.axis.AxisFault; import javax.xml.namespace.QName; import java.io.*; @@ -24,16 +22,6 @@ public abstract class Utils { - /** Java property name ('dom.parser'). - * The property value is a fully qualified name of a class of type - * org.biomoby.shared.dom.ParserWrapper. - */ - public static final String PROP_PARSER_WRAPPER = "dom.parser"; - - /** Default parser wrapper. */ - public static final String DEFAULT_PARSER_WRAPPER = - "org.biomoby.shared.dom.wrappers.Xerces"; - /************************************************************************* * Format an exception 'e' and return it back. *

@@ -122,72 +110,6 @@ } /************************************************************************* - * Find and return an instance of a DOM parser wrapper. A parser - * wrapper is a class allowing a uniform access to DOM parsers - - * because it defines a way how a Document is created and returned - * (see details in interface - * org.biomoby.shared.dom.ParseWrappers, or in samples in - * the distribution of Apache Xerces-2 where this is all taken - * from). - *

- * - * The DOM parser wrapper class name is taken from, in this order: - *

    - *
  1. Java property {@link #PROP_PARSER_WRAPPER} - *
  2. parameter parserClassName - *
  3. default value {@link #DEFAULT_PARSER_WRAPPER} - *
- *

- * - * This is based on the samples shown int the Apache Xerces-2 distribution. - * See more details there. This implementation differ from those samples - * in few not too crucial details: - *

    - *
  • It can take parser class name also from a Java property - * ({@link #DEFAULT_PARSER_WRAPPER}) - *
  • It raises Moby specific exception - *
- *

- * @param parserClassName is a class to be instatiated (unless there is - * a Java property {@link #PROP_PARSER_WRAPPER}) - * @return an instance of a DOM parser wrapper - * @throws MobyException if unable to instantiate specified DOM parser - *************************************************************************/ - public static ParserWrapper getDOMParser (String parserClassName) - throws MobyException { - - // which parser do we want - String name = System.getProperty (PROP_PARSER_WRAPPER); - if (name != null) - parserClassName = name; - if (parserClassName == null) - parserClassName = DEFAULT_PARSER_WRAPPER; - - // create parser - try { - return (ParserWrapper)Class.forName (parserClassName).newInstance(); - } - catch (Exception e) { - throw new MobyException ("Unable to instantiate parser (" + parserClassName +")"); - } - } - - /************************************************************************* - * Find and return an instance of a DOM parser wrapper. - * It does the same as method {@link #getDOMParser(String)} except that it - * does not get any parser class name in the parameter. - *

- * - * @return an instance of a DOM parser wrapper - * @see #getDOMParser(String) - * @throws MobyException if unable to instantiate the specified DOM parser - *************************************************************************/ - public static ParserWrapper getDOMParser() - throws MobyException { - return getDOMParser (null); - } - - /************************************************************************* * Return just the last part of the LSID identifier. An example of * an LSID identifier as used by and returned from the Moby * registry is urn:lsid:biomoby.org:objectclass:object. From gordonp at pub.open-bio.org Fri Apr 2 11:40:23 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Fri Apr 2 11:32:55 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404021640.i32GeNlC013362@pub.open-bio.org> gordonp Fri Apr 2 11:40:23 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv13318/src/main/org/biomoby/client Modified Files: CentralImpl.java Log Message: Revised documentation, interfaces and classes pertaining to XML parsing and server cache to reflect new parsing and caching schemes moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 23:24:26 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/02 16:40:23 1.11 @@ -8,7 +8,6 @@ package org.biomoby.client; import org.biomoby.shared.*; -import org.biomoby.shared.dom.*; import org.apache.axis.client.*; import org.apache.axis.*; From mwilkinson at pub.open-bio.org Sun Apr 4 14:53:14 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Sun Apr 4 14:45:27 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404041853.i34IrECT029372@pub.open-bio.org> mwilkinson Sun Apr 4 14:53:13 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv29353/MOBY Modified Files: Central.pm Log Message: bug in the registration object - it should return LSID's in the 'id' tag. I think it now does this properly moby-live/Perl/MOBY Central.pm,1.123,1.124 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.123 retrieving revision 1.124 diff -u -r1.123 -r1.124 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/01/15 16:04:54 1.123 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/04 18:53:13 1.124 @@ -2887,7 +2887,7 @@ my $reg = &Registration({ success => 0, message => "$message", - registration_id => "$id", + id => "$id", }); return $reg; } @@ -2897,7 +2897,7 @@ my $reg = &Registration({ success => 1, message => "$message", - registration_id => "$id", + id => "$id", }); return $reg; } From mwilkinson at pub.open-bio.org Sun Apr 4 15:08:41 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Sun Apr 4 15:00:57 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404041908.i34J8fLj029465@pub.open-bio.org> mwilkinson Sun Apr 4 15:08:41 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv29446/MOBY Modified Files: Central.pm Log Message: bug in the registration object - it should return LSID's in the 'id' tag. I think it now does this properly moby-live/Perl/MOBY Central.pm,1.124,1.125 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.124 retrieving revision 1.125 diff -u -r1.124 -r1.125 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/04 18:53:13 1.124 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/04 19:08:41 1.125 @@ -109,7 +109,7 @@ sub Registration { my ( $details) = @_; - my $id = $details->{registration_id}; + my $id = $details->{id}; my $success = $details->{success}; my $message = $details->{message}; From mwilkinson at pub.open-bio.org Wed Apr 14 15:56:59 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Apr 14 15:48:08 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404141956.i3EJuxi2013404@pub.open-bio.org> mwilkinson Wed Apr 14 15:56:59 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv13353/Perl/MOBY/Client Modified Files: Central.pm CollectionArticle.pm ServiceInstance.pm SimpleArticle.pm Log Message: CommonSubs now includes support for services that use Secondary Parameter's. I am also almost finished writing an OO-interface for building/deconstructing MOBY objects, so that people don't have to learn the XML::DOM API. This is incomplete and untested yet, so don't shoot me if it doesn't work. See the docs for CommonSubs 'complexServiceInputParser' for details on how to manage services that use multiple inputs and/or secondary parameters. As soon as I get this OO interface working I will create an equivalent subroutine that parses the input into objects (but I wont remove this routine, so it wont break you servies if you use it) moby-live/Perl/MOBY/Client Central.pm,1.73,1.74 CollectionArticle.pm,1.6,1.7 ServiceInstance.pm,1.10,1.11 SimpleArticle.pm,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2004/03/26 16:10:40 1.73 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2004/04/14 19:56:59 1.74 @@ -1487,7 +1487,19 @@ } } } - + my @SECONDARIES; + my $secs = $Service->getElementsByTagName("secondaryArticles"); # there should only be one, but... who knows what + for my $in(0..$secs->getLength-1){ + my $current = $secs->item($in); + + foreach my $param($current->getChildNodes){ # child nodes will be "Parameter" tag names + next unless $param->getNodeType == ELEMENT_NODE && $param->getTagName eq "Parameter"; + my $THIS; + $THIS = MOBY::Client::SecondaryArticle->new(XML_DOM => $param); + push @SECONDARIES, $THIS; + } + } + my $Instance = MOBY::Client::ServiceInstance->new( authority => $AuthURI, authoritative => $authoritative, @@ -1498,6 +1510,7 @@ category => $cat, input => \@INPUTS, output => \@OUTPUTS, + secondary => \@SECONDARIES, description => $Description, registry => $Registry, XML => $Service->toString, @@ -1597,7 +1610,7 @@ # my ($self, $xml) = @_; my $Parser = new XML::DOM::Parser; - + #print STDERR $xml; my $doc = $Parser->parse($xml); my $Object = $doc->getDocumentElement(); my $obj = $Object->getTagName; @@ -1608,7 +1621,8 @@ my $reg = MOBY::Client::Registration->new( success => $success, message => $message, - registration_id => $id,); + registration_id => $id, + id => $id); return $reg; } =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm 2003/12/02 00:23:23 1.6 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm 2004/04/14 19:56:59 1.7 @@ -19,9 +19,42 @@ =head1 DESCRIPTION -This describes the Collection articles from the findService Response of MOBY Central -(i.e. the description of the service), it DOES NOT create collection articles -as provided by a service provider (i.e. simple articles containing data) +This describes the Collection articles from either the findService Response of MOBY Central +(i.e. the description of the service), or Collection articles +as provided in a service invocation or response message +(i.e. simple articles containing data) + +Basically it parses the following part of a findService response: + + + + someNbject + someNamespace + someNamespace2 + + + someNbject + someNamespace + someNamespace2 + + + +OR it parses the following part of a service invocation or response message: + + + + ..... + + + ..... + + + + +The articleName is retrieved with ->articleName +The contained Simples are retrieved as MOBY::Client::SimpleArticle objects +using the ->Simples method call. + =head1 AUTHORS @@ -38,8 +71,11 @@ Usage : my $IN = MOBY::Client::CollectionArticle->new(%args) Function : create CollectionArticle object Returns : MOBY::Client::SimpleArticle object - Args : articleName => $articleName (optional) - Simples => $objectType (required) + Args : either of the following two methods may be used to auto-generate the + object by passing the appropriate XML node as a string, or XML::DOM node object + + XML => $XML + XML_DOM => $XML::DOM::NODE =cut @@ -76,6 +112,29 @@ =cut + +=head2 XML + + Title : XML + Usage : $SA = $SA->XML($XML) + Function : set/reset all parameters for this object from the XML + Returns : MOBY::Client::SimpleArticle + Arguments : (optional) XML fragment from and including ... + +=cut + + +=head2 XML_DOM + + Title : XML_DOM + Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) + Function : set/reset all parameters for this object from the XML::DOM node for + Returns : MOBY::Client::SimpleArticle + Arguments : (optional) an $XML::DOM node from the article of a DOM + +=cut + + =head2 isSimple Title : isSimple @@ -104,6 +163,17 @@ =cut +=head2 isSecondary + + Title : isSecondary + Usage : $boolean = $IN->isSecondary() + Function : is this a SecondaryArticle type? + (yes, I know this is obvious) + Returns : 0 (true) + +=cut + + { # Encapsulated: # DATA @@ -115,6 +185,7 @@ articleName => [undef, 'read/write'], Simples => [[], 'read/write'], isSimple => [0, 'read' ], + isSecondary => [0, 'read' ], isCollection => [1, 'read' ], XML => [undef, 'read/write'], XML_DOM => [undef, 'read/write'], @@ -188,7 +259,7 @@ sub createFromXML { my ($self) = @_; - my $p = XML::DOM->new; + my $p = XML::DOM::Parser->new; my $doc = $p->parse($self->XML); my $root = $doc->getDocumentElement; return 0 unless ($root && ($root->getTagName eq "Collection")); @@ -198,6 +269,7 @@ sub createFromDOM { my ($self, $dom) = @_; return 0 unless ($dom && ($dom->getTagName eq "Collection")); + $self->XML($dom->toString); # set the string version of the DOM $self->articleName(""); $self->Simples([]); @@ -209,7 +281,7 @@ for my $n(0..$objects->getLength - 1){ foreach my $child($objects->item($n)->getChildNodes){ next unless $child->getNodeType == ELEMENT_NODE; - $self->addSimple(MOBY::Client::SimpleArticle->new(XML_DOM => $objects->item($n))); + $self->addSimple(MOBY::Client::SimpleArticle->new(articleName=>$self->articleName, XML_DOM => $objects->item($n))); } } return $self; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm 2004/03/18 23:10:34 1.10 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm 2004/04/14 19:56:59 1.11 @@ -186,6 +186,7 @@ type => [undef, 'read/write'], input => [[], 'read/write'], # listref of Simple and Collection articles output => [[], 'read/write'], # listref of Simple and Collection articles + secondary => [[], 'read/write'], # listref of SecondaryArticles category => [undef, 'read/write'], description => [undef, 'read/write'], registry => ['MOBY_Central', 'read/write'], =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm 2003/12/02 00:23:23 1.3 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm 2004/04/14 19:56:59 1.4 @@ -18,9 +18,30 @@ =head1 DESCRIPTION -This describes the Simple articles from the findService Response of MOBY Central -(i.e. the description of the service), it DOES NOT create simple articles -as provided by a service provider (i.e. simple articles containing data) +This describes the Simple articles from either the findService Response of MOBY Central +(i.e. the description of the service), or Simple articles +as provided in a service invocation or response message +(i.e. simple articles containing data) + +Basically it parses the following part of a findService response: + + + someNbject + someNamespace + someNamespace2 + + +OR it parses the following part of a service invocation or response message: + + + ..... + + +The articleName is retrieved with ->articleName +The namespace(s) are retrieved with ->namespaces +The objectType is retrieved with ->objectType +the id (if instantiated) is retrieved with ->id + =head1 AUTHORS @@ -37,11 +58,12 @@ Usage : my $SA = MOBY::Client::SimpleArticle->new(%args) Function : create SimpleArticle object Returns : MOBY::Client::SimpleArticle object - Args : articleName => $articleName (optional) - objectType => $objectType (required) - namespaces => \@namesapces (optional) - XML_DOM => $XML_DOM node of the simple article (optional) - XML => $XML XML string representing the simple article (optional) + Args : either of the following two methods may be used to auto-generate the + object by passing the appropriate XML node as a string, or XML::DOM node object + + XML => $XML + XML_DOM => $XML::DOM::NODE + =cut @@ -76,27 +98,27 @@ =cut -# -#=head2 XML -# -# Title : XML -# Usage : $SA = $SA->XML($XML) -# Function : set/reset all parameters for this object from the XML -# Returns : MOBY::Client::SimpleArticle -# Arguments : (optional) XML fragment from and including ... -# -#=cut -# -# -#=head2 XML_DOM -# -# Title : XML_DOM -# Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) -# Function : set/reset all parameters for this object from the XML::DOM node for -# Returns : MOBY::Client::SimpleArticle -# Arguments : (optional) an $XML::DOM node from the article of a DOM -# -#=cut + +=head2 XML + + Title : XML + Usage : $SA = $SA->XML($XML) + Function : set/reset all parameters for this object from the XML + Returns : MOBY::Client::SimpleArticle + Arguments : (optional) XML fragment from and including ... + +=cut + + +=head2 XML_DOM + + Title : XML_DOM + Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) + Function : set/reset all parameters for this object from the XML::DOM node for + Returns : MOBY::Client::SimpleArticle + Arguments : (optional) an $XML::DOM node from the article of a DOM + +=cut =head2 addNamespace @@ -136,6 +158,17 @@ =cut +=head2 isSecondary + + Title : isSecondary + Usage : $boolean = $IN->isSecondary() + Function : is this a SecondaryArticle type? + (yes, I know this is obvious) + Returns : 0 (true) + +=cut + + { # Encapsulated: # DATA @@ -147,8 +180,10 @@ articleName => [undef, 'read/write'], objectType => [undef, 'read/write'], namespaces => [[], 'read/write'], + id => [undef, 'read/write'], XML_DOM => [undef, 'read/write'], XML => [undef, 'read/write'], + isSecondary => [0, 'read' ], isSimple => [1, 'read' ], isCollection => [0, 'read' ], ); @@ -218,7 +253,7 @@ sub createFromXML { my ($self) = @_; - my $p = XML::DOM->new; + my $p = XML::DOM::Parser->new; my $doc = $p->parse($self->XML); my $root = $doc->getDocumentElement; return 0 unless ($root && ($root->getTagName eq "Simple")); @@ -228,7 +263,7 @@ sub createFromDOM { my ($self, $dom) = @_; return 0 unless ($dom && ($dom->getTagName eq "Simple")); - + $self->XML($dom->toString); # set the string version of the DOM $self->namespaces([]); # reset! $self->articleName(""); $self->objectType(""); @@ -236,7 +271,46 @@ my $attr = $dom->getAttributeNode('articleName'); my $articleName = ""; $articleName = $attr->getValue if $attr; - $self->articleName($articleName); + $self->articleName($articleName) if $articleName; # it may have already been set if this Simple is part of a Collection... + +# fork here - it may be an instantiated object (coming from a service invocation/response) +# or it may be a template object as in the SimpleArticle element of a registration call + +# if the objectType tag exists, then it is a template object + if (@{$dom->getElementsByTagName("objectType")}[0]){ + return $self->_createTemplateArticle($dom) + } + else { return $self->_createInstantiatedArticle($dom)} +# otherwise it should simpy contain an instantiated MOBY object + + +} + +sub _createInstantiatedArticle { + my ($self, $dom) = @_; + + # this will take a node from a MOBY invocation message + # and extract the object-type and namespace from the + # contained data object + + foreach my $child($dom->getChildNodes){ # there should be only one child node, and that is the data object itself; ignore whitespace + next unless $child->getNodeType == ELEMENT_NODE; + $self->objectType($child->getTagName); + my $attr = $child->getAttributeNode('namespace'); + $self->addNamespace($attr->getValue) if $attr; + my $id = $child->getAttributeNode('id'); + $self->id($id->getValue) if $id; + } + return $self; +} + +sub _createTemplateArticle { + my ($self, $dom) = @_; + + # this will take a node from a MOBY findServiceResponse + # message and extract the objectType and namespace array + # from the service signature. + my $objects = $dom->getElementsByTagName("objectType"); foreach my $child($objects->item(0)->getChildNodes){ # there must be only one in a simple! so take element 0 next unless $child->getNodeType == TEXT_NODE; @@ -254,7 +328,6 @@ return $self; } - sub AUTOLOAD { no strict "refs"; my ($self, $newval) = @_; From mwilkinson at pub.open-bio.org Wed Apr 14 15:56:59 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Apr 14 15:48:10 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404141956.i3EJuxs1013372@pub.open-bio.org> mwilkinson Wed Apr 14 15:56:59 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv13353/Perl/MOBY Modified Files: CommonSubs.pm Log Message: CommonSubs now includes support for services that use Secondary Parameter's. I am also almost finished writing an OO-interface for building/deconstructing MOBY objects, so that people don't have to learn the XML::DOM API. This is incomplete and untested yet, so don't shoot me if it doesn't work. See the docs for CommonSubs 'complexServiceInputParser' for details on how to manage services that use multiple inputs and/or secondary parameters. As soon as I get this OO interface working I will create an equivalent subroutine that parses the input into objects (but I wont remove this routine, so it wont break you servies if you use it) moby-live/Perl/MOBY CommonSubs.pm,1.43,1.44 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/03/19 00:24:10 1.43 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/14 19:56:59 1.44 @@ -16,51 +16,49 @@ =head2 Service-Side Paradigm The following is a generalized architecture for *all* -BioMOBY services showing how to parse incoming messages... +BioMOBY services showing how to parse incoming messages +using the subroutines provided in CommonSubs sub myServiceName { - my ($caller, $message) = @_; # get the incoming MOBY query XML - - my @queries = getInputs($message); # returns XML::DOM nodes - my $MOBY_RESPONSE = ""; # set empty response - - foreach my $query(@queries){ - - my $queryID = getInputID($query); # get the queryID attribute of the queryInput - - my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query - foreach my $input(@input_articles){ # input is a listref - - my ($articleName, $article) = @{$input}; # get the named article - - my $simple = isSimpleArticle($article); # articles may be simple or collection - my $collection = isCollectionArticle($article); - - if ($collection){ - - # do something wtih the collection... - # for example... - my @simples = getCollectedSimples($article); - # blah blah blah... - - } elsif ($simple){ - # maybe you just need the ID of the incoming query: - my ($id) = getSimpleArticleIDs('NCBI_gi', $article); # if you need the ID - - # or maybe you are going to do something with the content? - # for example, this will get the array of text lines - # for the moby:String object with the articleName 'SequenceString' - # that is in this $article - my @sequence = getNodeContentWithArticle($article, "String", "SequenceString"); - - # DO YOUR ANALYSIS HERE - my $result = ""; #whatever you analysis says - - $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename", $queryID); + my ($caller, $data) = @_; + my $MOBY_RESPONSE; # holds the response raw XML + + # genericServiceInputParser + # unpacks incoming message into an array of arrarefs. + # Each element of the array is a queryInput block, or a mobyData block + # the arrayref has the following structure: + # [SIMPLE, $queryID, $simple] + # the first element is a constant "SIMPLE" or "COLLECTION" + # the second element is the queryID (required for enumerating the responses) + # the third element is the XML::DOM for the Simple or Collection block + my (@inputs)= genericServiceInputParser($data); + # or fail properly with an empty response + return SOAP::Data->type('base64' => responseHeader("my.authURI.com") . responseFooter()) unless (scalar(@inputs)); + + # you only need to do this if you are intending to be namespace aware + # some services might not care what namespace the data is in, so long + # as there is data... + my @validNS_LSID = validateNamespaces("NCBI_gi"); # returns LSID's for each human-readable + + foreach (@inputs){ + my ($articleType, $qID, $input) = @{$_}; + unless (($articleType == SIMPLE) && ($input)){ + # in this example, we are only accepting SIMPLE types as input + # so write back an empty response block and move on to the next + $MOBY_RESPONSE .= simpleResponse("", "", $qID) ; + next; + } else { + # now take the namespace and ID from our input article + # (see pod docs for other possibilities) + my $namespace = getSimpleArticleNamespaceURI($input); # get namespace + my ($identifier) = getSimpleArticleIDs($input); # get ID (note array output! see pod) + + # here is where you do whatever manipulation you need to do + # for your particular service. + # you will be building an XML document into $MOBY_RESPONSE } - } - } - return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter; + } + return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter)); } =cut @@ -72,46 +70,63 @@ This is a service that: -CONSUMES: Object in the NCBI_Acc namespace +CONSUMES: base Object in the GO namespace EXECUTES: Retrieval -PRODUCES: GenericSequence (in the NCBI_Acc namespace) +PRODUCES: GO_Term (in the GO namespace) - use Bio::Perl; - # this subroutine is called from your dispatch_with line # in your SOAP daemon - - sub myServiceName { - my ($caller, $message) = @_; # get the incoming MOBY query XML - my @queries = getInputs($message); # returns XML::DOM nodes - my $MOBY_RESPONSE = ""; # set empty response - - foreach my $query(@queries){ - - my $queryID = getInputID($query); # get the queryID attribute of the queryInput - - my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query - foreach my $input(@input_articles){ # input is a listref - my ($articleName, $article) = @{$input}; # get the named article - next unless isSimpleArticle($article); # I only allow simple inputs in my service signature - my ($id) = getSimpleArticleIDs('NCBI_Acc', $article); # if you need the ID - my $seq; - eval {$seq = get_sequence('genbank',$id);} # suppress bioperl error messages - my $response = ""; - if ($seq){ - $length = length($seq); - $response = " - $length - $seq - "; - } - $MOBY_RESPONSE .= simpleResponse($response, '', $queryID); + + sub getGoTerm { + my ($caller, $message) = @_; + my $MOBY_RESPONSE; + my (@inputs)= genericServiceInputParser($message); # ([SIMPLE, $queryID, $simple],...) + return SOAP::Data->type('base64' => responseHeader('my.authURI.com') . responseFooter()) unless (scalar(@inputs)); + + my @validNS = validateNamespaces("GO"); # ONLY do this if you are intending to be namespace aware! + + my $dbh = _connectToGoDatabase(); + return SOAP::Data->type('base64' => responseHeader('my.authURI.com') . responseFooter()) unless $dbh; + my $sth = $dbh->prepare(q{ + select name, term_definition + from term, term_definition + where term.id = term_definition.term_id + and acc=?}); + + foreach (@inputs){ + my ($articleType, $ID, $input) = @{$_}; + unless ($articleType == SIMPLE){ + $MOBY_RESPONSE .= simpleResponse("", "", $ID); + next; + } else { + my $ns = getSimpleArticleNamespaceURI($input); + (($MOBY_RESPONSE .= simpleResponse("", "", $ID)) && (next)) + unless validateThisNamespace($ns, @validNS); # only do this if you are truly validating namespaces + my ($accession) = defined(getSimpleArticleIDs($ns, [$input]))?getSimpleArticleIDs($ns,[$input]):undef; + unless (defined($accession)){ + $MOBY_RESPONSE .= simpleResponse("", "", $ID); + next; + } + unless ($accession =~/^GO:/){ + $accession = "GO:$accession"; # we still haven't decided on whether id's should include the prefix... + } + $sth->execute($accession); + my ($term, $def) = $sth->fetchrow_array; + if ($term){ + $MOBY_RESPONSE .= simpleResponse(" + + $term + $def + ", "GO_Term_From_ID", $ID) + } else { + $MOBY_RESPONSE .= simpleResponse("", "", $ID) + } } - } - } - return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter; + } + + return SOAP::Data->type('base64' => (responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter)); } @@ -121,7 +136,8 @@ both Client and Service side to construct and parse MOBY Messages, and ensure that the message structure is valid as per the API. -It DOES NOT connect to MOBY Central for any of its functions. +It DOES NOT connect to MOBY Central for any of its functions, though it does +contact the ontology server, so it will require a network connection. =head1 AUTHORS @@ -148,11 +164,13 @@ use constant COLLECTION => 1; use constant SIMPLE => 2; +use constant SECONDARY => 3; +use constant PARAMETER => 3; # be friendly in case they use this instead use constant BE_NICE => 1; use constant BE_STRICT => 0; our @ISA = qw(Exporter); -our @EXPORT = qw(COLLECTION SIMPLE BE_NICE BE_STRICT); +our @EXPORT = qw(COLLECTION SIMPLE SECONDARY PARAMETER BE_NICE BE_STRICT); our @EXPORT_OK = qw( getSimpleArticleIDs getSimpleArticleNamespaceURI @@ -175,10 +193,13 @@ getResponseArticles getCrossReferences genericServiceInputParser + complexServiceInputParser whichDeepestParentObject getServiceNotes COLLECTION SIMPLE + SECONDARY + PARAMETER BE_NICE BE_STRICT ); @@ -204,40 +225,270 @@ getResponseArticles getCrossReferences genericServiceInputParser + complexServiceInputParser whichDeepestParentObject getServiceNotes COLLECTION SIMPLE + SECONDARY + PARAMETER BE_NICE BE_STRICT )]); +=head2 genericServiceInputParser + + name : genericServiceInputParser + function : For the MOST SIMPLE SERVICES that take single Simple or Collection inputs + and no Secondaries this routine takes the MOBY message and + breaks the objects out of it in a useful way + usage : my @inputs = genericServiceInputParser($MOBY_mssage)); + args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message + returns : @inputs - the structure of @inputs is a list of listrefs. + Each listref has three components: + 1. COLLECTION|SIMPLE|SECONDARY (i.e. constants 1, 2, 3) + 2. queryID (undef for Secondary parameters) + 3. $data - the data takes several forms + a. $article XML::DOM node for Simples + ... + b. \@article XML:DOM nodes for Collections + c. $secondary XML::DOM node + +=cut + + sub genericServiceInputParser { my ($message) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = getInputs($message); # returns XML::DOM nodes + my @queries = getInputs($message); # returns XML::DOM nodes ... foreach my $query(@queries){ my $queryID = getInputID($query); # get the queryID attribute of the queryInput - my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query + my @input_articles = getArticles($query); # get the Simple/Collection/Secondary articles making up this query ... or ... or ... foreach my $input(@input_articles){ # input is a listref my ($articleName, $article) = @{$input}; # get the named article - my $simple = isSimpleArticle($article); # articles may be simple or collection - my $collection = isCollectionArticle($article); - if ($collection){ + if (isCollectionArticle($article)){ my @simples = getCollectedSimples($article); push @inputs, [COLLECTION,$queryID, \@simples]; + } elsif (isSimpleArticle($article)){ + push @inputs, [SIMPLE,$queryID,$article]; + } elsif (isSecondaryArticle($article)){ + push @inputs, [SECONDARY,$queryID,$article]; + } + } + } + return @inputs; +} + + + + +=head2 complexServiceInputParser + + name : complexServiceInputParser + function : For more complex services taht have multiple articles for each input + and/or accept parameters, this routine will take a MOBY message and + extract the Simple/Collection/Parameter objects out of it in a + useful way. + usage : my $inputs = complexServiceInputParser($MOBY_mssage)); + args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message + returns : $inputs is a hashref with the following structure: + + $inputs->{$queryID} = [ [TYPE, $DOM], [TYPE, $DOM], [TYPE, $DOM] ] + + Simples ------------------------ + + for example, the input message: + + + + + + + Float + 10 + + + + will become: + (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module) + + $inputs->{1} = [ [SIMPLE, $DOM_name1], + [SECONDARY, $DOM_cutoff] + ] + + Please see the XML::DOM pod documentation for information about how + to parse XML DOM objects. + + + Collections -------------------- + + With inputs that have collections these are presented as a + listref of Simple article DOM's. So for the following message: + + + + + + + + + + + + Float + 10 + + + + will become + + $inputs->{1} = [ [COLLECTION, [$DOM, $DOM] ], + [SECONDARY, $DOM_cutoff] + ] + + Please see the XML::DOM pod documentation for information about how + to parse XML DOM objects. + + +=cut + + +sub complexServiceInputParser { + my ($message) = @_; # get the incoming MOBY query XML + my @inputs; # set empty response + my @queries = getInputs($message); # returns XML::DOM nodes ... + my %input_parameters; # $input_parameters{$queryID} = [ + + foreach my $query(@queries){ + my $queryID = getInputID($query); # get the queryID attribute of the queryInput + my @input_articles = getArticles($query); # get the Simple/Collection/Secondary articles making up this query ... or ... or ... + foreach my $input(@input_articles){ # input is a listref + my ($articleName, $article) = @{$input}; # get the named article + if (isCollectionArticle($article)){ + my @simples = getCollectedSimples($article); + push @{$input_parameters{$queryID}}, [COLLECTION, \@simples]; + } elsif (isSimpleArticle($article)){ + push @{$input_parameters{$queryID}}, [SIMPLE, $article]; + } elsif (isSecondaryArticle($article)){ + push @{$input_parameters{$queryID}}, [SECONDARY, $article]; + } + } + } + return \%input_parameters; +} + + +=head2 getArticles + + name : getArticles + function : get the Simple/Collection/Parameter articles for a single queryInput + or queryResponse node + usage : @articles = getArticles($XML) + args : raw XML or XML::DOM of a queryInput, mobyData, or queryResponse block (e.g. from getInputs) + returns : a list of listrefs; each listref is one component of the queryInput. + a single queryInput/Response may consist of one or more named or unnamed + simple, collection, or parameter articles. + The listref structure is thus [name, $ARTICLE_DOM]: + + e.g.: @articles = ['name1', $SIMPLE_DOM] + + generated from the following sample XML: + + + + + + + + or : @articles = ['name1', $COLL_DOM], ['paramname1', $PARAM_DOM] + + generated from the following sample XML: + + + + + + + + + + + + Float + 10 + + + +=cut + + +sub getArticles { + + my ($moby) = @_; + unless (ref($moby) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($moby); + $moby = $doc->getDocumentElement(); + } + + return undef unless $moby->getNodeType == ELEMENT_NODE; + return undef unless (($moby->getTagName =~ /queryInput/) || ($moby->getTagName =~ /queryResponse/) || ($moby->getTagName =~ /mobyData/)); + my @articles; + foreach my $child($moby->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them + next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace + next unless ($child->getTagName =~ /Simple/ || $child->getTagName =~ /Collection/ || $child->getTagName =~ /Parameter/); + my $articleName = $child->getAttribute('articleName'); + $articleName ||= $child->getAttribute('moby:articleName'); + push @articles, [$articleName, $child]; # push the named child DOM elements (which are or , ) + } + return @articles; # return them. +} + - } elsif ($simple){ + +=head2 genericServiceInputParserAsObject + + name : DO NOT USE! + function : to take a MOBY message and break the objects out of it. This is identical + to the subroutine above, except that it returns the data as + Objects rather than XML::DOM nodes + usage : my @inputs = genericServiceInputParser($MOBY_mssage)); + args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message + returns : @inputs - the structure of @inputs is a list of listrefs. + Each listref has three components: + 1. COLLECTION|SIMPLE|SECONDARY (i.e. constants 1, 2, 3) + 2. queryID (undef for Secondary parameters) + 3. $data - either MOBY::Client::SimpleArticle, CollectionArticle, or SecondaryArticle + +=cut + + +sub genericServiceInputParserAsObject { + my ($message) = @_; # get the incoming MOBY query XML + my @inputs; # set empty response + my @queries = getInputs($message); # returns XML::DOM nodes ... + + foreach my $query(@queries){ + my $queryID = getInputID($query); # get the queryID attribute of the queryInput + my @input_articles = getArticlesAsObjects($query); # get the Simple/Collection articles making up this query ... or ... or ...isCollection){ + my @simples = getCollectedSimples($article->XML); + push @inputs, [COLLECTION,$queryID, \@simples]; + } elsif ($article->isSimple){ push @inputs, [SIMPLE,$queryID,$article]; + } elsif ($article->isSecondary){ + push @inputs, [SECONDARY,$queryID,$article]; } } } return @inputs; } + ################################################# ################################## ################################## @@ -392,17 +643,16 @@ $data ||=''; # initialize to avoid uninit value errors $qID ||=""; $articleName ||=""; - if ($articleName) { return " - $data + $data "; } elsif($data) { return " - $data + $data "; } else { @@ -449,7 +699,7 @@ $data ||=[]; $qID ||= ''; unless ((ref($data) =~ /array/i) && $data->[0]){ # we're expecting an arrayref as input data,and it must not be empty - return ""; + return ""; } foreach (@{$data}){ @@ -465,7 +715,7 @@ } if ($articleName) { return " - + $content @@ -473,7 +723,7 @@ "; } else { return " - + $content "; @@ -545,8 +795,8 @@ function : get the queryInput block(s) as XML::DOM nodes usage : @queryInputs = getInputArticles($XML) args : the raw XML of a query, or an XML::DOM document - returns : a list of XML::DOM::Node's, each is a queryInput. - Note : Remember that queryInputs are numbered! This is what you + returns : a list of XML::DOM::Node's, each is a queryInput or mobyData block. + Note : Remember that these blocks are enumerated! This is what you pass as the third argument to the simpleResponse or collectionResponse subroutine to associate the numbered input to the numbered response @@ -562,16 +812,14 @@ my $doc = $parser->parse($XML); $moby = $doc->getDocumentElement(); } + my @queries; - my $x = $moby->getElementsByTagName('queryInput'); # get the queryInput block - unless ($x->item(0)){ - $x = $moby->getElementsByTagName('moby:queryInput'); + foreach my $querytag('queryInput', 'moby:queryInput', 'mobyData', 'moby:mobyData'){ + my $x = $moby->getElementsByTagName($querytag); # get the queryInput block + for (0..$x->getLength-1){ # there may be more than one queryInput per message + push @queries, $x->item($_); + } } - - my @queries; - for (0..$x->getLength-1){ # there may be more than one queryInput per message - push @queries, $x->item($_); - } return @queries; # return them in the order that they were discovered. } @@ -581,9 +829,9 @@ name : getInputID function : get the value of the queryID element usage : @queryInputs = getInputID($XML) - args : the raw XML or XML::DOM of a block + args : the raw XML or XML::DOM of a queryInput or mobyData block (e.g. from getInputs) returns : integer, or '' - Note : queryInputs and queryResponses are coordinately enumerated! + Note : Inputs and Responses are coordinately enumerated! The integer you get here is what you pass as the third argument to the simpleResponse or collectionResponse subroutine to associate the numbered input to the numbered response @@ -598,44 +846,61 @@ my $doc = $parser->parse($XML); $XML = $doc->getDocumentElement(); } - return '' unless $XML->getTagName =~ /queryInput/; + return '' unless (($XML->getTagName =~ /queryInput/) || ($XML->getTagName =~ /mobyData/)); my $qid = $XML->getAttribute('queryID'); + $qid ||= $XML->getAttribute('moby:queryID'); + return defined($qid)?$qid:''; } -=head2 getArticles +=head2 getArticlesAsObjects - name : getArticles + name : getArticlesAsObjects function : get the Simple/Collection articles for a single queryInput - or queryResponse node + or queryResponse node, rethrning them as SimpleArticle, + SecondaryArticle, or ServiceInstance objects usage : @articles = getArticles($XML) - args : raw XML or XML::DOM of a moby:queryInput or a moby:queryResponse block + args : raw XML or XML::DOM of a moby:queryInput, moby:queryResponse block returns : a list of listrefs; each listref is one component of the queryInput. - a single queryInput/Responsemay consist of one or more named or unnamed - simple or collection articles. The listref structure is thus [name, $ARTICLE]: + a single queryInput/Response may consist of one or more named or unnamed + simple, collection, or parameter articles. + The listref structure is thus [name, $ARTICLE_OBJECT]: - e.g.: @articles = ['name1', $SIMPLE_DOM] - or : @articles = ['name1', $COLLECTION_DOM], ['name2', $SIMPLE_DOM]... + e.g.: @articles = ['name1', $SimpleArticle] - the former is generated from the following sample XML: + generated from the following sample XML: + + or : @articles = ['name1', $CollectionArticle], ['paramname1', $SecondaryArticle] + + generated from the following sample XML: + - - - + + + + + + + + + + Float + 10 + =cut -sub getArticles { +sub getArticlesAsObjects { my ($moby) = @_; unless (ref($moby) =~ /XML\:\:DOM/){ @@ -645,14 +910,21 @@ } return undef unless $moby->getNodeType == ELEMENT_NODE; - return undef unless ($moby->getTagName =~ /queryInput/ || $moby->getTagName =~ /queryResponse/); + return undef unless (($moby->getTagName =~ /queryInput/) || ($moby->getTagName =~ /queryResponse/) || ($moby->getTagName =~ /mobyData/)); my @articles; foreach my $child($moby->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace - next unless ($child->getTagName =~ /Simple/ || $child->getTagName =~ /Collection/); - my $articleName = $child->getAttribute('articleName'); - $articleName ||= $child->getAttribute('moby:articleName'); - push @articles, [$articleName, $child]; # take the child elements, which are or + next unless ($child->getTagName =~ /Simple/ || $child->getTagName =~ /Collection/ || $child->getTagName =~ /Parameter/); + my $object; + if ($child->getTagName =~ /Simple/){ + $object = MOBY::Client::SimpleArticle->new(XML_DOM => $child); + } elsif ($child->getTagName =~ /Collection/){ + $object = MOBY::Client::CollectionArticle->new(XML_DOM => $child); + } elsif ($child->getTagName =~ /Parameter/){ + $object = MOBY::Client::CollectionArticle->new(XML_DOM => $child); + } + next unless $object; + push @articles, $object; # take the child elements, which are or } return @articles; # return them. } @@ -707,18 +979,18 @@ the former is generated from the following XML: ... - - + + - - + + - - + + ... =cut @@ -733,11 +1005,13 @@ $moby = $doc->getDocumentElement(); } - my $x = $moby->getElementsByTagName('queryInput'); # get the queryInput block - unless ($x->item(0)){ - $x = $moby->getElementsByTagName('moby:queryInput'); + my $x; + foreach ('queryInput', 'moby:queryInput', 'mobyData', 'moby:mobyData'){ + $x = $moby->getElementsByTagName($_); # get the queryInput block + last if $x->item(0); } - + return undef unless $x->item(0); # in case there was no match at all + my @queries; for (0..$x->getLength-1){ # there may be more than one queryInput per message my @this_query; @@ -750,6 +1024,7 @@ return @queries; # return them in the order that they were discovered. } + =head2 isSimpleArticle name : isSimpleArticle @@ -798,6 +1073,57 @@ return 0; } + +=head2 isSecondaryArticle + + name : isSecondaryArticle + function : tests XML (text) or an XML DOM node to see if it represents a Secondary article + usage : if (isSecondaryArticle($node)){do something to it} + input : an XML::DOM node, an XML::DOM::Document or straight XML + returns : boolean + +=cut + +sub isSecondaryArticle { + my ($DOM) = @_; + unless (ref($DOM) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc; + eval {$doc = $parser->parse($DOM);}; + return 0 if ($@); + $DOM = $doc->getDocumentElement(); + } + $DOM = $DOM->getDocumentElement if ($DOM->isa("XML::DOM::Document")); + return 1 if ($DOM->getTagName =~ /Parameter/); + return 0; +} + + +=head2 extractRawContent + + name : extractRawContent + function : pass me an article (Simple, or Collection) and I'll give you the + content AS A STRING - i.e. the raw XML of the contained MOBY Object(s) + usage : extractRawContent($simple) + input : the one element of the output from getArticles + returns : string + +=cut + + +sub extractRawContent { + my ($article) = @_; + return "" unless $article; + return "" unless ref($article) =~ /XML::DOM/; + my $response; + foreach ($article->getChildNodes){ + $response .= $_->toString; + } + return $response; + +} + + =head2 getNodeContentWithArticle name : getNodeContentWithArticle @@ -815,16 +1141,16 @@ For example, in the following XML: ... ... - - + + 3 ATG - - + + ... ... @@ -843,32 +1169,6 @@ =cut - -=head2 extractRawContent - - name : extractRawContent - function : pass me an article (Simple, or Collection) and I'll give you the - content AS A STRING - i.e. the raw XML of the contained MOBY Object(s) - usage : extractRawContent($simple) - input : the one element of the output from getArticles - returns : string - -=cut - - -sub extractRawContent { - my ($article) = @_; - return "" unless $article; - return "" unless ref($article) =~ /XML::DOM/; - my $response; - foreach ($article->getChildNodes){ - $response .= $_->toString; - } - return $response; - -} - - sub getNodeContentWithArticle{ # give me a DOM, a TagName, an articleName and I will return you the content # of that node **as a string** (beware if there are additional XML tags in there!) @@ -989,30 +1289,32 @@ my @collections; my @Xrefs; my $success = 0; - my $responses = $moby->getElementsByTagName('moby:queryResponse'); - $responses ||= $moby->getElementsByTagName('queryResponse'); - foreach my $n(0..($responses->getLength - 1)){ - my $resp = $responses->item($n); - foreach my $response_component($resp->getChildNodes){ - next unless $response_component->getNodeType == ELEMENT_NODE; - if (($response_component->getTagName eq "Simple") || ($response_component->getTagName eq "moby:Simple")){ - foreach my $Object($response_component->getChildNodes) { - next unless $Object->getNodeType == ELEMENT_NODE; - $success = 1; - push @objects,$Object; - } - } elsif (($response_component->getTagName eq "Collection") || ($response_component->getTagName eq "moby:Collection")){ - my @objects; - foreach my $simple($response_component->getChildNodes){ - next unless $simple->getNodeType == ELEMENT_NODE; - next unless (($simple->getTagName eq "Simple") || ($simple->getTagName eq "moby:Simple")); - foreach my $Object($simple->getChildNodes) { + foreach my $which ('moby:queryResponse', 'queryResponse', 'mobyData', 'moby:mobyData'){ + my $responses = $moby->getElementsByTagName($which); + next unless $responses; + foreach my $n(0..($responses->getLength - 1)){ + my $resp = $responses->item($n); + foreach my $response_component($resp->getChildNodes){ + next unless $response_component->getNodeType == ELEMENT_NODE; + if (($response_component->getTagName eq "Simple") || ($response_component->getTagName eq "moby:Simple")){ + foreach my $Object($response_component->getChildNodes) { next unless $Object->getNodeType == ELEMENT_NODE; $success = 1; push @objects,$Object; } + } elsif (($response_component->getTagName eq "Collection") || ($response_component->getTagName eq "moby:Collection")){ + my @objects; + foreach my $simple($response_component->getChildNodes){ + next unless $simple->getNodeType == ELEMENT_NODE; + next unless (($simple->getTagName eq "Simple") || ($simple->getTagName eq "moby:Simple")); + foreach my $Object($simple->getChildNodes) { + next unless $Object->getNodeType == ELEMENT_NODE; + $success = 1; + push @objects,$Object; + } + } + push @collections, \@objects; #I'm not using collections yet, so we just use Simples. } - push @collections, \@objects; #I'm not using collections yet, so we just use Simples. } } } From mwilkinson at pub.open-bio.org Wed Apr 14 16:10:35 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Apr 14 16:01:44 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404142010.i3EKAZia013510@pub.open-bio.org> mwilkinson Wed Apr 14 16:10:35 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv13487/MOBY Modified Files: CommonSubs.html CommonSubs.pm Log Message: updating docs and HTML docs moby-live/Perl/MOBY CommonSubs.html,1.8,1.9 CommonSubs.pm,1.44,1.45 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html 2003/12/27 20:24:52 1.8 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html 2004/04/14 20:10:35 1.9 @@ -15,9 +15,9 @@ @@ -61,57 +68,55 @@ MOBY Services

-
-

Client Side Paradigm

+

Client Side Paradigm

+

not written yet

Service-Side Paradigm

The following is a generalized architecture for *all* -BioMOBY services showing how to parse incoming messages...

+BioMOBY services showing how to parse incoming messages +using the subroutines provided in CommonSubs

  sub myServiceName {
-   my ($caller, $message) = @_;  # get the incoming MOBY query XML
-
-   my @queries = getInputs($message);  # returns XML::DOM nodes
-   my $MOBY_RESPONSE = "";           # set empty response
- 
-   foreach my $query(@queries){
-
-     my $queryID = getInputID($query);  # get the queryID attribute of the queryInput
-     
-     my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query
-     foreach my $input(@input_articles){       # input is a listref
-
-        my ($articleName, $article) = @{$input}; # get the named article
-        
-        my $simple = isSimpleArticle($article);  # articles may be simple or collection
-        my $collection = isCollectionArticle($article);
-
-        if ($collection){
-
-            # do something wtih the collection...
-            # for example...
-            my @simples = getCollectedSimples($article);
-            # blah blah blah...
-            
-        } elsif ($simple){
-            # maybe you just need the ID of the incoming query:
-            my ($id) = getSimpleArticleIDs('NCBI_gi', $article); # if you need the ID
-
-            # or maybe you are going to do something with the content?
-            # for example, this will get the array of text lines
-            # for the moby:String object with the articleName 'SequenceString'
-            # that is in this $article
-            my @sequence = getNodeContentWithArticle($article, "String", "SequenceString");
-
-            #  DO YOUR ANALYSIS HERE
-            my $result = ""; #whatever you analysis says
-            
-            $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename", $queryID);
+    my ($caller, $data) = @_;
+    my $MOBY_RESPONSE; # holds the response raw XML
+    
+        # genericServiceInputParser
+        # unpacks incoming message into an array of arrarefs.
+        # Each element of the array is a queryInput block, or a mobyData block
+        # the arrayref has the following structure:
+        # [SIMPLE, $queryID, $simple]
+        # the first element is a constant "SIMPLE" or "COLLECTION"
+        # the second element is the queryID (required for enumerating the responses)
+        # the third element is the XML::DOM for the Simple or Collection block    
+    my (@inputs)= genericServiceInputParser($data); 
+        # or fail properly with an empty response
+    return SOAP::Data->type('base64' => responseHeader("my.authURI.com") . responseFooter()) unless (scalar(@inputs));
+    
+        # you only need to do this if you are intending to be namespace aware
+        # some services might not care what namespace the data is in, so long
+        # as there is data...
+    my @validNS_LSID = validateNamespaces("NCBI_gi");  # returns LSID's for each human-readable
+
+    foreach (@inputs){
+        my ($articleType, $qID, $input) = @{$_};
+        unless (($articleType == SIMPLE) && ($input)){
+                # in this example, we are only accepting SIMPLE types as input
+                # so write back an empty response block and move on to the next
+            $MOBY_RESPONSE .= simpleResponse("", "", $qID) ;
+            next;
+        } else {
+                # now take the namespace and ID from our input article
+                # (see pod docs for other possibilities)
+            my $namespace = getSimpleArticleNamespaceURI($input); # get namespace
+            my ($identifier) = getSimpleArticleIDs($input);  # get ID (note array output! see pod)
+                        
+            # here is where you do whatever manipulation you need to do
+            # for your particular service.
+            # you will be building an XML document into $MOBY_RESPONSE            
         }
-     }
-   }
-   return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter;
+    }
+    return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter));    
  }

@@ -119,45 +124,62 @@

EXAMPLE

A COMPLETE EXAMPLE OF AN EASY MOBY SERVICE

This is a service that:

-

CONSUMES: Object in the NCBI_Acc namespace -EXECUTES: Retrieval -PRODUCES: GenericSequence (in the NCBI_Acc namespace)

- use Bio::Perl;
- 
+ CONSUMES:  base Object in the GO namespace
+ EXECUTES:  Retrieval
+ PRODUCES:  GO_Term (in the GO namespace)
+
  # this subroutine is called from your dispatch_with line
- # in your SOAP daemon
- 
- sub myServiceName {
-   my ($caller, $message) = @_;  # get the incoming MOBY query XML
+ # in your SOAP daemon
-   my @queries = getInputs($message);  # returns XML::DOM nodes
-   my $MOBY_RESPONSE = "";           # set empty response
- 
-   foreach my $query(@queries){
-
-     my $queryID = getInputID($query);  # get the queryID attribute of the queryInput
-     
-     my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query
-     foreach my $input(@input_articles){       # input is a listref
-        my ($articleName, $article) = @{$input}; # get the named article
-        next unless isSimpleArticle($article);   # I only allow simple inputs in my service signature
-        my ($id) = getSimpleArticleIDs('NCBI_Acc', $article); # if you need the ID
-        my $seq;
-        eval {$seq = get_sequence('genbank',$id);} # suppress bioperl error messages
-        my $response = "";
-        if ($seq){
-            $length = length($seq);
-            $response = "<GenericSequence namespace='NCBI_Acc' id='$id'>
-                           <Integer namespace='' id='' articleName='Length'>$length</Integer>
-                           <String namespace='' id='' articleName='SequenceString'>$seq</String>
-                         </GenericSequence>";
-        }
-            $MOBY_RESPONSE .= simpleResponse($response, '', $queryID);
+ sub getGoTerm {
+    my ($caller, $message) = @_;
+    my $MOBY_RESPONSE;
+    my (@inputs)= genericServiceInputParser($message); # ([SIMPLE, $queryID, $simple],...)
+    return SOAP::Data->type('base64' => responseHeader('my.authURI.com') . responseFooter()) unless (scalar(@inputs));
+
+    my @validNS = validateNamespaces("GO");  # ONLY do this if you are intending to be namespace aware!
+
+    my $dbh = _connectToGoDatabase();
+    return SOAP::Data->type('base64' => responseHeader('my.authURI.com') . responseFooter()) unless $dbh;
+    my $sth = $dbh->prepare(q{
+       select name, term_definition
+       from term, term_definition
+       where term.id = term_definition.term_id
+       and acc=?});
+
+    foreach (@inputs){
+        my ($articleType, $ID, $input) = @{$_};
+        unless ($articleType == SIMPLE){
+            $MOBY_RESPONSE .= simpleResponse("", "", $ID);
+            next;
+        } else {
+            my $ns = getSimpleArticleNamespaceURI($input);
+            (($MOBY_RESPONSE .= simpleResponse("", "", $ID)) && (next))
+                unless validateThisNamespace($ns, @validNS);  # only do this if you are truly validating namespaces
+            my ($accession) = defined(getSimpleArticleIDs($ns, [$input]))?getSimpleArticleIDs($ns,[$input]):undef;
+            unless (defined($accession)){
+                $MOBY_RESPONSE .= simpleResponse("", "", $ID);
+                next;
+            }
+            unless ($accession =~/^GO:/){
+                 $accession = "GO:$accession";  # we still haven't decided on whether id's should include the prefix...
+            }
+            $sth->execute($accession);        
+            my ($term, $def) = $sth->fetchrow_array;
+            if ($term){
+                 $MOBY_RESPONSE .= simpleResponse("
+                 <moby:GO_Term namespace='GO' id='$accession'>
+                  <moby:String namespace='' id='' articleName='Term'>$term</moby:String>
+                  <moby:String namespace='' id='' articleName='Definition'>$def</moby:String>
+                 </moby:GO_Term>", "GO_Term_From_ID", $ID)
+            } else {
+                 $MOBY_RESPONSE .= simpleResponse("", "", $ID)
+            }
         }
-     }
-   }
-   return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter;
+    }
+    
+    return SOAP::Data->type('base64' => (responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter));    
  }

@@ -166,7 +188,8 @@

CommonSubs are used to do various manipulations of MOBY Messages. It is useful both Client and Service side to construct and parse MOBY Messages, and ensure that the message structure is valid as per the API.

-

It DOES NOT connect to MOBY Central for any of its functions.

+

It DOES NOT connect to MOBY Central for any of its functions, though it does +contact the ontology server, so it will require a network connection.


@@ -179,6 +202,150 @@

METHODS

+

genericServiceInputParser

+
+ name     : genericServiceInputParser
+ function : For the MOST SIMPLE SERVICES that take single Simple or Collection inputs
+            and no Secondaries this routine takes the MOBY message and
+            breaks the objects out of it in a useful way
+ usage    : my @inputs = genericServiceInputParser($MOBY_mssage));
+ args     : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message
+ returns  : @inputs - the structure of @inputs is a list of listrefs.
+            Each listref has three components:
+                1. COLLECTION|SIMPLE|SECONDARY (i.e. constants 1, 2, 3)
+                2. queryID (undef for Secondary parameters)
+                3. $data - the data takes several forms
+                         a. $article XML::DOM node for Simples
+                            <queryInput...>...</queryInput>
+                         b. \@article XML:DOM nodes for Collections
+                         c. $secondary XML::DOM node
+

+

+

complexServiceInputParser

+
+ name     : complexServiceInputParser
+ function : For more complex services taht have multiple articles for each input
+            and/or accept parameters, this routine will take a MOBY message and
+            extract the Simple/Collection/Parameter objects out of it in a
+            useful way.
+ usage    : my $inputs = complexServiceInputParser($MOBY_mssage));
+ args     : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message
+ returns  : $inputs is a hashref with the following structure:
+            
+            $inputs->{$queryID} = [ [TYPE, $DOM], [TYPE, $DOM], [TYPE, $DOM] ]
+            
+            Simples ------------------------
+            
+            for example, the input message:
+            
+                <queryInput queryID = '1'>
+                    <Simple articleName='name1'>
+                       <Object namespace=blah id=blah/>
+                    </Simple>
+                    <Parameter articleName='cutoff'>
+                       <datatype>Float</datatype>
+                       <default>10</default>
+                    </Parameter>
+                </queryInput>
+
+            will become:
+            (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module)
+            
+            $inputs->{1} = [ [SIMPLE, $DOM_name1],
+                             [SECONDARY, $DOM_cutoff]
+                           ]
+
+            Please see the XML::DOM pod documentation for information about how
+            to parse XML DOM objects.
+            
+            
+            Collections --------------------
+            
+            With inputs that have collections these are presented as a
+            listref of Simple article DOM's.  So for the following message:
+            
+                <queryInput>
+                    <Collection articleName='name1'>
+                      <Simple>
+                       <Object namespace=blah id=blah/>
+                      </Simple>
+                      <Simple>
+                       <Object namespace=blah id=blah/>
+                      </Simple>
+                    </Collection>
+                    <Parameter articleName='cutoff'>
+                       <datatype>Float</datatype>
+                       <default>10</default>
+                    </Parameter>
+                </queryInput>
+
+            will become
+            
+            $inputs->{1} = [ [COLLECTION, [$DOM, $DOM] ],
+                             [SECONDARY, $DOM_cutoff]
+                           ]
+
+            Please see the XML::DOM pod documentation for information about how
+            to parse XML DOM objects.
+

+

+

getArticles

+
+ name     : getArticles
+ function : get the Simple/Collection/Parameter articles for a single queryInput
+            or queryResponse node
+ usage    : @articles = getArticles($XML)
+ args     : raw XML or XML::DOM of a queryInput, mobyData, or queryResponse block (e.g. from getInputs)
+ returns  : a list of listrefs; each listref is one component of the queryInput.
+            a single queryInput/Response may consist of one or more named or unnamed
+            simple, collection, or parameter articles.
+            The listref structure is thus [name, $ARTICLE_DOM]:
+            
+    e.g.:  @articles = ['name1', $SIMPLE_DOM]
+
+            generated from the following sample XML:
+
+                <queryInput>
+                    <Simple articleName='name1'>
+                      <Object namespace=blah id=blah/>
+                    </Simple>
+                </queryInput>
+        
+    or  :  @articles = ['name1', $COLL_DOM], ['paramname1', $PARAM_DOM]
+
+            generated from the following sample XML:
+
+                <queryInput>
+                    <Collection articleName='name1'>
+                      <Simple>
+                       <Object namespace=blah id=blah/>
+                      </Simple>
+                      <Simple>
+                       <Object namespace=blah id=blah/>
+                      </Simple>
+                    </Collection>
+                    <Parameter articleName='e value cutoff'>
+                       <datatype>Float</datatype>
+                       <default>10</default>
+                    </Parameter>
+                </queryInput>
+

+

+

genericServiceInputParserAsObject

+
+ name     : DO NOT USE!
+ function : to take a MOBY message and break the objects out of it.  This is identical
+            to the subroutine above, except that it returns the data as
+            Objects rather than XML::DOM nodes
+ usage    : my @inputs = genericServiceInputParser($MOBY_mssage));
+ args     : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message
+ returns  : @inputs - the structure of @inputs is a list of listrefs.
+            Each listref has three components:
+                1. COLLECTION|SIMPLE|SECONDARY (i.e. constants 1, 2, 3)
+                2. queryID (undef for Secondary parameters)
+                3. $data - either MOBY::Client::SimpleArticle, CollectionArticle, or SecondaryArticle
+

+

getSimpleArticleIDs

  name     : getSimpleArticleIDs
@@ -243,12 +410,16 @@
 

responseHeader

- name     : responseHeader($auth)
- function : print the XML string of a MOBY response header
- usage    : return responseHeader('illuminae.com') . $DATA . responseFooter;
- args     : a string representing the service providers authority URI
- caveat   : will soon be expanded to include service provision info
-            and additional namespace declarations
+ name     : responseHeader
+ function : print the XML string of a MOBY response header +/- serviceNotes
+ usage    : responseHeader('illuminae.com')
+            responseHeader(
+                -authority => 'illuminae.com',
+                -note => 'here is some data from the service provider')
+ args     : a string representing the service providers authority URI,
+            OR a set of named arguments with the authority and the
+            service provision notes.
+ caveat   : 
  notes    :  returns everything required up to the response articles themselves.
              i.e. something like:
  <?xml version='1.0' encoding='UTF-8'?>
@@ -274,8 +445,8 @@
  function : get the queryInput block(s) as XML::DOM nodes
  usage    : @queryInputs = getInputArticles($XML)
  args     : the raw XML of a <MOBY> query, or an XML::DOM document
- returns  : a list of XML::DOM::Node's, each is a queryInput.
- Note     : Remember that queryInputs are numbered!  This is what you
+ returns  : a list of XML::DOM::Node's, each is a queryInput or mobyData block.
+ Note     : Remember that these blocks are enumerated!  This is what you
             pass as the third argument to the simpleResponse or collectionResponse
             subroutine to associate the numbered input to the numbered response

@@ -285,40 +456,23 @@ name : getInputID function : get the value of the queryID element usage : @queryInputs = getInputID($XML) - args : the raw XML or XML::DOM of a <queryInput> block + args : the raw XML or XML::DOM of a queryInput or mobyData block (e.g. from getInputs) returns : integer, or '' - Note : queryInputs and queryResponses are coordinately enumerated! + Note : Inputs and Responses are coordinately enumerated! The integer you get here is what you pass as the third argument to the simpleResponse or collectionResponse subroutine to associate the numbered input to the numbered response

-

getArticles

+

getArticlesAsObjects

- name     : getArticles
+ name     : DO NOT USE!!
  function : get the Simple/Collection articles for a single queryInput
-            or queryResponse node
+            or queryResponse node, rethrning them as SimpleArticle,
+            SecondaryArticle, or ServiceInstance objects
  usage    : @articles = getArticles($XML)
- args     : raw XML or XML::DOM of a moby:queryInput or a moby:queryResponse block
- returns  : a list of listrefs; each listref is one component of the queryInput.
-            a single queryInput/Responsemay consist of one or more named or unnamed
-            simple or collection articles.  The listref structure is thus [name, $ARTICLE]:
-            
-            e.g.:  @articles = ['name1', $SIMPLE_DOM]
-            or  :  @articles = ['name1', $COLLECTION_DOM], ['name2', $SIMPLE_DOM]...
-
-            the former is generated from the following sample XML:
-
-                <queryInput>
-                    <Simple articleName='name1'>
-                      <Object namespace=blah id=blah/>
-                    </Simple>
-                </queryInput>
-                <queryInput>
-                    <Simple articleName='name1'>
-                      <Object namespace=blah id=blah/>
-                    </Simple>
-                </queryInput>
+ args : raw XML or XML::DOM of a moby:queryInput, moby:queryResponse block + returns :

getCollectedSimples

@@ -346,18 +500,18 @@ the former is generated from the following XML: ... - <moby:Query> - <queryInput> + <moby:mobyContent> + <moby:mobyData> <Simple> <Object namespace=blah id=blah/> </Simple> - </queryInput> - <queryInput> + </moby:mobyData> + <moby:mobyData> <Simple> <Object namespace=blah id=blah/> </Simple> - </queryInput> - </moby:Query> + </moby:mobyData> + </moby:mobyContent> ...

@@ -379,6 +533,25 @@ returns : boolean

+

isSecondaryArticle

+
+ name     : isSecondaryArticle
+ function : tests XML (text) or an XML DOM node to see if it represents a Secondary article
+ usage    : if (isSecondaryArticle($node)){do something to it}
+ input    : an XML::DOM node, an XML::DOM::Document or straight XML
+ returns  : boolean
+

+

+

extractRawContent

+
+ name     : extractRawContent
+ function : pass me an article (Simple, or Collection) and I'll give you the
+            content AS A STRING - i.e. the raw XML of the contained MOBY Object(s)
+ usage    : extractRawContent($simple)
+ input    : the one element of the output from getArticles
+ returns  : string
+

+

getNodeContentWithArticle

  name     : getNodeContentWithArticle
@@ -396,16 +569,16 @@
             For example, in the following XML:
              ...
              ...
-             <moby:Query>
-                <queryInput>
+             <moby:mobyContent>
+                <moby:mobyData>
                     <Simple>
                       <Sequence namespace=blah id=blah>
                            <Integer namespace='' id='' articleName="Length">3</Integer>
                            <String namespace='' id='' articleName="SequenceString">ATG</String>
                       </Sequence>
                     </Simple>
-                </queryInput>
-             </moby:Query>
+                </moby:mobyData>
+             </moby:mobyContent>
              ...
              ...
              
@@ -422,16 +595,6 @@
               }

-

extractRawContent

-
- name     : extractRawContent
- function : pass me an article (Simple, or Collection) and I'll give you the
-            content AS A STRING - i.e. the raw XML of the contained MOBY Object(s)
- usage    : extractRawContent($simple)
- input    : the one element of the output from getArticles
- returns  : string
-

-

validateNamespaces

  name     : validateNamespaces
@@ -462,6 +625,15 @@
             an array-ref of Simple article XML::DOM::Node's

+

getServiceNotes

+
+ name     : getServiceNotes
+ function : to get the content of the Service Notes block of the MOBY message
+ usage    : getServiceNotes($message)
+ args     : $message is either the XML::DOM of the MOBY message, or plain XML
+ returns  : String content of the ServiceNotes block of the MOBY Message
+

+

getCrossReferences

  name     : getCrossReferences
@@ -496,8 +668,78 @@
  args     : $CENTRAL - your MOBY::Client::Central object
             $queryTerm - the object type I am interested in
             \@termlist - the list of object types that I know about
- returns  : an ontology term as a scalar, or undef if there
-            is no parent of this node in the nodelist
+ returns : an ontology term and LSID as a scalar, or undef if there + is no parent of this node in the nodelist. + (note that it will only return the term if you give it + term names in the @termList. If you give it + LSID's in the termList, then both the parameters + returned will be LSID's - it doesn't back-translate...) +

+

+

_rearrange (stolen from BioPerl ;-) )

+
+ Usage     : $object->_rearrange( array_ref, list_of_arguments)
+ Purpose   : Rearranges named parameters to requested order.
+ Example   : $self->_rearrange([qw(SEQUENCE ID DESC)],@param);
+           : Where @param = (-sequence => $s,
+           :                    -desc     => $d,
+           :                    -id       => $i);
+ Returns   : @params - an array of parameters in the requested order.
+           : The above example would return ($s, $i, $d).
+           : Unspecified parameters will return undef. For example, if
+           :        @param = (-sequence => $s);
+           : the above _rearrange call would return ($s, undef, undef)
+ Argument  : $order : a reference to an array which describes the desired
+           :          order of the named parameters.
+           : @param : an array of parameters, either as a list (in
+           :          which case the function simply returns the list),
+           :          or as an associative array with hyphenated tags
+           :          (in which case the function sorts the values 
+           :          according to @{$order} and returns that new array.)
+           :          The tags can be upper, lower, or mixed case
+           :          but they must start with a hyphen (at least the
+           :          first one should be hyphenated.)
+ Source    : This function was taken from CGI.pm, written by Dr. Lincoln
+           : Stein, and adapted for use in Bio::Seq by Richard Resnick and
+           : then adapted for use in Bio::Root::Object.pm by Steve Chervitz,
+           : then migrated into Bio::Root::RootI.pm by Ewan Birney.
+ Comments  :
+           : Uppercase tags are the norm, 
+           : (SAC)
+           : This method may not be appropriate for method calls that are
+           : within in an inner loop if efficiency is a concern.
+           :
+           : Parameters can be specified using any of these formats:
+           :  @param = (-name=>'me', -color=>'blue');
+           :  @param = (-NAME=>'me', -COLOR=>'blue');
+           :  @param = (-Name=>'me', -Color=>'blue');
+           :  @param = ('me', 'blue');
+           : A leading hyphenated argument is used by this function to 
+           : indicate that named parameters are being used.
+           : Therefore, the ('me', 'blue') list will be returned as-is.
+           :
+           : Note that Perl will confuse unquoted, hyphenated tags as 
+           : function calls if there is a function of the same name 
+           : in the current namespace:
+           :    -name => 'foo' is interpreted as -&name => 'foo'
+           :
+           : For ultimate safety, put single quotes around the tag:
+           :    ('-name'=>'me', '-color' =>'blue');
+           : This can be a bit cumbersome and I find not as readable
+           : as using all uppercase, which is also fairly safe:
+           :    (-NAME=>'me', -COLOR =>'blue');
+           :
+           : Personal note (SAC): I have found all uppercase tags to
+           : be more managable: it involves less single-quoting,
+           : the key names stand out better, and there are no method naming 
+           : conflicts.
+           : The drawbacks are that it's not as easy to type as lowercase,
+           : and lots of uppercase can be hard to read.
+           :
+           : Regardless of the style, it greatly helps to line
+           : the parameters up vertically for long/complex lists.
+
+
=================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/14 19:56:59 1.44 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/14 20:10:35 1.45 @@ -8,7 +8,9 @@ =cut -=head1 Client Side Paradigm +=head2 Client Side Paradigm + +not written yet =cut @@ -51,7 +53,7 @@ # now take the namespace and ID from our input article # (see pod docs for other possibilities) my $namespace = getSimpleArticleNamespaceURI($input); # get namespace - my ($identifier) = getSimpleArticleIDs($input); # get ID (note array output! see pod) + my ($identifier) = getSimpleArticleIDs($input); # get ID (note array output! see pod) # here is where you do whatever manipulation you need to do # for your particular service. @@ -70,9 +72,9 @@ This is a service that: -CONSUMES: base Object in the GO namespace -EXECUTES: Retrieval -PRODUCES: GO_Term (in the GO namespace) + CONSUMES: base Object in the GO namespace + EXECUTES: Retrieval + PRODUCES: GO_Term (in the GO namespace) # this subroutine is called from your dispatch_with line @@ -101,28 +103,28 @@ $MOBY_RESPONSE .= simpleResponse("", "", $ID); next; } else { - my $ns = getSimpleArticleNamespaceURI($input); - (($MOBY_RESPONSE .= simpleResponse("", "", $ID)) && (next)) - unless validateThisNamespace($ns, @validNS); # only do this if you are truly validating namespaces - my ($accession) = defined(getSimpleArticleIDs($ns, [$input]))?getSimpleArticleIDs($ns,[$input]):undef; - unless (defined($accession)){ - $MOBY_RESPONSE .= simpleResponse("", "", $ID); - next; - } - unless ($accession =~/^GO:/){ - $accession = "GO:$accession"; # we still haven't decided on whether id's should include the prefix... - } - $sth->execute($accession); - my ($term, $def) = $sth->fetchrow_array; - if ($term){ - $MOBY_RESPONSE .= simpleResponse(" - - $term - $def - ", "GO_Term_From_ID", $ID) - } else { - $MOBY_RESPONSE .= simpleResponse("", "", $ID) - } + my $ns = getSimpleArticleNamespaceURI($input); + (($MOBY_RESPONSE .= simpleResponse("", "", $ID)) && (next)) + unless validateThisNamespace($ns, @validNS); # only do this if you are truly validating namespaces + my ($accession) = defined(getSimpleArticleIDs($ns, [$input]))?getSimpleArticleIDs($ns,[$input]):undef; + unless (defined($accession)){ + $MOBY_RESPONSE .= simpleResponse("", "", $ID); + next; + } + unless ($accession =~/^GO:/){ + $accession = "GO:$accession"; # we still haven't decided on whether id's should include the prefix... + } + $sth->execute($accession); + my ($term, $def) = $sth->fetchrow_array; + if ($term){ + $MOBY_RESPONSE .= simpleResponse(" + + $term + $def + ", "GO_Term_From_ID", $ID) + } else { + $MOBY_RESPONSE .= simpleResponse("", "", $ID) + } } } @@ -857,45 +859,13 @@ =head2 getArticlesAsObjects - name : getArticlesAsObjects + name : DO NOT USE!! function : get the Simple/Collection articles for a single queryInput or queryResponse node, rethrning them as SimpleArticle, SecondaryArticle, or ServiceInstance objects usage : @articles = getArticles($XML) args : raw XML or XML::DOM of a moby:queryInput, moby:queryResponse block - returns : a list of listrefs; each listref is one component of the queryInput. - a single queryInput/Response may consist of one or more named or unnamed - simple, collection, or parameter articles. - The listref structure is thus [name, $ARTICLE_OBJECT]: - - e.g.: @articles = ['name1', $SimpleArticle] - - generated from the following sample XML: - - - - - - - - or : @articles = ['name1', $CollectionArticle], ['paramname1', $SecondaryArticle] - - generated from the following sample XML: - - - - - - - - - - - - Float - 10 - - + returns : =cut @@ -1327,10 +1297,10 @@ =head2 getServiceNotes name : getServiceNotes - function : - usage : - args : - returns : + function : to get the content of the Service Notes block of the MOBY message + usage : getServiceNotes($message) + args : $message is either the XML::DOM of the MOBY message, or plain XML + returns : String content of the ServiceNotes block of the MOBY Message =cut @@ -1518,7 +1488,7 @@ # _rearrange stolen from BioPerl's Bio::RootI.pm # because it is just so useful! -=head2 _rearrange +=head2 _rearrange (stolen from BioPerl ;-) ) Usage : $object->_rearrange( array_ref, list_of_arguments) Purpose : Rearranges named parameters to requested order. From mwilkinson at pub.open-bio.org Thu Apr 15 10:38:22 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu Apr 15 10:29:25 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404151438.i3FEcM5S016350@pub.open-bio.org> mwilkinson Thu Apr 15 10:38:22 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv16304/Client Modified Files: CollectionArticle.html ServiceInstance.html SimpleArticle.html Log Message: updating all documentation that has gone out of sync with the code moby-live/Perl/MOBY/Client CollectionArticle.html,1.1,1.2 ServiceInstance.html,1.7,1.8 SimpleArticle.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.html 2003/07/01 15:00:47 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.html 2004/04/15 14:38:22 1.2 @@ -1,8 +1,8 @@ -MOBY::Client::CollectionArticle - a small object describing a MOBY Collection input or output - +MOBY::Client::CollectionArticle - a small object describing the Collection articles from the findService Response message of MOBY Central + @@ -23,8 +23,11 @@
  • articleName
  • Simples
  • addSimple
  • +
  • XML
  • +
  • XML_DOM
  • isSimple
  • isCollection
  • +
  • isSecondary
  • @@ -34,19 +37,52 @@

    NAME

    -

    MOBY::Client::CollectionArticle - a small object describing a MOBY Collection input or output

    +

    MOBY::Client::CollectionArticle - a small object describing the Collection articles from the findService Response message of MOBY Central


    SYNOPSIS

    +

    experimental - please do not use in your code


    DESCRIPTION

    +

    This describes the Collection articles from either the findService Response of MOBY Central +(i.e. the description of the service), or Collection articles +as provided in a service invocation or response message +(i.e. simple articles containing data)

    +

    Basically it parses the following part of a findService response:

    +
    + <Collection articleName="foo">
    +  <Simple>
    +     <objectType>someNbject</objectType>
    +     <Namespace>someNamespace</Namespace>
    +     <Namespace>someNamespace2</Namespace>
    +  </Simple>
    +  <Simple>
    +     <objectType>someNbject</objectType>
    +     <Namespace>someNamespace</Namespace>
    +     <Namespace>someNamespace2</Namespace>
    +  </Simple>
    + </Collection>
    +

    OR it parses the following part of a service invocation or response message:

    +
    + <Collection articleName="foo">
    +  <Simple>
    +    <SomeObject namespace='someNamespace' id='someID'>.....</SomeObject>
    +  </Simple>
    +  <Simple>
    +    <SomeObject namespace='someNamespace' id='someID'>.....</SomeObject>
    +  </Simple>
    + </Collection>
    +

    The articleName is retrieved with ->articleName +The contained Simples are retrieved as MOBY::Client::SimpleArticle objects +using the ->Simples method call.


    AUTHORS

    +

    Mark Wilkinson (markw at illuminae dot com)


    @@ -59,8 +95,11 @@ Usage : my $IN = MOBY::Client::CollectionArticle->new(%args) Function : create CollectionArticle object Returns : MOBY::Client::SimpleArticle object - Args : articleName => $articleName (optional) - Simples => $objectType (required) + Args : either of the following two methods may be used to auto-generate the + object by passing the appropriate XML node as a string, or XML::DOM node object + + XML => $XML + XML_DOM => $XML::DOM::NODE

    articleName

    @@ -91,6 +130,24 @@ Arguments : a new MOBY::Client::SimpleArticle to add to collection

    +

    XML

    +
    + Title     :    XML
    + Usage     :   $SA = $SA->XML($XML)
    + Function  :    set/reset all parameters for this object from the XML
    + Returns   :    MOBY::Client::SimpleArticle
    + Arguments :    (optional) XML fragment from and including <Simple>...</Simple>
    +

    +

    +

    XML_DOM

    +
    + Title     :    XML_DOM
    + Usage     :    $namespaces = $SA->XML_DOM($XML_DOM_NODE)
    + Function  :    set/reset all parameters for this object from the XML::DOM node for <Simple>
    + Returns   :    MOBY::Client::SimpleArticle
    + Arguments :    (optional) an $XML::DOM node from the <Simple> article of a DOM
    +

    +

    isSimple

      Title     :    isSimple
    @@ -100,7 +157,7 @@
                      get both Simple and Collection objects in your
                      Input and output lists, it is good to be able
                      to test what you have in-hand)
    - Returns   :    1 (true)
    + Returns : 0 (false)

    isCollection

    @@ -112,7 +169,16 @@ get both Simple and Collection objects in your Input and output lists, it is good to be able to test what you have in-hand) - Returns : 0 for false + Returns : 1 (true) +

    +

    +

    isSecondary

    +
    + Title     :    isSecondary
    + Usage     :    $boolean = $IN->isSecondary()
    + Function  :    is this a SecondaryArticle type?
    +                (yes, I know this is obvious)
    + Returns   :    0 (true)
    =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html 2003/11/01 18:05:55 1.7 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html 2004/04/15 14:38:22 1.8 @@ -2,7 +2,7 @@ MOBY::Client::ServiceInstance - a small object describing a MOBY service - + @@ -126,10 +126,10 @@

    input

    - Title     :    output
    - Usage     :    $output = $Service->output($args)
    + Title     :    input
    + Usage     :    $input = $Service->input($args)
      Args      :    (optional) listref of SimpleArticle and/or CollectionArticle objects
    - Function  :    get/set output
    + Function  :    get/set input
      Returns   :    listref of MOBY::Client::SimpleArticle
                     and/or MOBY::Client::CollectionArticle objects

    =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.html 2003/07/01 15:00:47 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.html 2004/04/15 14:38:22 1.2 @@ -1,8 +1,8 @@ -MOBY::Client::SimpleArticle - a small object describing a MOBY Simple input/output article - +MOBY::Client::SimpleArticle - a small object describing the Simple articles from the findService Response message of MOBY Central + @@ -23,9 +23,12 @@

  • articleName
  • objectType
  • namespaces
  • +
  • XML
  • +
  • XML_DOM
  • addNamespace
  • isSimple
  • isCollection
  • +
  • isSecondary
  • @@ -35,19 +38,39 @@

    NAME

    -

    MOBY::Client::SimpleArticle - a small object describing a MOBY Simple input/output article

    +

    MOBY::Client::SimpleArticle - a small object describing the Simple articles from the findService Response message of MOBY Central


    SYNOPSIS

    +

    experimental - please do not use in your code


    DESCRIPTION

    +

    This describes the Simple articles from either the findService Response of MOBY Central +(i.e. the description of the service), or Simple articles +as provided in a service invocation or response message +(i.e. simple articles containing data)

    +

    Basically it parses the following part of a findService response:

    +

    <Simple articleName='foo'> + <objectType>someNbject</objectType> + <Namespace>someNamespace</Namespace> + <Namespace>someNamespace2</Namespace> +</Simple>

    +

    OR it parses the following part of a service invocation or response message:

    +

    <Simple articleName='foo'> + <SomeObject namespace='someNamespace' id='someID'>.....</SomeObject> +</Simple>

    +

    The articleName is retrieved with ->articleName +The namespace(s) are retrieved with ->namespaces +The objectType is retrieved with ->objectType +the id (if instantiated) is retrieved with ->id


    AUTHORS

    +

    Mark Wilkinson (markw at illuminae dot com)


    @@ -60,11 +83,11 @@ Usage : my $SA = MOBY::Client::SimpleArticle->new(%args) Function : create SimpleArticle object Returns : MOBY::Client::SimpleArticle object - Args : articleName => $articleName (optional) - objectType => $objectType (required) - namespaces => \@namesapces (optional) - XML_DOM => $XML_DOM node of the simple article (optional) - XML => $XML XML string representing the simple article (optional) + Args : either of the following two methods may be used to auto-generate the + object by passing the appropriate XML node as a string, or XML::DOM node object + + XML => $XML + XML_DOM => $XML::DOM::NODE

    articleName

    @@ -94,6 +117,24 @@ Arguments : (optional) arrayref of namespace strings to set

    +

    XML

    +
    + Title     :    XML
    + Usage     :   $SA = $SA->XML($XML)
    + Function  :    set/reset all parameters for this object from the XML
    + Returns   :    MOBY::Client::SimpleArticle
    + Arguments :    (optional) XML fragment from and including <Simple>...</Simple>
    +

    +

    +

    XML_DOM

    +
    + Title     :    XML_DOM
    + Usage     :    $namespaces = $SA->XML_DOM($XML_DOM_NODE)
    + Function  :    set/reset all parameters for this object from the XML::DOM node for <Simple>
    + Returns   :    MOBY::Client::SimpleArticle
    + Arguments :    (optional) an $XML::DOM node from the <Simple> article of a DOM
    +

    +

    addNamespace

      Title     :    addNamespace
    @@ -124,6 +165,15 @@
                      Input and output lists, it is good to be able
                      to test what you have in-hand)
      Returns   :    0 for false
    +

    +

    +

    isSecondary

    +
    + Title     :    isSecondary
    + Usage     :    $boolean = $IN->isSecondary()
    + Function  :    is this a SecondaryArticle type?
    +                (yes, I know this is obvious)
    + Returns   :    0 (true)
    From mwilkinson at pub.open-bio.org Thu Apr 15 10:38:22 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu Apr 15 10:29:26 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404151438.i3FEcMdP016323@pub.open-bio.org> mwilkinson Thu Apr 15 10:38:22 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv16304 Modified Files: Central.html Log Message: updating all documentation that has gone out of sync with the code moby-live/Perl/MOBY Central.html,1.12,1.13 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.html,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Perl/MOBY/Central.html 2003/12/02 01:08:24 1.12 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.html 2004/04/15 14:38:22 1.13 @@ -2,7 +2,7 @@ MOBY::Central.pm - API for communicating with the MOBY Central registry - + @@ -155,14 +155,14 @@
  • MOBY, by default, supports three types of Class Relationships: ISA, HAS, and HASA (these are the relationship ontology terms)
  • -
  • notice that, in a HAS and HASA relationships, it is necessary to indicate an article name for each contained object type. Thus, for example, you could have a sequence object that contained a String object with name ``nucleotideSequence'' and an Integer object with the name ``sequenceLength''.
    +
  • notice that, in a HAS and HASA relationships, it is necessary to indicate an article name for each contained object type. Thus, for example, you could have a sequence object that contained a String object with name ``nucleotideSequence'' and an Integer object with the name ``sequenceLength''.
  • Input XML :

    @@ -215,7 +215,7 @@
  • the ISA ontology terms must exist or this registration will fail.
  • -
  • all parameters are required.
    +
  • all parameters are required.
  • email must be valid for later deregistration or updates
  • @@ -306,13 +306,13 @@
  • a service must have at least one Input OR Output Object Class. Either Input or Output may be blank to represent ``PUT'' or ``GET'' services respectively
  • -
  • the contactEmail address must be valid, as it is used to authorize deregistrations and changes to the service you registered.
    +
  • the contactEmail address must be valid, as it is used to authorize deregistrations and changes to the service you registered.
  • -
  • the ``authoritativeService'' tag is used to indicate whether or not the registered service is ``authoritative'' for that transformation. i.e. if anyone else were to perform the same transformation they would have to have obtained the information to do so from you. This is similar to, but not necessarily identical to, mirroring someone elses data, since the data in question may not exist prior to service invocation.
    +
  • the ``authoritativeService'' tag is used to indicate whether or not the registered service is ``authoritative'' for that transformation. i.e. if anyone else were to perform the same transformation they would have to have obtained the information to do so from you. This is similar to, but not necessarily identical to, mirroring someone elses data, since the data in question may not exist prior to service invocation.
  • only Input Secondary articles are defined during registration; Output Secondary objects are entirely optional and may or may not be interpreted Client-side using their articleName tags.
  • -
  • Service Categories:
    +
  • Service Categories:
  • @@ -394,14 +394,14 @@
      There are two forms of Primary articles:
      -
    • Simple - the article consists of a single MOBY Object
      +
    • Simple - the article consists of a single MOBY Object
    • Collection - the article consists of a collection (``bag'') of MOBY Objects (not necessarily the same object type).
      • -
      • Their number/order is not relevant, nor predictable
        +
      • Their number/order is not relevant, nor predictable
      • -
      • If order is important to the service provider, then a collection should not be used, rather the collection should be broken into named Simple parameters. This may impose limitations on the the types of services that can be registered in MOBY Central. If it becomes a serious problem, a new Primary article type will be added in a future revision.
        +
      • If order is important to the service provider, then a collection should not be used, rather the collection should be broken into named Simple parameters. This may impose limitations on the the types of services that can be registered in MOBY Central. If it becomes a serious problem, a new Primary article type will be added in a future revision.
      • The use of more than one Class in a collection is difficult to interpret, though it is equally difficult to envision a service that would require this. It is purposely left losely defined since any given Service Instance can tighten up this definition during the registration process.
      • @@ -416,14 +416,14 @@

        An example of the use of each of these might be another BLAST service, where you provide the sequences that make up the Blast database as well as the sequence to Blast against it. The sequences used to construct the database might be passed as a Collection input article containing multiple Sequence Objects, while the sequence to Blast against it would be a Simple input article consisting of a single Sequence Object.

        There is currently only one form of Secondary article:

          -
        • Secondary - the article may or may not be specifically configured by the client as Input, and may or may not be returned by the Service as output.
          +
        • Secondary - the article may or may not be specifically configured by the client as Input, and may or may not be returned by the Service as output.
        • From simont at pub.open-bio.org Mon Apr 19 10:59:02 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon Apr 19 11:20:48 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191459.i3JEx2RH008573@pub.open-bio.org> simont Mon Apr 19 10:59:02 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment In directory pub.open-bio.org:/tmp/cvs-serv8555/OntologyDevelopment Log Message: Directory /home/repository/moby/moby-live/Docs/OntologyDevelopment added to the repository moby-live/Docs/OntologyDevelopment - New directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/RCS/directory,v: No such file or directory From simont at pub.open-bio.org Mon Apr 19 10:59:39 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon Apr 19 11:20:49 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191459.i3JExdJe008636@pub.open-bio.org> simont Mon Apr 19 10:59:39 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs In directory pub.open-bio.org:/tmp/cvs-serv8618/MyGridDocs Log Message: Directory /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs added to the repository moby-live/Docs/OntologyDevelopment/MyGridDocs - New directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs/RCS/directory,v: No such file or directory From simont at pub.open-bio.org Mon Apr 19 11:00:10 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon Apr 19 11:20:49 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191500.i3JF0Awd008727@pub.open-bio.org> simont Mon Apr 19 11:00:10 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv8709/MobyServiceOntologyProtege Log Message: Directory /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege added to the repository moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege - New directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/RCS/directory,v: No such file or directory From simont at pub.open-bio.org Mon Apr 19 11:01:02 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon Apr 19 11:20:50 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191501.i3JF12Q9008789@pub.open-bio.org> simont Mon Apr 19 11:01:02 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment In directory pub.open-bio.org:/tmp/cvs-serv8772 Added Files: README Log Message: Initial commit of service ontology development moby-live/Docs/OntologyDevelopment README,NONE,1.1 From simont at pub.open-bio.org Mon Apr 19 11:01:03 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon Apr 19 11:20:50 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191501.i3JF13T1008804@pub.open-bio.org> simont Mon Apr 19 11:01:02 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv8772/MobyServiceOntologyProtege Added Files: MobyServiceOntology.pprj Log Message: Initial commit of service ontology development moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MobyServiceOntology.pprj,NONE,1.1 From simont at pub.open-bio.org Mon Apr 19 11:01:03 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon Apr 19 11:20:51 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191501.i3JF13Ee008825@pub.open-bio.org> simont Mon Apr 19 11:01:03 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs In directory pub.open-bio.org:/tmp/cvs-serv8772/MyGridDocs Added Files: mygrid-reasoned.daml mygrid.daml Log Message: Initial commit of service ontology development moby-live/Docs/OntologyDevelopment/MyGridDocs mygrid-reasoned.daml,NONE,1.1 mygrid.daml,NONE,1.1 From simont at pub.open-bio.org Mon Apr 19 11:10:17 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon Apr 19 11:20:51 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191510.i3JFAHhx008927@pub.open-bio.org> simont Mon Apr 19 11:10:17 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv8912 Added Files: MobyServiceOntology.owl Log Message: Service ontology from Protege in OWL format moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MobyServiceOntology.owl,NONE,1.1 From simont at pub.open-bio.org Mon Apr 19 11:10:34 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon Apr 19 11:20:52 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191510.i3JFAYnV008966@pub.open-bio.org> simont Mon Apr 19 11:10:34 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv8951 Added Files: MOBY_Service_ontology.png Log Message: Service ontology graph from OWLviz plugin moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MOBY_Service_ontology.png,NONE,1.1 From mwilkinson at pub.open-bio.org Tue Apr 20 14:49:45 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue Apr 20 14:40:14 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404201849.i3KInjdG014321@pub.open-bio.org> mwilkinson Tue Apr 20 14:49:45 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14302 Modified Files: OntologyServer.pm Log Message: moving toward LSID compabitibility for the ontology server. moby-live/Perl/MOBY OntologyServer.pm,1.33,1.34 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/02/18 22:23:55 1.33 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 18:49:45 1.34 @@ -164,6 +164,10 @@ =head2 objectExists + moby:newterm will return (0, $message, $MOBYLSID) + newterm will return (0, $message, $MOBYLSID + oldterm will return (1, $message, undef) + newLSID will return (0, $desc, $lsid) =cut @@ -174,9 +178,9 @@ my $sth; return (0, "WRONG ONTOLOGY!",'') unless ($self->ontology eq 'object'); - if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objecttype/)){ - return (1, "external ontology", $term); - } +# if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objecttype/)){ +# return (1, "external ontology", $term); +# } if ($term =~ /^urn\:lsid/){ $sth = $self->dbh->prepare("select object_lsid, object_type, description, authority, contact_email from object where object_lsid = ?"); @@ -184,14 +188,31 @@ $sth = $self->dbh->prepare("select object_lsid, object_type, description, authority, contact_email from object where object_type = ?"); } $sth->execute($term); - my ($id, $type, $desc, $auth, $email) = $sth->fetchrow_array; - if ($id){ - return (1,$desc,$id); - } else { - return (0, "Object Type $term does not exist in the biomoby.org Object Class system\n",''); - } + my ($lsid, $type, $desc, $auth, $email) = $sth->fetchrow_array; + if ($lsid){ # if it is in there, then it has been discovered regardless of being foreign or not + return (1,$desc,$lsid); + } elsif (_isForeignLSID($term)){ # if not in our ontology, but is a foreign LSID, then pass it back verbatim + return (0, "LSID $term does not exist in the biomoby.org Object Class system\n", $term); + } else { # under all other circumstances (i.e. not a term, or a non-existent biomoby LSID) then fail + return (0, "Object type $term does not exist in the biomoby.org Object Class system\n", ''); + } } + +sub _isMOBYLSID { + my ($lsid) = @_; + return 1 if $lsid =~ /^urn\:lsid\:biomoby.org/; + return 0 +} + + +sub _isForeignLSID { + my ($lsid) = @_; + return 0 if $lsid =~ /^urn\:lsid\:biomoby.org/; + return 1 +} + + =head2 createObject =cut From mwilkinson at pub.open-bio.org Tue Apr 20 14:58:05 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue Apr 20 14:48:34 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404201858.i3KIw5NH014378@pub.open-bio.org> mwilkinson Tue Apr 20 14:58:05 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14359 Modified Files: OntologyServer.pm Log Message: moving toward LSID compabitibility for the ontology server. moby-live/Perl/MOBY OntologyServer.pm,1.34,1.35 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 18:49:45 1.34 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 18:58:05 1.35 @@ -230,13 +230,26 @@ return (0, "requires a contact email address",'') unless ($args{contact_email}); return (0, "requires a object description",'') unless ($args{description}); my $term = $args{node}; - if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ # if it is an LSID, but not a MOBY LSID, than barf - return (0, "can't create a term in a non-MOBY ontology!", $term); - } + +# if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ # if it is an LSID, but not a MOBY LSID, than barf +# return (0, "can't create a term in a non-MOBY ontology!", $term); +# } my $LSID = ($args{'node'} =~ /urn\:lsid/)?$args{'node'}:$self->setURI($args{'node'}); unless ($LSID){return (0, "Failed during creation of an LSID",'')} + if ($args{'node'} =~ /^urn\:lsid/){ + $sth = $self->dbh->prepare("select object_lsid, object_type, description, authority, contact_email from object where object_lsid = ?"); + } else { + $sth = $self->dbh->prepare("select object_lsid, object_type, description, authority, contact_email from object where object_type = ?"); + } + $sth->execute($term); + my ($lsid, $type, $desc, $auth, $email) = $sth->fetchrow_array; + if ($lsid){ # if it is in there, then the object exists + return (0,"This term already exists: $lsid",$lsid); + } + + $args{description} =~ s/^\s+(.*?)\s+$/$1/s; $args{node} =~ s/^\s+(.*?)\s+$/$1/s; $args{contact_email} =~ s/^\s+(.*?)\s+$/$1/s; @@ -368,20 +381,32 @@ # adds a relationship #subject_node => $term, #relationship => $reltype, -#predicate_node => $objectType, +#object_node => $objectType, #articleName => $articleName, #authority => $auth, #contact_email => $email my ($self, %args) = @_; + return (0, "WRONG ONTOLOGY!",'') unless ($self->ontology eq 'object'); - my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{subject_node}); + + if ($args{subject_node} =~ /^urn:lsid/){ + my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{subject_node}); + } else { + my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{subject_node}); + } return (0, qq{Object type $args{subject_node} does not exist in the ontology},'') unless defined $subj_id; + if ($args{object_node} =~ /^urn:lsid/){ + my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{object_node}); + } else { + my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{object_node}); + } + return (0, qq{Object type $args{object_node} does not exist in the ontology},'') unless defined $subj_id; + + my (@isa) = $self->dbh->selectrow_array(q{select * from object_term2term where object2_id = ?},undef, $subj_id); if (scalar @isa){return (0, qq{Object type $args{subject_node} has existing object dependencies in the ontology. It cannot be changed.},$subj_lsid);} - - my ($obj_id, $obj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{object_node}); # get ID of the related object - defined $obj_lsid || return (0, qq{Object $args{object_node} does not exist in the ontology},''); + my $OE = MOBY::OntologyServer->new(ontology => 'relationship'); my ($success, $desc, $rel_lsid) = $OE->relationshipExists(term => $args{relationship}, ontology => 'object'); From mwilkinson at pub.open-bio.org Tue Apr 20 15:02:19 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue Apr 20 14:52:46 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404201902.i3KJ2JnR014465@pub.open-bio.org> mwilkinson Tue Apr 20 15:02:19 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14446/MOBY Modified Files: OntologyServer.pm Log Message: more LSID compatibility for object registration moby-live/Perl/MOBY OntologyServer.pm,1.35,1.36 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 18:58:05 1.35 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:02:19 1.36 @@ -238,6 +238,7 @@ my $LSID = ($args{'node'} =~ /urn\:lsid/)?$args{'node'}:$self->setURI($args{'node'}); unless ($LSID){return (0, "Failed during creation of an LSID",'')} + my $sth; if ($args{'node'} =~ /^urn\:lsid/){ $sth = $self->dbh->prepare("select object_lsid, object_type, description, authority, contact_email from object where object_lsid = ?"); } else { @@ -388,20 +389,21 @@ my ($self, %args) = @_; return (0, "WRONG ONTOLOGY!",'') unless ($self->ontology eq 'object'); - + + my ($subj_id, $subj_lsid, $obj_id, $obj_lsid); if ($args{subject_node} =~ /^urn:lsid/){ - my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{subject_node}); + ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{subject_node}); } else { - my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{subject_node}); + ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{subject_node}); } return (0, qq{Object type $args{subject_node} does not exist in the ontology},'') unless defined $subj_id; if ($args{object_node} =~ /^urn:lsid/){ - my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{object_node}); + ($obj_id, $obj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{object_node}); } else { - my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{object_node}); + ($obj_id, $obj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{object_node}); } - return (0, qq{Object type $args{object_node} does not exist in the ontology},'') unless defined $subj_id; + return (0, qq{Object type $args{object_node} does not exist in the ontology},'') unless defined $obj_id; my (@isa) = $self->dbh->selectrow_array(q{select * from object_term2term where object2_id = ?},undef, $subj_id); From mwilkinson at pub.open-bio.org Tue Apr 20 15:10:38 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue Apr 20 15:01:07 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404201910.i3KJAcND014565@pub.open-bio.org> mwilkinson Tue Apr 20 15:10:38 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14546/MOBY Modified Files: OntologyServer.pm Log Message: allow deregistration of LSIDs from Object ontology moby-live/Perl/MOBY OntologyServer.pm,1.36,1.37 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:02:19 1.36 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:10:38 1.37 @@ -73,7 +73,7 @@ use Carp; use vars qw($AUTOLOAD); use DBI; -use DBD::mysql; +#use DBD::mysql; my $debug = 1; @@ -308,9 +308,9 @@ return (0, "WRONG ONTOLOGY",'') unless ($self->ontology eq 'object'); my $term = $args{term}; - if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ - return (0, "can't delete from external ontology", $term); - } +# if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ +# return (0, "can't delete from external ontology", $term); +# } my $LSID; unless ($term =~ /urn\:lsid/){$LSID = $self->getObjectURI($term)} else {$LSID=$term} From mwilkinson at pub.open-bio.org Tue Apr 20 15:12:32 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue Apr 20 15:03:02 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404201912.i3KJCWZk014674@pub.open-bio.org> mwilkinson Tue Apr 20 15:12:32 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14655/MOBY Modified Files: OntologyServer.pm Log Message: allow deregistration of LSIDs from Object ontology moby-live/Perl/MOBY OntologyServer.pm,1.37,1.38 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:10:38 1.37 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:12:32 1.38 @@ -73,7 +73,7 @@ use Carp; use vars qw($AUTOLOAD); use DBI; -#use DBD::mysql; +use DBD::mysql; my $debug = 1; From mwilkinson at pub.open-bio.org Tue Apr 20 19:16:31 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue Apr 20 19:06:59 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202316.i3KNGVxq015448@pub.open-bio.org> mwilkinson Tue Apr 20 19:16:31 EDT 2004 Update of /home/repository/moby/moby-live/Perl/Accessories In directory pub.open-bio.org:/tmp/cvs-serv15430/Accessories Log Message: Directory /home/repository/moby/moby-live/Perl/Accessories added to the repository moby-live/Perl/Accessories - New directory rcsdiff: /home/repository/moby/moby-live/Perl/Accessories/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/Accessories/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/Accessories/RCS/directory,v: No such file or directory From mwilkinson at pub.open-bio.org Tue Apr 20 19:19:19 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue Apr 20 19:09:45 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202319.i3KNJJ4h015550@pub.open-bio.org> mwilkinson Tue Apr 20 19:19:19 EDT 2004 Update of /home/repository/moby/moby-live/Perl/Accessories In directory pub.open-bio.org:/tmp/cvs-serv15535/Accessories Added Files: NamespaceMaintenance.cgi Log Message: adding a cgi page to maintain the MOBY Namespace GO XrefAbbs document. moby-live/Perl/Accessories NamespaceMaintenance.cgi,NONE,1.1 From mwilkinson at pub.open-bio.org Tue Apr 20 19:19:29 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue Apr 20 19:09:56 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202319.i3KNJTTK015597@pub.open-bio.org> mwilkinson Tue Apr 20 19:19:29 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv15574/MOBY Modified Files: Central.pm OntologyServer.pm Log Message: done moby-live/Perl/MOBY Central.pm,1.125,1.126 OntologyServer.pm,1.38,1.39 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.125 retrieving revision 1.126 diff -u -r1.125 -r1.126 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/04 19:08:41 1.125 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/20 23:19:29 1.126 @@ -236,6 +236,7 @@ } return &_error("Malformed authURI - must not have an http:// prefix","") if $auth =~ '[/:]'; return &_error("Malformed authURI - must take the form NNN.NNN.NNN","") unless $auth =~ /\./; +print STDERR "\n\nemail was $email\n\n"; return &_error("Malformed email - must be a valid email address of the form name\@organization.foo","") unless $email =~ /\S\@\S+\.\S+/; # validate that the final ontology will be valid by testing against existing relationships and such @@ -2329,10 +2330,10 @@ return undef unless $term; # and bail out if we didn't succeed $ontology ||="service"; # if we have now succeeded and haven't already taken the ontology then it must be the service ontology - &_LOG("Ontology was $ontology; Term was $term\n"); + &_LOG("Ontology was $ontology; Term was: $term\n"); my $OS = MOBY::OntologyServer->new(ontology => $ontology); my %rels = %{$OS->Relationships(term => $term, expand => $expand_relationship)}; # %rels = $rels{relationship} = [lsid, lsid,lsid] - + &_LOG("\nrels ",(keys %rels),"\n"); my $response="\n"; my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship'); foreach (keys %reltypes){ # for each of our desired types @@ -2340,6 +2341,7 @@ delete $reltypes{$_}; # remove the non-LSID version from the hash $reltypes{$rellsid} = 1; # set the LSID as valid } + &_LOG("\nvalid rels ",(keys %reltypes),"\n"); # now for each of the relationship types that we were returned foreach (keys %rels){ my $rellsid = $OSrel->getRelationshipURI($ontology, $_); @@ -2356,6 +2358,7 @@ $response .= "\n"; } $response .="\n"; + &_LOG("returning $response\n"); return $response; } =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:12:32 1.38 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 23:19:29 1.39 @@ -593,7 +593,7 @@ } if ($term =~ /^urn:lsid:biomoby.org:namespacetype/){ - $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_lsid = ?"); + $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_lsid= ?"); } else { $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_type = ?"); } From mwilkinson at pub.open-bio.org Tue Apr 20 19:19:30 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue Apr 20 19:09:56 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202319.i3KNJUhi015616@pub.open-bio.org> mwilkinson Tue Apr 20 19:19:29 EDT 2004 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv15574/scripts Modified Files: testMOBYClientCentral_v05.pl Log Message: done moby-live/Perl/scripts testMOBYClientCentral_v05.pl,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2004/01/02 20:39:23 1.13 +++ /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2004/04/20 23:19:29 1.14 @@ -5,7 +5,7 @@ ($reg, $test, $expect) = @_; die "\a\a\aREG OBJECT MALFORMED" unless $reg; if ($reg->success == $expect){ - print "test $test\t\t[PASS]\n"; + print "test $test\t\t[PASS]",($reg->registration_id),"\n"; } else { print "test $test\t\t[FAIL]\n",$reg->message,"\n\n"; } From mwilkinson at pub.open-bio.org Tue Apr 20 19:24:25 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue Apr 20 19:14:52 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202324.i3KNOPFe015724@pub.open-bio.org> mwilkinson Tue Apr 20 19:24:25 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv15701/MOBY Modified Files: Central.pm OntologyServer.pm Log Message: backing out incorrect changes I just committed moby-live/Perl/MOBY Central.pm,1.126,1.127 OntologyServer.pm,1.39,1.40 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.126 retrieving revision 1.127 diff -u -r1.126 -r1.127 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/20 23:19:29 1.126 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/20 23:24:25 1.127 @@ -236,7 +236,6 @@ } return &_error("Malformed authURI - must not have an http:// prefix","") if $auth =~ '[/:]'; return &_error("Malformed authURI - must take the form NNN.NNN.NNN","") unless $auth =~ /\./; -print STDERR "\n\nemail was $email\n\n"; return &_error("Malformed email - must be a valid email address of the form name\@organization.foo","") unless $email =~ /\S\@\S+\.\S+/; # validate that the final ontology will be valid by testing against existing relationships and such @@ -2330,10 +2329,10 @@ return undef unless $term; # and bail out if we didn't succeed $ontology ||="service"; # if we have now succeeded and haven't already taken the ontology then it must be the service ontology - &_LOG("Ontology was $ontology; Term was: $term\n"); + &_LOG("Ontology was $ontology; Term was $term\n"); my $OS = MOBY::OntologyServer->new(ontology => $ontology); my %rels = %{$OS->Relationships(term => $term, expand => $expand_relationship)}; # %rels = $rels{relationship} = [lsid, lsid,lsid] - &_LOG("\nrels ",(keys %rels),"\n"); + my $response="\n"; my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship'); foreach (keys %reltypes){ # for each of our desired types @@ -2341,7 +2340,6 @@ delete $reltypes{$_}; # remove the non-LSID version from the hash $reltypes{$rellsid} = 1; # set the LSID as valid } - &_LOG("\nvalid rels ",(keys %reltypes),"\n"); # now for each of the relationship types that we were returned foreach (keys %rels){ my $rellsid = $OSrel->getRelationshipURI($ontology, $_); @@ -2358,7 +2356,6 @@ $response .= "\n"; } $response .="\n"; - &_LOG("returning $response\n"); return $response; } =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 23:19:29 1.39 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 23:24:25 1.40 @@ -593,7 +593,7 @@ } if ($term =~ /^urn:lsid:biomoby.org:namespacetype/){ - $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_lsid= ?"); + $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_lsid = ?"); } else { $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_type = ?"); } From mwilkinson at pub.open-bio.org Tue Apr 20 19:24:26 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue Apr 20 19:14:53 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202324.i3KNOQMH015743@pub.open-bio.org> mwilkinson Tue Apr 20 19:24:25 EDT 2004 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv15701/scripts Modified Files: testMOBYClientCentral_v05.pl Log Message: backing out incorrect changes I just committed moby-live/Perl/scripts testMOBYClientCentral_v05.pl,1.14,1.15 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2004/04/20 23:19:29 1.14 +++ /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2004/04/20 23:24:25 1.15 @@ -5,7 +5,7 @@ ($reg, $test, $expect) = @_; die "\a\a\aREG OBJECT MALFORMED" unless $reg; if ($reg->success == $expect){ - print "test $test\t\t[PASS]",($reg->registration_id),"\n"; + print "test $test\t\t[PASS]\n"; } else { print "test $test\t\t[FAIL]\n",$reg->message,"\n\n"; } From gordonp at pub.open-bio.org Wed Apr 21 13:22:26 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Wed Apr 21 13:12:48 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404211722.i3LHMQ3e014293@pub.open-bio.org> gordonp Wed Apr 21 13:22:26 EDT 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv14268/client Modified Files: CentralImpl.java Log Message: Fixed bug (extra input def closing tags) in service search template building moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.11,1.12 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/02 16:40:23 1.11 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/21 17:22:26 1.12 @@ -19,9 +19,6 @@ import java.io.*; import java.net.*; -//import org.apache.xerces.parsers.*; - - /** * A default implementation of the * interface {@link org.biomoby.shared.Central Central} @@ -337,7 +334,6 @@ buf.append ("\n\n"); MobyData[] pi = service.getPrimaryInputs(); if (pi.length > 0) { - buf.append ("\n\n"); for (int i = 0; i < pi.length; i++) buf.append (pi[i].toXML()); } @@ -1173,10 +1169,8 @@ result = doCall (methodName, new Object[] { }); else result = doCall (methodName, new Object[] { inputXML }); - - if (result == null) - throw new MobyException ("Returned result is null."); - + if (result == null) + throw new MobyException ("Returned result is null."); if (result instanceof String) return (String)result; if (result instanceof String[]) { From gordonp at pub.open-bio.org Wed Apr 21 13:26:47 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Wed Apr 21 13:17:08 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404211726.i3LHQlsu014346@pub.open-bio.org> gordonp Wed Apr 21 13:26:46 EDT 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv14325 Added Files: MobyDataInstance.java MobyDataSecondaryInstance.java MobyDataServiceAssocInstance.java MobyDataSetInstance.java MobyDataSimpleInstance.java MobyPrefixResolver.java SOAPException.java Log Message: Added initial version of core classes required to create/display/query with instances of MOBY data moby-live/Java/src/main/org/biomoby/shared MobyDataInstance.java,NONE,1.1 MobyDataSecondaryInstance.java,NONE,1.1 MobyDataServiceAssocInstance.java,NONE,1.1 MobyDataSetInstance.java,NONE,1.1 MobyDataSimpleInstance.java,NONE,1.1 MobyPrefixResolver.java,NONE,1.1 SOAPException.java,NONE,1.1 From gordonp at pub.open-bio.org Wed Apr 21 13:28:58 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Wed Apr 21 13:19:25 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404211728.i3LHSwQt014386@pub.open-bio.org> gordonp Wed Apr 21 13:28:58 EDT 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv14365 Added Files: MobyRequest.java Log Message: Initial version of Java class implementing service invocation (input MobyData objects, output MobyData objects) moby-live/Java/src/main/org/biomoby/client MobyRequest.java,NONE,1.1 From gordonp at pub.open-bio.org Wed Apr 21 13:56:49 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Wed Apr 21 13:47:11 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404211756.i3LHunGx014626@pub.open-bio.org> gordonp Wed Apr 21 13:56:49 EDT 2004 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv14601 Modified Files: ChangeLog Log Message: Included service invocation implementation info moby-live/Java/docs ChangeLog,1.11,1.12 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/04/02 16:40:23 1.11 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/04/21 17:56:49 1.12 @@ -1,3 +1,31 @@ +2004-04-21 Paul Gordon + + * Implemented Moby data instance classes for simples, collections, + secondary inputs in org.biomoby.shared.*; + + * Implemented namespace resolver for retrieval of MOBY attributes in DOM fragments, + default namespace mapping for XPath, etc. + + * Implemented org.biomoby.client.MobyRequest, which handles the SOAP transactions + for service invocation. Takes in Moby data objects, outputs Moby data objects + e.g. + // Assumes you already have a service (mobyService) and data (mobyInputData) around + mobyRequest = new MobyRequest(new CentralImpl()); + mobyRequest.setDebugMode(true); + mobyRequest.setService(mobyService); + mobyRequest.setInput((MobyDataInstance[]) mobyInputData); + try{ + mobyRequest.invokeService(); + } catch(MobyException mobye){ + System.err.println("Failure in MOBY protocol: " + mobye); + } catch(SOAPException soape){ + System.err.println("Failure in SOAP transaction: " + soape); + } catch(NOsUccessException nse){ + System.err.println("Failure in MOBY logic (input was not acceptable " + + "for this service)" + nse); + } + + 2004-04-02 Paul Gordon * Changed XML parsing to JAXP based interface that works on more platforms From simont at pub.open-bio.org Wed Apr 28 11:56:14 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Wed Apr 28 11:45:51 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404281556.i3SFuESq017669@pub.open-bio.org> simont Wed Apr 28 11:56:14 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv17654 Added Files: MobyServiceOntology.rdf-xml Log Message: rdf-xml document that is needed by Protege for the .pprj file moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MobyServiceOntology.rdf-xml,NONE,1.1 From simont at pub.open-bio.org Wed Apr 28 14:45:19 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Wed Apr 28 14:34:59 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404281845.i3SIjJTP018191@pub.open-bio.org> simont Wed Apr 28 14:45:19 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv18172 Modified Files: MobyServiceOntology.owl Log Message: updated OWL file in sync with .pprj moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MobyServiceOntology.owl,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MobyServiceOntology.owl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MobyServiceOntology.owl 2004/04/19 15:10:16 1.1 +++ /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MobyServiceOntology.owl 2004/04/28 18:45:19 1.2 @@ -20,291 +20,412 @@ >0.1 - + + + + + + + + + + + - + + takes input object and returns a visual representation of that object - plot, graph, image, etc. - + - + - + + returns a translation of the input into a different form - + - + - + - + - + + TODO: Need to explore this more closely, current subclass structure seems limiting + - + takes group of input objects and filters them by a specified criteria, returns a subset of the group + >takes input object and converts it to another format or representation - + + removal of services from central repository - + - + takes input object and returns a visual representation of that object - plot, graph, image, etc. + >a service that performs an bioinformatic analysis upon the input object(s). Inputs are biologically meaningful things. - + - + searches a protein database + >operate on databases to add, delete, update data - + - + + searches a literature database - + - + returns a translation of the input into a different form + >searches nucleotide database - + - + + + + A dictionary-type service that provides definitions for supplied terms + - - true - - - - + - + + + + - + + alignment using tertiary structure comparison, eg. STAMP - - - - + - + + operate on collections of objects - + + + takes input and predicts some property of the input object based on specific algorithms + + - + + + + + + + + + All services that do something related to the bioinformatics applications, data, analyses, etc. themselves. As distinct from services that deal with webservice computing infrastructure - service registration, deregisration, etc. - + >Service that aligns two objects - + + takes object(s) and breaks apart into subobjects + + + + root of bioMOBY Object ontology + + + service that takes an input and parses it, analyzing the parts of the input document, returning an organized collection of the parts back to the calling application. - + - + - - - - - TODO: Need to explore this more closely, current subclass structure seems limiting - - + + takes input object and converts it to another format or representation + >inserts input object into something - database, file - + - + - takes input object and performs digestion, returns collection of subobjects - eg. restriction analysis of DNA, digestion of protein by trypsin, etc. - + - + + + + + + - - - - - - + - + - + - - + + prediction of structural features - eg coils, sheets in protein + + + + - + - + operate on databases to add, delete, update data + >provides a resolution service, eg LSID resolution - + a service that performs an bioinformatic analysis upon the input object(s). Inputs are biologically meaningful things. - + >validates the format of the input, eg SQUIZZ tool + - - takes a list of input objects and groups them accoring to criteria, returns a collection of the grouped objects or the same list with group information included. + - + - - + + + takes input and finds features based on comparisons to known things, eg. restriction site sequence (as opposed to prediction by algorithm) - + returns a summarized version of the input - + >service that calculates something: pI of protein sequence, MWt, Hydrophobicity, etc. + - + - + - + + + + - + + + + searches a literature database + >predicts the physical location of the input object based on some analysis - eg. protein location within the cell based on signal peptide, transmembrane regions, etc. - + - + + + searches nucleotide database + >predicts the existence of various features in the input object through the use of a specific algorithm - eg. gene prediction. + - - + + + Calculates a protein's accurate molecular weight - - + + + + - + + + + + + + + + + + + + + A dictionary-type service that provides definitions for supplied terms - + >services that send data to and from a registry - that perform a registry transaction of some kind. - + - - + + + takes group of input objects and filters them by a specified criteria, returns a subset of the group - + - + alignment using tertiary structure comparison, eg. STAMP + >searches a protein database - - + + + + - + - + + + + + + + + + + true + + + + operate on collections of objects + >service that is related to computing infrastructure, does not operate on biological object(s). Eg. performing webservice registration + + + - + searches a database using supplied input objects as search criteria, returns a list of hits + >a service that performs a task upon biological or objects - + + + + + + + + + + + + + + + + + + + + + + takes input object and performs digestion, returns collection of subobjects - eg. restriction analysis of DNA, digestion of protein by trypsin, etc. + + + + + + + + + takes a list of input objects and groups them accoring to criteria, returns a collection of the grouped objects or the same list with group information included. + + + + + + + returns a summarized version of the input + + + + + calculates a protein's isoelectric point + + + + + + + Service thats main function is to take an input and retrieves information related to the input, eg. using a term to retrieve a definition, a genbank accession to get a flat file. - - + takes input and predicts some property of the input object based on specific algorithms + >searches a database using supplied input objects as search criteria, returns a list of hits + + + - translates a nucleic acid sequence to a protein sequence - - - + - - - - - - - - + Root of the bioMOBY service ontology - - - Service that aligns two objects - - - - - - registers services with central repository, eg. MOBY Central - - - takes object(s) and breaks apart into subobjects - + + @@ -313,43 +434,26 @@ service searches sequence data for known patterns - - - - - - - - - root of bioMOBY Object ontology - - - service that takes an input and parses it, analyzing the parts of the input document, returning an organized collection of the parts back to the calling application. - + manipulation services - take input objects and manipulate them in some way - - + + searches for the occurance of known pattern(s) - eg. transcription factor binding sites + Not sure if the method should be defined by the ontology at this level + performs some type of cluster analysis on input data - - searches for the occurance of known pattern(s) - eg. transcription factor binding sites - - - - @@ -359,46 +463,25 @@ - repeat finding in sequence data - - - - inserts input object into something - database, file - - - + - - - - - - - - - returns the definition of a keyword as defined in a particular dictionary of terms. - - - - + + prediction of structural features - eg coils, sheets in protein - - + >Calculates the melting point of a given DNA sequence - - - provides a resolution service, eg LSID resolution - - - - - - validates the format of the input, eg SQUIZZ tool - - service deletes data from a database - - - takes input and finds features based on comparisons to known things, eg. restriction site sequence (as opposed to prediction by algorithm) - + - - - - service that calculates something: pI of protein sequence, MWt, Hydrophobicity, etc. - Allows registration of objects (and/or services) in specified repositories. - - - - - - - - - - - - - - predicts the physical location of the input object based on some analysis - eg. protein location within the cell based on signal peptide, transmembrane regions, etc. + @@ -490,24 +536,16 @@ - - - - - - - - predicts the existence of various features in the input object through the use of a specific algorithm - eg. gene prediction. - - - + + Predicts the hydrophilic/hydrophobic proile of a sequence + From simont at pub.open-bio.org Wed Apr 28 14:48:41 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Wed Apr 28 14:38:17 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404281848.i3SImfuD018245@pub.open-bio.org> simont Wed Apr 28 14:48:41 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv18226 Modified Files: MOBY_Service_ontology.png Log Message: Updated to be in sync with OWL and pprj files. moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MOBY_Service_ontology.png,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MOBY_Service_ontology.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MOBY_Service_ontology.png 2004/04/19 15:10:34 1.1 and /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MOBY_Service_ontology.png 2004/04/28 18:48:41 1.2 differ rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MOBY_Service_ontology.png: diff failed From ambrose at pub.open-bio.org Thu Apr 29 14:03:52 2004 From: ambrose at pub.open-bio.org (Ambrose Ng) Date: Thu Apr 29 16:08:02 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404291803.i3TI3q7S022533@pub.open-bio.org> ambrose Thu Apr 29 14:03:52 EDT 2004 Update of /home/repository/moby/moby-live/Perl/Accessories In directory pub.open-bio.org:/tmp/cvs-serv22507/Perl/Accessories Modified Files: NamespaceMaintenance.cgi Log Message: updated error catching on namespace maintenance cgi page moby-live/Perl/Accessories NamespaceMaintenance.cgi,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Accessories/NamespaceMaintenance.cgi,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/Accessories/NamespaceMaintenance.cgi 2004/04/20 23:19:19 1.1 +++ /home/repository/moby/moby-live/Perl/Accessories/NamespaceMaintenance.cgi 2004/04/29 18:03:52 1.2 @@ -68,7 +68,7 @@ print "* = required fields",p, " --------",p, - "Full abbreviation will be \"authority abbr_identifier abbreviation\" \"GeneDB_Tbrucei\"", + "Full abbreviation will be \"authority abbreviation_identifier abbreviation\" e.g. \"GeneDB_Tbrucei\"", start_form, table( Tr(td("authority abbreviation* "),td(textfield(-name => 'authabvr', -class => "require"),"e.g.: GeneDB")), @@ -79,8 +79,8 @@ Tr(td("contact email* "),td(textfield(-name =>'email1', -class => "require"),"@",textfield(-name => 'email2', -class => "require" ),"e.g.: example\@email.ca")), Tr(td("object "),td(textfield('object'),"e.g.: Gene identifier.")), Tr(td("generic url* "), - td(popup_menu(-name=>'urltype', - -values=>['choose','http://','https://'], -class => "require" ),textfield(-name => 'url', -class => "require"),"e.g.: http\:\/\/www.genedb.org\/tryp ")), + td(popup_menu(-name=>'urltype',-class => "require" , + -values=>['choose','http://','https://']),textfield(-name => 'url', -class => "require"),"e.g.: http\:\/\/www.genedb.org\/tryp ")), Tr(td("synonym "),td(textarea('syn'),"e.g.: SP, SWP, SWISS-PROT. one entry per line")), Tr(td("example_id "),td(textfield('example_id'),"e.g.: Tb927.1.5250")), Tr(td("url_syntax "), @@ -112,13 +112,13 @@ Tr(td("authority abbreviation: "),td($authabvr),(hidden('authabvr')),(hidden('namespace_id'))), Tr(td("identifier abbreviation: "),td($namespacetype),(hidden('namespacetype'))), Tr(td"--------"), - Tr(td("description* "),td(textarea('desc'),"Type a short description here about the entry.")), - Tr(td("authority* "),td(textfield('auth'),"e.g.: www.genedb.org")), - Tr(td("contact email* "),td(textfield('email1'),"@",textfield('email2'),"e.g.: example\@email.ca")), + Tr(td("description* "),td(textarea(-name =>'desc', -class => "require"),"Type a short description here about the entry.")), + Tr(td("authority* "),td(textfield(-name =>'auth', -class => "require"),"e.g.: www.genedb.org")), + Tr(td("contact email* "),td(textfield(-name=>'email1', -class => "require"),"@",textfield(-name =>'email2', -class=> "require"),"e.g.: example\@email.ca")), Tr(td("object "),td(textfield('object'),"e.g.: Gene identifier.")), Tr(td("generic url* "), - td(popup_menu(-name=>'urltype', - -values=>['choose','http://','https://']),textfield('url'),"e.g.: http\:\/\/www.genedb.org\/tryp ")), + td(popup_menu(-name=>'urltype',-class=>"require", + -values=>['choose','http://','https://']),textfield(-name=>'url',-class=>"require"),"e.g.: http\:\/\/www.genedb.org\/tryp ")), Tr(td("synonym "),td(textarea('syn'),"e.g.: SP, SWP, SWISS-PROT. one entry per line")), Tr(td("example_id "),td(textfield('example_id'),"e.g.: Tb927.1.5250")), Tr(td("url_syntax "), @@ -231,7 +231,7 @@ print "unfilled description field",hr; return 1; } - elsif (!$Param{email1} or !$Param{email2}) { + elsif (!$Param{email1} or !$Param{email2} or !($Param{email2} =~ /\./)) { print "invalid email address",hr; return 1; } From mwilkinson at pub.open-bio.org Thu Apr 29 18:28:03 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu Apr 29 18:17:31 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404292228.i3TMS3K6023057@pub.open-bio.org> mwilkinson Thu Apr 29 18:28:03 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv23038/MOBY Modified Files: CommonSubs.pm Log Message: implementing API changes into CommonSubs. It is only the messaging structure that has changed, so MOBY::Central and Clinet::Central did not need to be updated. Testing this now...hopefully it will work moby-live/Perl/MOBY CommonSubs.pm,1.45,1.46 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/14 20:10:35 1.45 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/29 22:28:03 1.46 @@ -254,7 +254,7 @@ 2. queryID (undef for Secondary parameters) 3. $data - the data takes several forms a. $article XML::DOM node for Simples - ... + ... b. \@article XML:DOM nodes for Collections c. $secondary XML::DOM node @@ -264,10 +264,10 @@ sub genericServiceInputParser { my ($message) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = getInputs($message); # returns XML::DOM nodes ... + my @queries = getInputs($message); # returns XML::DOM nodes ... foreach my $query(@queries){ - my $queryID = getInputID($query); # get the queryID attribute of the queryInput + my $queryID = getInputID($query); # get the queryID attribute of the mobyData my @input_articles = getArticles($query); # get the Simple/Collection/Secondary articles making up this query ... or ... or ... foreach my $input(@input_articles){ # input is a listref my ($articleName, $article) = @{$input}; # get the named article @@ -304,7 +304,7 @@ for example, the input message: - + @@ -312,7 +312,7 @@ Float 10 - + will become: (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module) @@ -330,7 +330,7 @@ With inputs that have collections these are presented as a listref of Simple article DOM's. So for the following message: - + @@ -343,7 +343,7 @@ Float 10 - + will become @@ -361,11 +361,11 @@ sub complexServiceInputParser { my ($message) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = getInputs($message); # returns XML::DOM nodes ... + my @queries = getInputs($message); # returns XML::DOM nodes ... my %input_parameters; # $input_parameters{$queryID} = [ foreach my $query(@queries){ - my $queryID = getInputID($query); # get the queryID attribute of the queryInput + my $queryID = getInputID($query); # get the queryID attribute of the mobyData my @input_articles = getArticles($query); # get the Simple/Collection/Secondary articles making up this query ... or ... or ... foreach my $input(@input_articles){ # input is a listref my ($articleName, $article) = @{$input}; # get the named article @@ -386,12 +386,11 @@ =head2 getArticles name : getArticles - function : get the Simple/Collection/Parameter articles for a single queryInput - or queryResponse node + function : get the Simple/Collection/Parameter articles for a single mobyData usage : @articles = getArticles($XML) args : raw XML or XML::DOM of a queryInput, mobyData, or queryResponse block (e.g. from getInputs) - returns : a list of listrefs; each listref is one component of the queryInput. - a single queryInput/Response may consist of one or more named or unnamed + returns : a list of listrefs; each listref is one component of the queryInput or mobyData block + a single block may consist of one or more named or unnamed simple, collection, or parameter articles. The listref structure is thus [name, $ARTICLE_DOM]: @@ -399,17 +398,17 @@ generated from the following sample XML: - + - + or : @articles = ['name1', $COLL_DOM], ['paramname1', $PARAM_DOM] generated from the following sample XML: - + @@ -422,7 +421,7 @@ Float 10 - + =cut @@ -471,10 +470,10 @@ sub genericServiceInputParserAsObject { my ($message) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = getInputs($message); # returns XML::DOM nodes ... - + my @queries = getInputs($message); # returns XML::DOM nodes ... + foreach my $query(@queries){ - my $queryID = getInputID($query); # get the queryID attribute of the queryInput + my $queryID = getInputID($query); # get the queryID attribute of the mobyData my @input_articles = getArticlesAsObjects($query); # get the Simple/Collection articles making up this query ... or ... or ...isCollection){ @@ -621,16 +620,17 @@ } + =head2 simpleResponse name : simpleResponse - function : wraps a simple article in the appropriate queryResponse structure + function : wraps a simple article in the appropriate (mobyData) structure usage : $resp .= &simpleResponse($object, 'MyArticleName', $queryID); args : (in order) $object - (optional) a MOBY Object as raw XML $article - (optional) an articeName for this article $query - (optional, but strongly recommended) the queryID value for the - queryInput block to which you are responding + mobyData block to which you are responding notes : as required by the API you must return a response for every input. If one of the inputs was invalid, you return a valid (empty) MOBY response by calling &simpleResponse(undef, undef, $queryID) with no arguments. @@ -647,19 +647,19 @@ $articleName ||=""; if ($articleName) { return " - + $data - + "; } elsif($data) { return " - + $data - + "; } else { return " - + "; } } @@ -671,7 +671,7 @@ my $doc = $parser->parse($query); $query = $doc->getDocumentElement(); } - return '' unless $query->getTagName =~/queryInput/; + return '' unless ($query->getTagName =~/queryInput/ || $query->getTagName =~/mobyData/); my $id = $query->getAttribute('queryID'); $id ||= $query->getAttribute('moby:queryID'); return $id; @@ -681,12 +681,12 @@ =head2 collectionResponse name : collectionResponse - function : wraps a set of articles in the appropriate queryResponse structure + function : wraps a set of articles in the appropriate mobyData structure usage : return responseHeader . &collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter; args : (in order) \@objects - (optional) a listref of MOBY Objects as raw XML $article - (optional) an articeName for this article - $queryID - (optional, but strongly recommended) the queryInput ID + $queryID - (optional, but strongly recommended) the mobyData ID to which you are responding notes : as required by the API you must return a response for every input. If one of the inputs was invalid, you return a valid (empty) MOBY @@ -701,7 +701,7 @@ $data ||=[]; $qID ||= ''; unless ((ref($data) =~ /array/i) && $data->[0]){ # we're expecting an arrayref as input data,and it must not be empty - return ""; + return ""; } foreach (@{$data}){ @@ -717,17 +717,17 @@ } if ($articleName) { return " - + $content - + "; } else { return " - + $content - + "; } } @@ -762,7 +762,7 @@ $notes ||=""; my $xml = "". "". - ""; + ""; if ($notes){ my $encodednotes = HTML::Entities::encode($notes); $xml .="$encodednotes"; @@ -786,7 +786,7 @@ sub responseFooter { - return ""; + return ""; } @@ -794,7 +794,7 @@ =head2 getInputs name : getInputs - function : get the queryInput block(s) as XML::DOM nodes + function : get the mobyData block(s) as XML::DOM nodes usage : @queryInputs = getInputArticles($XML) args : the raw XML of a query, or an XML::DOM document returns : a list of XML::DOM::Node's, each is a queryInput or mobyData block. @@ -817,8 +817,8 @@ my @queries; foreach my $querytag('queryInput', 'moby:queryInput', 'mobyData', 'moby:mobyData'){ - my $x = $moby->getElementsByTagName($querytag); # get the queryInput block - for (0..$x->getLength-1){ # there may be more than one queryInput per message + my $x = $moby->getElementsByTagName($querytag); # get the mobyData block + for (0..$x->getLength-1){ # there may be more than one mobyData per message push @queries, $x->item($_); } } @@ -860,11 +860,11 @@ =head2 getArticlesAsObjects name : DO NOT USE!! - function : get the Simple/Collection articles for a single queryInput + function : get the Simple/Collection articles for a single mobyData or queryResponse node, rethrning them as SimpleArticle, SecondaryArticle, or ServiceInstance objects usage : @articles = getArticles($XML) - args : raw XML or XML::DOM of a moby:queryInput, moby:queryResponse block + args : raw XML or XML::DOM of a moby:mobyData block returns : =cut @@ -977,13 +977,13 @@ my $x; foreach ('queryInput', 'moby:queryInput', 'mobyData', 'moby:mobyData'){ - $x = $moby->getElementsByTagName($_); # get the queryInput block + $x = $moby->getElementsByTagName($_); # get the mobyData block last if $x->item(0); } return undef unless $x->item(0); # in case there was no match at all my @queries; - for (0..$x->getLength-1){ # there may be more than one queryInput per message + for (0..$x->getLength-1){ # there may be more than one mobyData per message my @this_query; foreach my $child($x->item($_)->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace From mwilkinson at pub.open-bio.org Thu Apr 29 18:37:57 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu Apr 29 18:27:44 2004 Subject: [MOBY-guts] biomoby commit Message-ID: <200404292237.i3TMbv5I023169@pub.open-bio.org> mwilkinson Thu Apr 29 18:37:57 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv23150/MOBY Modified Files: CommonSubs.pm Log Message: mismatched XML tag fixed moby-live/Perl/MOBY CommonSubs.pm,1.46,1.47 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/29 22:28:03 1.46 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/29 22:37:57 1.47 @@ -786,7 +786,7 @@ sub responseFooter { - return ""; + return ""; } From senger at pub.open-bio.org Thu Apr 1 11:41:03 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 1 Apr 2004 11:41:03 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404011641.i31Gf3t6006392@pub.open-bio.org> senger Thu Apr 1 11:41:03 EST 2004 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv6373/src/Clients Modified Files: MobyGraphs.java Log Message: moby-live/Java/src/Clients MobyGraphs.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2003/11/25 13:18:10 1.3 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2004/04/01 16:41:03 1.4 @@ -179,13 +179,18 @@ } edges = FilterServices.filter (edges, authorities, serviceNames, depth); - String[] pathEnds = cmd.getParam ("-path", 2); - if (pathEnds.length == 2) + if (cmd.hasParam ("-path")) { + String[] pathEnds = cmd.getParam ("-path", 2); + if (pathEnds[0] == null || pathEnds[1] == null) { + System.err.println ("Missing value for parameter '-path'. It should be followed by two service names."); + System.exit (1); + } edges = FilterServices.pathes (edges, pathEnds[0], pathEnds[1]); - if (edges == null) { - System.err.println ("No connection found between '" + - pathEnds[0] + "' and '" + pathEnds[1] + "'"); - System.exit(1); + if (edges == null) { + System.err.println ("No connection found between '" + + pathEnds[0] + "' and '" + pathEnds[1] + "'"); + System.exit(1); + } } // create a graph (in whatever format) From senger at pub.open-bio.org Thu Apr 1 11:41:03 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 1 Apr 2004 11:41:03 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404011641.i31Gf3Vp006415@pub.open-bio.org> senger Thu Apr 1 11:41:03 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv6373/src/main/org/biomoby/client Modified Files: CentralImpl.java ServiceConnections.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.7,1.8 ServiceConnections.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/03/09 00:20:13 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 16:41:03 1.8 @@ -587,8 +587,12 @@ NodeList children = elem.getChildNodes(); for (int j = 0; j < children.getLength(); j++) { if (children.item (j).getNodeName().equals ("Description")) { - results.put (elem.getAttribute ("name"), - children.item (j).getFirstChild().getNodeValue()); + String desc; + if (children.item (j).getFirstChild() == null) + desc = ""; + else + desc = children.item (j).getFirstChild().getNodeValue(); + results.put (elem.getAttribute ("name"), desc); break; } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java 2003/10/17 13:13:34 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java 2004/04/01 16:41:03 1.2 @@ -69,7 +69,7 @@ Hashtable dataTypesTable = new Hashtable(); for (int i = 0; i < dataTypes.length; i++) { MobyDataType dataType = dataTypes[i]; - dataTypesTable.put (dataType.getName().toLowerCase(), dataType); + dataTypesTable.put (Utils.pureName (dataType.getName()).toLowerCase(), dataType); } // here we are going to build the resulting edges @@ -117,12 +117,13 @@ // ...find the data type of this output String dataTypeName = output.getDataType().getName(); MobyDataType dataType = - (MobyDataType)dataTypesTable.get (dataTypeName.toLowerCase()); + (MobyDataType)dataTypesTable.get (Utils.pureName (dataTypeName).toLowerCase()); if (dataType == null) { // this means that there is something wrong with the Moby central registration System.err.println ("Service " + name + " has an unknown output data type '" + Utils.pureName (dataTypeName) + "'"); + System.err.println ("\tLSID: " + dataTypeName); continue; } @@ -239,10 +240,11 @@ String connector = null; MobyDataType outputType = - (MobyDataType)dataTypes.get (output.getDataType().getName().toLowerCase()); - - String outputName = outputType.getName(); - String inputName = input.getDataType().getName(); + (MobyDataType)dataTypes.get (Utils.pureName (output.getDataType().getName()).toLowerCase()); + if (outputType == null) // strange... + return null; + String outputName = Utils.pureName (outputType.getName()); + String inputName = Utils.pureName (input.getDataType().getName()); if (outputName.equals (inputName)) connector = outputName; @@ -275,7 +277,9 @@ if (inputName.equals (parents[i])) return true; MobyDataType outputType = - (MobyDataType)dataTypes.get (parents[i].toLowerCase()); + (MobyDataType)dataTypes.get (Utils.pureName (parents[i]).toLowerCase()); + if (outputType == null) // strange? + return false; if (findMatchInParents (outputType.getParentNames(), inputName, dataTypes)) return true; } From gordonp at pub.open-bio.org Thu Apr 1 12:30:08 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Thu, 1 Apr 2004 12:30:08 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404011730.i31HU8PW006626@pub.open-bio.org> gordonp Thu Apr 1 12:30:08 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv6601 Modified Files: CentralImpl.java Log Message: Implements response caching, and uses JAXP DocumentBuilder to harness a XML parser in a more platform independent way moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 16:41:03 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 17:30:08 1.9 @@ -61,11 +61,12 @@ public class CentralImpl implements Central { - + private Hashtable cache; // To not call MOBY Central everytime the same method is called private URL endpoint; private String uri; - private ParserWrapper parser; + private javax.xml.parsers.DocumentBuilder docBuilder; private boolean debug = false; + private boolean useCache = true; /** Default location (endpoint) of a Moby registry. */ // public static final String DEFAULT_ENDPOINT = "http://mobycentral.cbr.nrc.ca/cgi-bin/MOBY-Central.pl"; @@ -118,8 +119,18 @@ } this.uri = namespace; - // instantiate a DOM parser - parser = Utils.getDOMParser(); + // This method should work on almost all platforms to get an XML parser instance + try { + javax.xml.parsers.DocumentBuilderFactory dbf = + javax.xml.parsers.DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + docBuilder = dbf.newDocumentBuilder(); + } catch (Exception e) { + throw new MobyException ("Could not configure an XML parser: " + e); + } + + cache = new Hashtable(); + useCache = true; } /************************************************************************* @@ -192,8 +203,11 @@ String id = "", success = "0", message = ""; // parse returned XML - Document document = parser.parse (new StringReader (xml)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(xml));} + catch(Exception e){throw new MobyException(e.toString());} Element root = document.getDocumentElement(); + NodeList children = root.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { if (children.item (i).getNodeType() != Node.ELEMENT_NODE) @@ -403,8 +417,11 @@ *************************************************************************/ protected MobyService[] extractServices (String xml) throws MobyException { + + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(xml));} + catch(Exception e){throw new MobyException(e.toString());} - Document document = parser.parse (new StringReader (xml)); NodeList list = document.getElementsByTagName ("Service"); MobyService[] results = new MobyService [list.getLength()]; for (int i = 0; i < list.getLength(); i++) { @@ -491,18 +508,31 @@ *************************************************************************/ public Map getServiceNames() throws MobyException { + + // First, check to se if we have the values cached from a previous call + // in this instance + if(useCache && cache.containsKey("retrieveServiceNames")) + return (Map) cache.get("retrieveServiceNames"); + String result = (String)doCall ("retrieveServiceNames", new Object[] {}); // parse returned XML Map results = new HashMap(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("serviceName"); for (int i = 0; i < list.getLength(); i++) { Element elem = (Element)list.item (i); results.put (elem.getAttribute ("name"), elem.getAttribute ("authURI")); } + + // Add this data to the cache in case we get called again + if(useCache) + cache.put("retrieveServiceNames", results); return results; } @@ -516,15 +546,27 @@ *************************************************************************/ public String[] getProviders() throws MobyException { + + // First, see if we have the values cached from a previous call in this instance + if(useCache && cache.containsKey("retrieveServiceProviders")) + return (String[]) cache.get("retrieveServiceProviders"); + String result = (String)doCall ("retrieveServiceProviders", new Object[] {}); // parse returned XML - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("serviceProvider"); String[] results = new String [list.getLength()]; for (int i = 0; i < list.getLength(); i++) results[i] = ((Element)list.item (i)).getAttribute ("name"); + + // Add this data to the cache in case we get called again + if(useCache) + cache.put("retrieveServiceProviders", results); return results; } @@ -541,12 +583,19 @@ *************************************************************************/ public Map getServiceTypes() throws MobyException { + // First, see if we have the values cached from a previous call in this instance + if(useCache && cache.containsKey("retrieveServiceTypes")) + return (Map) cache.get("retrieveServiceTypes"); + String result = (String)doCall ("retrieveServiceTypes", new Object[] {}); // parse returned XML Map results = new HashMap(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("serviceType"); for (int i = 0; i < list.getLength(); i++) { Element elem = (Element)list.item (i); @@ -559,6 +608,10 @@ } } } + + // Add this data to the cache in case we get called again + if(useCache) + cache.put("retrieveServiceTypes", results); return results; } @@ -575,28 +628,43 @@ *************************************************************************/ public Map getNamespaces() throws MobyException { + + // First, see if we have the values cached from a previous call in this instance + if(useCache && cache.containsKey("retrieveNamespaces")) + return (Map) cache.get("retrieveNamespaces"); + String result = (String)doCall ("retrieveNamespaces", new Object[] {}); // parse returned XML Map results = new HashMap(); - Document document = parser.parse (new StringReader (result)); - NodeList list = document.getElementsByTagName ("Namespace"); - for (int i = 0; i < list.getLength(); i++) { + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + + NodeList list = document.getDocumentElement().getElementsByTagName ("Namespace"); + if(list == null || list.getLength() == 0){ + throw new MobyException("Could not find Namespace children of response root node " + + document.getDocumentElement()); + } + int length = list.getLength(); + for (int i = 0; i < length; i++) { Element elem = (Element)list.item (i); - NodeList children = elem.getChildNodes(); - for (int j = 0; j < children.getLength(); j++) { - if (children.item (j).getNodeName().equals ("Description")) { - String desc; - if (children.item (j).getFirstChild() == null) - desc = ""; - else - desc = children.item (j).getFirstChild().getNodeValue(); - results.put (elem.getAttribute ("name"), desc); - break; - } + NodeList children = elem.getElementsByTagName("Description"); + if(children.item(0).hasChildNodes()){ + children.item(0).normalize(); + results.put (elem.getAttribute ("name"), + children.item(0).getFirstChild().getNodeValue()); + } + else{ + // No description provided + results.put (elem.getAttribute ("name"), ""); } } + + // Add this data to the cache in case we get called again + if(useCache) + cache.put("retrieveNamespaces", results); return results; } @@ -613,12 +681,19 @@ *************************************************************************/ public Map getDataTypeNames() throws MobyException { + // First, see if we have the values cached from a previous call in this instance + if(useCache && cache.containsKey("retrieveObjectNames")) + return (Map) cache.get("retrieveObjectNames"); + String result = (String)doCall ("retrieveObjectNames", new Object[] {}); // parse returned XML Map results = new HashMap(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("Object"); for (int i = 0; i < list.getLength(); i++) { Element elem = (Element)list.item (i); @@ -631,6 +706,9 @@ } } } + + if(useCache) + cache.put("retrieveObjectNames", results); return results; } @@ -655,6 +733,11 @@ *************************************************************************/ public MobyDataType getDataType (String dataTypeName) throws MobyException, NoSuccessException { + + // See if we've already retrieved the DataType and cached it + if(cache.containsKey("retrieveObjectDefinition"+dataTypeName)) + return (MobyDataType) cache.get("retrieveObjectDefinition"+dataTypeName); + String result = (String)doCall ("retrieveObjectDefinition", new Object[] { @@ -664,7 +747,10 @@ }); // parse returned XML - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("retrieveObjectDefinition"); if (list == null || list.getLength() == 0) throw new NoSuccessException ("Data Type name was not founnd.", @@ -717,6 +803,7 @@ } } } + cache.put("retrieveObjectDefinition"+dataTypeName, data); return data; } @@ -778,6 +865,11 @@ *************************************************************************/ public String getServiceWSDL (String serviceName, String authority) throws MobyException, NoSuccessException { + // See if we've already retrieved the DataType and cached it + String cacheKey = "getServiceWSDL" + serviceName + ":" + authority; + if(cache.containsKey(cacheKey)) + return (String) cache.get(cacheKey); + String result = (String)doCall ("retrieveService", new Object[] { @@ -787,12 +879,17 @@ }); // parse returned XML - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + Element service = document.getDocumentElement(); Node wsdl = service.getFirstChild(); if (wsdl == null) throw new NoSuccessException ("Service not found OR WSDL is not available.", serviceName + " (" + authority + ")"); + if(useCache) + cache.put(cacheKey, wsdl.getNodeValue()); return wsdl.getNodeValue(); } @@ -1051,14 +1148,20 @@ if (pattern == null) pattern = new MobyService ("dummy"); - String result = - (String)doCall ("findService", - new Object[] { + String[] query = new String[] { "" + buildQueryObject (pattern, keywords, true, true, false) + "" - }); - return extractServices (result); + }; + if(useCache && cache.containsKey("findService"+query[0])) + return (MobyService[]) cache.get("findService"+query[0]); + + String result = (String) doCall ("findService", query); + MobyService[] services = extractServices (result); + + if(useCache) + cache.put("findService"+query[0], services); + return services; } /************************************************************************** @@ -1106,6 +1209,10 @@ public String[] getServiceTypeRelationships (String serviceTypeName, boolean expand) throws MobyException { + String cacheKey = "Relationships" + serviceTypeName + ":" + expand; + if(useCache && cache.containsKey(cacheKey)) + return (String[]) cache.get(cacheKey); + String result = (String)doCall ("Relationships", new Object[] { @@ -1118,7 +1225,10 @@ // parse returned XML Vector v = new Vector(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("Relationship"); for (int i = 0; i < list.getLength(); i++) { Element elem = (Element)list.item (i); @@ -1131,6 +1241,9 @@ } String[] results = new String [v.size()]; v.copyInto (results); + + if(useCache) + cache.put(cacheKey, results); return results; } @@ -1151,6 +1264,10 @@ *************************************************************************/ public Map getDataTypeRelationships (String dataTypeName) throws MobyException { + String cacheKey = "getDataTypeRelationships"+dataTypeName; + if(useCache && cache.containsKey(cacheKey)) + return (Map) cache.get(cacheKey); + String result = (String)doCall ("Relationships", new Object[] { @@ -1165,7 +1282,10 @@ // parse returned XML Map results = new HashMap(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("Relationship"); for (int i = 0; i < list.getLength(); i++) { @@ -1182,6 +1302,9 @@ v.copyInto (names); results.put (relType, names); } + + if(useCache) + cache.put(cacheKey, results); return results; } @@ -1199,6 +1322,10 @@ public String[] getDataTypeRelationships (String dataTypeName, String relationshipType) throws MobyException { + String cacheKey = "getDataTypeRelationships" + dataTypeName + ":" + relationshipType; + if(useCache && cache.containsKey(cacheKey)) + return (String[]) cache.get(cacheKey); + String result = (String)doCall ("Relationships", new Object[] { @@ -1211,7 +1338,10 @@ // parse returned XML Vector v = new Vector(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("Relationship"); // it should always be just one element in this list @@ -1226,7 +1356,29 @@ } String[] results = new String [v.size()]; v.copyInto (results); + + if(useCache) + cache.put(cacheKey, results); return results; } + /** + * By default, caching is enabled to reduce network traffic and XML parsing. Setting + * this to false will clear the cache, and not cache any further calls unless it is + * set to true again. + * + * @param shouldCache whether retrieveXXX call results should be cached in case they are called again (i.e. don't requery MobyCentral every time) + */ + public void setCacheMode(boolean shouldCache){ + useCache = shouldCache; + if(!useCache) + cache.clear(); + } + + /** + * @return whether retrieveXXX calls will cache their responses + */ + public boolean getCacheMode(){ + return useCache; + } } From senger at pub.open-bio.org Thu Apr 1 16:03:42 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 1 Apr 2004 16:03:42 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012103.i31L3gJf007111@pub.open-bio.org> senger Thu Apr 1 16:03:42 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv7084/src/main/org/biomoby/client Modified Files: FileCache.java GraphsServlet.java ServletFileCache.java Log Message: moby-live/Java/src/main/org/biomoby/client FileCache.java,1.2,1.3 GraphsServlet.java,1.4,1.5 ServletFileCache.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/FileCache.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/FileCache.java 2003/11/09 01:05:02 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/FileCache.java 2004/04/01 21:03:42 1.3 @@ -1,6 +1,6 @@ // FileCache.java // -// A cache used for a data produced by a servlet. +// A cache storing data in files. // // senger at ebi.ac.uk // November 2003 @@ -37,7 +37,10 @@ // given 'rootDirname) protected static String startingDir; - /************************************************************************** + // index of cached files (TBD: put it also in a file?) + Hashtable index = new Hashtable(); + + /************************************************************************** * To be used by the inheriting classes. **************************************************************************/ protected FileCache() { @@ -49,14 +52,14 @@ * Constructor specifying where to create files with the cached * objects. Use this constructor if you cannot store them in the * context of the calling servlet (usually because of the - * unsifficient write permissions). The cache files will created in + * unsifficient write permissions). The cache files will be stored in * *
                * /cache/
                * 
          * * The all not yet existing directories (for example the last - * 'cache' diorectory) will be created for you. + * 'cache' directory) will be created for you. *

          * * 'rootURLName' is used by method {@link #getURL} to return back @@ -75,7 +78,11 @@ static final char CLEAR_CHAR = '_'; /************************************************************************** * It creates an 'id' in the form: - * rootName / semanticType / prop1_prop2_... (time).syntaxType + * rootName / semanticType / { prop1_prop2_... } (time).syntaxType + * + * The part between { and } (inclusive) will be replaced by a + * unique shorter string in order to create a reasonably long real + * file name. **************************************************************************/ public String createId (String rootName, String semanticType, String syntaxType, @@ -94,10 +101,13 @@ ps[++i] = it.next().toString(); } Arrays.sort (ps); + buf.append ("{"); for (int i = 0; i < ps.length; i++) { buf.append (CLEAR_CHAR); - buf.append (clean (ps[i].toString())); +// buf.append (clean (ps[i].toString())); + buf.append (ps[i].toString()); } + buf.append ("}"); buf.append ("(" + lastModified + ")"); buf.append ("."); buf.append (clean (syntaxType)); @@ -235,6 +245,20 @@ * dir (as set in a constructor). **************************************************************************/ protected String getRelativeFilename (String id) { - return fileSeparator + startingDir + fileSeparator + id; + String fileName = (String)index.get (id); + if (fileName == null) { + int posFrom = id.indexOf ("{"); + int posTo = id.indexOf ("}"); + StringBuffer buf = new StringBuffer(); + buf.append (fileSeparator); + buf.append (startingDir); + buf.append (fileSeparator); + buf.append (id.substring (0, posFrom)); + buf.append (clean (new java.rmi.server.UID().toString())); + buf.append (id.substring (posTo+1)); + fileName = new String (buf); + index.put (id, fileName); + } + return fileName; } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.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/GraphsServlet.java 2003/11/25 13:18:10 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2004/04/01 21:03:42 1.5 @@ -491,7 +491,7 @@ h.gen (TD, radios[0]) + h.gen (TD, - "Show all services and all connections")) + + "Show all services and all connections " + h.gen (EM, "(very long and big)"))) + h.gen (TR, h.gen (TD, new String[] { VALIGN, "top" }, radios[1]) + =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServletFileCache.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServletFileCache.java 2003/11/08 00:27:24 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServletFileCache.java 2004/04/01 21:03:42 1.2 @@ -40,11 +40,11 @@ * * * The not existing directories (for example the last 'cache' - * diorectory) will be created for you. + * directory) will be created for you. * * The 'contextPath' is a path (relative to the servlet context) * where the cached files will be created (actually starting from - * here, because they may be created ina deeper directory + * here, because they may be created in a deeper directory * structure. Usually you get it in the calling servlet from the * request by method request.getContextPath(). The 'contextPath' * starts with a "/" character but does not end with a "/" From mwilkinson at pub.open-bio.org Thu Apr 1 16:23:48 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 1 Apr 2004 16:23:48 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012123.i31LNmaC007236@pub.open-bio.org> mwilkinson Thu Apr 1 16:23:47 EST 2004 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv7213/MOBY/Client Modified Files: Service.html Service.pm Log Message: update the execute method to allow multiple inputs to a single invocation. Documentation updated. Fixed bug of articleName attribute being attached to the wrong XML element moby-live/Perl/MOBY/Client Service.html,1.3,1.4 Service.pm,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.html 2003/08/06 14:31:21 1.3 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.html 2004/04/01 21:23:47 1.4 @@ -2,7 +2,7 @@ MOBY::Client::Service - an object for communicating with MOBY Services - + @@ -95,12 +95,21 @@ input is named "object1" in both cases. $Service->execute(XMLinputlist => [ - ['collection1', [ + ['', [ '<Object namespace="blah" id="123"/>', '<Object namespace="blah" id="234"/>'] ]); This would invoke the service once with a collection of sequence inputs - called "collection1" + that are not required to be named ('') +

          +                $Service->execute(XMLinputlist => [
          +                                 [
          +                             'input1', '<Object namespace="blah" id="123"/>',
          +                             'input2', '<Object namespace="blah" id="234"/>',
          +                             ]
          +                              ]);
          +                This would cause a single invocation of a service requiring
          +                two input parameters named "input1" and "input2"

          ServiceName

          =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2004/01/05 21:29:08 1.7 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2004/04/01 21:23:47 1.8 @@ -165,12 +165,21 @@ input is named "object1" in both cases. $Service->execute(XMLinputlist => [ - ['collection1', [ + ['', [ '', ''] ]); This would invoke the service once with a collection of sequence inputs - called "collection1" + that are not required to be named ('') + + $Service->execute(XMLinputlist => [ + [ + 'input1', '', + 'input2', '', + ] + ]); + This would cause a single invocation of a service requiring + two input parameters named "input1" and "input2" =cut @@ -183,20 +192,25 @@ my $data; foreach (@inputs){ return "ERROR: expected listref [articleName, XML] for data element" unless (ref($_) =~ /array/i); - my ($articleName, $XML) = @{$_}; my $qID = $self->_nextQueryID; - if (!(ref($XML)=~/array/i)){ - $articleName ||=""; - $XML ||= ""; - $data .= "\n$XML\n\n"; - } elsif (ref($XML)=~/array/i){ - my @objs = @{$XML}; - $data .="\n"; - foreach (@objs){ - $data .= "$_\n"; - } - $data .="\n\n" - } + $data .= ""; + while (my ($articleName, $XML) = splice (@{$_}, 0, 2)){ + if (!(ref($XML)=~/array/i)){ + $articleName ||=""; + $XML ||= ""; + $data .= "\n$XML\n\n"; + + # need to do this for collections also!!!!!! + } elsif (ref($XML)=~/array/i){ + my @objs = @{$XML}; + $data .="\n"; + foreach (@objs){ + $data .= "$_\n"; + } + $data .="\n"; + } + } + $data .="\n"; } $data = " From senger at pub.open-bio.org Thu Apr 1 18:24:27 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 1 Apr 2004 18:24:27 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012324.i31NORH0007750@pub.open-bio.org> senger Thu Apr 1 18:24:26 EST 2004 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv7731/docs Modified Files: ChangeLog Log Message: moby-live/Java/docs ChangeLog,1.9,1.10 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/03/09 00:20:13 1.9 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/04/01 23:24:26 1.10 @@ -1,8 +1,20 @@ +2004-04-02 Martin Senger + + * Fixed producing graphs to deal with situation that some Moby + methods return simple names and some full LSIDs. + + * Fixed servlet producing graphs (proxy is set now correctly, + cached files have no longer too long names). + 2004-03-08 Martin Senger * Fixed extracting URL and emailContact from a service response object. +2004-01-15 Martin Senger + + * Fixed: better error reporting when am empty result is returned. + 2003-11-24 Martin Senger * Added graphs of service types. From senger at pub.open-bio.org Thu Apr 1 18:24:27 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 1 Apr 2004 18:24:27 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012324.i31NOR4d007795@pub.open-bio.org> senger Thu Apr 1 18:24:27 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv7731/src/main/org/biomoby/shared Modified Files: MobyService.java Log Message: moby-live/Java/src/main/org/biomoby/shared MobyService.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2003/09/24 14:33:37 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2004/04/01 23:24:27 1.2 @@ -170,6 +170,7 @@ } public boolean equals (MobyService anotherOne) { + if (anotherOne == null) return false; return this.name.equals (anotherOne.getName()); } From senger at pub.open-bio.org Thu Apr 1 18:24:27 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 1 Apr 2004 18:24:27 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012324.i31NOR54007774@pub.open-bio.org> senger Thu Apr 1 18:24:27 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv7731/src/main/org/biomoby/client Modified Files: CentralImpl.java GraphsServlet.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.9,1.10 GraphsServlet.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 17:30:08 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 23:24:26 1.10 @@ -1174,6 +1174,10 @@ result = doCall (methodName, new Object[] { }); else result = doCall (methodName, new Object[] { inputXML }); + + if (result == null) + throw new MobyException ("Returned result is null."); + if (result instanceof String) return (String)result; if (result instanceof String[]) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2004/04/01 21:03:42 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2004/04/01 23:24:27 1.6 @@ -205,7 +205,7 @@ for (Enumeration en = context.getInitParameterNames(); en.hasMoreElements(); ) { String name = (String)en.nextElement(); if (name != null) - initParams.put (name.toLowerCase(), context.getInitParameter (name)); + initParams.put (name, context.getInitParameter (name)); } // then read config parameters (scope: this servlet) - they may overwrite @@ -213,7 +213,7 @@ for (Enumeration en = getInitParameterNames(); en.hasMoreElements(); ) { String name = (String)en.nextElement(); if (name != null) - initParams.put (name.toLowerCase(), getInitParameter (name)); + initParams.put (name, getInitParameter (name)); } // read some suggested defaults from the init parameters @@ -869,6 +869,7 @@ // do this only the first time if (registry == null) { registry = new CentralImpl (endpoint, namespace); + ((CentralImpl)registry).setCacheMode (false); registry.setDebug (debug); } From gss at pub.open-bio.org Thu Apr 1 18:59:40 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:40 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31Nxeh3008031@pub.open-bio.org> gss Thu Apr 1 18:59:40 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/config-files Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files added to the repository moby-live/S-MOBY/ref-impl/config-files - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:40 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:40 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxeCB008049@pub.open-bio.org> gss Thu Apr 1 18:59:40 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfZh008086@pub.open-bio.org> gss Thu Apr 1 18:59:40 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfNQ008145@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31Nxf4v008171@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/queries In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/queries Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/queries added to the repository moby-live/S-MOBY/ref-impl/queries - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:40 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:40 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31Nxewk008068@pub.open-bio.org> gss Thu Apr 1 18:59:40 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31Nxf9x008190@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/queries/discovery Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery added to the repository moby-live/S-MOBY/ref-impl/queries/discovery - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfmQ008127@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfpH008108@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfA9008234@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref added to the repository moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfIJ008252@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets added to the repository moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfbP008208@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/queries/engage Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage added to the repository moby-live/S-MOBY/ref-impl/queries/engage - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:42 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:42 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxgYH008294@pub.open-bio.org> gss Thu Apr 1 18:59:42 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools added to the repository moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:42 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:42 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxgOr008314@pub.open-bio.org> gss Thu Apr 1 18:59:42 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db added to the repository moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 18:59:42 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:42 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxgVx008275@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev added to the repository moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 19:01:23 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:01:23 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020001.i3201NBN008511@pub.open-bio.org> gss Thu Apr 1 19:01:23 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/db In directory pub.open-bio.org:/tmp/cvs-serv8489/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/db Removed Files: CitationDB.java Log Message: No longer needed moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/db CitationDB.java,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/db/RCS/CitationDB.java,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 19:02:04 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:02:04 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020002.i32024CM008540@pub.open-bio.org> gss Thu Apr 1 19:02:03 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files In directory pub.open-bio.org:/tmp/cvs-serv8519/ref-impl/config-files Added Files: for-tomcat-conf-server.xml for-tomcat-conf-catalina.properties Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/config-files for-tomcat-conf-server.xml,NONE,1.1 for-tomcat-conf-catalina.properties,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 19:03:19 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:03:19 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020003.i3203JpJ008595@pub.open-bio.org> gss Thu Apr 1 19:03:19 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet In directory pub.open-bio.org:/tmp/cvs-serv8570/ref-impl/core/org/smoby/tools/server/servlet Modified Files: AbstractMobyServlet.java Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet AbstractMobyServlet.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet/AbstractMobyServlet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet/AbstractMobyServlet.java 2004/04/01 00:23:46 1.5 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet/AbstractMobyServlet.java 2004/04/02 00:03:19 1.6 @@ -93,6 +93,26 @@ } /** + * Helper method for returning the first statement (if any) from a source + * graph's model, that has the given subject, predicate, and object. + * @param source graph from which the model should be queried + * @param subject subject of the matching statement + * @param predicate predicate of the matching statement + * @param object object of the matching statement + * @return the first matching statement + */ + protected Statement getFirstStatement( + MOBYGraph source, Resource subject, Property predicate, RDFNode object) + { + StmtIterator it = source.getModel().listStatements(subject, predicate, object); + if (it.hasNext()) { + return it.nextStatement(); + } else { + return null; + } + } + + /** * By MOBY convention, an HTTP POST equates to a request for the service * provided by a provider. */ From gss at pub.open-bio.org Thu Apr 1 19:03:27 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:03:27 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020003.i3203Rnp008624@pub.open-bio.org> gss Thu Apr 1 19:03:27 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager In directory pub.open-bio.org:/tmp/cvs-serv8603/ref-impl/example-clients/SimpleEngager Added Files: SimpleProviderEngagerPanel$1.class SimpleProviderEngagerPanel$3.class SimpleProviderEngagerPanel$2.class SimpleProviderEngagerPanel.class Log Message: moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager SimpleProviderEngagerPanel$1.class,NONE,1.1 SimpleProviderEngagerPanel$3.class,NONE,1.1 SimpleProviderEngagerPanel$2.class,NONE,1.1 SimpleProviderEngagerPanel.class,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 19:03:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:03:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020003.i3203ddJ008665@pub.open-bio.org> gss Thu Apr 1 19:03:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv8639/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary Modified Files: AcmePubs.java Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary AcmePubs.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary/AcmePubs.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary/AcmePubs.java 2004/03/30 22:24:28 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary/AcmePubs.java 2004/04/02 00:03:39 1.3 @@ -1,7 +1,6 @@ package com.acmepubs.vocabulary; -import org.smoby.tools.common.vocabulary.VocabularyDescription; -import com.hp.hpl.jena.graph.*; +import org.smoby.tools.common.vocabulary.*; import com.hp.hpl.jena.rdf.model.*; public class AcmePubs extends VocabularyDescription @@ -11,6 +10,6 @@ return "http://www.acmepubs.com:8080/"; } - public static final Property geneID = property(getURI(), "geneID"); - public static final Property pubDate = property(getURI(), "pubDate"); + public static final Property geneSymbol = property(getURI(), "geneSymbol"); + public static final Property literatureGuideURL = property(getURI(), "literatureGuideURL"); } From gss at pub.open-bio.org Thu Apr 1 19:03:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:03:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020003.i3203d4k008684@pub.open-bio.org> gss Thu Apr 1 19:03:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets In directory pub.open-bio.org:/tmp/cvs-serv8639/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets Modified Files: CitationSearchServlet.java Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets CitationSearchServlet.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.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/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.java 2004/04/01 00:33:35 1.6 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.java 2004/04/02 00:03:39 1.7 @@ -6,12 +6,12 @@ import javax.servlet.*; import javax.servlet.http.*; +import org.go.vocabulary.Go; import org.smoby.tools.common.graph.MOBYGraph; import org.smoby.tools.common.vocabulary.MOBY; import org.smoby.tools.server.servlet.AbstractMobyServlet; - -import com.acmepubs.db.CitationDB; import com.acmepubs.vocabulary.AcmePubs; + import com.hp.hpl.jena.rdf.model.*; /** @@ -36,125 +36,50 @@ /** * Handle a request for a citation search by looking up - * a gene symbol and returning a list of publication - * abstracts. In this simplistic first cut, only look - * at the first "hasMapping" property, find the "geneID" - * property value as a lookup value, and for each matching - * publication date past the first one, create a copy of - * the entire subgraph and fill in its "pubDate" property. + * a gene symbol and returning a URL for querying the + * SGD database for literature pertaining to that URL. */ protected void handleRequest(MOBYGraph graph) { - // Retrieve the subject of the moby:mapsTo statement + // Retrieve the subject of the moby:operatesOn statement (there is only + // one operatesOn statement in a valid MOBY graph) // Resource mobyGraphSubject = (Resource) graph.getOperatesOnStmt().getObject(); - // Get the subject of the first hasMapping statement (the only one - // considered in this first cut) + // There may be multiple moby:hasMapping statements. For each one, + // map its geneSymbol to a literatureGuideURL // - Resource start = graph.getModel() - .listStatements(mobyGraphSubject, MOBY.hasMapping, (RDFNode) null) - .nextStatement().getSubject(); + StmtIterator it = graph.getModel().listStatements( + mobyGraphSubject, MOBY.hasMapping, (RDFNode) null); - // Retrieve the subgraph that is "reachable" from the subject of the - // first hasMapping statement. - // - Model subgraph = ModelFactory.createDefaultModel(); - subgraph.setNsPrefixes(graph.getModel().getNsPrefixMap()); - addReachableStatements(start, graph.getModel(), subgraph); - - // Find the "geneID" statement in the subgraph; if there isn't one, - // then we can't handle it (really should throw an exception...) - // - StmtIterator it = subgraph.listStatements(null, AcmePubs.geneID, (RDFNode) null); - if (! it.hasNext()) return; - - // Get the object of the geneID statement; if it isn't a String, then - // again we can't handle it. - // - String geneID = null; - try { - geneID = it.nextStatement().getString(); - } catch (Throwable t) { - return; - } - - // Look up the gene symbol; if not found, then there's nothing to do - // - List pubDates = CitationDB.getCitations(geneID); - if (pubDates == null) return; - - // For each publication date found, replace the object of the pubDate - // statement with the publication date in the subgraph (for the first - // pub date) or in a copy (for subsequent pub dates) - // - int i = 0; - for (Iterator iter = pubDates.iterator(); iter.hasNext(); i++) - { - String pubDate = iter.next().toString(); - - // In the first match, we use the subgraph pulled from the original - // graph; in additional matches, we use a copy (whose statements have - // to be added to the original model) - // - if (i > 0) - { - subgraph = copyModel(subgraph); - graph.getModel().add(subgraph); - } - - // Find the "pubDate" statement in the subgraph; if there isn't one, - // then we can't handle it (really should throw an exception...) - // - it = subgraph.listStatements(null, AcmePubs.pubDate, (RDFNode) null); - if (! it.hasNext()) return; - - // Replace the object of the pubDate statement with a literal value, - // namely the publication date - // - Statement stmt = it.nextStatement(); - stmt.changeObject(pubDate); - } - } - - protected Model copyModel(Model model) - { - Model copy = ModelFactory.createDefaultModel(); - copy.setNsPrefixes(model.getNsPrefixMap()); - for (StmtIterator it = model.listStatements(); it.hasNext();) - { - Statement stmt = it.nextStatement(); - copy.add(copy.createStatement( - stmt.getSubject(), - stmt.getPredicate(), - stmt.getObject())); - } - return copy; - } - - /** - * Add to a model the depth-first traversal - * of a source graph starting from a given subject - * @param subject the resource that is the starting poing - * @param source the model containing a set of statements from which to add - * @param subgraph the model to which to add reachable statements - */ - protected void addReachableStatements(Resource subject, Model source, Model subgraph) - { - StmtIterator it = source.listStatements(subject, null, (RDFNode) null); - while (it.hasNext()) - { - Statement stmt = it.nextStatement(); - if (! subgraph.contains(stmt)) - { - subgraph.add(stmt); - addReachableStatements(stmt.getSubject(), source, subgraph); - addReachableStatements(stmt.getPredicate(), source, subgraph); - if (stmt.getObject() instanceof Resource) { - addReachableStatements((Resource) stmt.getObject(), source, subgraph); - } + while (it.hasNext()) + { + try + { + Statement hasMappingStmt = it.nextStatement(); + Resource mobySubject = (Resource) hasMappingStmt.getObject(); + + Statement geneSymbolStmt = + getFirstStatement(graph, mobySubject, AcmePubs.geneSymbol, null); + + String geneSymbol = geneSymbolStmt.getString(); + + Statement mapsToStmt = + getFirstStatement(graph, mobySubject, MOBY.mapsTo, null); + + Resource mobyObject = (Resource) mapsToStmt.getObject(); + + Statement literatureGuideURLStmt = + getFirstStatement(graph, mobyObject, AcmePubs.literatureGuideURL, null); + + String baseURI = "http://db.yeastgenome.org/cgi-bin/SGD/reference/geneinfo.pl?locus="; + literatureGuideURLStmt.changeObject(baseURI + geneSymbol); + } + catch (Throwable t) + { + // Something went wrong, so proceed to next hasMapping statement } - } + } } /** From gss at pub.open-bio.org Thu Apr 1 19:03:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:03:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020003.i3203dBB008705@pub.open-bio.org> gss Thu Apr 1 19:03:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com In directory pub.open-bio.org:/tmp/cvs-serv8639/ref-impl/example-providers/acmepubs.com Modified Files: .classpath Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com .classpath,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/.classpath,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/.classpath 2004/03/18 23:52:50 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/.classpath 2004/04/02 00:03:39 1.3 @@ -5,6 +5,9 @@ + + + From gss at pub.open-bio.org Thu Apr 1 19:04:21 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:04:21 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020004.i3204L20008768@pub.open-bio.org> gss Thu Apr 1 19:04:21 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv8739/ref-impl/example-providers/megapubs.com/WebRoot Modified Files: citationSearch.rdf citationSearch.n3 Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot citationSearch.rdf,1.3,1.4 citationSearch.n3,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.rdf,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.rdf 2004/03/30 23:54:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.rdf 2004/04/02 00:04:21 1.4 @@ -1,32 +1,28 @@ + xmlns:moby="http://www.s-moby.org:8080/terms#" + xmlns:sgd="http://www.sgd.org:8080/terms#" > + + + + + - - + - - - - - + - + + - - - - - - - + @@ -34,9 +30,14 @@ Cool new search - - + + - + + + + + + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.n3 2004/03/30 23:54:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.n3 2004/04/02 00:04:21 1.4 @@ -1,7 +1,8 @@ @prefix pubs: . @prefix xsd: . @prefix megapubs: . - at prefix mygrid: . + at prefix go: . + at prefix sgd: . @prefix moby: . @prefix rdfs: . @prefix rdf: . @@ -17,20 +18,20 @@ moby:hasMapping _:bnode2 . _:bnode2 - a moby:Subject, mygrid:gene_id ; + a moby:Subject, go:GeneSymbol ; moby:mapsTo _:bnode3 ; - megapubs:geneID _:bnode4 . + megapubs:geneSymbol _:bnode4 . _:bnode3 - a moby:Object, pubs:PubAbstract ; - megapubs:pubDate _:bnode6 . + a moby:Object, sgd:LiteratureGuide ; + megapubs:literatureGuideURL _:bnode6 . -megapubs:geneID +megapubs:geneSymbol a owl:DataTypeProperty ; - rdfs:domain mygrid:gene_id ; + rdfs:domain go:GeneSymbol ; rdfs:range xsd:string . -megapubs:pubDate +megapubs:literatureGuideURL a owl:DataTypeProperty ; - rdfs:domain pubs:PubAbstract ; - rdfs:range xsd:date . + rdfs:domain sgd:LiteratureGuide ; + rdfs:range xsd:anyURI . \ No newline at end of file From gss at pub.open-bio.org Thu Apr 1 19:04:21 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:04:21 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020004.i3204LYU008787@pub.open-bio.org> gss Thu Apr 1 19:04:21 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv8739/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary Modified Files: MegaPubs.java Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary MegaPubs.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary/MegaPubs.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary/MegaPubs.java 2004/03/30 23:54:26 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary/MegaPubs.java 2004/04/02 00:04:21 1.2 @@ -1,6 +1,6 @@ package com.megapubs.vocabulary; -import org.smoby.tools.common.vocabulary.VocabularyDescription; -import com.hp.hpl.jena.graph.*; + +import org.smoby.tools.common.vocabulary.*; import com.hp.hpl.jena.rdf.model.*; public class MegaPubs extends VocabularyDescription @@ -10,6 +10,6 @@ return "http://www.megapubs.com:8080/"; } - public static final Property geneID = property(getURI(), "geneID"); - public static final Property pubDate = property(getURI(), "pubDate"); + public static final Property geneSymbol = property(getURI(), "geneSymbol"); + public static final Property literatureGuideURL = property(getURI(), "literatureGuideURL"); } From gss at pub.open-bio.org Thu Apr 1 19:05:06 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:05:06 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020005.i32056lu008825@pub.open-bio.org> gss Thu Apr 1 19:05:06 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src In directory pub.open-bio.org:/tmp/cvs-serv8800/ref-impl/server/src Modified Files: smoby.properties Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/server/src smoby.properties,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties 2004/03/27 01:27:51 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties 2004/04/02 00:05:06 1.3 @@ -1,11 +1,20 @@ # Database information section # -# DB_DRIVER_CLASS_NAME = org.postgresql.Driver -DB_DRIVER_CLASS_NAME = com.mysql.jdbc.Driver + +# Common values for MySQL and PostgreSQL +# DB_USER_ID = smobydev DB_PASSWORD = -# DB_URL = jdbc:postgresql://localhost/smoby-dev -DB_URL = jdbc:mysql://localhost/smoby-dev -# DB_TYPE = PostgreSQL -DB_TYPE = MySQL -DB_REPOSITORY_NAME = gss-test \ No newline at end of file +DB_DRIVER_CLASS_NAME = com.mysql.jdbc.Driver +DB_REPOSITORY_NAME = smoby-dev + +# Uncomment if using MySQL +# +# DB_URL = jdbc:mysql://localhost/smoby-dev +# DB_TYPE = MySQL + +# Uncomment if using PostgreSQL +# +DB_DRIVER_CLASS_NAME = org.postgresql.Driver +DB_TYPE = PostgreSQL +DB_URL = jdbc:postgresql://localhost/smoby-dev \ No newline at end of file From gss at pub.open-bio.org Thu Apr 1 19:05:16 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:05:16 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020005.i3205G0b008854@pub.open-bio.org> gss Thu Apr 1 19:05:16 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery In directory pub.open-bio.org:/tmp/cvs-serv8833/ref-impl/queries/discovery Added Files: query.n3 query.rdf Log Message: moby-live/S-MOBY/ref-impl/queries/discovery query.n3,NONE,1.1 query.rdf,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 19:05:16 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:05:16 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020005.i3205Gve008869@pub.open-bio.org> gss Thu Apr 1 19:05:16 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage In directory pub.open-bio.org:/tmp/cvs-serv8833/ref-impl/queries/engage Added Files: engage-acmepubs-citationSearch.n3 engage-megapubs-citationSearch.rdf engage-megapubs-citationSearch.n3 engage-acmepubs-citationSearch.rdf Log Message: moby-live/S-MOBY/ref-impl/queries/engage engage-acmepubs-citationSearch.n3,NONE,1.1 engage-megapubs-citationSearch.rdf,NONE,1.1 engage-megapubs-citationSearch.n3,NONE,1.1 engage-acmepubs-citationSearch.rdf,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 19:08:26 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:08:26 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020008.i3208QCs009022@pub.open-bio.org> gss Thu Apr 1 19:08:26 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes In directory pub.open-bio.org:/tmp/cvs-serv8997/ref-impl/server/WebRoot/WEB-INF/classes Added Files: smoby.properties log4j.properties Log Message: moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes smoby.properties,1.2,1.3 log4j.properties,NONE,1.1 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/smoby.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/smoby.properties 2004/03/20 00:33:08 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/smoby.properties 2004/04/02 00:08:26 1.3 @@ -1,8 +1,20 @@ # Database information section # -DB_DRIVER_CLASS_NAME = org.postgresql.Driver + +# Common values for MySQL and PostgreSQL +# DB_USER_ID = smobydev DB_PASSWORD = -DB_URL = jdbc:postgresql://localhost/smoby-dev +DB_DRIVER_CLASS_NAME = com.mysql.jdbc.Driver +DB_REPOSITORY_NAME = smoby-dev + +# Uncomment if using MySQL +# +# DB_URL = jdbc:mysql://localhost/smoby-dev +# DB_TYPE = MySQL + +# Uncomment if using PostgreSQL +# +DB_DRIVER_CLASS_NAME = org.postgresql.Driver DB_TYPE = PostgreSQL -DB_REPOSITORY_NAME = gss-test \ No newline at end of file +DB_URL = jdbc:postgresql://localhost/smoby-dev \ No newline at end of file From gss at pub.open-bio.org Thu Apr 1 19:45:31 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:45:31 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020045.i320jVOk009344@pub.open-bio.org> gss Thu Apr 1 19:45:31 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager In directory pub.open-bio.org:/tmp/cvs-serv9316 Added Files: .cvsignore Removed Files: SimpleProviderEngagerPanel$2.class SimpleProviderEngagerPanel$3.class SimpleProviderEngagerPanel.class SimpleProviderEngagerPanel$1.class Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager .cvsignore,NONE,1.1 SimpleProviderEngagerPanel$2.class,1.1,NONE SimpleProviderEngagerPanel$3.class,1.1,NONE SimpleProviderEngagerPanel.class,1.1,NONE SimpleProviderEngagerPanel$1.class,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager/RCS/SimpleProviderEngagerPanel.class,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager/RCS/SimpleProviderEngagerPanel.class,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager/RCS/SimpleProviderEngagerPanel.class,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager/RCS/SimpleProviderEngagerPanel.class,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 19:55:59 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:55:59 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020055.i320txLR009423@pub.open-bio.org> gss Thu Apr 1 19:55:59 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core In directory pub.open-bio.org:/tmp/cvs-serv9398 Modified Files: .project Log Message: Change output folder moby-live/S-MOBY/ref-impl/core .project,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.project,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.project 2004/03/27 01:14:22 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.project 2004/04/02 00:55:59 1.4 @@ -16,4 +16,11 @@ org.eclipse.jdt.core.javanature + + + classes + 2 + C:/Tomcat5.0/shared/classes/from-smoby-core + + From gss at pub.open-bio.org Thu Apr 1 19:57:05 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:57:05 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020057.i320v57B009454@pub.open-bio.org> gss Thu Apr 1 19:57:05 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv9433/WebRoot Added Files: terms terms.n3 index.html Log Message: Moved moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot terms,NONE,1.1 terms.n3,NONE,1.1 index.html,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 20:00:19 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 20:00:19 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020100.i3210Jml009608@pub.open-bio.org> gss Thu Apr 1 20:00:19 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF In directory pub.open-bio.org:/tmp/cvs-serv9569/WebRoot/WEB-INF Added Files: .cvsignore Log Message: Moved moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF .cvsignore,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 20:00:19 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 20:00:19 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020100.i3210Jn6009593@pub.open-bio.org> gss Thu Apr 1 20:00:19 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org In directory pub.open-bio.org:/tmp/cvs-serv9569 Removed Files: terms terms.n3 index.html Log Message: Moved moby-live/S-MOBY/ref-impl/example-providers/go.org terms,1.1,NONE terms.n3,1.1,NONE index.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/RCS/terms,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/RCS/terms.n3,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/RCS/index.html,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 20:01:12 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 20:01:12 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020101.i3211C56009691@pub.open-bio.org> gss Thu Apr 1 20:01:12 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org In directory pub.open-bio.org:/tmp/cvs-serv9667 Removed Files: index.html terms terms.n3 Log Message: Moved moby-live/S-MOBY/ref-impl/example-providers/sgd.org index.html,1.1,NONE terms,1.1,NONE terms.n3,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/RCS/index.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/RCS/terms,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/RCS/terms.n3,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 20:21:06 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 20:21:06 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020121.i321L60f010234@pub.open-bio.org> gss Thu Apr 1 20:21:06 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv10213/WebRoot Added Files: terms terms.n3 index.html Log Message: Moved moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot terms,NONE,1.1 terms.n3,NONE,1.1 index.html,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 20:24:59 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 20:24:59 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020124.i321Oxbi010272@pub.open-bio.org> gss Thu Apr 1 20:24:59 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src In directory pub.open-bio.org:/tmp/cvs-serv10247/src Modified Files: smoby.properties Log Message: Fixed properties file moby-live/S-MOBY/ref-impl/server/src smoby.properties,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties 2004/04/02 00:05:06 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties 2004/04/02 01:24:59 1.4 @@ -5,11 +5,11 @@ # DB_USER_ID = smobydev DB_PASSWORD = -DB_DRIVER_CLASS_NAME = com.mysql.jdbc.Driver DB_REPOSITORY_NAME = smoby-dev # Uncomment if using MySQL # +# DB_DRIVER_CLASS_NAME = com.mysql.jdbc.Driver # DB_URL = jdbc:mysql://localhost/smoby-dev # DB_TYPE = MySQL From gordonp at pub.open-bio.org Fri Apr 2 11:40:23 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Fri, 2 Apr 2004 11:40:23 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404021640.i32GeN2R013343@pub.open-bio.org> gordonp Fri Apr 2 11:40:23 EST 2004 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv13318/docs Modified Files: ChangeLog Log Message: Revised documentation, interfaces and classes pertaining to XML parsing and server cache to reflect new parsing and caching schemes moby-live/Java/docs ChangeLog,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/04/01 23:24:26 1.10 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/04/02 16:40:23 1.11 @@ -1,3 +1,9 @@ +2004-04-02 Paul Gordon + + * Changed XML parsing to JAXP based interface that works on more platforms + + * Implemented Central response caching to reduce network and XML parsing loads + 2004-04-02 Martin Senger * Fixed producing graphs to deal with situation that some Moby From gordonp at pub.open-bio.org Fri Apr 2 11:40:23 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Fri, 2 Apr 2004 11:40:23 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404021640.i32GeNaY013386@pub.open-bio.org> gordonp Fri Apr 2 11:40:23 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv13318/src/main/org/biomoby/shared Modified Files: Central.java Utils.java Log Message: Revised documentation, interfaces and classes pertaining to XML parsing and server cache to reflect new parsing and caching schemes moby-live/Java/src/main/org/biomoby/shared Central.java,1.3,1.4 Utils.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2003/11/25 13:18:11 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2004/04/02 16:40:23 1.4 @@ -323,4 +323,15 @@ *************************************************************************/ void setDebug (boolean debug); + /************************************************************************** + * Set whether the server responses should cached or not to speedup + * multiple calls for the same data. + * @param shouldCache if set to false, any previously cached documents should be deleted + *************************************************************************/ + void setCacheMode(boolean shouldCache); + + /************************************************************************** + * Reports whether server responses are being cached or not. + *************************************************************************/ + boolean getCacheMode(); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java 2003/11/25 13:18:11 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java 2004/04/02 16:40:23 1.4 @@ -7,8 +7,6 @@ package org.biomoby.shared; -import org.biomoby.shared.dom.*; - import org.apache.axis.AxisFault; import javax.xml.namespace.QName; import java.io.*; @@ -24,16 +22,6 @@ public abstract class Utils { - /** Java property name ('dom.parser'). - * The property value is a fully qualified name of a class of type - * org.biomoby.shared.dom.ParserWrapper. - */ - public static final String PROP_PARSER_WRAPPER = "dom.parser"; - - /** Default parser wrapper. */ - public static final String DEFAULT_PARSER_WRAPPER = - "org.biomoby.shared.dom.wrappers.Xerces"; - /************************************************************************* * Format an exception 'e' and return it back. *

          @@ -122,72 +110,6 @@ } /************************************************************************* - * Find and return an instance of a DOM parser wrapper. A parser - * wrapper is a class allowing a uniform access to DOM parsers - - * because it defines a way how a Document is created and returned - * (see details in interface - * org.biomoby.shared.dom.ParseWrappers, or in samples in - * the distribution of Apache Xerces-2 where this is all taken - * from). - *

          - * - * The DOM parser wrapper class name is taken from, in this order: - *

            - *
          1. Java property {@link #PROP_PARSER_WRAPPER} - *
          2. parameter parserClassName - *
          3. default value {@link #DEFAULT_PARSER_WRAPPER} - *
          - *

          - * - * This is based on the samples shown int the Apache Xerces-2 distribution. - * See more details there. This implementation differ from those samples - * in few not too crucial details: - *

            - *
          • It can take parser class name also from a Java property - * ({@link #DEFAULT_PARSER_WRAPPER}) - *
          • It raises Moby specific exception - *
          - *

          - * @param parserClassName is a class to be instatiated (unless there is - * a Java property {@link #PROP_PARSER_WRAPPER}) - * @return an instance of a DOM parser wrapper - * @throws MobyException if unable to instantiate specified DOM parser - *************************************************************************/ - public static ParserWrapper getDOMParser (String parserClassName) - throws MobyException { - - // which parser do we want - String name = System.getProperty (PROP_PARSER_WRAPPER); - if (name != null) - parserClassName = name; - if (parserClassName == null) - parserClassName = DEFAULT_PARSER_WRAPPER; - - // create parser - try { - return (ParserWrapper)Class.forName (parserClassName).newInstance(); - } - catch (Exception e) { - throw new MobyException ("Unable to instantiate parser (" + parserClassName +")"); - } - } - - /************************************************************************* - * Find and return an instance of a DOM parser wrapper. - * It does the same as method {@link #getDOMParser(String)} except that it - * does not get any parser class name in the parameter. - *

          - * - * @return an instance of a DOM parser wrapper - * @see #getDOMParser(String) - * @throws MobyException if unable to instantiate the specified DOM parser - *************************************************************************/ - public static ParserWrapper getDOMParser() - throws MobyException { - return getDOMParser (null); - } - - /************************************************************************* * Return just the last part of the LSID identifier. An example of * an LSID identifier as used by and returned from the Moby * registry is urn:lsid:biomoby.org:objectclass:object. From gordonp at pub.open-bio.org Fri Apr 2 11:40:23 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Fri, 2 Apr 2004 11:40:23 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404021640.i32GeNlC013362@pub.open-bio.org> gordonp Fri Apr 2 11:40:23 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv13318/src/main/org/biomoby/client Modified Files: CentralImpl.java Log Message: Revised documentation, interfaces and classes pertaining to XML parsing and server cache to reflect new parsing and caching schemes moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 23:24:26 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/02 16:40:23 1.11 @@ -8,7 +8,6 @@ package org.biomoby.client; import org.biomoby.shared.*; -import org.biomoby.shared.dom.*; import org.apache.axis.client.*; import org.apache.axis.*; From mwilkinson at pub.open-bio.org Sun Apr 4 14:53:14 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Sun, 4 Apr 2004 14:53:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404041853.i34IrECT029372@pub.open-bio.org> mwilkinson Sun Apr 4 14:53:13 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv29353/MOBY Modified Files: Central.pm Log Message: bug in the registration object - it should return LSID's in the 'id' tag. I think it now does this properly moby-live/Perl/MOBY Central.pm,1.123,1.124 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.123 retrieving revision 1.124 diff -u -r1.123 -r1.124 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/01/15 16:04:54 1.123 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/04 18:53:13 1.124 @@ -2887,7 +2887,7 @@ my $reg = &Registration({ success => 0, message => "$message", - registration_id => "$id", + id => "$id", }); return $reg; } @@ -2897,7 +2897,7 @@ my $reg = &Registration({ success => 1, message => "$message", - registration_id => "$id", + id => "$id", }); return $reg; } From mwilkinson at pub.open-bio.org Sun Apr 4 15:08:41 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Sun, 4 Apr 2004 15:08:41 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404041908.i34J8fLj029465@pub.open-bio.org> mwilkinson Sun Apr 4 15:08:41 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv29446/MOBY Modified Files: Central.pm Log Message: bug in the registration object - it should return LSID's in the 'id' tag. I think it now does this properly moby-live/Perl/MOBY Central.pm,1.124,1.125 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.124 retrieving revision 1.125 diff -u -r1.124 -r1.125 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/04 18:53:13 1.124 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/04 19:08:41 1.125 @@ -109,7 +109,7 @@ sub Registration { my ( $details) = @_; - my $id = $details->{registration_id}; + my $id = $details->{id}; my $success = $details->{success}; my $message = $details->{message}; From mwilkinson at pub.open-bio.org Wed Apr 14 15:56:59 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 14 Apr 2004 15:56:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404141956.i3EJuxi2013404@pub.open-bio.org> mwilkinson Wed Apr 14 15:56:59 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv13353/Perl/MOBY/Client Modified Files: Central.pm CollectionArticle.pm ServiceInstance.pm SimpleArticle.pm Log Message: CommonSubs now includes support for services that use Secondary Parameter's. I am also almost finished writing an OO-interface for building/deconstructing MOBY objects, so that people don't have to learn the XML::DOM API. This is incomplete and untested yet, so don't shoot me if it doesn't work. See the docs for CommonSubs 'complexServiceInputParser' for details on how to manage services that use multiple inputs and/or secondary parameters. As soon as I get this OO interface working I will create an equivalent subroutine that parses the input into objects (but I wont remove this routine, so it wont break you servies if you use it) moby-live/Perl/MOBY/Client Central.pm,1.73,1.74 CollectionArticle.pm,1.6,1.7 ServiceInstance.pm,1.10,1.11 SimpleArticle.pm,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2004/03/26 16:10:40 1.73 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2004/04/14 19:56:59 1.74 @@ -1487,7 +1487,19 @@ } } } - + my @SECONDARIES; + my $secs = $Service->getElementsByTagName("secondaryArticles"); # there should only be one, but... who knows what + for my $in(0..$secs->getLength-1){ + my $current = $secs->item($in); + + foreach my $param($current->getChildNodes){ # child nodes will be "Parameter" tag names + next unless $param->getNodeType == ELEMENT_NODE && $param->getTagName eq "Parameter"; + my $THIS; + $THIS = MOBY::Client::SecondaryArticle->new(XML_DOM => $param); + push @SECONDARIES, $THIS; + } + } + my $Instance = MOBY::Client::ServiceInstance->new( authority => $AuthURI, authoritative => $authoritative, @@ -1498,6 +1510,7 @@ category => $cat, input => \@INPUTS, output => \@OUTPUTS, + secondary => \@SECONDARIES, description => $Description, registry => $Registry, XML => $Service->toString, @@ -1597,7 +1610,7 @@ # my ($self, $xml) = @_; my $Parser = new XML::DOM::Parser; - + #print STDERR $xml; my $doc = $Parser->parse($xml); my $Object = $doc->getDocumentElement(); my $obj = $Object->getTagName; @@ -1608,7 +1621,8 @@ my $reg = MOBY::Client::Registration->new( success => $success, message => $message, - registration_id => $id,); + registration_id => $id, + id => $id); return $reg; } =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm 2003/12/02 00:23:23 1.6 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm 2004/04/14 19:56:59 1.7 @@ -19,9 +19,42 @@ =head1 DESCRIPTION -This describes the Collection articles from the findService Response of MOBY Central -(i.e. the description of the service), it DOES NOT create collection articles -as provided by a service provider (i.e. simple articles containing data) +This describes the Collection articles from either the findService Response of MOBY Central +(i.e. the description of the service), or Collection articles +as provided in a service invocation or response message +(i.e. simple articles containing data) + +Basically it parses the following part of a findService response: + + + + someNbject + someNamespace + someNamespace2 + + + someNbject + someNamespace + someNamespace2 + + + +OR it parses the following part of a service invocation or response message: + + + + ..... + + + ..... + + + + +The articleName is retrieved with ->articleName +The contained Simples are retrieved as MOBY::Client::SimpleArticle objects +using the ->Simples method call. + =head1 AUTHORS @@ -38,8 +71,11 @@ Usage : my $IN = MOBY::Client::CollectionArticle->new(%args) Function : create CollectionArticle object Returns : MOBY::Client::SimpleArticle object - Args : articleName => $articleName (optional) - Simples => $objectType (required) + Args : either of the following two methods may be used to auto-generate the + object by passing the appropriate XML node as a string, or XML::DOM node object + + XML => $XML + XML_DOM => $XML::DOM::NODE =cut @@ -76,6 +112,29 @@ =cut + +=head2 XML + + Title : XML + Usage : $SA = $SA->XML($XML) + Function : set/reset all parameters for this object from the XML + Returns : MOBY::Client::SimpleArticle + Arguments : (optional) XML fragment from and including ... + +=cut + + +=head2 XML_DOM + + Title : XML_DOM + Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) + Function : set/reset all parameters for this object from the XML::DOM node for + Returns : MOBY::Client::SimpleArticle + Arguments : (optional) an $XML::DOM node from the article of a DOM + +=cut + + =head2 isSimple Title : isSimple @@ -104,6 +163,17 @@ =cut +=head2 isSecondary + + Title : isSecondary + Usage : $boolean = $IN->isSecondary() + Function : is this a SecondaryArticle type? + (yes, I know this is obvious) + Returns : 0 (true) + +=cut + + { # Encapsulated: # DATA @@ -115,6 +185,7 @@ articleName => [undef, 'read/write'], Simples => [[], 'read/write'], isSimple => [0, 'read' ], + isSecondary => [0, 'read' ], isCollection => [1, 'read' ], XML => [undef, 'read/write'], XML_DOM => [undef, 'read/write'], @@ -188,7 +259,7 @@ sub createFromXML { my ($self) = @_; - my $p = XML::DOM->new; + my $p = XML::DOM::Parser->new; my $doc = $p->parse($self->XML); my $root = $doc->getDocumentElement; return 0 unless ($root && ($root->getTagName eq "Collection")); @@ -198,6 +269,7 @@ sub createFromDOM { my ($self, $dom) = @_; return 0 unless ($dom && ($dom->getTagName eq "Collection")); + $self->XML($dom->toString); # set the string version of the DOM $self->articleName(""); $self->Simples([]); @@ -209,7 +281,7 @@ for my $n(0..$objects->getLength - 1){ foreach my $child($objects->item($n)->getChildNodes){ next unless $child->getNodeType == ELEMENT_NODE; - $self->addSimple(MOBY::Client::SimpleArticle->new(XML_DOM => $objects->item($n))); + $self->addSimple(MOBY::Client::SimpleArticle->new(articleName=>$self->articleName, XML_DOM => $objects->item($n))); } } return $self; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm 2004/03/18 23:10:34 1.10 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm 2004/04/14 19:56:59 1.11 @@ -186,6 +186,7 @@ type => [undef, 'read/write'], input => [[], 'read/write'], # listref of Simple and Collection articles output => [[], 'read/write'], # listref of Simple and Collection articles + secondary => [[], 'read/write'], # listref of SecondaryArticles category => [undef, 'read/write'], description => [undef, 'read/write'], registry => ['MOBY_Central', 'read/write'], =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm 2003/12/02 00:23:23 1.3 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm 2004/04/14 19:56:59 1.4 @@ -18,9 +18,30 @@ =head1 DESCRIPTION -This describes the Simple articles from the findService Response of MOBY Central -(i.e. the description of the service), it DOES NOT create simple articles -as provided by a service provider (i.e. simple articles containing data) +This describes the Simple articles from either the findService Response of MOBY Central +(i.e. the description of the service), or Simple articles +as provided in a service invocation or response message +(i.e. simple articles containing data) + +Basically it parses the following part of a findService response: + + + someNbject + someNamespace + someNamespace2 + + +OR it parses the following part of a service invocation or response message: + + + ..... + + +The articleName is retrieved with ->articleName +The namespace(s) are retrieved with ->namespaces +The objectType is retrieved with ->objectType +the id (if instantiated) is retrieved with ->id + =head1 AUTHORS @@ -37,11 +58,12 @@ Usage : my $SA = MOBY::Client::SimpleArticle->new(%args) Function : create SimpleArticle object Returns : MOBY::Client::SimpleArticle object - Args : articleName => $articleName (optional) - objectType => $objectType (required) - namespaces => \@namesapces (optional) - XML_DOM => $XML_DOM node of the simple article (optional) - XML => $XML XML string representing the simple article (optional) + Args : either of the following two methods may be used to auto-generate the + object by passing the appropriate XML node as a string, or XML::DOM node object + + XML => $XML + XML_DOM => $XML::DOM::NODE + =cut @@ -76,27 +98,27 @@ =cut -# -#=head2 XML -# -# Title : XML -# Usage : $SA = $SA->XML($XML) -# Function : set/reset all parameters for this object from the XML -# Returns : MOBY::Client::SimpleArticle -# Arguments : (optional) XML fragment from and including ... -# -#=cut -# -# -#=head2 XML_DOM -# -# Title : XML_DOM -# Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) -# Function : set/reset all parameters for this object from the XML::DOM node for -# Returns : MOBY::Client::SimpleArticle -# Arguments : (optional) an $XML::DOM node from the article of a DOM -# -#=cut + +=head2 XML + + Title : XML + Usage : $SA = $SA->XML($XML) + Function : set/reset all parameters for this object from the XML + Returns : MOBY::Client::SimpleArticle + Arguments : (optional) XML fragment from and including ... + +=cut + + +=head2 XML_DOM + + Title : XML_DOM + Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) + Function : set/reset all parameters for this object from the XML::DOM node for + Returns : MOBY::Client::SimpleArticle + Arguments : (optional) an $XML::DOM node from the article of a DOM + +=cut =head2 addNamespace @@ -136,6 +158,17 @@ =cut +=head2 isSecondary + + Title : isSecondary + Usage : $boolean = $IN->isSecondary() + Function : is this a SecondaryArticle type? + (yes, I know this is obvious) + Returns : 0 (true) + +=cut + + { # Encapsulated: # DATA @@ -147,8 +180,10 @@ articleName => [undef, 'read/write'], objectType => [undef, 'read/write'], namespaces => [[], 'read/write'], + id => [undef, 'read/write'], XML_DOM => [undef, 'read/write'], XML => [undef, 'read/write'], + isSecondary => [0, 'read' ], isSimple => [1, 'read' ], isCollection => [0, 'read' ], ); @@ -218,7 +253,7 @@ sub createFromXML { my ($self) = @_; - my $p = XML::DOM->new; + my $p = XML::DOM::Parser->new; my $doc = $p->parse($self->XML); my $root = $doc->getDocumentElement; return 0 unless ($root && ($root->getTagName eq "Simple")); @@ -228,7 +263,7 @@ sub createFromDOM { my ($self, $dom) = @_; return 0 unless ($dom && ($dom->getTagName eq "Simple")); - + $self->XML($dom->toString); # set the string version of the DOM $self->namespaces([]); # reset! $self->articleName(""); $self->objectType(""); @@ -236,7 +271,46 @@ my $attr = $dom->getAttributeNode('articleName'); my $articleName = ""; $articleName = $attr->getValue if $attr; - $self->articleName($articleName); + $self->articleName($articleName) if $articleName; # it may have already been set if this Simple is part of a Collection... + +# fork here - it may be an instantiated object (coming from a service invocation/response) +# or it may be a template object as in the SimpleArticle element of a registration call + +# if the objectType tag exists, then it is a template object + if (@{$dom->getElementsByTagName("objectType")}[0]){ + return $self->_createTemplateArticle($dom) + } + else { return $self->_createInstantiatedArticle($dom)} +# otherwise it should simpy contain an instantiated MOBY object + + +} + +sub _createInstantiatedArticle { + my ($self, $dom) = @_; + + # this will take a node from a MOBY invocation message + # and extract the object-type and namespace from the + # contained data object + + foreach my $child($dom->getChildNodes){ # there should be only one child node, and that is the data object itself; ignore whitespace + next unless $child->getNodeType == ELEMENT_NODE; + $self->objectType($child->getTagName); + my $attr = $child->getAttributeNode('namespace'); + $self->addNamespace($attr->getValue) if $attr; + my $id = $child->getAttributeNode('id'); + $self->id($id->getValue) if $id; + } + return $self; +} + +sub _createTemplateArticle { + my ($self, $dom) = @_; + + # this will take a node from a MOBY findServiceResponse + # message and extract the objectType and namespace array + # from the service signature. + my $objects = $dom->getElementsByTagName("objectType"); foreach my $child($objects->item(0)->getChildNodes){ # there must be only one in a simple! so take element 0 next unless $child->getNodeType == TEXT_NODE; @@ -254,7 +328,6 @@ return $self; } - sub AUTOLOAD { no strict "refs"; my ($self, $newval) = @_; From mwilkinson at pub.open-bio.org Wed Apr 14 15:56:59 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 14 Apr 2004 15:56:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404141956.i3EJuxs1013372@pub.open-bio.org> mwilkinson Wed Apr 14 15:56:59 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv13353/Perl/MOBY Modified Files: CommonSubs.pm Log Message: CommonSubs now includes support for services that use Secondary Parameter's. I am also almost finished writing an OO-interface for building/deconstructing MOBY objects, so that people don't have to learn the XML::DOM API. This is incomplete and untested yet, so don't shoot me if it doesn't work. See the docs for CommonSubs 'complexServiceInputParser' for details on how to manage services that use multiple inputs and/or secondary parameters. As soon as I get this OO interface working I will create an equivalent subroutine that parses the input into objects (but I wont remove this routine, so it wont break you servies if you use it) moby-live/Perl/MOBY CommonSubs.pm,1.43,1.44 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/03/19 00:24:10 1.43 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/14 19:56:59 1.44 @@ -16,51 +16,49 @@ =head2 Service-Side Paradigm The following is a generalized architecture for *all* -BioMOBY services showing how to parse incoming messages... +BioMOBY services showing how to parse incoming messages +using the subroutines provided in CommonSubs sub myServiceName { - my ($caller, $message) = @_; # get the incoming MOBY query XML - - my @queries = getInputs($message); # returns XML::DOM nodes - my $MOBY_RESPONSE = ""; # set empty response - - foreach my $query(@queries){ - - my $queryID = getInputID($query); # get the queryID attribute of the queryInput - - my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query - foreach my $input(@input_articles){ # input is a listref - - my ($articleName, $article) = @{$input}; # get the named article - - my $simple = isSimpleArticle($article); # articles may be simple or collection - my $collection = isCollectionArticle($article); - - if ($collection){ - - # do something wtih the collection... - # for example... - my @simples = getCollectedSimples($article); - # blah blah blah... - - } elsif ($simple){ - # maybe you just need the ID of the incoming query: - my ($id) = getSimpleArticleIDs('NCBI_gi', $article); # if you need the ID - - # or maybe you are going to do something with the content? - # for example, this will get the array of text lines - # for the moby:String object with the articleName 'SequenceString' - # that is in this $article - my @sequence = getNodeContentWithArticle($article, "String", "SequenceString"); - - # DO YOUR ANALYSIS HERE - my $result = ""; #whatever you analysis says - - $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename", $queryID); + my ($caller, $data) = @_; + my $MOBY_RESPONSE; # holds the response raw XML + + # genericServiceInputParser + # unpacks incoming message into an array of arrarefs. + # Each element of the array is a queryInput block, or a mobyData block + # the arrayref has the following structure: + # [SIMPLE, $queryID, $simple] + # the first element is a constant "SIMPLE" or "COLLECTION" + # the second element is the queryID (required for enumerating the responses) + # the third element is the XML::DOM for the Simple or Collection block + my (@inputs)= genericServiceInputParser($data); + # or fail properly with an empty response + return SOAP::Data->type('base64' => responseHeader("my.authURI.com") . responseFooter()) unless (scalar(@inputs)); + + # you only need to do this if you are intending to be namespace aware + # some services might not care what namespace the data is in, so long + # as there is data... + my @validNS_LSID = validateNamespaces("NCBI_gi"); # returns LSID's for each human-readable + + foreach (@inputs){ + my ($articleType, $qID, $input) = @{$_}; + unless (($articleType == SIMPLE) && ($input)){ + # in this example, we are only accepting SIMPLE types as input + # so write back an empty response block and move on to the next + $MOBY_RESPONSE .= simpleResponse("", "", $qID) ; + next; + } else { + # now take the namespace and ID from our input article + # (see pod docs for other possibilities) + my $namespace = getSimpleArticleNamespaceURI($input); # get namespace + my ($identifier) = getSimpleArticleIDs($input); # get ID (note array output! see pod) + + # here is where you do whatever manipulation you need to do + # for your particular service. + # you will be building an XML document into $MOBY_RESPONSE } - } - } - return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter; + } + return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter)); } =cut @@ -72,46 +70,63 @@ This is a service that: -CONSUMES: Object in the NCBI_Acc namespace +CONSUMES: base Object in the GO namespace EXECUTES: Retrieval -PRODUCES: GenericSequence (in the NCBI_Acc namespace) +PRODUCES: GO_Term (in the GO namespace) - use Bio::Perl; - # this subroutine is called from your dispatch_with line # in your SOAP daemon - - sub myServiceName { - my ($caller, $message) = @_; # get the incoming MOBY query XML - my @queries = getInputs($message); # returns XML::DOM nodes - my $MOBY_RESPONSE = ""; # set empty response - - foreach my $query(@queries){ - - my $queryID = getInputID($query); # get the queryID attribute of the queryInput - - my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query - foreach my $input(@input_articles){ # input is a listref - my ($articleName, $article) = @{$input}; # get the named article - next unless isSimpleArticle($article); # I only allow simple inputs in my service signature - my ($id) = getSimpleArticleIDs('NCBI_Acc', $article); # if you need the ID - my $seq; - eval {$seq = get_sequence('genbank',$id);} # suppress bioperl error messages - my $response = ""; - if ($seq){ - $length = length($seq); - $response = " - $length - $seq - "; - } - $MOBY_RESPONSE .= simpleResponse($response, '', $queryID); + + sub getGoTerm { + my ($caller, $message) = @_; + my $MOBY_RESPONSE; + my (@inputs)= genericServiceInputParser($message); # ([SIMPLE, $queryID, $simple],...) + return SOAP::Data->type('base64' => responseHeader('my.authURI.com') . responseFooter()) unless (scalar(@inputs)); + + my @validNS = validateNamespaces("GO"); # ONLY do this if you are intending to be namespace aware! + + my $dbh = _connectToGoDatabase(); + return SOAP::Data->type('base64' => responseHeader('my.authURI.com') . responseFooter()) unless $dbh; + my $sth = $dbh->prepare(q{ + select name, term_definition + from term, term_definition + where term.id = term_definition.term_id + and acc=?}); + + foreach (@inputs){ + my ($articleType, $ID, $input) = @{$_}; + unless ($articleType == SIMPLE){ + $MOBY_RESPONSE .= simpleResponse("", "", $ID); + next; + } else { + my $ns = getSimpleArticleNamespaceURI($input); + (($MOBY_RESPONSE .= simpleResponse("", "", $ID)) && (next)) + unless validateThisNamespace($ns, @validNS); # only do this if you are truly validating namespaces + my ($accession) = defined(getSimpleArticleIDs($ns, [$input]))?getSimpleArticleIDs($ns,[$input]):undef; + unless (defined($accession)){ + $MOBY_RESPONSE .= simpleResponse("", "", $ID); + next; + } + unless ($accession =~/^GO:/){ + $accession = "GO:$accession"; # we still haven't decided on whether id's should include the prefix... + } + $sth->execute($accession); + my ($term, $def) = $sth->fetchrow_array; + if ($term){ + $MOBY_RESPONSE .= simpleResponse(" + + $term + $def + ", "GO_Term_From_ID", $ID) + } else { + $MOBY_RESPONSE .= simpleResponse("", "", $ID) + } } - } - } - return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter; + } + + return SOAP::Data->type('base64' => (responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter)); } @@ -121,7 +136,8 @@ both Client and Service side to construct and parse MOBY Messages, and ensure that the message structure is valid as per the API. -It DOES NOT connect to MOBY Central for any of its functions. +It DOES NOT connect to MOBY Central for any of its functions, though it does +contact the ontology server, so it will require a network connection. =head1 AUTHORS @@ -148,11 +164,13 @@ use constant COLLECTION => 1; use constant SIMPLE => 2; +use constant SECONDARY => 3; +use constant PARAMETER => 3; # be friendly in case they use this instead use constant BE_NICE => 1; use constant BE_STRICT => 0; our @ISA = qw(Exporter); -our @EXPORT = qw(COLLECTION SIMPLE BE_NICE BE_STRICT); +our @EXPORT = qw(COLLECTION SIMPLE SECONDARY PARAMETER BE_NICE BE_STRICT); our @EXPORT_OK = qw( getSimpleArticleIDs getSimpleArticleNamespaceURI @@ -175,10 +193,13 @@ getResponseArticles getCrossReferences genericServiceInputParser + complexServiceInputParser whichDeepestParentObject getServiceNotes COLLECTION SIMPLE + SECONDARY + PARAMETER BE_NICE BE_STRICT ); @@ -204,40 +225,270 @@ getResponseArticles getCrossReferences genericServiceInputParser + complexServiceInputParser whichDeepestParentObject getServiceNotes COLLECTION SIMPLE + SECONDARY + PARAMETER BE_NICE BE_STRICT )]); +=head2 genericServiceInputParser + + name : genericServiceInputParser + function : For the MOST SIMPLE SERVICES that take single Simple or Collection inputs + and no Secondaries this routine takes the MOBY message and + breaks the objects out of it in a useful way + usage : my @inputs = genericServiceInputParser($MOBY_mssage)); + args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message + returns : @inputs - the structure of @inputs is a list of listrefs. + Each listref has three components: + 1. COLLECTION|SIMPLE|SECONDARY (i.e. constants 1, 2, 3) + 2. queryID (undef for Secondary parameters) + 3. $data - the data takes several forms + a. $article XML::DOM node for Simples + ... + b. \@article XML:DOM nodes for Collections + c. $secondary XML::DOM node + +=cut + + sub genericServiceInputParser { my ($message) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = getInputs($message); # returns XML::DOM nodes + my @queries = getInputs($message); # returns XML::DOM nodes ... foreach my $query(@queries){ my $queryID = getInputID($query); # get the queryID attribute of the queryInput - my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query + my @input_articles = getArticles($query); # get the Simple/Collection/Secondary articles making up this query ... or ... or ... foreach my $input(@input_articles){ # input is a listref my ($articleName, $article) = @{$input}; # get the named article - my $simple = isSimpleArticle($article); # articles may be simple or collection - my $collection = isCollectionArticle($article); - if ($collection){ + if (isCollectionArticle($article)){ my @simples = getCollectedSimples($article); push @inputs, [COLLECTION,$queryID, \@simples]; + } elsif (isSimpleArticle($article)){ + push @inputs, [SIMPLE,$queryID,$article]; + } elsif (isSecondaryArticle($article)){ + push @inputs, [SECONDARY,$queryID,$article]; + } + } + } + return @inputs; +} + + + + +=head2 complexServiceInputParser + + name : complexServiceInputParser + function : For more complex services taht have multiple articles for each input + and/or accept parameters, this routine will take a MOBY message and + extract the Simple/Collection/Parameter objects out of it in a + useful way. + usage : my $inputs = complexServiceInputParser($MOBY_mssage)); + args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message + returns : $inputs is a hashref with the following structure: + + $inputs->{$queryID} = [ [TYPE, $DOM], [TYPE, $DOM], [TYPE, $DOM] ] + + Simples ------------------------ + + for example, the input message: + + + + + + + Float + 10 + + + + will become: + (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module) + + $inputs->{1} = [ [SIMPLE, $DOM_name1], + [SECONDARY, $DOM_cutoff] + ] + + Please see the XML::DOM pod documentation for information about how + to parse XML DOM objects. + + + Collections -------------------- + + With inputs that have collections these are presented as a + listref of Simple article DOM's. So for the following message: + + + + + + + + + + + + Float + 10 + + + + will become + + $inputs->{1} = [ [COLLECTION, [$DOM, $DOM] ], + [SECONDARY, $DOM_cutoff] + ] + + Please see the XML::DOM pod documentation for information about how + to parse XML DOM objects. + + +=cut + + +sub complexServiceInputParser { + my ($message) = @_; # get the incoming MOBY query XML + my @inputs; # set empty response + my @queries = getInputs($message); # returns XML::DOM nodes ... + my %input_parameters; # $input_parameters{$queryID} = [ + + foreach my $query(@queries){ + my $queryID = getInputID($query); # get the queryID attribute of the queryInput + my @input_articles = getArticles($query); # get the Simple/Collection/Secondary articles making up this query ... or ... or ... + foreach my $input(@input_articles){ # input is a listref + my ($articleName, $article) = @{$input}; # get the named article + if (isCollectionArticle($article)){ + my @simples = getCollectedSimples($article); + push @{$input_parameters{$queryID}}, [COLLECTION, \@simples]; + } elsif (isSimpleArticle($article)){ + push @{$input_parameters{$queryID}}, [SIMPLE, $article]; + } elsif (isSecondaryArticle($article)){ + push @{$input_parameters{$queryID}}, [SECONDARY, $article]; + } + } + } + return \%input_parameters; +} + + +=head2 getArticles + + name : getArticles + function : get the Simple/Collection/Parameter articles for a single queryInput + or queryResponse node + usage : @articles = getArticles($XML) + args : raw XML or XML::DOM of a queryInput, mobyData, or queryResponse block (e.g. from getInputs) + returns : a list of listrefs; each listref is one component of the queryInput. + a single queryInput/Response may consist of one or more named or unnamed + simple, collection, or parameter articles. + The listref structure is thus [name, $ARTICLE_DOM]: + + e.g.: @articles = ['name1', $SIMPLE_DOM] + + generated from the following sample XML: + + + + + + + + or : @articles = ['name1', $COLL_DOM], ['paramname1', $PARAM_DOM] + + generated from the following sample XML: + + + + + + + + + + + + Float + 10 + + + +=cut + + +sub getArticles { + + my ($moby) = @_; + unless (ref($moby) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($moby); + $moby = $doc->getDocumentElement(); + } + + return undef unless $moby->getNodeType == ELEMENT_NODE; + return undef unless (($moby->getTagName =~ /queryInput/) || ($moby->getTagName =~ /queryResponse/) || ($moby->getTagName =~ /mobyData/)); + my @articles; + foreach my $child($moby->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them + next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace + next unless ($child->getTagName =~ /Simple/ || $child->getTagName =~ /Collection/ || $child->getTagName =~ /Parameter/); + my $articleName = $child->getAttribute('articleName'); + $articleName ||= $child->getAttribute('moby:articleName'); + push @articles, [$articleName, $child]; # push the named child DOM elements (which are or , ) + } + return @articles; # return them. +} + - } elsif ($simple){ + +=head2 genericServiceInputParserAsObject + + name : DO NOT USE! + function : to take a MOBY message and break the objects out of it. This is identical + to the subroutine above, except that it returns the data as + Objects rather than XML::DOM nodes + usage : my @inputs = genericServiceInputParser($MOBY_mssage)); + args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message + returns : @inputs - the structure of @inputs is a list of listrefs. + Each listref has three components: + 1. COLLECTION|SIMPLE|SECONDARY (i.e. constants 1, 2, 3) + 2. queryID (undef for Secondary parameters) + 3. $data - either MOBY::Client::SimpleArticle, CollectionArticle, or SecondaryArticle + +=cut + + +sub genericServiceInputParserAsObject { + my ($message) = @_; # get the incoming MOBY query XML + my @inputs; # set empty response + my @queries = getInputs($message); # returns XML::DOM nodes ... + + foreach my $query(@queries){ + my $queryID = getInputID($query); # get the queryID attribute of the queryInput + my @input_articles = getArticlesAsObjects($query); # get the Simple/Collection articles making up this query ... or ... or ...isCollection){ + my @simples = getCollectedSimples($article->XML); + push @inputs, [COLLECTION,$queryID, \@simples]; + } elsif ($article->isSimple){ push @inputs, [SIMPLE,$queryID,$article]; + } elsif ($article->isSecondary){ + push @inputs, [SECONDARY,$queryID,$article]; } } } return @inputs; } + ################################################# ################################## ################################## @@ -392,17 +643,16 @@ $data ||=''; # initialize to avoid uninit value errors $qID ||=""; $articleName ||=""; - if ($articleName) { return " - $data + $data "; } elsif($data) { return " - $data + $data "; } else { @@ -449,7 +699,7 @@ $data ||=[]; $qID ||= ''; unless ((ref($data) =~ /array/i) && $data->[0]){ # we're expecting an arrayref as input data,and it must not be empty - return ""; + return ""; } foreach (@{$data}){ @@ -465,7 +715,7 @@ } if ($articleName) { return " - + $content @@ -473,7 +723,7 @@ "; } else { return " - + $content "; @@ -545,8 +795,8 @@ function : get the queryInput block(s) as XML::DOM nodes usage : @queryInputs = getInputArticles($XML) args : the raw XML of a query, or an XML::DOM document - returns : a list of XML::DOM::Node's, each is a queryInput. - Note : Remember that queryInputs are numbered! This is what you + returns : a list of XML::DOM::Node's, each is a queryInput or mobyData block. + Note : Remember that these blocks are enumerated! This is what you pass as the third argument to the simpleResponse or collectionResponse subroutine to associate the numbered input to the numbered response @@ -562,16 +812,14 @@ my $doc = $parser->parse($XML); $moby = $doc->getDocumentElement(); } + my @queries; - my $x = $moby->getElementsByTagName('queryInput'); # get the queryInput block - unless ($x->item(0)){ - $x = $moby->getElementsByTagName('moby:queryInput'); + foreach my $querytag('queryInput', 'moby:queryInput', 'mobyData', 'moby:mobyData'){ + my $x = $moby->getElementsByTagName($querytag); # get the queryInput block + for (0..$x->getLength-1){ # there may be more than one queryInput per message + push @queries, $x->item($_); + } } - - my @queries; - for (0..$x->getLength-1){ # there may be more than one queryInput per message - push @queries, $x->item($_); - } return @queries; # return them in the order that they were discovered. } @@ -581,9 +829,9 @@ name : getInputID function : get the value of the queryID element usage : @queryInputs = getInputID($XML) - args : the raw XML or XML::DOM of a block + args : the raw XML or XML::DOM of a queryInput or mobyData block (e.g. from getInputs) returns : integer, or '' - Note : queryInputs and queryResponses are coordinately enumerated! + Note : Inputs and Responses are coordinately enumerated! The integer you get here is what you pass as the third argument to the simpleResponse or collectionResponse subroutine to associate the numbered input to the numbered response @@ -598,44 +846,61 @@ my $doc = $parser->parse($XML); $XML = $doc->getDocumentElement(); } - return '' unless $XML->getTagName =~ /queryInput/; + return '' unless (($XML->getTagName =~ /queryInput/) || ($XML->getTagName =~ /mobyData/)); my $qid = $XML->getAttribute('queryID'); + $qid ||= $XML->getAttribute('moby:queryID'); + return defined($qid)?$qid:''; } -=head2 getArticles +=head2 getArticlesAsObjects - name : getArticles + name : getArticlesAsObjects function : get the Simple/Collection articles for a single queryInput - or queryResponse node + or queryResponse node, rethrning them as SimpleArticle, + SecondaryArticle, or ServiceInstance objects usage : @articles = getArticles($XML) - args : raw XML or XML::DOM of a moby:queryInput or a moby:queryResponse block + args : raw XML or XML::DOM of a moby:queryInput, moby:queryResponse block returns : a list of listrefs; each listref is one component of the queryInput. - a single queryInput/Responsemay consist of one or more named or unnamed - simple or collection articles. The listref structure is thus [name, $ARTICLE]: + a single queryInput/Response may consist of one or more named or unnamed + simple, collection, or parameter articles. + The listref structure is thus [name, $ARTICLE_OBJECT]: - e.g.: @articles = ['name1', $SIMPLE_DOM] - or : @articles = ['name1', $COLLECTION_DOM], ['name2', $SIMPLE_DOM]... + e.g.: @articles = ['name1', $SimpleArticle] - the former is generated from the following sample XML: + generated from the following sample XML: + + or : @articles = ['name1', $CollectionArticle], ['paramname1', $SecondaryArticle] + + generated from the following sample XML: + - - - + + + + + + + + + + Float + 10 + =cut -sub getArticles { +sub getArticlesAsObjects { my ($moby) = @_; unless (ref($moby) =~ /XML\:\:DOM/){ @@ -645,14 +910,21 @@ } return undef unless $moby->getNodeType == ELEMENT_NODE; - return undef unless ($moby->getTagName =~ /queryInput/ || $moby->getTagName =~ /queryResponse/); + return undef unless (($moby->getTagName =~ /queryInput/) || ($moby->getTagName =~ /queryResponse/) || ($moby->getTagName =~ /mobyData/)); my @articles; foreach my $child($moby->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace - next unless ($child->getTagName =~ /Simple/ || $child->getTagName =~ /Collection/); - my $articleName = $child->getAttribute('articleName'); - $articleName ||= $child->getAttribute('moby:articleName'); - push @articles, [$articleName, $child]; # take the child elements, which are or + next unless ($child->getTagName =~ /Simple/ || $child->getTagName =~ /Collection/ || $child->getTagName =~ /Parameter/); + my $object; + if ($child->getTagName =~ /Simple/){ + $object = MOBY::Client::SimpleArticle->new(XML_DOM => $child); + } elsif ($child->getTagName =~ /Collection/){ + $object = MOBY::Client::CollectionArticle->new(XML_DOM => $child); + } elsif ($child->getTagName =~ /Parameter/){ + $object = MOBY::Client::CollectionArticle->new(XML_DOM => $child); + } + next unless $object; + push @articles, $object; # take the child elements, which are or } return @articles; # return them. } @@ -707,18 +979,18 @@ the former is generated from the following XML: ... - - + + - - + + - - + + ... =cut @@ -733,11 +1005,13 @@ $moby = $doc->getDocumentElement(); } - my $x = $moby->getElementsByTagName('queryInput'); # get the queryInput block - unless ($x->item(0)){ - $x = $moby->getElementsByTagName('moby:queryInput'); + my $x; + foreach ('queryInput', 'moby:queryInput', 'mobyData', 'moby:mobyData'){ + $x = $moby->getElementsByTagName($_); # get the queryInput block + last if $x->item(0); } - + return undef unless $x->item(0); # in case there was no match at all + my @queries; for (0..$x->getLength-1){ # there may be more than one queryInput per message my @this_query; @@ -750,6 +1024,7 @@ return @queries; # return them in the order that they were discovered. } + =head2 isSimpleArticle name : isSimpleArticle @@ -798,6 +1073,57 @@ return 0; } + +=head2 isSecondaryArticle + + name : isSecondaryArticle + function : tests XML (text) or an XML DOM node to see if it represents a Secondary article + usage : if (isSecondaryArticle($node)){do something to it} + input : an XML::DOM node, an XML::DOM::Document or straight XML + returns : boolean + +=cut + +sub isSecondaryArticle { + my ($DOM) = @_; + unless (ref($DOM) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc; + eval {$doc = $parser->parse($DOM);}; + return 0 if ($@); + $DOM = $doc->getDocumentElement(); + } + $DOM = $DOM->getDocumentElement if ($DOM->isa("XML::DOM::Document")); + return 1 if ($DOM->getTagName =~ /Parameter/); + return 0; +} + + +=head2 extractRawContent + + name : extractRawContent + function : pass me an article (Simple, or Collection) and I'll give you the + content AS A STRING - i.e. the raw XML of the contained MOBY Object(s) + usage : extractRawContent($simple) + input : the one element of the output from getArticles + returns : string + +=cut + + +sub extractRawContent { + my ($article) = @_; + return "" unless $article; + return "" unless ref($article) =~ /XML::DOM/; + my $response; + foreach ($article->getChildNodes){ + $response .= $_->toString; + } + return $response; + +} + + =head2 getNodeContentWithArticle name : getNodeContentWithArticle @@ -815,16 +1141,16 @@ For example, in the following XML: ... ... - - + + 3 ATG - - + + ... ... @@ -843,32 +1169,6 @@ =cut - -=head2 extractRawContent - - name : extractRawContent - function : pass me an article (Simple, or Collection) and I'll give you the - content AS A STRING - i.e. the raw XML of the contained MOBY Object(s) - usage : extractRawContent($simple) - input : the one element of the output from getArticles - returns : string - -=cut - - -sub extractRawContent { - my ($article) = @_; - return "" unless $article; - return "" unless ref($article) =~ /XML::DOM/; - my $response; - foreach ($article->getChildNodes){ - $response .= $_->toString; - } - return $response; - -} - - sub getNodeContentWithArticle{ # give me a DOM, a TagName, an articleName and I will return you the content # of that node **as a string** (beware if there are additional XML tags in there!) @@ -989,30 +1289,32 @@ my @collections; my @Xrefs; my $success = 0; - my $responses = $moby->getElementsByTagName('moby:queryResponse'); - $responses ||= $moby->getElementsByTagName('queryResponse'); - foreach my $n(0..($responses->getLength - 1)){ - my $resp = $responses->item($n); - foreach my $response_component($resp->getChildNodes){ - next unless $response_component->getNodeType == ELEMENT_NODE; - if (($response_component->getTagName eq "Simple") || ($response_component->getTagName eq "moby:Simple")){ - foreach my $Object($response_component->getChildNodes) { - next unless $Object->getNodeType == ELEMENT_NODE; - $success = 1; - push @objects,$Object; - } - } elsif (($response_component->getTagName eq "Collection") || ($response_component->getTagName eq "moby:Collection")){ - my @objects; - foreach my $simple($response_component->getChildNodes){ - next unless $simple->getNodeType == ELEMENT_NODE; - next unless (($simple->getTagName eq "Simple") || ($simple->getTagName eq "moby:Simple")); - foreach my $Object($simple->getChildNodes) { + foreach my $which ('moby:queryResponse', 'queryResponse', 'mobyData', 'moby:mobyData'){ + my $responses = $moby->getElementsByTagName($which); + next unless $responses; + foreach my $n(0..($responses->getLength - 1)){ + my $resp = $responses->item($n); + foreach my $response_component($resp->getChildNodes){ + next unless $response_component->getNodeType == ELEMENT_NODE; + if (($response_component->getTagName eq "Simple") || ($response_component->getTagName eq "moby:Simple")){ + foreach my $Object($response_component->getChildNodes) { next unless $Object->getNodeType == ELEMENT_NODE; $success = 1; push @objects,$Object; } + } elsif (($response_component->getTagName eq "Collection") || ($response_component->getTagName eq "moby:Collection")){ + my @objects; + foreach my $simple($response_component->getChildNodes){ + next unless $simple->getNodeType == ELEMENT_NODE; + next unless (($simple->getTagName eq "Simple") || ($simple->getTagName eq "moby:Simple")); + foreach my $Object($simple->getChildNodes) { + next unless $Object->getNodeType == ELEMENT_NODE; + $success = 1; + push @objects,$Object; + } + } + push @collections, \@objects; #I'm not using collections yet, so we just use Simples. } - push @collections, \@objects; #I'm not using collections yet, so we just use Simples. } } } From mwilkinson at pub.open-bio.org Wed Apr 14 16:10:35 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 14 Apr 2004 16:10:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404142010.i3EKAZia013510@pub.open-bio.org> mwilkinson Wed Apr 14 16:10:35 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv13487/MOBY Modified Files: CommonSubs.html CommonSubs.pm Log Message: updating docs and HTML docs moby-live/Perl/MOBY CommonSubs.html,1.8,1.9 CommonSubs.pm,1.44,1.45 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html 2003/12/27 20:24:52 1.8 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html 2004/04/14 20:10:35 1.9 @@ -15,9 +15,9 @@ @@ -61,57 +68,55 @@ MOBY Services

          -
          -

          Client Side Paradigm

          +

          Client Side Paradigm

          +

          not written yet

          Service-Side Paradigm

          The following is a generalized architecture for *all* -BioMOBY services showing how to parse incoming messages...

          +BioMOBY services showing how to parse incoming messages +using the subroutines provided in CommonSubs

            sub myServiceName {
          -   my ($caller, $message) = @_;  # get the incoming MOBY query XML
          -
          -   my @queries = getInputs($message);  # returns XML::DOM nodes
          -   my $MOBY_RESPONSE = "";           # set empty response
          - 
          -   foreach my $query(@queries){
          -
          -     my $queryID = getInputID($query);  # get the queryID attribute of the queryInput
          -     
          -     my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query
          -     foreach my $input(@input_articles){       # input is a listref
          -
          -        my ($articleName, $article) = @{$input}; # get the named article
          -        
          -        my $simple = isSimpleArticle($article);  # articles may be simple or collection
          -        my $collection = isCollectionArticle($article);
          -
          -        if ($collection){
          -
          -            # do something wtih the collection...
          -            # for example...
          -            my @simples = getCollectedSimples($article);
          -            # blah blah blah...
          -            
          -        } elsif ($simple){
          -            # maybe you just need the ID of the incoming query:
          -            my ($id) = getSimpleArticleIDs('NCBI_gi', $article); # if you need the ID
          -
          -            # or maybe you are going to do something with the content?
          -            # for example, this will get the array of text lines
          -            # for the moby:String object with the articleName 'SequenceString'
          -            # that is in this $article
          -            my @sequence = getNodeContentWithArticle($article, "String", "SequenceString");
          -
          -            #  DO YOUR ANALYSIS HERE
          -            my $result = ""; #whatever you analysis says
          -            
          -            $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename", $queryID);
          +    my ($caller, $data) = @_;
          +    my $MOBY_RESPONSE; # holds the response raw XML
          +    
          +        # genericServiceInputParser
          +        # unpacks incoming message into an array of arrarefs.
          +        # Each element of the array is a queryInput block, or a mobyData block
          +        # the arrayref has the following structure:
          +        # [SIMPLE, $queryID, $simple]
          +        # the first element is a constant "SIMPLE" or "COLLECTION"
          +        # the second element is the queryID (required for enumerating the responses)
          +        # the third element is the XML::DOM for the Simple or Collection block    
          +    my (@inputs)= genericServiceInputParser($data); 
          +        # or fail properly with an empty response
          +    return SOAP::Data->type('base64' => responseHeader("my.authURI.com") . responseFooter()) unless (scalar(@inputs));
          +    
          +        # you only need to do this if you are intending to be namespace aware
          +        # some services might not care what namespace the data is in, so long
          +        # as there is data...
          +    my @validNS_LSID = validateNamespaces("NCBI_gi");  # returns LSID's for each human-readable
          +
          +    foreach (@inputs){
          +        my ($articleType, $qID, $input) = @{$_};
          +        unless (($articleType == SIMPLE) && ($input)){
          +                # in this example, we are only accepting SIMPLE types as input
          +                # so write back an empty response block and move on to the next
          +            $MOBY_RESPONSE .= simpleResponse("", "", $qID) ;
          +            next;
          +        } else {
          +                # now take the namespace and ID from our input article
          +                # (see pod docs for other possibilities)
          +            my $namespace = getSimpleArticleNamespaceURI($input); # get namespace
          +            my ($identifier) = getSimpleArticleIDs($input);  # get ID (note array output! see pod)
          +                        
          +            # here is where you do whatever manipulation you need to do
          +            # for your particular service.
          +            # you will be building an XML document into $MOBY_RESPONSE            
                   }
          -     }
          -   }
          -   return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter;
          +    }
          +    return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter));    
            }

          @@ -119,45 +124,62 @@

          EXAMPLE

          A COMPLETE EXAMPLE OF AN EASY MOBY SERVICE

          This is a service that:

          -

          CONSUMES: Object in the NCBI_Acc namespace -EXECUTES: Retrieval -PRODUCES: GenericSequence (in the NCBI_Acc namespace)

          - use Bio::Perl;
          - 
          + CONSUMES:  base Object in the GO namespace
          + EXECUTES:  Retrieval
          + PRODUCES:  GO_Term (in the GO namespace)
          +
            # this subroutine is called from your dispatch_with line
          - # in your SOAP daemon
          - 
          - sub myServiceName {
          -   my ($caller, $message) = @_;  # get the incoming MOBY query XML
          + # in your SOAP daemon
          -   my @queries = getInputs($message);  # returns XML::DOM nodes
          -   my $MOBY_RESPONSE = "";           # set empty response
          - 
          -   foreach my $query(@queries){
          -
          -     my $queryID = getInputID($query);  # get the queryID attribute of the queryInput
          -     
          -     my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query
          -     foreach my $input(@input_articles){       # input is a listref
          -        my ($articleName, $article) = @{$input}; # get the named article
          -        next unless isSimpleArticle($article);   # I only allow simple inputs in my service signature
          -        my ($id) = getSimpleArticleIDs('NCBI_Acc', $article); # if you need the ID
          -        my $seq;
          -        eval {$seq = get_sequence('genbank',$id);} # suppress bioperl error messages
          -        my $response = "";
          -        if ($seq){
          -            $length = length($seq);
          -            $response = "<GenericSequence namespace='NCBI_Acc' id='$id'>
          -                           <Integer namespace='' id='' articleName='Length'>$length</Integer>
          -                           <String namespace='' id='' articleName='SequenceString'>$seq</String>
          -                         </GenericSequence>";
          -        }
          -            $MOBY_RESPONSE .= simpleResponse($response, '', $queryID);
          + sub getGoTerm {
          +    my ($caller, $message) = @_;
          +    my $MOBY_RESPONSE;
          +    my (@inputs)= genericServiceInputParser($message); # ([SIMPLE, $queryID, $simple],...)
          +    return SOAP::Data->type('base64' => responseHeader('my.authURI.com') . responseFooter()) unless (scalar(@inputs));
          +
          +    my @validNS = validateNamespaces("GO");  # ONLY do this if you are intending to be namespace aware!
          +
          +    my $dbh = _connectToGoDatabase();
          +    return SOAP::Data->type('base64' => responseHeader('my.authURI.com') . responseFooter()) unless $dbh;
          +    my $sth = $dbh->prepare(q{
          +       select name, term_definition
          +       from term, term_definition
          +       where term.id = term_definition.term_id
          +       and acc=?});
          +
          +    foreach (@inputs){
          +        my ($articleType, $ID, $input) = @{$_};
          +        unless ($articleType == SIMPLE){
          +            $MOBY_RESPONSE .= simpleResponse("", "", $ID);
          +            next;
          +        } else {
          +            my $ns = getSimpleArticleNamespaceURI($input);
          +            (($MOBY_RESPONSE .= simpleResponse("", "", $ID)) && (next))
          +                unless validateThisNamespace($ns, @validNS);  # only do this if you are truly validating namespaces
          +            my ($accession) = defined(getSimpleArticleIDs($ns, [$input]))?getSimpleArticleIDs($ns,[$input]):undef;
          +            unless (defined($accession)){
          +                $MOBY_RESPONSE .= simpleResponse("", "", $ID);
          +                next;
          +            }
          +            unless ($accession =~/^GO:/){
          +                 $accession = "GO:$accession";  # we still haven't decided on whether id's should include the prefix...
          +            }
          +            $sth->execute($accession);        
          +            my ($term, $def) = $sth->fetchrow_array;
          +            if ($term){
          +                 $MOBY_RESPONSE .= simpleResponse("
          +                 <moby:GO_Term namespace='GO' id='$accession'>
          +                  <moby:String namespace='' id='' articleName='Term'>$term</moby:String>
          +                  <moby:String namespace='' id='' articleName='Definition'>$def</moby:String>
          +                 </moby:GO_Term>", "GO_Term_From_ID", $ID)
          +            } else {
          +                 $MOBY_RESPONSE .= simpleResponse("", "", $ID)
          +            }
                   }
          -     }
          -   }
          -   return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter;
          +    }
          +    
          +    return SOAP::Data->type('base64' => (responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter));    
            }

          @@ -166,7 +188,8 @@

          CommonSubs are used to do various manipulations of MOBY Messages. It is useful both Client and Service side to construct and parse MOBY Messages, and ensure that the message structure is valid as per the API.

          -

          It DOES NOT connect to MOBY Central for any of its functions.

          +

          It DOES NOT connect to MOBY Central for any of its functions, though it does +contact the ontology server, so it will require a network connection.


          @@ -179,6 +202,150 @@

          METHODS

          +

          genericServiceInputParser

          +
          + name     : genericServiceInputParser
          + function : For the MOST SIMPLE SERVICES that take single Simple or Collection inputs
          +            and no Secondaries this routine takes the MOBY message and
          +            breaks the objects out of it in a useful way
          + usage    : my @inputs = genericServiceInputParser($MOBY_mssage));
          + args     : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message
          + returns  : @inputs - the structure of @inputs is a list of listrefs.
          +            Each listref has three components:
          +                1. COLLECTION|SIMPLE|SECONDARY (i.e. constants 1, 2, 3)
          +                2. queryID (undef for Secondary parameters)
          +                3. $data - the data takes several forms
          +                         a. $article XML::DOM node for Simples
          +                            <queryInput...>...</queryInput>
          +                         b. \@article XML:DOM nodes for Collections
          +                         c. $secondary XML::DOM node
          +

          +

          +

          complexServiceInputParser

          +
          + name     : complexServiceInputParser
          + function : For more complex services taht have multiple articles for each input
          +            and/or accept parameters, this routine will take a MOBY message and
          +            extract the Simple/Collection/Parameter objects out of it in a
          +            useful way.
          + usage    : my $inputs = complexServiceInputParser($MOBY_mssage));
          + args     : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message
          + returns  : $inputs is a hashref with the following structure:
          +            
          +            $inputs->{$queryID} = [ [TYPE, $DOM], [TYPE, $DOM], [TYPE, $DOM] ]
          +            
          +            Simples ------------------------
          +            
          +            for example, the input message:
          +            
          +                <queryInput queryID = '1'>
          +                    <Simple articleName='name1'>
          +                       <Object namespace=blah id=blah/>
          +                    </Simple>
          +                    <Parameter articleName='cutoff'>
          +                       <datatype>Float</datatype>
          +                       <default>10</default>
          +                    </Parameter>
          +                </queryInput>
          +
          +            will become:
          +            (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module)
          +            
          +            $inputs->{1} = [ [SIMPLE, $DOM_name1],
          +                             [SECONDARY, $DOM_cutoff]
          +                           ]
          +
          +            Please see the XML::DOM pod documentation for information about how
          +            to parse XML DOM objects.
          +            
          +            
          +            Collections --------------------
          +            
          +            With inputs that have collections these are presented as a
          +            listref of Simple article DOM's.  So for the following message:
          +            
          +                <queryInput>
          +                    <Collection articleName='name1'>
          +                      <Simple>
          +                       <Object namespace=blah id=blah/>
          +                      </Simple>
          +                      <Simple>
          +                       <Object namespace=blah id=blah/>
          +                      </Simple>
          +                    </Collection>
          +                    <Parameter articleName='cutoff'>
          +                       <datatype>Float</datatype>
          +                       <default>10</default>
          +                    </Parameter>
          +                </queryInput>
          +
          +            will become
          +            
          +            $inputs->{1} = [ [COLLECTION, [$DOM, $DOM] ],
          +                             [SECONDARY, $DOM_cutoff]
          +                           ]
          +
          +            Please see the XML::DOM pod documentation for information about how
          +            to parse XML DOM objects.
          +

          +

          +

          getArticles

          +
          + name     : getArticles
          + function : get the Simple/Collection/Parameter articles for a single queryInput
          +            or queryResponse node
          + usage    : @articles = getArticles($XML)
          + args     : raw XML or XML::DOM of a queryInput, mobyData, or queryResponse block (e.g. from getInputs)
          + returns  : a list of listrefs; each listref is one component of the queryInput.
          +            a single queryInput/Response may consist of one or more named or unnamed
          +            simple, collection, or parameter articles.
          +            The listref structure is thus [name, $ARTICLE_DOM]:
          +            
          +    e.g.:  @articles = ['name1', $SIMPLE_DOM]
          +
          +            generated from the following sample XML:
          +
          +                <queryInput>
          +                    <Simple articleName='name1'>
          +                      <Object namespace=blah id=blah/>
          +                    </Simple>
          +                </queryInput>
          +        
          +    or  :  @articles = ['name1', $COLL_DOM], ['paramname1', $PARAM_DOM]
          +
          +            generated from the following sample XML:
          +
          +                <queryInput>
          +                    <Collection articleName='name1'>
          +                      <Simple>
          +                       <Object namespace=blah id=blah/>
          +                      </Simple>
          +                      <Simple>
          +                       <Object namespace=blah id=blah/>
          +                      </Simple>
          +                    </Collection>
          +                    <Parameter articleName='e value cutoff'>
          +                       <datatype>Float</datatype>
          +                       <default>10</default>
          +                    </Parameter>
          +                </queryInput>
          +

          +

          +

          genericServiceInputParserAsObject

          +
          + name     : DO NOT USE!
          + function : to take a MOBY message and break the objects out of it.  This is identical
          +            to the subroutine above, except that it returns the data as
          +            Objects rather than XML::DOM nodes
          + usage    : my @inputs = genericServiceInputParser($MOBY_mssage));
          + args     : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message
          + returns  : @inputs - the structure of @inputs is a list of listrefs.
          +            Each listref has three components:
          +                1. COLLECTION|SIMPLE|SECONDARY (i.e. constants 1, 2, 3)
          +                2. queryID (undef for Secondary parameters)
          +                3. $data - either MOBY::Client::SimpleArticle, CollectionArticle, or SecondaryArticle
          +

          +

          getSimpleArticleIDs

            name     : getSimpleArticleIDs
          @@ -243,12 +410,16 @@
           

          responseHeader

          - name     : responseHeader($auth)
          - function : print the XML string of a MOBY response header
          - usage    : return responseHeader('illuminae.com') . $DATA . responseFooter;
          - args     : a string representing the service providers authority URI
          - caveat   : will soon be expanded to include service provision info
          -            and additional namespace declarations
          + name     : responseHeader
          + function : print the XML string of a MOBY response header +/- serviceNotes
          + usage    : responseHeader('illuminae.com')
          +            responseHeader(
          +                -authority => 'illuminae.com',
          +                -note => 'here is some data from the service provider')
          + args     : a string representing the service providers authority URI,
          +            OR a set of named arguments with the authority and the
          +            service provision notes.
          + caveat   : 
            notes    :  returns everything required up to the response articles themselves.
                        i.e. something like:
            <?xml version='1.0' encoding='UTF-8'?>
          @@ -274,8 +445,8 @@
            function : get the queryInput block(s) as XML::DOM nodes
            usage    : @queryInputs = getInputArticles($XML)
            args     : the raw XML of a <MOBY> query, or an XML::DOM document
          - returns  : a list of XML::DOM::Node's, each is a queryInput.
          - Note     : Remember that queryInputs are numbered!  This is what you
          + returns  : a list of XML::DOM::Node's, each is a queryInput or mobyData block.
          + Note     : Remember that these blocks are enumerated!  This is what you
                       pass as the third argument to the simpleResponse or collectionResponse
                       subroutine to associate the numbered input to the numbered response

          @@ -285,40 +456,23 @@ name : getInputID function : get the value of the queryID element usage : @queryInputs = getInputID($XML) - args : the raw XML or XML::DOM of a <queryInput> block + args : the raw XML or XML::DOM of a queryInput or mobyData block (e.g. from getInputs) returns : integer, or '' - Note : queryInputs and queryResponses are coordinately enumerated! + Note : Inputs and Responses are coordinately enumerated! The integer you get here is what you pass as the third argument to the simpleResponse or collectionResponse subroutine to associate the numbered input to the numbered response

          -

          getArticles

          +

          getArticlesAsObjects

          - name     : getArticles
          + name     : DO NOT USE!!
            function : get the Simple/Collection articles for a single queryInput
          -            or queryResponse node
          +            or queryResponse node, rethrning them as SimpleArticle,
          +            SecondaryArticle, or ServiceInstance objects
            usage    : @articles = getArticles($XML)
          - args     : raw XML or XML::DOM of a moby:queryInput or a moby:queryResponse block
          - returns  : a list of listrefs; each listref is one component of the queryInput.
          -            a single queryInput/Responsemay consist of one or more named or unnamed
          -            simple or collection articles.  The listref structure is thus [name, $ARTICLE]:
          -            
          -            e.g.:  @articles = ['name1', $SIMPLE_DOM]
          -            or  :  @articles = ['name1', $COLLECTION_DOM], ['name2', $SIMPLE_DOM]...
          -
          -            the former is generated from the following sample XML:
          -
          -                <queryInput>
          -                    <Simple articleName='name1'>
          -                      <Object namespace=blah id=blah/>
          -                    </Simple>
          -                </queryInput>
          -                <queryInput>
          -                    <Simple articleName='name1'>
          -                      <Object namespace=blah id=blah/>
          -                    </Simple>
          -                </queryInput>
          + args : raw XML or XML::DOM of a moby:queryInput, moby:queryResponse block + returns :

          getCollectedSimples

          @@ -346,18 +500,18 @@ the former is generated from the following XML: ... - <moby:Query> - <queryInput> + <moby:mobyContent> + <moby:mobyData> <Simple> <Object namespace=blah id=blah/> </Simple> - </queryInput> - <queryInput> + </moby:mobyData> + <moby:mobyData> <Simple> <Object namespace=blah id=blah/> </Simple> - </queryInput> - </moby:Query> + </moby:mobyData> + </moby:mobyContent> ...

          @@ -379,6 +533,25 @@ returns : boolean

          +

          isSecondaryArticle

          +
          + name     : isSecondaryArticle
          + function : tests XML (text) or an XML DOM node to see if it represents a Secondary article
          + usage    : if (isSecondaryArticle($node)){do something to it}
          + input    : an XML::DOM node, an XML::DOM::Document or straight XML
          + returns  : boolean
          +

          +

          +

          extractRawContent

          +
          + name     : extractRawContent
          + function : pass me an article (Simple, or Collection) and I'll give you the
          +            content AS A STRING - i.e. the raw XML of the contained MOBY Object(s)
          + usage    : extractRawContent($simple)
          + input    : the one element of the output from getArticles
          + returns  : string
          +

          +

          getNodeContentWithArticle

            name     : getNodeContentWithArticle
          @@ -396,16 +569,16 @@
                       For example, in the following XML:
                        ...
                        ...
          -             <moby:Query>
          -                <queryInput>
          +             <moby:mobyContent>
          +                <moby:mobyData>
                               <Simple>
                                 <Sequence namespace=blah id=blah>
                                      <Integer namespace='' id='' articleName="Length">3</Integer>
                                      <String namespace='' id='' articleName="SequenceString">ATG</String>
                                 </Sequence>
                               </Simple>
          -                </queryInput>
          -             </moby:Query>
          +                </moby:mobyData>
          +             </moby:mobyContent>
                        ...
                        ...
                        
          @@ -422,16 +595,6 @@
                         }

          -

          extractRawContent

          -
          - name     : extractRawContent
          - function : pass me an article (Simple, or Collection) and I'll give you the
          -            content AS A STRING - i.e. the raw XML of the contained MOBY Object(s)
          - usage    : extractRawContent($simple)
          - input    : the one element of the output from getArticles
          - returns  : string
          -

          -

          validateNamespaces

            name     : validateNamespaces
          @@ -462,6 +625,15 @@
                       an array-ref of Simple article XML::DOM::Node's

          +

          getServiceNotes

          +
          + name     : getServiceNotes
          + function : to get the content of the Service Notes block of the MOBY message
          + usage    : getServiceNotes($message)
          + args     : $message is either the XML::DOM of the MOBY message, or plain XML
          + returns  : String content of the ServiceNotes block of the MOBY Message
          +

          +

          getCrossReferences

            name     : getCrossReferences
          @@ -496,8 +668,78 @@
            args     : $CENTRAL - your MOBY::Client::Central object
                       $queryTerm - the object type I am interested in
                       \@termlist - the list of object types that I know about
          - returns  : an ontology term as a scalar, or undef if there
          -            is no parent of this node in the nodelist
          + returns : an ontology term and LSID as a scalar, or undef if there + is no parent of this node in the nodelist. + (note that it will only return the term if you give it + term names in the @termList. If you give it + LSID's in the termList, then both the parameters + returned will be LSID's - it doesn't back-translate...) +

          +

          +

          _rearrange (stolen from BioPerl ;-) )

          +
          + Usage     : $object->_rearrange( array_ref, list_of_arguments)
          + Purpose   : Rearranges named parameters to requested order.
          + Example   : $self->_rearrange([qw(SEQUENCE ID DESC)], at param);
          +           : Where @param = (-sequence => $s,
          +           :                    -desc     => $d,
          +           :                    -id       => $i);
          + Returns   : @params - an array of parameters in the requested order.
          +           : The above example would return ($s, $i, $d).
          +           : Unspecified parameters will return undef. For example, if
          +           :        @param = (-sequence => $s);
          +           : the above _rearrange call would return ($s, undef, undef)
          + Argument  : $order : a reference to an array which describes the desired
          +           :          order of the named parameters.
          +           : @param : an array of parameters, either as a list (in
          +           :          which case the function simply returns the list),
          +           :          or as an associative array with hyphenated tags
          +           :          (in which case the function sorts the values 
          +           :          according to @{$order} and returns that new array.)
          +           :          The tags can be upper, lower, or mixed case
          +           :          but they must start with a hyphen (at least the
          +           :          first one should be hyphenated.)
          + Source    : This function was taken from CGI.pm, written by Dr. Lincoln
          +           : Stein, and adapted for use in Bio::Seq by Richard Resnick and
          +           : then adapted for use in Bio::Root::Object.pm by Steve Chervitz,
          +           : then migrated into Bio::Root::RootI.pm by Ewan Birney.
          + Comments  :
          +           : Uppercase tags are the norm, 
          +           : (SAC)
          +           : This method may not be appropriate for method calls that are
          +           : within in an inner loop if efficiency is a concern.
          +           :
          +           : Parameters can be specified using any of these formats:
          +           :  @param = (-name=>'me', -color=>'blue');
          +           :  @param = (-NAME=>'me', -COLOR=>'blue');
          +           :  @param = (-Name=>'me', -Color=>'blue');
          +           :  @param = ('me', 'blue');
          +           : A leading hyphenated argument is used by this function to 
          +           : indicate that named parameters are being used.
          +           : Therefore, the ('me', 'blue') list will be returned as-is.
          +           :
          +           : Note that Perl will confuse unquoted, hyphenated tags as 
          +           : function calls if there is a function of the same name 
          +           : in the current namespace:
          +           :    -name => 'foo' is interpreted as -&name => 'foo'
          +           :
          +           : For ultimate safety, put single quotes around the tag:
          +           :    ('-name'=>'me', '-color' =>'blue');
          +           : This can be a bit cumbersome and I find not as readable
          +           : as using all uppercase, which is also fairly safe:
          +           :    (-NAME=>'me', -COLOR =>'blue');
          +           :
          +           : Personal note (SAC): I have found all uppercase tags to
          +           : be more managable: it involves less single-quoting,
          +           : the key names stand out better, and there are no method naming 
          +           : conflicts.
          +           : The drawbacks are that it's not as easy to type as lowercase,
          +           : and lots of uppercase can be hard to read.
          +           :
          +           : Regardless of the style, it greatly helps to line
          +           : the parameters up vertically for long/complex lists.
          +
          +
          =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/14 19:56:59 1.44 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/14 20:10:35 1.45 @@ -8,7 +8,9 @@ =cut -=head1 Client Side Paradigm +=head2 Client Side Paradigm + +not written yet =cut @@ -51,7 +53,7 @@ # now take the namespace and ID from our input article # (see pod docs for other possibilities) my $namespace = getSimpleArticleNamespaceURI($input); # get namespace - my ($identifier) = getSimpleArticleIDs($input); # get ID (note array output! see pod) + my ($identifier) = getSimpleArticleIDs($input); # get ID (note array output! see pod) # here is where you do whatever manipulation you need to do # for your particular service. @@ -70,9 +72,9 @@ This is a service that: -CONSUMES: base Object in the GO namespace -EXECUTES: Retrieval -PRODUCES: GO_Term (in the GO namespace) + CONSUMES: base Object in the GO namespace + EXECUTES: Retrieval + PRODUCES: GO_Term (in the GO namespace) # this subroutine is called from your dispatch_with line @@ -101,28 +103,28 @@ $MOBY_RESPONSE .= simpleResponse("", "", $ID); next; } else { - my $ns = getSimpleArticleNamespaceURI($input); - (($MOBY_RESPONSE .= simpleResponse("", "", $ID)) && (next)) - unless validateThisNamespace($ns, @validNS); # only do this if you are truly validating namespaces - my ($accession) = defined(getSimpleArticleIDs($ns, [$input]))?getSimpleArticleIDs($ns,[$input]):undef; - unless (defined($accession)){ - $MOBY_RESPONSE .= simpleResponse("", "", $ID); - next; - } - unless ($accession =~/^GO:/){ - $accession = "GO:$accession"; # we still haven't decided on whether id's should include the prefix... - } - $sth->execute($accession); - my ($term, $def) = $sth->fetchrow_array; - if ($term){ - $MOBY_RESPONSE .= simpleResponse(" - - $term - $def - ", "GO_Term_From_ID", $ID) - } else { - $MOBY_RESPONSE .= simpleResponse("", "", $ID) - } + my $ns = getSimpleArticleNamespaceURI($input); + (($MOBY_RESPONSE .= simpleResponse("", "", $ID)) && (next)) + unless validateThisNamespace($ns, @validNS); # only do this if you are truly validating namespaces + my ($accession) = defined(getSimpleArticleIDs($ns, [$input]))?getSimpleArticleIDs($ns,[$input]):undef; + unless (defined($accession)){ + $MOBY_RESPONSE .= simpleResponse("", "", $ID); + next; + } + unless ($accession =~/^GO:/){ + $accession = "GO:$accession"; # we still haven't decided on whether id's should include the prefix... + } + $sth->execute($accession); + my ($term, $def) = $sth->fetchrow_array; + if ($term){ + $MOBY_RESPONSE .= simpleResponse(" + + $term + $def + ", "GO_Term_From_ID", $ID) + } else { + $MOBY_RESPONSE .= simpleResponse("", "", $ID) + } } } @@ -857,45 +859,13 @@ =head2 getArticlesAsObjects - name : getArticlesAsObjects + name : DO NOT USE!! function : get the Simple/Collection articles for a single queryInput or queryResponse node, rethrning them as SimpleArticle, SecondaryArticle, or ServiceInstance objects usage : @articles = getArticles($XML) args : raw XML or XML::DOM of a moby:queryInput, moby:queryResponse block - returns : a list of listrefs; each listref is one component of the queryInput. - a single queryInput/Response may consist of one or more named or unnamed - simple, collection, or parameter articles. - The listref structure is thus [name, $ARTICLE_OBJECT]: - - e.g.: @articles = ['name1', $SimpleArticle] - - generated from the following sample XML: - - - - - - - - or : @articles = ['name1', $CollectionArticle], ['paramname1', $SecondaryArticle] - - generated from the following sample XML: - - - - - - - - - - - - Float - 10 - - + returns : =cut @@ -1327,10 +1297,10 @@ =head2 getServiceNotes name : getServiceNotes - function : - usage : - args : - returns : + function : to get the content of the Service Notes block of the MOBY message + usage : getServiceNotes($message) + args : $message is either the XML::DOM of the MOBY message, or plain XML + returns : String content of the ServiceNotes block of the MOBY Message =cut @@ -1518,7 +1488,7 @@ # _rearrange stolen from BioPerl's Bio::RootI.pm # because it is just so useful! -=head2 _rearrange +=head2 _rearrange (stolen from BioPerl ;-) ) Usage : $object->_rearrange( array_ref, list_of_arguments) Purpose : Rearranges named parameters to requested order. From mwilkinson at pub.open-bio.org Thu Apr 15 10:38:22 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 15 Apr 2004 10:38:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404151438.i3FEcM5S016350@pub.open-bio.org> mwilkinson Thu Apr 15 10:38:22 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv16304/Client Modified Files: CollectionArticle.html ServiceInstance.html SimpleArticle.html Log Message: updating all documentation that has gone out of sync with the code moby-live/Perl/MOBY/Client CollectionArticle.html,1.1,1.2 ServiceInstance.html,1.7,1.8 SimpleArticle.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.html 2003/07/01 15:00:47 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.html 2004/04/15 14:38:22 1.2 @@ -1,8 +1,8 @@ -MOBY::Client::CollectionArticle - a small object describing a MOBY Collection input or output - +MOBY::Client::CollectionArticle - a small object describing the Collection articles from the findService Response message of MOBY Central + @@ -23,8 +23,11 @@
        • articleName
        • Simples
        • addSimple
        • +
        • XML
        • +
        • XML_DOM
        • isSimple
        • isCollection
        • +
        • isSecondary
        • @@ -34,19 +37,52 @@

          NAME

          -

          MOBY::Client::CollectionArticle - a small object describing a MOBY Collection input or output

          +

          MOBY::Client::CollectionArticle - a small object describing the Collection articles from the findService Response message of MOBY Central


          SYNOPSIS

          +

          experimental - please do not use in your code


          DESCRIPTION

          +

          This describes the Collection articles from either the findService Response of MOBY Central +(i.e. the description of the service), or Collection articles +as provided in a service invocation or response message +(i.e. simple articles containing data)

          +

          Basically it parses the following part of a findService response:

          +
          + <Collection articleName="foo">
          +  <Simple>
          +     <objectType>someNbject</objectType>
          +     <Namespace>someNamespace</Namespace>
          +     <Namespace>someNamespace2</Namespace>
          +  </Simple>
          +  <Simple>
          +     <objectType>someNbject</objectType>
          +     <Namespace>someNamespace</Namespace>
          +     <Namespace>someNamespace2</Namespace>
          +  </Simple>
          + </Collection>
          +

          OR it parses the following part of a service invocation or response message:

          +
          + <Collection articleName="foo">
          +  <Simple>
          +    <SomeObject namespace='someNamespace' id='someID'>.....</SomeObject>
          +  </Simple>
          +  <Simple>
          +    <SomeObject namespace='someNamespace' id='someID'>.....</SomeObject>
          +  </Simple>
          + </Collection>
          +

          The articleName is retrieved with ->articleName +The contained Simples are retrieved as MOBY::Client::SimpleArticle objects +using the ->Simples method call.


          AUTHORS

          +

          Mark Wilkinson (markw at illuminae dot com)


          @@ -59,8 +95,11 @@ Usage : my $IN = MOBY::Client::CollectionArticle->new(%args) Function : create CollectionArticle object Returns : MOBY::Client::SimpleArticle object - Args : articleName => $articleName (optional) - Simples => $objectType (required) + Args : either of the following two methods may be used to auto-generate the + object by passing the appropriate XML node as a string, or XML::DOM node object + + XML => $XML + XML_DOM => $XML::DOM::NODE

          articleName

          @@ -91,6 +130,24 @@ Arguments : a new MOBY::Client::SimpleArticle to add to collection

          +

          XML

          +
          + Title     :    XML
          + Usage     :   $SA = $SA->XML($XML)
          + Function  :    set/reset all parameters for this object from the XML
          + Returns   :    MOBY::Client::SimpleArticle
          + Arguments :    (optional) XML fragment from and including <Simple>...</Simple>
          +

          +

          +

          XML_DOM

          +
          + Title     :    XML_DOM
          + Usage     :    $namespaces = $SA->XML_DOM($XML_DOM_NODE)
          + Function  :    set/reset all parameters for this object from the XML::DOM node for <Simple>
          + Returns   :    MOBY::Client::SimpleArticle
          + Arguments :    (optional) an $XML::DOM node from the <Simple> article of a DOM
          +

          +

          isSimple

            Title     :    isSimple
          @@ -100,7 +157,7 @@
                            get both Simple and Collection objects in your
                            Input and output lists, it is good to be able
                            to test what you have in-hand)
          - Returns   :    1 (true)
          + Returns : 0 (false)

          isCollection

          @@ -112,7 +169,16 @@ get both Simple and Collection objects in your Input and output lists, it is good to be able to test what you have in-hand) - Returns : 0 for false + Returns : 1 (true) +

          +

          +

          isSecondary

          +
          + Title     :    isSecondary
          + Usage     :    $boolean = $IN->isSecondary()
          + Function  :    is this a SecondaryArticle type?
          +                (yes, I know this is obvious)
          + Returns   :    0 (true)
          =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html 2003/11/01 18:05:55 1.7 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html 2004/04/15 14:38:22 1.8 @@ -2,7 +2,7 @@ MOBY::Client::ServiceInstance - a small object describing a MOBY service - + @@ -126,10 +126,10 @@

          input

          - Title     :    output
          - Usage     :    $output = $Service->output($args)
          + Title     :    input
          + Usage     :    $input = $Service->input($args)
            Args      :    (optional) listref of SimpleArticle and/or CollectionArticle objects
          - Function  :    get/set output
          + Function  :    get/set input
            Returns   :    listref of MOBY::Client::SimpleArticle
                           and/or MOBY::Client::CollectionArticle objects

          =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.html 2003/07/01 15:00:47 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.html 2004/04/15 14:38:22 1.2 @@ -1,8 +1,8 @@ -MOBY::Client::SimpleArticle - a small object describing a MOBY Simple input/output article - +MOBY::Client::SimpleArticle - a small object describing the Simple articles from the findService Response message of MOBY Central + @@ -23,9 +23,12 @@

        • articleName
        • objectType
        • namespaces
        • +
        • XML
        • +
        • XML_DOM
        • addNamespace
        • isSimple
        • isCollection
        • +
        • isSecondary
        • @@ -35,19 +38,39 @@

          NAME

          -

          MOBY::Client::SimpleArticle - a small object describing a MOBY Simple input/output article

          +

          MOBY::Client::SimpleArticle - a small object describing the Simple articles from the findService Response message of MOBY Central


          SYNOPSIS

          +

          experimental - please do not use in your code


          DESCRIPTION

          +

          This describes the Simple articles from either the findService Response of MOBY Central +(i.e. the description of the service), or Simple articles +as provided in a service invocation or response message +(i.e. simple articles containing data)

          +

          Basically it parses the following part of a findService response:

          +

          <Simple articleName='foo'> + <objectType>someNbject</objectType> + <Namespace>someNamespace</Namespace> + <Namespace>someNamespace2</Namespace> +</Simple>

          +

          OR it parses the following part of a service invocation or response message:

          +

          <Simple articleName='foo'> + <SomeObject namespace='someNamespace' id='someID'>.....</SomeObject> +</Simple>

          +

          The articleName is retrieved with ->articleName +The namespace(s) are retrieved with ->namespaces +The objectType is retrieved with ->objectType +the id (if instantiated) is retrieved with ->id


          AUTHORS

          +

          Mark Wilkinson (markw at illuminae dot com)


          @@ -60,11 +83,11 @@ Usage : my $SA = MOBY::Client::SimpleArticle->new(%args) Function : create SimpleArticle object Returns : MOBY::Client::SimpleArticle object - Args : articleName => $articleName (optional) - objectType => $objectType (required) - namespaces => \@namesapces (optional) - XML_DOM => $XML_DOM node of the simple article (optional) - XML => $XML XML string representing the simple article (optional) + Args : either of the following two methods may be used to auto-generate the + object by passing the appropriate XML node as a string, or XML::DOM node object + + XML => $XML + XML_DOM => $XML::DOM::NODE

          articleName

          @@ -94,6 +117,24 @@ Arguments : (optional) arrayref of namespace strings to set

          +

          XML

          +
          + Title     :    XML
          + Usage     :   $SA = $SA->XML($XML)
          + Function  :    set/reset all parameters for this object from the XML
          + Returns   :    MOBY::Client::SimpleArticle
          + Arguments :    (optional) XML fragment from and including <Simple>...</Simple>
          +

          +

          +

          XML_DOM

          +
          + Title     :    XML_DOM
          + Usage     :    $namespaces = $SA->XML_DOM($XML_DOM_NODE)
          + Function  :    set/reset all parameters for this object from the XML::DOM node for <Simple>
          + Returns   :    MOBY::Client::SimpleArticle
          + Arguments :    (optional) an $XML::DOM node from the <Simple> article of a DOM
          +

          +

          addNamespace

            Title     :    addNamespace
          @@ -124,6 +165,15 @@
                            Input and output lists, it is good to be able
                            to test what you have in-hand)
            Returns   :    0 for false
          +

          +

          +

          isSecondary

          +
          + Title     :    isSecondary
          + Usage     :    $boolean = $IN->isSecondary()
          + Function  :    is this a SecondaryArticle type?
          +                (yes, I know this is obvious)
          + Returns   :    0 (true)
          From mwilkinson at pub.open-bio.org Thu Apr 15 10:38:22 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 15 Apr 2004 10:38:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404151438.i3FEcMdP016323@pub.open-bio.org> mwilkinson Thu Apr 15 10:38:22 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv16304 Modified Files: Central.html Log Message: updating all documentation that has gone out of sync with the code moby-live/Perl/MOBY Central.html,1.12,1.13 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.html,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Perl/MOBY/Central.html 2003/12/02 01:08:24 1.12 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.html 2004/04/15 14:38:22 1.13 @@ -2,7 +2,7 @@ MOBY::Central.pm - API for communicating with the MOBY Central registry - + @@ -155,14 +155,14 @@
        • MOBY, by default, supports three types of Class Relationships: ISA, HAS, and HASA (these are the relationship ontology terms)
        • -
        • notice that, in a HAS and HASA relationships, it is necessary to indicate an article name for each contained object type. Thus, for example, you could have a sequence object that contained a String object with name ``nucleotideSequence'' and an Integer object with the name ``sequenceLength''.
          +
        • notice that, in a HAS and HASA relationships, it is necessary to indicate an article name for each contained object type. Thus, for example, you could have a sequence object that contained a String object with name ``nucleotideSequence'' and an Integer object with the name ``sequenceLength''.
        • Input XML :

          @@ -215,7 +215,7 @@
        • the ISA ontology terms must exist or this registration will fail.
        • -
        • all parameters are required.
          +
        • all parameters are required.
        • email must be valid for later deregistration or updates
        • @@ -306,13 +306,13 @@
        • a service must have at least one Input OR Output Object Class. Either Input or Output may be blank to represent ``PUT'' or ``GET'' services respectively
        • -
        • the contactEmail address must be valid, as it is used to authorize deregistrations and changes to the service you registered.
          +
        • the contactEmail address must be valid, as it is used to authorize deregistrations and changes to the service you registered.
        • -
        • the ``authoritativeService'' tag is used to indicate whether or not the registered service is ``authoritative'' for that transformation. i.e. if anyone else were to perform the same transformation they would have to have obtained the information to do so from you. This is similar to, but not necessarily identical to, mirroring someone elses data, since the data in question may not exist prior to service invocation.
          +
        • the ``authoritativeService'' tag is used to indicate whether or not the registered service is ``authoritative'' for that transformation. i.e. if anyone else were to perform the same transformation they would have to have obtained the information to do so from you. This is similar to, but not necessarily identical to, mirroring someone elses data, since the data in question may not exist prior to service invocation.
        • only Input Secondary articles are defined during registration; Output Secondary objects are entirely optional and may or may not be interpreted Client-side using their articleName tags.
        • -
        • Service Categories:
          +
        • Service Categories:
        • @@ -394,14 +394,14 @@
            There are two forms of Primary articles:
            -
          • Simple - the article consists of a single MOBY Object
            +
          • Simple - the article consists of a single MOBY Object
          • Collection - the article consists of a collection (``bag'') of MOBY Objects (not necessarily the same object type).
            • -
            • Their number/order is not relevant, nor predictable
              +
            • Their number/order is not relevant, nor predictable
            • -
            • If order is important to the service provider, then a collection should not be used, rather the collection should be broken into named Simple parameters. This may impose limitations on the the types of services that can be registered in MOBY Central. If it becomes a serious problem, a new Primary article type will be added in a future revision.
              +
            • If order is important to the service provider, then a collection should not be used, rather the collection should be broken into named Simple parameters. This may impose limitations on the the types of services that can be registered in MOBY Central. If it becomes a serious problem, a new Primary article type will be added in a future revision.
            • The use of more than one Class in a collection is difficult to interpret, though it is equally difficult to envision a service that would require this. It is purposely left losely defined since any given Service Instance can tighten up this definition during the registration process.
            • @@ -416,14 +416,14 @@

              An example of the use of each of these might be another BLAST service, where you provide the sequences that make up the Blast database as well as the sequence to Blast against it. The sequences used to construct the database might be passed as a Collection input article containing multiple Sequence Objects, while the sequence to Blast against it would be a Simple input article consisting of a single Sequence Object.

              There is currently only one form of Secondary article:

                -
              • Secondary - the article may or may not be specifically configured by the client as Input, and may or may not be returned by the Service as output.
                +
              • Secondary - the article may or may not be specifically configured by the client as Input, and may or may not be returned by the Service as output.
              • From simont at pub.open-bio.org Mon Apr 19 10:59:02 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 10:59:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191459.i3JEx2RH008573@pub.open-bio.org> simont Mon Apr 19 10:59:02 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment In directory pub.open-bio.org:/tmp/cvs-serv8555/OntologyDevelopment Log Message: Directory /home/repository/moby/moby-live/Docs/OntologyDevelopment added to the repository moby-live/Docs/OntologyDevelopment - New directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/RCS/directory,v: No such file or directory From simont at pub.open-bio.org Mon Apr 19 10:59:39 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 10:59:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191459.i3JExdJe008636@pub.open-bio.org> simont Mon Apr 19 10:59:39 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs In directory pub.open-bio.org:/tmp/cvs-serv8618/MyGridDocs Log Message: Directory /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs added to the repository moby-live/Docs/OntologyDevelopment/MyGridDocs - New directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs/RCS/directory,v: No such file or directory From simont at pub.open-bio.org Mon Apr 19 11:00:10 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 11:00:10 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191500.i3JF0Awd008727@pub.open-bio.org> simont Mon Apr 19 11:00:10 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv8709/MobyServiceOntologyProtege Log Message: Directory /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege added to the repository moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege - New directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/RCS/directory,v: No such file or directory From simont at pub.open-bio.org Mon Apr 19 11:01:02 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 11:01:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191501.i3JF12Q9008789@pub.open-bio.org> simont Mon Apr 19 11:01:02 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment In directory pub.open-bio.org:/tmp/cvs-serv8772 Added Files: README Log Message: Initial commit of service ontology development moby-live/Docs/OntologyDevelopment README,NONE,1.1 From simont at pub.open-bio.org Mon Apr 19 11:01:03 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 11:01:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191501.i3JF13T1008804@pub.open-bio.org> simont Mon Apr 19 11:01:02 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv8772/MobyServiceOntologyProtege Added Files: MobyServiceOntology.pprj Log Message: Initial commit of service ontology development moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MobyServiceOntology.pprj,NONE,1.1 From simont at pub.open-bio.org Mon Apr 19 11:01:03 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 11:01:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191501.i3JF13Ee008825@pub.open-bio.org> simont Mon Apr 19 11:01:03 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs In directory pub.open-bio.org:/tmp/cvs-serv8772/MyGridDocs Added Files: mygrid-reasoned.daml mygrid.daml Log Message: Initial commit of service ontology development moby-live/Docs/OntologyDevelopment/MyGridDocs mygrid-reasoned.daml,NONE,1.1 mygrid.daml,NONE,1.1 From simont at pub.open-bio.org Mon Apr 19 11:10:17 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 11:10:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191510.i3JFAHhx008927@pub.open-bio.org> simont Mon Apr 19 11:10:17 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv8912 Added Files: MobyServiceOntology.owl Log Message: Service ontology from Protege in OWL format moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MobyServiceOntology.owl,NONE,1.1 From simont at pub.open-bio.org Mon Apr 19 11:10:34 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 11:10:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191510.i3JFAYnV008966@pub.open-bio.org> simont Mon Apr 19 11:10:34 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv8951 Added Files: MOBY_Service_ontology.png Log Message: Service ontology graph from OWLviz plugin moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MOBY_Service_ontology.png,NONE,1.1 From mwilkinson at pub.open-bio.org Tue Apr 20 14:49:45 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 14:49:45 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404201849.i3KInjdG014321@pub.open-bio.org> mwilkinson Tue Apr 20 14:49:45 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14302 Modified Files: OntologyServer.pm Log Message: moving toward LSID compabitibility for the ontology server. moby-live/Perl/MOBY OntologyServer.pm,1.33,1.34 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/02/18 22:23:55 1.33 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 18:49:45 1.34 @@ -164,6 +164,10 @@ =head2 objectExists + moby:newterm will return (0, $message, $MOBYLSID) + newterm will return (0, $message, $MOBYLSID + oldterm will return (1, $message, undef) + newLSID will return (0, $desc, $lsid) =cut @@ -174,9 +178,9 @@ my $sth; return (0, "WRONG ONTOLOGY!",'') unless ($self->ontology eq 'object'); - if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objecttype/)){ - return (1, "external ontology", $term); - } +# if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objecttype/)){ +# return (1, "external ontology", $term); +# } if ($term =~ /^urn\:lsid/){ $sth = $self->dbh->prepare("select object_lsid, object_type, description, authority, contact_email from object where object_lsid = ?"); @@ -184,14 +188,31 @@ $sth = $self->dbh->prepare("select object_lsid, object_type, description, authority, contact_email from object where object_type = ?"); } $sth->execute($term); - my ($id, $type, $desc, $auth, $email) = $sth->fetchrow_array; - if ($id){ - return (1,$desc,$id); - } else { - return (0, "Object Type $term does not exist in the biomoby.org Object Class system\n",''); - } + my ($lsid, $type, $desc, $auth, $email) = $sth->fetchrow_array; + if ($lsid){ # if it is in there, then it has been discovered regardless of being foreign or not + return (1,$desc,$lsid); + } elsif (_isForeignLSID($term)){ # if not in our ontology, but is a foreign LSID, then pass it back verbatim + return (0, "LSID $term does not exist in the biomoby.org Object Class system\n", $term); + } else { # under all other circumstances (i.e. not a term, or a non-existent biomoby LSID) then fail + return (0, "Object type $term does not exist in the biomoby.org Object Class system\n", ''); + } } + +sub _isMOBYLSID { + my ($lsid) = @_; + return 1 if $lsid =~ /^urn\:lsid\:biomoby.org/; + return 0 +} + + +sub _isForeignLSID { + my ($lsid) = @_; + return 0 if $lsid =~ /^urn\:lsid\:biomoby.org/; + return 1 +} + + =head2 createObject =cut From mwilkinson at pub.open-bio.org Tue Apr 20 14:58:05 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 14:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404201858.i3KIw5NH014378@pub.open-bio.org> mwilkinson Tue Apr 20 14:58:05 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14359 Modified Files: OntologyServer.pm Log Message: moving toward LSID compabitibility for the ontology server. moby-live/Perl/MOBY OntologyServer.pm,1.34,1.35 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 18:49:45 1.34 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 18:58:05 1.35 @@ -230,13 +230,26 @@ return (0, "requires a contact email address",'') unless ($args{contact_email}); return (0, "requires a object description",'') unless ($args{description}); my $term = $args{node}; - if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ # if it is an LSID, but not a MOBY LSID, than barf - return (0, "can't create a term in a non-MOBY ontology!", $term); - } + +# if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ # if it is an LSID, but not a MOBY LSID, than barf +# return (0, "can't create a term in a non-MOBY ontology!", $term); +# } my $LSID = ($args{'node'} =~ /urn\:lsid/)?$args{'node'}:$self->setURI($args{'node'}); unless ($LSID){return (0, "Failed during creation of an LSID",'')} + if ($args{'node'} =~ /^urn\:lsid/){ + $sth = $self->dbh->prepare("select object_lsid, object_type, description, authority, contact_email from object where object_lsid = ?"); + } else { + $sth = $self->dbh->prepare("select object_lsid, object_type, description, authority, contact_email from object where object_type = ?"); + } + $sth->execute($term); + my ($lsid, $type, $desc, $auth, $email) = $sth->fetchrow_array; + if ($lsid){ # if it is in there, then the object exists + return (0,"This term already exists: $lsid",$lsid); + } + + $args{description} =~ s/^\s+(.*?)\s+$/$1/s; $args{node} =~ s/^\s+(.*?)\s+$/$1/s; $args{contact_email} =~ s/^\s+(.*?)\s+$/$1/s; @@ -368,20 +381,32 @@ # adds a relationship #subject_node => $term, #relationship => $reltype, -#predicate_node => $objectType, +#object_node => $objectType, #articleName => $articleName, #authority => $auth, #contact_email => $email my ($self, %args) = @_; + return (0, "WRONG ONTOLOGY!",'') unless ($self->ontology eq 'object'); - my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{subject_node}); + + if ($args{subject_node} =~ /^urn:lsid/){ + my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{subject_node}); + } else { + my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{subject_node}); + } return (0, qq{Object type $args{subject_node} does not exist in the ontology},'') unless defined $subj_id; + if ($args{object_node} =~ /^urn:lsid/){ + my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{object_node}); + } else { + my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{object_node}); + } + return (0, qq{Object type $args{object_node} does not exist in the ontology},'') unless defined $subj_id; + + my (@isa) = $self->dbh->selectrow_array(q{select * from object_term2term where object2_id = ?},undef, $subj_id); if (scalar @isa){return (0, qq{Object type $args{subject_node} has existing object dependencies in the ontology. It cannot be changed.},$subj_lsid);} - - my ($obj_id, $obj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{object_node}); # get ID of the related object - defined $obj_lsid || return (0, qq{Object $args{object_node} does not exist in the ontology},''); + my $OE = MOBY::OntologyServer->new(ontology => 'relationship'); my ($success, $desc, $rel_lsid) = $OE->relationshipExists(term => $args{relationship}, ontology => 'object'); From mwilkinson at pub.open-bio.org Tue Apr 20 15:02:19 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 15:02:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404201902.i3KJ2JnR014465@pub.open-bio.org> mwilkinson Tue Apr 20 15:02:19 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14446/MOBY Modified Files: OntologyServer.pm Log Message: more LSID compatibility for object registration moby-live/Perl/MOBY OntologyServer.pm,1.35,1.36 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 18:58:05 1.35 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:02:19 1.36 @@ -238,6 +238,7 @@ my $LSID = ($args{'node'} =~ /urn\:lsid/)?$args{'node'}:$self->setURI($args{'node'}); unless ($LSID){return (0, "Failed during creation of an LSID",'')} + my $sth; if ($args{'node'} =~ /^urn\:lsid/){ $sth = $self->dbh->prepare("select object_lsid, object_type, description, authority, contact_email from object where object_lsid = ?"); } else { @@ -388,20 +389,21 @@ my ($self, %args) = @_; return (0, "WRONG ONTOLOGY!",'') unless ($self->ontology eq 'object'); - + + my ($subj_id, $subj_lsid, $obj_id, $obj_lsid); if ($args{subject_node} =~ /^urn:lsid/){ - my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{subject_node}); + ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{subject_node}); } else { - my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{subject_node}); + ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{subject_node}); } return (0, qq{Object type $args{subject_node} does not exist in the ontology},'') unless defined $subj_id; if ($args{object_node} =~ /^urn:lsid/){ - my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{object_node}); + ($obj_id, $obj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{object_node}); } else { - my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{object_node}); + ($obj_id, $obj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{object_node}); } - return (0, qq{Object type $args{object_node} does not exist in the ontology},'') unless defined $subj_id; + return (0, qq{Object type $args{object_node} does not exist in the ontology},'') unless defined $obj_id; my (@isa) = $self->dbh->selectrow_array(q{select * from object_term2term where object2_id = ?},undef, $subj_id); From mwilkinson at pub.open-bio.org Tue Apr 20 15:10:38 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 15:10:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404201910.i3KJAcND014565@pub.open-bio.org> mwilkinson Tue Apr 20 15:10:38 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14546/MOBY Modified Files: OntologyServer.pm Log Message: allow deregistration of LSIDs from Object ontology moby-live/Perl/MOBY OntologyServer.pm,1.36,1.37 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:02:19 1.36 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:10:38 1.37 @@ -73,7 +73,7 @@ use Carp; use vars qw($AUTOLOAD); use DBI; -use DBD::mysql; +#use DBD::mysql; my $debug = 1; @@ -308,9 +308,9 @@ return (0, "WRONG ONTOLOGY",'') unless ($self->ontology eq 'object'); my $term = $args{term}; - if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ - return (0, "can't delete from external ontology", $term); - } +# if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ +# return (0, "can't delete from external ontology", $term); +# } my $LSID; unless ($term =~ /urn\:lsid/){$LSID = $self->getObjectURI($term)} else {$LSID=$term} From mwilkinson at pub.open-bio.org Tue Apr 20 15:12:32 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 15:12:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404201912.i3KJCWZk014674@pub.open-bio.org> mwilkinson Tue Apr 20 15:12:32 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14655/MOBY Modified Files: OntologyServer.pm Log Message: allow deregistration of LSIDs from Object ontology moby-live/Perl/MOBY OntologyServer.pm,1.37,1.38 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:10:38 1.37 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:12:32 1.38 @@ -73,7 +73,7 @@ use Carp; use vars qw($AUTOLOAD); use DBI; -#use DBD::mysql; +use DBD::mysql; my $debug = 1; From mwilkinson at pub.open-bio.org Tue Apr 20 19:16:31 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 19:16:31 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202316.i3KNGVxq015448@pub.open-bio.org> mwilkinson Tue Apr 20 19:16:31 EDT 2004 Update of /home/repository/moby/moby-live/Perl/Accessories In directory pub.open-bio.org:/tmp/cvs-serv15430/Accessories Log Message: Directory /home/repository/moby/moby-live/Perl/Accessories added to the repository moby-live/Perl/Accessories - New directory rcsdiff: /home/repository/moby/moby-live/Perl/Accessories/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/Accessories/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/Accessories/RCS/directory,v: No such file or directory From mwilkinson at pub.open-bio.org Tue Apr 20 19:19:19 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 19:19:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202319.i3KNJJ4h015550@pub.open-bio.org> mwilkinson Tue Apr 20 19:19:19 EDT 2004 Update of /home/repository/moby/moby-live/Perl/Accessories In directory pub.open-bio.org:/tmp/cvs-serv15535/Accessories Added Files: NamespaceMaintenance.cgi Log Message: adding a cgi page to maintain the MOBY Namespace GO XrefAbbs document. moby-live/Perl/Accessories NamespaceMaintenance.cgi,NONE,1.1 From mwilkinson at pub.open-bio.org Tue Apr 20 19:19:29 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 19:19:29 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202319.i3KNJTTK015597@pub.open-bio.org> mwilkinson Tue Apr 20 19:19:29 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv15574/MOBY Modified Files: Central.pm OntologyServer.pm Log Message: done moby-live/Perl/MOBY Central.pm,1.125,1.126 OntologyServer.pm,1.38,1.39 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.125 retrieving revision 1.126 diff -u -r1.125 -r1.126 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/04 19:08:41 1.125 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/20 23:19:29 1.126 @@ -236,6 +236,7 @@ } return &_error("Malformed authURI - must not have an http:// prefix","") if $auth =~ '[/:]'; return &_error("Malformed authURI - must take the form NNN.NNN.NNN","") unless $auth =~ /\./; +print STDERR "\n\nemail was $email\n\n"; return &_error("Malformed email - must be a valid email address of the form name\@organization.foo","") unless $email =~ /\S\@\S+\.\S+/; # validate that the final ontology will be valid by testing against existing relationships and such @@ -2329,10 +2330,10 @@ return undef unless $term; # and bail out if we didn't succeed $ontology ||="service"; # if we have now succeeded and haven't already taken the ontology then it must be the service ontology - &_LOG("Ontology was $ontology; Term was $term\n"); + &_LOG("Ontology was $ontology; Term was: $term\n"); my $OS = MOBY::OntologyServer->new(ontology => $ontology); my %rels = %{$OS->Relationships(term => $term, expand => $expand_relationship)}; # %rels = $rels{relationship} = [lsid, lsid,lsid] - + &_LOG("\nrels ",(keys %rels),"\n"); my $response="\n"; my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship'); foreach (keys %reltypes){ # for each of our desired types @@ -2340,6 +2341,7 @@ delete $reltypes{$_}; # remove the non-LSID version from the hash $reltypes{$rellsid} = 1; # set the LSID as valid } + &_LOG("\nvalid rels ",(keys %reltypes),"\n"); # now for each of the relationship types that we were returned foreach (keys %rels){ my $rellsid = $OSrel->getRelationshipURI($ontology, $_); @@ -2356,6 +2358,7 @@ $response .= "\n"; } $response .="\n"; + &_LOG("returning $response\n"); return $response; } =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:12:32 1.38 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 23:19:29 1.39 @@ -593,7 +593,7 @@ } if ($term =~ /^urn:lsid:biomoby.org:namespacetype/){ - $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_lsid = ?"); + $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_lsid= ?"); } else { $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_type = ?"); } From mwilkinson at pub.open-bio.org Tue Apr 20 19:19:30 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 19:19:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202319.i3KNJUhi015616@pub.open-bio.org> mwilkinson Tue Apr 20 19:19:29 EDT 2004 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv15574/scripts Modified Files: testMOBYClientCentral_v05.pl Log Message: done moby-live/Perl/scripts testMOBYClientCentral_v05.pl,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2004/01/02 20:39:23 1.13 +++ /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2004/04/20 23:19:29 1.14 @@ -5,7 +5,7 @@ ($reg, $test, $expect) = @_; die "\a\a\aREG OBJECT MALFORMED" unless $reg; if ($reg->success == $expect){ - print "test $test\t\t[PASS]\n"; + print "test $test\t\t[PASS]",($reg->registration_id),"\n"; } else { print "test $test\t\t[FAIL]\n",$reg->message,"\n\n"; } From mwilkinson at pub.open-bio.org Tue Apr 20 19:24:25 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 19:24:25 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202324.i3KNOPFe015724@pub.open-bio.org> mwilkinson Tue Apr 20 19:24:25 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv15701/MOBY Modified Files: Central.pm OntologyServer.pm Log Message: backing out incorrect changes I just committed moby-live/Perl/MOBY Central.pm,1.126,1.127 OntologyServer.pm,1.39,1.40 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.126 retrieving revision 1.127 diff -u -r1.126 -r1.127 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/20 23:19:29 1.126 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/20 23:24:25 1.127 @@ -236,7 +236,6 @@ } return &_error("Malformed authURI - must not have an http:// prefix","") if $auth =~ '[/:]'; return &_error("Malformed authURI - must take the form NNN.NNN.NNN","") unless $auth =~ /\./; -print STDERR "\n\nemail was $email\n\n"; return &_error("Malformed email - must be a valid email address of the form name\@organization.foo","") unless $email =~ /\S\@\S+\.\S+/; # validate that the final ontology will be valid by testing against existing relationships and such @@ -2330,10 +2329,10 @@ return undef unless $term; # and bail out if we didn't succeed $ontology ||="service"; # if we have now succeeded and haven't already taken the ontology then it must be the service ontology - &_LOG("Ontology was $ontology; Term was: $term\n"); + &_LOG("Ontology was $ontology; Term was $term\n"); my $OS = MOBY::OntologyServer->new(ontology => $ontology); my %rels = %{$OS->Relationships(term => $term, expand => $expand_relationship)}; # %rels = $rels{relationship} = [lsid, lsid,lsid] - &_LOG("\nrels ",(keys %rels),"\n"); + my $response="\n"; my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship'); foreach (keys %reltypes){ # for each of our desired types @@ -2341,7 +2340,6 @@ delete $reltypes{$_}; # remove the non-LSID version from the hash $reltypes{$rellsid} = 1; # set the LSID as valid } - &_LOG("\nvalid rels ",(keys %reltypes),"\n"); # now for each of the relationship types that we were returned foreach (keys %rels){ my $rellsid = $OSrel->getRelationshipURI($ontology, $_); @@ -2358,7 +2356,6 @@ $response .= "\n"; } $response .="\n"; - &_LOG("returning $response\n"); return $response; } =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 23:19:29 1.39 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 23:24:25 1.40 @@ -593,7 +593,7 @@ } if ($term =~ /^urn:lsid:biomoby.org:namespacetype/){ - $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_lsid= ?"); + $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_lsid = ?"); } else { $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_type = ?"); } From mwilkinson at pub.open-bio.org Tue Apr 20 19:24:26 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 19:24:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202324.i3KNOQMH015743@pub.open-bio.org> mwilkinson Tue Apr 20 19:24:25 EDT 2004 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv15701/scripts Modified Files: testMOBYClientCentral_v05.pl Log Message: backing out incorrect changes I just committed moby-live/Perl/scripts testMOBYClientCentral_v05.pl,1.14,1.15 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2004/04/20 23:19:29 1.14 +++ /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2004/04/20 23:24:25 1.15 @@ -5,7 +5,7 @@ ($reg, $test, $expect) = @_; die "\a\a\aREG OBJECT MALFORMED" unless $reg; if ($reg->success == $expect){ - print "test $test\t\t[PASS]",($reg->registration_id),"\n"; + print "test $test\t\t[PASS]\n"; } else { print "test $test\t\t[FAIL]\n",$reg->message,"\n\n"; } From gordonp at pub.open-bio.org Wed Apr 21 13:22:26 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Wed, 21 Apr 2004 13:22:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404211722.i3LHMQ3e014293@pub.open-bio.org> gordonp Wed Apr 21 13:22:26 EDT 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv14268/client Modified Files: CentralImpl.java Log Message: Fixed bug (extra input def closing tags) in service search template building moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.11,1.12 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/02 16:40:23 1.11 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/21 17:22:26 1.12 @@ -19,9 +19,6 @@ import java.io.*; import java.net.*; -//import org.apache.xerces.parsers.*; - - /** * A default implementation of the * interface {@link org.biomoby.shared.Central Central} @@ -337,7 +334,6 @@ buf.append ("\n\n"); MobyData[] pi = service.getPrimaryInputs(); if (pi.length > 0) { - buf.append ("\n\n"); for (int i = 0; i < pi.length; i++) buf.append (pi[i].toXML()); } @@ -1173,10 +1169,8 @@ result = doCall (methodName, new Object[] { }); else result = doCall (methodName, new Object[] { inputXML }); - - if (result == null) - throw new MobyException ("Returned result is null."); - + if (result == null) + throw new MobyException ("Returned result is null."); if (result instanceof String) return (String)result; if (result instanceof String[]) { From gordonp at pub.open-bio.org Wed Apr 21 13:26:47 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Wed, 21 Apr 2004 13:26:47 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404211726.i3LHQlsu014346@pub.open-bio.org> gordonp Wed Apr 21 13:26:46 EDT 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv14325 Added Files: MobyDataInstance.java MobyDataSecondaryInstance.java MobyDataServiceAssocInstance.java MobyDataSetInstance.java MobyDataSimpleInstance.java MobyPrefixResolver.java SOAPException.java Log Message: Added initial version of core classes required to create/display/query with instances of MOBY data moby-live/Java/src/main/org/biomoby/shared MobyDataInstance.java,NONE,1.1 MobyDataSecondaryInstance.java,NONE,1.1 MobyDataServiceAssocInstance.java,NONE,1.1 MobyDataSetInstance.java,NONE,1.1 MobyDataSimpleInstance.java,NONE,1.1 MobyPrefixResolver.java,NONE,1.1 SOAPException.java,NONE,1.1 From gordonp at pub.open-bio.org Wed Apr 21 13:28:58 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Wed, 21 Apr 2004 13:28:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404211728.i3LHSwQt014386@pub.open-bio.org> gordonp Wed Apr 21 13:28:58 EDT 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv14365 Added Files: MobyRequest.java Log Message: Initial version of Java class implementing service invocation (input MobyData objects, output MobyData objects) moby-live/Java/src/main/org/biomoby/client MobyRequest.java,NONE,1.1 From gordonp at pub.open-bio.org Wed Apr 21 13:56:49 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Wed, 21 Apr 2004 13:56:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404211756.i3LHunGx014626@pub.open-bio.org> gordonp Wed Apr 21 13:56:49 EDT 2004 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv14601 Modified Files: ChangeLog Log Message: Included service invocation implementation info moby-live/Java/docs ChangeLog,1.11,1.12 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/04/02 16:40:23 1.11 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/04/21 17:56:49 1.12 @@ -1,3 +1,31 @@ +2004-04-21 Paul Gordon + + * Implemented Moby data instance classes for simples, collections, + secondary inputs in org.biomoby.shared.*; + + * Implemented namespace resolver for retrieval of MOBY attributes in DOM fragments, + default namespace mapping for XPath, etc. + + * Implemented org.biomoby.client.MobyRequest, which handles the SOAP transactions + for service invocation. Takes in Moby data objects, outputs Moby data objects + e.g. + // Assumes you already have a service (mobyService) and data (mobyInputData) around + mobyRequest = new MobyRequest(new CentralImpl()); + mobyRequest.setDebugMode(true); + mobyRequest.setService(mobyService); + mobyRequest.setInput((MobyDataInstance[]) mobyInputData); + try{ + mobyRequest.invokeService(); + } catch(MobyException mobye){ + System.err.println("Failure in MOBY protocol: " + mobye); + } catch(SOAPException soape){ + System.err.println("Failure in SOAP transaction: " + soape); + } catch(NOsUccessException nse){ + System.err.println("Failure in MOBY logic (input was not acceptable " + + "for this service)" + nse); + } + + 2004-04-02 Paul Gordon * Changed XML parsing to JAXP based interface that works on more platforms From simont at pub.open-bio.org Wed Apr 28 11:56:14 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Wed, 28 Apr 2004 11:56:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404281556.i3SFuESq017669@pub.open-bio.org> simont Wed Apr 28 11:56:14 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv17654 Added Files: MobyServiceOntology.rdf-xml Log Message: rdf-xml document that is needed by Protege for the .pprj file moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MobyServiceOntology.rdf-xml,NONE,1.1 From simont at pub.open-bio.org Wed Apr 28 14:45:19 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Wed, 28 Apr 2004 14:45:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404281845.i3SIjJTP018191@pub.open-bio.org> simont Wed Apr 28 14:45:19 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv18172 Modified Files: MobyServiceOntology.owl Log Message: updated OWL file in sync with .pprj moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MobyServiceOntology.owl,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MobyServiceOntology.owl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MobyServiceOntology.owl 2004/04/19 15:10:16 1.1 +++ /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MobyServiceOntology.owl 2004/04/28 18:45:19 1.2 @@ -20,291 +20,412 @@ >0.1 - + + + + + + + + + + + - + + takes input object and returns a visual representation of that object - plot, graph, image, etc. - + - + - + + returns a translation of the input into a different form - + - + - + - + - + + TODO: Need to explore this more closely, current subclass structure seems limiting + - + takes group of input objects and filters them by a specified criteria, returns a subset of the group + >takes input object and converts it to another format or representation - + + removal of services from central repository - + - + takes input object and returns a visual representation of that object - plot, graph, image, etc. + >a service that performs an bioinformatic analysis upon the input object(s). Inputs are biologically meaningful things. - + - + searches a protein database + >operate on databases to add, delete, update data - + - + + searches a literature database - + - + returns a translation of the input into a different form + >searches nucleotide database - + - + + + + A dictionary-type service that provides definitions for supplied terms + - - true - - - - + - + + + + - + + alignment using tertiary structure comparison, eg. STAMP - - - - + - + + operate on collections of objects - + + + takes input and predicts some property of the input object based on specific algorithms + + - + + + + + + + + + All services that do something related to the bioinformatics applications, data, analyses, etc. themselves. As distinct from services that deal with webservice computing infrastructure - service registration, deregisration, etc. - + >Service that aligns two objects - + + takes object(s) and breaks apart into subobjects + + + + root of bioMOBY Object ontology + + + service that takes an input and parses it, analyzing the parts of the input document, returning an organized collection of the parts back to the calling application. - + - + - - - - - TODO: Need to explore this more closely, current subclass structure seems limiting - - + + takes input object and converts it to another format or representation + >inserts input object into something - database, file - + - + - takes input object and performs digestion, returns collection of subobjects - eg. restriction analysis of DNA, digestion of protein by trypsin, etc. - + - + + + + + + - - - - - - + - + - + - - + + prediction of structural features - eg coils, sheets in protein + + + + - + - + operate on databases to add, delete, update data + >provides a resolution service, eg LSID resolution - + a service that performs an bioinformatic analysis upon the input object(s). Inputs are biologically meaningful things. - + >validates the format of the input, eg SQUIZZ tool + - - takes a list of input objects and groups them accoring to criteria, returns a collection of the grouped objects or the same list with group information included. + - + - - + + + takes input and finds features based on comparisons to known things, eg. restriction site sequence (as opposed to prediction by algorithm) - + returns a summarized version of the input - + >service that calculates something: pI of protein sequence, MWt, Hydrophobicity, etc. + - + - + - + + + + - + + + + searches a literature database + >predicts the physical location of the input object based on some analysis - eg. protein location within the cell based on signal peptide, transmembrane regions, etc. - + - + + + searches nucleotide database + >predicts the existence of various features in the input object through the use of a specific algorithm - eg. gene prediction. + - - + + + Calculates a protein's accurate molecular weight - - + + + + - + + + + + + + + + + + + + + A dictionary-type service that provides definitions for supplied terms - + >services that send data to and from a registry - that perform a registry transaction of some kind. - + - - + + + takes group of input objects and filters them by a specified criteria, returns a subset of the group - + - + alignment using tertiary structure comparison, eg. STAMP + >searches a protein database - - + + + + - + - + + + + + + + + + + true + + + + operate on collections of objects + >service that is related to computing infrastructure, does not operate on biological object(s). Eg. performing webservice registration + + + - + searches a database using supplied input objects as search criteria, returns a list of hits + >a service that performs a task upon biological or objects - + + + + + + + + + + + + + + + + + + + + + + takes input object and performs digestion, returns collection of subobjects - eg. restriction analysis of DNA, digestion of protein by trypsin, etc. + + + + + + + + + takes a list of input objects and groups them accoring to criteria, returns a collection of the grouped objects or the same list with group information included. + + + + + + + returns a summarized version of the input + + + + + calculates a protein's isoelectric point + + + + + + + Service thats main function is to take an input and retrieves information related to the input, eg. using a term to retrieve a definition, a genbank accession to get a flat file. - - + takes input and predicts some property of the input object based on specific algorithms + >searches a database using supplied input objects as search criteria, returns a list of hits + + + - translates a nucleic acid sequence to a protein sequence - - - + - - - - - - - - + Root of the bioMOBY service ontology - - - Service that aligns two objects - - - - - - registers services with central repository, eg. MOBY Central - - - takes object(s) and breaks apart into subobjects - + + @@ -313,43 +434,26 @@ service searches sequence data for known patterns - - - - - - - - - root of bioMOBY Object ontology - - - service that takes an input and parses it, analyzing the parts of the input document, returning an organized collection of the parts back to the calling application. - + manipulation services - take input objects and manipulate them in some way - - + + searches for the occurance of known pattern(s) - eg. transcription factor binding sites + Not sure if the method should be defined by the ontology at this level + performs some type of cluster analysis on input data - - searches for the occurance of known pattern(s) - eg. transcription factor binding sites - - - - @@ -359,46 +463,25 @@ - repeat finding in sequence data - - - - inserts input object into something - database, file - - - + - - - - - - - - - returns the definition of a keyword as defined in a particular dictionary of terms. - - - - + + prediction of structural features - eg coils, sheets in protein - - + >Calculates the melting point of a given DNA sequence - - - provides a resolution service, eg LSID resolution - - - - - - validates the format of the input, eg SQUIZZ tool - - service deletes data from a database - - - takes input and finds features based on comparisons to known things, eg. restriction site sequence (as opposed to prediction by algorithm) - + - - - - service that calculates something: pI of protein sequence, MWt, Hydrophobicity, etc. - Allows registration of objects (and/or services) in specified repositories. - - - - - - - - - - - - - - predicts the physical location of the input object based on some analysis - eg. protein location within the cell based on signal peptide, transmembrane regions, etc. + @@ -490,24 +536,16 @@ - - - - - - - - predicts the existence of various features in the input object through the use of a specific algorithm - eg. gene prediction. - - - + + Predicts the hydrophilic/hydrophobic proile of a sequence + From simont at pub.open-bio.org Wed Apr 28 14:48:41 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Wed, 28 Apr 2004 14:48:41 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404281848.i3SImfuD018245@pub.open-bio.org> simont Wed Apr 28 14:48:41 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv18226 Modified Files: MOBY_Service_ontology.png Log Message: Updated to be in sync with OWL and pprj files. moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MOBY_Service_ontology.png,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MOBY_Service_ontology.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MOBY_Service_ontology.png 2004/04/19 15:10:34 1.1 and /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MOBY_Service_ontology.png 2004/04/28 18:48:41 1.2 differ rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MOBY_Service_ontology.png: diff failed From ambrose at pub.open-bio.org Thu Apr 29 14:03:52 2004 From: ambrose at pub.open-bio.org (Ambrose Ng) Date: Thu, 29 Apr 2004 14:03:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404291803.i3TI3q7S022533@pub.open-bio.org> ambrose Thu Apr 29 14:03:52 EDT 2004 Update of /home/repository/moby/moby-live/Perl/Accessories In directory pub.open-bio.org:/tmp/cvs-serv22507/Perl/Accessories Modified Files: NamespaceMaintenance.cgi Log Message: updated error catching on namespace maintenance cgi page moby-live/Perl/Accessories NamespaceMaintenance.cgi,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Accessories/NamespaceMaintenance.cgi,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/Accessories/NamespaceMaintenance.cgi 2004/04/20 23:19:19 1.1 +++ /home/repository/moby/moby-live/Perl/Accessories/NamespaceMaintenance.cgi 2004/04/29 18:03:52 1.2 @@ -68,7 +68,7 @@ print "* = required fields",p, " --------",p, - "Full abbreviation will be \"authority abbr_identifier abbreviation\" \"GeneDB_Tbrucei\"", + "Full abbreviation will be \"authority abbreviation_identifier abbreviation\" e.g. \"GeneDB_Tbrucei\"", start_form, table( Tr(td("authority abbreviation* "),td(textfield(-name => 'authabvr', -class => "require"),"e.g.: GeneDB")), @@ -79,8 +79,8 @@ Tr(td("contact email* "),td(textfield(-name =>'email1', -class => "require"),"@",textfield(-name => 'email2', -class => "require" ),"e.g.: example\@email.ca")), Tr(td("object "),td(textfield('object'),"e.g.: Gene identifier.")), Tr(td("generic url* "), - td(popup_menu(-name=>'urltype', - -values=>['choose','http://','https://'], -class => "require" ),textfield(-name => 'url', -class => "require"),"e.g.: http\:\/\/www.genedb.org\/tryp ")), + td(popup_menu(-name=>'urltype',-class => "require" , + -values=>['choose','http://','https://']),textfield(-name => 'url', -class => "require"),"e.g.: http\:\/\/www.genedb.org\/tryp ")), Tr(td("synonym "),td(textarea('syn'),"e.g.: SP, SWP, SWISS-PROT. one entry per line")), Tr(td("example_id "),td(textfield('example_id'),"e.g.: Tb927.1.5250")), Tr(td("url_syntax "), @@ -112,13 +112,13 @@ Tr(td("authority abbreviation: "),td($authabvr),(hidden('authabvr')),(hidden('namespace_id'))), Tr(td("identifier abbreviation: "),td($namespacetype),(hidden('namespacetype'))), Tr(td"--------"), - Tr(td("description* "),td(textarea('desc'),"Type a short description here about the entry.")), - Tr(td("authority* "),td(textfield('auth'),"e.g.: www.genedb.org")), - Tr(td("contact email* "),td(textfield('email1'),"@",textfield('email2'),"e.g.: example\@email.ca")), + Tr(td("description* "),td(textarea(-name =>'desc', -class => "require"),"Type a short description here about the entry.")), + Tr(td("authority* "),td(textfield(-name =>'auth', -class => "require"),"e.g.: www.genedb.org")), + Tr(td("contact email* "),td(textfield(-name=>'email1', -class => "require"),"@",textfield(-name =>'email2', -class=> "require"),"e.g.: example\@email.ca")), Tr(td("object "),td(textfield('object'),"e.g.: Gene identifier.")), Tr(td("generic url* "), - td(popup_menu(-name=>'urltype', - -values=>['choose','http://','https://']),textfield('url'),"e.g.: http\:\/\/www.genedb.org\/tryp ")), + td(popup_menu(-name=>'urltype',-class=>"require", + -values=>['choose','http://','https://']),textfield(-name=>'url',-class=>"require"),"e.g.: http\:\/\/www.genedb.org\/tryp ")), Tr(td("synonym "),td(textarea('syn'),"e.g.: SP, SWP, SWISS-PROT. one entry per line")), Tr(td("example_id "),td(textfield('example_id'),"e.g.: Tb927.1.5250")), Tr(td("url_syntax "), @@ -231,7 +231,7 @@ print "unfilled description field",hr; return 1; } - elsif (!$Param{email1} or !$Param{email2}) { + elsif (!$Param{email1} or !$Param{email2} or !($Param{email2} =~ /\./)) { print "invalid email address",hr; return 1; } From mwilkinson at pub.open-bio.org Thu Apr 29 18:28:03 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 29 Apr 2004 18:28:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404292228.i3TMS3K6023057@pub.open-bio.org> mwilkinson Thu Apr 29 18:28:03 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv23038/MOBY Modified Files: CommonSubs.pm Log Message: implementing API changes into CommonSubs. It is only the messaging structure that has changed, so MOBY::Central and Clinet::Central did not need to be updated. Testing this now...hopefully it will work moby-live/Perl/MOBY CommonSubs.pm,1.45,1.46 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/14 20:10:35 1.45 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/29 22:28:03 1.46 @@ -254,7 +254,7 @@ 2. queryID (undef for Secondary parameters) 3. $data - the data takes several forms a. $article XML::DOM node for Simples - ... + ... b. \@article XML:DOM nodes for Collections c. $secondary XML::DOM node @@ -264,10 +264,10 @@ sub genericServiceInputParser { my ($message) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = getInputs($message); # returns XML::DOM nodes ... + my @queries = getInputs($message); # returns XML::DOM nodes ... foreach my $query(@queries){ - my $queryID = getInputID($query); # get the queryID attribute of the queryInput + my $queryID = getInputID($query); # get the queryID attribute of the mobyData my @input_articles = getArticles($query); # get the Simple/Collection/Secondary articles making up this query ... or ... or ... foreach my $input(@input_articles){ # input is a listref my ($articleName, $article) = @{$input}; # get the named article @@ -304,7 +304,7 @@ for example, the input message: - + @@ -312,7 +312,7 @@ Float 10 - + will become: (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module) @@ -330,7 +330,7 @@ With inputs that have collections these are presented as a listref of Simple article DOM's. So for the following message: - + @@ -343,7 +343,7 @@ Float 10 - + will become @@ -361,11 +361,11 @@ sub complexServiceInputParser { my ($message) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = getInputs($message); # returns XML::DOM nodes ... + my @queries = getInputs($message); # returns XML::DOM nodes ... my %input_parameters; # $input_parameters{$queryID} = [ foreach my $query(@queries){ - my $queryID = getInputID($query); # get the queryID attribute of the queryInput + my $queryID = getInputID($query); # get the queryID attribute of the mobyData my @input_articles = getArticles($query); # get the Simple/Collection/Secondary articles making up this query ... or ... or ... foreach my $input(@input_articles){ # input is a listref my ($articleName, $article) = @{$input}; # get the named article @@ -386,12 +386,11 @@ =head2 getArticles name : getArticles - function : get the Simple/Collection/Parameter articles for a single queryInput - or queryResponse node + function : get the Simple/Collection/Parameter articles for a single mobyData usage : @articles = getArticles($XML) args : raw XML or XML::DOM of a queryInput, mobyData, or queryResponse block (e.g. from getInputs) - returns : a list of listrefs; each listref is one component of the queryInput. - a single queryInput/Response may consist of one or more named or unnamed + returns : a list of listrefs; each listref is one component of the queryInput or mobyData block + a single block may consist of one or more named or unnamed simple, collection, or parameter articles. The listref structure is thus [name, $ARTICLE_DOM]: @@ -399,17 +398,17 @@ generated from the following sample XML: - + - + or : @articles = ['name1', $COLL_DOM], ['paramname1', $PARAM_DOM] generated from the following sample XML: - + @@ -422,7 +421,7 @@ Float 10 - + =cut @@ -471,10 +470,10 @@ sub genericServiceInputParserAsObject { my ($message) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = getInputs($message); # returns XML::DOM nodes ... - + my @queries = getInputs($message); # returns XML::DOM nodes ... + foreach my $query(@queries){ - my $queryID = getInputID($query); # get the queryID attribute of the queryInput + my $queryID = getInputID($query); # get the queryID attribute of the mobyData my @input_articles = getArticlesAsObjects($query); # get the Simple/Collection articles making up this query ... or ... or ...isCollection){ @@ -621,16 +620,17 @@ } + =head2 simpleResponse name : simpleResponse - function : wraps a simple article in the appropriate queryResponse structure + function : wraps a simple article in the appropriate (mobyData) structure usage : $resp .= &simpleResponse($object, 'MyArticleName', $queryID); args : (in order) $object - (optional) a MOBY Object as raw XML $article - (optional) an articeName for this article $query - (optional, but strongly recommended) the queryID value for the - queryInput block to which you are responding + mobyData block to which you are responding notes : as required by the API you must return a response for every input. If one of the inputs was invalid, you return a valid (empty) MOBY response by calling &simpleResponse(undef, undef, $queryID) with no arguments. @@ -647,19 +647,19 @@ $articleName ||=""; if ($articleName) { return " - + $data - + "; } elsif($data) { return " - + $data - + "; } else { return " - + "; } } @@ -671,7 +671,7 @@ my $doc = $parser->parse($query); $query = $doc->getDocumentElement(); } - return '' unless $query->getTagName =~/queryInput/; + return '' unless ($query->getTagName =~/queryInput/ || $query->getTagName =~/mobyData/); my $id = $query->getAttribute('queryID'); $id ||= $query->getAttribute('moby:queryID'); return $id; @@ -681,12 +681,12 @@ =head2 collectionResponse name : collectionResponse - function : wraps a set of articles in the appropriate queryResponse structure + function : wraps a set of articles in the appropriate mobyData structure usage : return responseHeader . &collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter; args : (in order) \@objects - (optional) a listref of MOBY Objects as raw XML $article - (optional) an articeName for this article - $queryID - (optional, but strongly recommended) the queryInput ID + $queryID - (optional, but strongly recommended) the mobyData ID to which you are responding notes : as required by the API you must return a response for every input. If one of the inputs was invalid, you return a valid (empty) MOBY @@ -701,7 +701,7 @@ $data ||=[]; $qID ||= ''; unless ((ref($data) =~ /array/i) && $data->[0]){ # we're expecting an arrayref as input data,and it must not be empty - return ""; + return ""; } foreach (@{$data}){ @@ -717,17 +717,17 @@ } if ($articleName) { return " - + $content - + "; } else { return " - + $content - + "; } } @@ -762,7 +762,7 @@ $notes ||=""; my $xml = "". "". - ""; + ""; if ($notes){ my $encodednotes = HTML::Entities::encode($notes); $xml .="$encodednotes"; @@ -786,7 +786,7 @@ sub responseFooter { - return ""; + return ""; } @@ -794,7 +794,7 @@ =head2 getInputs name : getInputs - function : get the queryInput block(s) as XML::DOM nodes + function : get the mobyData block(s) as XML::DOM nodes usage : @queryInputs = getInputArticles($XML) args : the raw XML of a query, or an XML::DOM document returns : a list of XML::DOM::Node's, each is a queryInput or mobyData block. @@ -817,8 +817,8 @@ my @queries; foreach my $querytag('queryInput', 'moby:queryInput', 'mobyData', 'moby:mobyData'){ - my $x = $moby->getElementsByTagName($querytag); # get the queryInput block - for (0..$x->getLength-1){ # there may be more than one queryInput per message + my $x = $moby->getElementsByTagName($querytag); # get the mobyData block + for (0..$x->getLength-1){ # there may be more than one mobyData per message push @queries, $x->item($_); } } @@ -860,11 +860,11 @@ =head2 getArticlesAsObjects name : DO NOT USE!! - function : get the Simple/Collection articles for a single queryInput + function : get the Simple/Collection articles for a single mobyData or queryResponse node, rethrning them as SimpleArticle, SecondaryArticle, or ServiceInstance objects usage : @articles = getArticles($XML) - args : raw XML or XML::DOM of a moby:queryInput, moby:queryResponse block + args : raw XML or XML::DOM of a moby:mobyData block returns : =cut @@ -977,13 +977,13 @@ my $x; foreach ('queryInput', 'moby:queryInput', 'mobyData', 'moby:mobyData'){ - $x = $moby->getElementsByTagName($_); # get the queryInput block + $x = $moby->getElementsByTagName($_); # get the mobyData block last if $x->item(0); } return undef unless $x->item(0); # in case there was no match at all my @queries; - for (0..$x->getLength-1){ # there may be more than one queryInput per message + for (0..$x->getLength-1){ # there may be more than one mobyData per message my @this_query; foreach my $child($x->item($_)->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace From mwilkinson at pub.open-bio.org Thu Apr 29 18:37:57 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 29 Apr 2004 18:37:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404292237.i3TMbv5I023169@pub.open-bio.org> mwilkinson Thu Apr 29 18:37:57 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv23150/MOBY Modified Files: CommonSubs.pm Log Message: mismatched XML tag fixed moby-live/Perl/MOBY CommonSubs.pm,1.46,1.47 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/29 22:28:03 1.46 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/29 22:37:57 1.47 @@ -786,7 +786,7 @@ sub responseFooter { - return ""; + return ""; } From gss at pub.open-bio.org Thu Apr 1 00:23:46 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:23:46 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010023.i310NkO4000887@pub.open-bio.org> gss Wed Mar 31 19:23:46 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet In directory pub.open-bio.org:/tmp/cvs-serv862/org/smoby/tools/server/servlet Modified Files: AbstractMobyServlet.java Log Message: Minor incremental changes moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet AbstractMobyServlet.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet/AbstractMobyServlet.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet/AbstractMobyServlet.java 2004/03/30 21:57:48 1.4 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet/AbstractMobyServlet.java 2004/04/01 00:23:46 1.5 @@ -6,10 +6,10 @@ import javax.servlet.*; import javax.servlet.http.*; -import org.apache.commons.httpclient.util.DateParseException; -import org.apache.commons.httpclient.util.DateParser; -import org.smoby.tools.common.graph.MOBYGraph; -import org.smoby.tools.common.vocabulary.MOBY; +import org.apache.commons.httpclient.util.*; +import org.smoby.tools.common.graph.*; +import org.smoby.tools.common.vocabulary.*; +import com.hp.hpl.jena.rdf.model.*; /** * This abstract class serves as a base class for MOBY servlets. From gss at pub.open-bio.org Thu Apr 1 00:27:37 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:27:37 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010027.i310Rblf001053@pub.open-bio.org> gss Wed Mar 31 19:27:37 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org In directory pub.open-bio.org:/tmp/cvs-serv1029/go.org Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:28:49 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:28:49 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010028.i310SnJ0001206@pub.open-bio.org> gss Wed Mar 31 19:28:49 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org In directory pub.open-bio.org:/tmp/cvs-serv1182/sgd.org Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:28 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:28 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310USS4001277@pub.open-bio.org> gss Wed Mar 31 19:30:28 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/.myeclipse In directory pub.open-bio.org:/tmp/cvs-serv1253/.myeclipse Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/.myeclipse added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/.myeclipse - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/.myeclipse/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/.myeclipse/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/.myeclipse/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:28 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:28 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310USqI001295@pub.open-bio.org> gss Wed Mar 31 19:30:28 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv1253/WebRoot Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:28 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:28 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310USKq001352@pub.open-bio.org> gss Wed Mar 31 19:30:28 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes In directory pub.open-bio.org:/tmp/cvs-serv1253/WebRoot/WEB-INF/classes Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:28 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:28 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310USC9001313@pub.open-bio.org> gss Wed Mar 31 19:30:28 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/META-INF In directory pub.open-bio.org:/tmp/cvs-serv1253/WebRoot/META-INF Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/META-INF added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/META-INF - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/META-INF/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/META-INF/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/META-INF/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:29 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:29 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310UT7L001459@pub.open-bio.org> gss Wed Mar 31 19:30:29 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/go/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv1253/src/org/go/vocabulary Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/go/vocabulary added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/go/vocabulary - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/go/vocabulary/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/go/vocabulary/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/go/vocabulary/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:28 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:28 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310UScl001374@pub.open-bio.org> gss Wed Mar 31 19:30:28 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/lib In directory pub.open-bio.org:/tmp/cvs-serv1253/WebRoot/WEB-INF/lib Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/lib added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/lib - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/lib/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/lib/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/lib/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:28 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:28 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310USgr001333@pub.open-bio.org> gss Wed Mar 31 19:30:28 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF In directory pub.open-bio.org:/tmp/cvs-serv1253/WebRoot/WEB-INF Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:28 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:28 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310USb5001398@pub.open-bio.org> gss Wed Mar 31 19:30:28 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src In directory pub.open-bio.org:/tmp/cvs-serv1253/src Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/src - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:29 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:29 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310UTRh001437@pub.open-bio.org> gss Wed Mar 31 19:30:28 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/go In directory pub.open-bio.org:/tmp/cvs-serv1253/src/org/go Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/go added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/go - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/go/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/go/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/go/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:28 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:28 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310USnp001416@pub.open-bio.org> gss Wed Mar 31 19:30:28 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org In directory pub.open-bio.org:/tmp/cvs-serv1253/src/org Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310Ud6E001538@pub.open-bio.org> gss Wed Mar 31 19:30:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv1496/WebRoot Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310UdBJ001620@pub.open-bio.org> gss Wed Mar 31 19:30:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/lib In directory pub.open-bio.org:/tmp/cvs-serv1496/WebRoot/WEB-INF/lib Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/lib added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/lib - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/lib/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/lib/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/lib/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310UdLp001557@pub.open-bio.org> gss Wed Mar 31 19:30:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/META-INF In directory pub.open-bio.org:/tmp/cvs-serv1496/WebRoot/META-INF Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/META-INF added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/META-INF - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/META-INF/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/META-INF/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/META-INF/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310UdUs001597@pub.open-bio.org> gss Wed Mar 31 19:30:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes In directory pub.open-bio.org:/tmp/cvs-serv1496/WebRoot/WEB-INF/classes Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310Udvp001520@pub.open-bio.org> gss Wed Mar 31 19:30:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/.myeclipse In directory pub.open-bio.org:/tmp/cvs-serv1496/.myeclipse Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/.myeclipse added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/.myeclipse - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/.myeclipse/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/.myeclipse/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/.myeclipse/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310UdD2001641@pub.open-bio.org> gss Wed Mar 31 19:30:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src In directory pub.open-bio.org:/tmp/cvs-serv1496/src Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:40 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:40 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310Ued7001681@pub.open-bio.org> gss Wed Mar 31 19:30:40 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/sgd In directory pub.open-bio.org:/tmp/cvs-serv1496/src/org/sgd Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/sgd added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/sgd - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/sgd/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/sgd/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/sgd/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:50 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:50 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310Uo73001760@pub.open-bio.org> gss Wed Mar 31 19:30:50 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/META-INF In directory pub.open-bio.org:/tmp/cvs-serv1739/WebRoot/META-INF Added Files: MANIFEST.MF Log Message: New example vocabulary providers moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/META-INF MANIFEST.MF,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 00:30:54 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:54 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310Us7l001843@pub.open-bio.org> gss Wed Mar 31 19:30:54 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/META-INF In directory pub.open-bio.org:/tmp/cvs-serv1822/WebRoot/META-INF Added Files: MANIFEST.MF Log Message: New example vocabulary providers moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/META-INF MANIFEST.MF,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 00:30:54 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:54 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310UsjS001858@pub.open-bio.org> gss Wed Mar 31 19:30:54 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org In directory pub.open-bio.org:/tmp/cvs-serv1822 Added Files: index.html terms .classpath terms.n3 .project .mymetadata Log Message: New example vocabulary providers moby-live/S-MOBY/ref-impl/example-providers/sgd.org index.html,NONE,1.1 terms,NONE,1.1 .classpath,NONE,1.1 terms.n3,NONE,1.1 .project,NONE,1.1 .mymetadata,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 00:30:50 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:50 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310Uoae001791@pub.open-bio.org> gss Wed Mar 31 19:30:50 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/go/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv1739/src/org/go/vocabulary Added Files: Go.java Log Message: New example vocabulary providers moby-live/S-MOBY/ref-impl/example-providers/go.org/src/org/go/vocabulary Go.java,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 00:30:54 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:54 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310UsGQ001874@pub.open-bio.org> gss Wed Mar 31 19:30:54 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF In directory pub.open-bio.org:/tmp/cvs-serv1822/WebRoot/WEB-INF Added Files: web.xml Log Message: New example vocabulary providers moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF web.xml,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 00:30:50 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:50 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310UoFc001775@pub.open-bio.org> gss Wed Mar 31 19:30:50 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org In directory pub.open-bio.org:/tmp/cvs-serv1739 Added Files: terms .mymetadata .project .classpath terms.n3 index.html Log Message: New example vocabulary providers moby-live/S-MOBY/ref-impl/example-providers/go.org terms,NONE,1.1 .mymetadata,NONE,1.1 .project,NONE,1.1 .classpath,NONE,1.1 terms.n3,NONE,1.1 index.html,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 00:30:54 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:54 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310UsO4001889@pub.open-bio.org> gss Wed Mar 31 19:30:54 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/sgd/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv1822/src/org/sgd/vocabulary Added Files: SGD.java Log Message: New example vocabulary providers moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/sgd/vocabulary SGD.java,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 00:30:50 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:50 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310UoNi001806@pub.open-bio.org> gss Wed Mar 31 19:30:50 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF In directory pub.open-bio.org:/tmp/cvs-serv1739/WebRoot/WEB-INF Added Files: web.xml Log Message: New example vocabulary providers moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF web.xml,NONE,1.1 From gss at pub.open-bio.org Thu Apr 1 00:33:35 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:33:35 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010033.i310XZlo002087@pub.open-bio.org> gss Wed Mar 31 19:33:35 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets In directory pub.open-bio.org:/tmp/cvs-serv2062/src/com/acmepubs/servlets Modified Files: CitationSearchServlet.java Log Message: Changes to vocabulary, incomplete changes to servlet code to handle new description graph. moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets CitationSearchServlet.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.java 2004/03/30 22:24:28 1.5 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.java 2004/04/01 00:33:35 1.6 @@ -7,6 +7,7 @@ import javax.servlet.http.*; import org.smoby.tools.common.graph.MOBYGraph; +import org.smoby.tools.common.vocabulary.MOBY; import org.smoby.tools.server.servlet.AbstractMobyServlet; import com.acmepubs.db.CitationDB; @@ -36,42 +37,124 @@ /** * Handle a request for a citation search by looking up * a gene symbol and returning a list of publication - * abstracts. + * abstracts. In this simplistic first cut, only look + * at the first "hasMapping" property, find the "geneID" + * property value as a lookup value, and for each matching + * publication date past the first one, create a copy of + * the entire subgraph and fill in its "pubDate" property. */ protected void handleRequest(MOBYGraph graph) { - Model model = graph.getModel(); - // Retrieve the subject of the moby:mapsTo statement // - Resource subject = graph.getMapsToStmt().getSubject(); + Resource mobyGraphSubject = (Resource) graph.getOperatesOnStmt().getObject(); - // Retrieve the subject of the acmepubs:geneID statement + // Get the subject of the first hasMapping statement (the only one + // considered in this first cut) // - StmtIterator it = model.listStatements( - subject, AcmePubs.geneID, (String) null); + Resource start = graph.getModel() + .listStatements(mobyGraphSubject, MOBY.hasMapping, (RDFNode) null) + .nextStatement().getSubject(); - if (it.hasNext()) - { - Statement s = it.nextStatement(); - try - { - String geneSymbol = s.getString(); - List pubDates = CitationDB.getCitations(geneSymbol); - if (pubDates != null) - { - StmtIterator it2 = model.listStatements( - (Resource) graph.getMapsToStmt().getObject(), - AcmePubs.pubDate, - (RDFNode) null); - - if (it2.hasNext()) - { - Statement s2 = it2.nextStatement(); - } - } - } catch (Throwable t) {} - } + // Retrieve the subgraph that is "reachable" from the subject of the + // first hasMapping statement. + // + Model subgraph = ModelFactory.createDefaultModel(); + subgraph.setNsPrefixes(graph.getModel().getNsPrefixMap()); + addReachableStatements(start, graph.getModel(), subgraph); + + // Find the "geneID" statement in the subgraph; if there isn't one, + // then we can't handle it (really should throw an exception...) + // + StmtIterator it = subgraph.listStatements(null, AcmePubs.geneID, (RDFNode) null); + if (! it.hasNext()) return; + + // Get the object of the geneID statement; if it isn't a String, then + // again we can't handle it. + // + String geneID = null; + try { + geneID = it.nextStatement().getString(); + } catch (Throwable t) { + return; + } + + // Look up the gene symbol; if not found, then there's nothing to do + // + List pubDates = CitationDB.getCitations(geneID); + if (pubDates == null) return; + + // For each publication date found, replace the object of the pubDate + // statement with the publication date in the subgraph (for the first + // pub date) or in a copy (for subsequent pub dates) + // + int i = 0; + for (Iterator iter = pubDates.iterator(); iter.hasNext(); i++) + { + String pubDate = iter.next().toString(); + + // In the first match, we use the subgraph pulled from the original + // graph; in additional matches, we use a copy (whose statements have + // to be added to the original model) + // + if (i > 0) + { + subgraph = copyModel(subgraph); + graph.getModel().add(subgraph); + } + + // Find the "pubDate" statement in the subgraph; if there isn't one, + // then we can't handle it (really should throw an exception...) + // + it = subgraph.listStatements(null, AcmePubs.pubDate, (RDFNode) null); + if (! it.hasNext()) return; + + // Replace the object of the pubDate statement with a literal value, + // namely the publication date + // + Statement stmt = it.nextStatement(); + stmt.changeObject(pubDate); + } + } + + protected Model copyModel(Model model) + { + Model copy = ModelFactory.createDefaultModel(); + copy.setNsPrefixes(model.getNsPrefixMap()); + for (StmtIterator it = model.listStatements(); it.hasNext();) + { + Statement stmt = it.nextStatement(); + copy.add(copy.createStatement( + stmt.getSubject(), + stmt.getPredicate(), + stmt.getObject())); + } + return copy; + } + + /** + * Add to a model the depth-first traversal + * of a source graph starting from a given subject + * @param subject the resource that is the starting poing + * @param source the model containing a set of statements from which to add + * @param subgraph the model to which to add reachable statements + */ + protected void addReachableStatements(Resource subject, Model source, Model subgraph) + { + StmtIterator it = source.listStatements(subject, null, (RDFNode) null); + while (it.hasNext()) + { + Statement stmt = it.nextStatement(); + if (! subgraph.contains(stmt)) + { + subgraph.add(stmt); + addReachableStatements(stmt.getSubject(), source, subgraph); + addReachableStatements(stmt.getPredicate(), source, subgraph); + if (stmt.getObject() instanceof Resource) { + addReachableStatements((Resource) stmt.getObject(), source, subgraph); + } + } + } } /** From gss at pub.open-bio.org Thu Apr 1 00:33:35 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:33:35 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010033.i310XZXW002110@pub.open-bio.org> gss Wed Mar 31 19:33:35 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv2062/WebRoot Modified Files: citationSearch.rdf citationSearch.n3 Log Message: Changes to vocabulary, incomplete changes to servlet code to handle new description graph. moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/WebRoot citationSearch.rdf,1.3,1.4 citationSearch.n3,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/WebRoot/citationSearch.rdf,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/WebRoot/citationSearch.rdf 2004/03/30 23:54:19 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/WebRoot/citationSearch.rdf 2004/04/01 00:33:35 1.4 @@ -1,32 +1,28 @@ + xmlns:moby="http://www.s-moby.org:8080/terms#" + xmlns:sgd="http://www.sgd.org:8080/terms#" > + + + + + - - + - - - - - + - + + - - - - - - - + @@ -34,9 +30,14 @@ Industry standard search - - + + - + + + + + + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/WebRoot/citationSearch.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/WebRoot/citationSearch.n3 2004/03/30 23:54:19 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/WebRoot/citationSearch.n3 2004/04/01 00:33:35 1.4 @@ -1,7 +1,8 @@ @prefix pubs: . @prefix xsd: . @prefix acmepubs: . - at prefix mygrid: . + at prefix go: . + at prefix sgd: . @prefix moby: . @prefix rdfs: . @prefix rdf: . @@ -17,20 +18,20 @@ moby:hasMapping _:bnode2 . _:bnode2 - a moby:Subject, mygrid:gene_id ; + a moby:Subject, go:GeneSymbol ; moby:mapsTo _:bnode3 ; - acmepubs:geneID _:bnode4 . + acmepubs:geneSymbol _:bnode4 . _:bnode3 - a moby:Object, pubs:PubAbstract ; - acmepubs:pubDate _:bnode6 . + a moby:Object, sgd:LiteratureGuide ; + acmepubs:literatureGuideURL _:bnode6 . -acmepubs:geneID +acmepubs:geneSymbol a owl:DataTypeProperty ; - rdfs:domain mygrid:gene_id ; + rdfs:domain go:GeneSymbol ; rdfs:range xsd:string . -acmepubs:pubDate +acmepubs:literatureGuideURL a owl:DataTypeProperty ; - rdfs:domain pubs:PubAbstract ; - rdfs:range xsd:date . \ No newline at end of file + rdfs:domain sgd:LiteratureGuide ; + rdfs:range xsd:anyURI . \ No newline at end of file From gss at pub.open-bio.org Thu Apr 1 00:34:23 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:34:23 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010034.i310YNF1002146@pub.open-bio.org> gss Wed Mar 31 19:34:23 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv2121/WebRoot Modified Files: domains.html Log Message: Reference new vocabulary providers go.org and sgd.org moby-live/S-MOBY/ref-impl/server/WebRoot domains.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/domains.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/domains.html 2004/03/30 23:54:34 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/domains.html 2004/04/01 00:34:23 1.3 @@ -4,22 +4,22 @@ Semantic MOBY Server - Hosted Pages - - - - - - -
                - Semantic MOBY Server - Hosted Pages -
                + + + + + + +
                Semantic +MOBY Server - Hosted Pages

                The Semantic MOBY reference implementation server hosts the following pages:

                - +
                - + +hypothetical vocabulary provider, go.org. This provider is meant to be +representative of the type of vocabulary information that the real Gene +Ontology (GO) Consortium would need to provide in order to be a +Semantic MOBY vocabulary provider.
                + + href="http://www.go.org:8080/terms">www.go.org/terms + + + + + + + + @@ -104,46 +124,55 @@
                Page
                @@ -76,20 +76,40 @@
                www.mygrid.orgwww.go.org Home page of a -hypothetical vocabulary provider, mygrid.org.
                www.mygrid.org/terms The vocabulary of terms -defined by mygrid.org. The notes regarding www.pubs.org/terms apply +defined by go.org. The notes regarding www.pubs.org/terms apply here as well.
                www.sgd.orgHome page of a +hypothetical vocabulary provider, sgd.org. This provider is meant to be +representative of the type of vocabulary +information that the real Saccharomyces Gene Database would +need to +provide in order to be a Semantic MOBY vocabulary provider.
                www.sgd.org/termsThe vocabulary of terms +defined by go.org. The notes regarding www.pubs.org/terms apply +here as well.
                www.s-moby.org This page you're currently viewing.

                +

                Since these hosts are virtual, in order to access their pages by name, -you will need to modify how hosts are looked up. This can most easily be +you will need to modify how hosts are looked up. This can most easily +be done by adding -entries to the hosts file, making the host names refer to the +entries to the hosts file, making the host names refer to +the local host (127.0.0.1). The Tomcat web server / servlet -container then resolves to a virtual host by name. The following entries +container then resolves to a virtual host by name. The following +entries should be added -to the hosts file of the given operating system on which the +to the hosts file of the given operating system on which +the test server is running: -

                -Under Linux/Unix, add to /etc/hosts +

                Under Linux/Unix, add to /etc/hosts +

                  - -127.0.0.1 www.acmepubs.com acmepubs.com
                  -127.0.0.1 www.megapubs.com megapubs.com
                  -127.0.0.1 www.pubs.org pubs.org
                  -127.0.0.1 www.mygrid.org mygrid.org
                  -127.0.0.1 www.s-moby.org s-moby.org
                  -127.0.0.1 www.smobydev.org smobydev.org
                  -
                  + +127.0.0.1 www.acmepubs.com acmepubs.com
                  +127.0.0.1 www.megapubs.com megapubs.com
                  +127.0.0.1 www.pubs.org pubs.org
                  +127.0.0.1 www.go.org go.org
                  +127.0.0.1 www.sgd.org sgd.org
                  +127.0.0.1 www.s-moby.org s-moby.org
                  +127.0.0.1 www.smobydev.org smobydev.org
                  +

                Under Windows NT/2000/XP, add to <WIN_DIR>/system32/drivers/etc/hosts +

                  - -127.0.0.1 acmepubs.com
                  -127.0.0.1 www.acmepubs.com
                  -127.0.0.1 megapubs.com
                  -127.0.0.1 www.megapubs.com
                  -127.0.0.1 mygrid.org
                  -127.0.0.1 www.mygrid.org
                  -127.0.0.1 pubs.org
                  -127.0.0.1 www.pubs.org
                  -127.0.0.1 s-moby.org
                  -127.0.0.1 www.s-moby.org
                  -
                  + +127.0.0.1 acmepubs.com
                  +127.0.0.1 www.acmepubs.com
                  +127.0.0.1 megapubs.com
                  +127.0.0.1 www.megapubs.com
                  +127.0.0.1 go.org
                  +127.0.0.1 www.go.org
                  +127.0.0.1 sgd.org
                  +127.0.0.1 www.sgd.org
                  +127.0.0.1 pubs.org
                  +127.0.0.1 www.pubs.org
                  +127.0.0.1 s-moby.org
                  +127.0.0.1 www.s-moby.org
                  +
                From gss at pub.open-bio.org Thu Apr 1 00:35:06 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:35:06 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010035.i310Z6Rs002194@pub.open-bio.org> gss Wed Mar 31 19:35:06 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/pubs.org/src/org/pubs/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv2169/src/org/pubs/vocabulary Modified Files: Pubs.java Log Message: Minor incremental changes moby-live/S-MOBY/ref-impl/example-providers/pubs.org/src/org/pubs/vocabulary Pubs.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/pubs.org/src/org/pubs/vocabulary/Pubs.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/pubs.org/src/org/pubs/vocabulary/Pubs.java 2004/03/30 23:54:30 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/pubs.org/src/org/pubs/vocabulary/Pubs.java 2004/04/01 00:35:06 1.2 @@ -1,6 +1,6 @@ package org.pubs.vocabulary; -import org.smoby.tools.common.vocabulary.VocabularyDescription; -import com.hp.hpl.jena.graph.*; + +import org.smoby.tools.common.vocabulary.*; import com.hp.hpl.jena.rdf.model.*; public class Pubs extends VocabularyDescription From gss at pub.open-bio.org Thu Apr 1 00:30:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310Udrx001575@pub.open-bio.org> gss Wed Mar 31 19:30:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF In directory pub.open-bio.org:/tmp/cvs-serv1496/WebRoot/WEB-INF Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:40 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:40 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310Uekh001659@pub.open-bio.org> gss Wed Mar 31 19:30:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org In directory pub.open-bio.org:/tmp/cvs-serv1496/src/org Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 00:30:40 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 19:30:40 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010030.i310UevY001702@pub.open-bio.org> gss Wed Mar 31 19:30:40 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/sgd/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv1496/src/org/sgd/vocabulary Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/sgd/vocabulary added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/sgd/vocabulary - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/sgd/vocabulary/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/sgd/vocabulary/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/src/org/sgd/vocabulary/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 01:17:38 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 20:17:38 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010117.i311Hccv002945@pub.open-bio.org> gss Wed Mar 31 20:17:38 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv2869/S-MOBY/ref-impl/example-providers/mygrid.org/WebRoot Removed Files: index.html terms terms.n3 Log Message: Use go.org instead moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/WebRoot index.html,1.1,NONE terms,1.1,NONE terms.n3,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/WebRoot/RCS/index.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/WebRoot/RCS/terms,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/WebRoot/RCS/terms.n3,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 01:17:38 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 20:17:38 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010117.i311Hc4W002909@pub.open-bio.org> gss Wed Mar 31 20:17:38 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/WebRoot/META-INF In directory pub.open-bio.org:/tmp/cvs-serv2869/S-MOBY/ref-impl/example-providers/mygrid.org/WebRoot/META-INF Removed Files: MANIFEST.MF Log Message: Use go.org instead moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/WebRoot/META-INF MANIFEST.MF,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/WebRoot/META-INF/RCS/MANIFEST.MF,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 01:17:38 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 20:17:38 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010117.i311HciY002925@pub.open-bio.org> gss Wed Mar 31 20:17:38 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/WebRoot/WEB-INF In directory pub.open-bio.org:/tmp/cvs-serv2869/S-MOBY/ref-impl/example-providers/mygrid.org/WebRoot/WEB-INF Removed Files: web.xml Log Message: Use go.org instead moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/WebRoot/WEB-INF web.xml,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/WebRoot/WEB-INF/RCS/web.xml,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 01:17:38 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 20:17:38 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010117.i311Hcg3002893@pub.open-bio.org> gss Wed Mar 31 20:17:38 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/mygrid.org In directory pub.open-bio.org:/tmp/cvs-serv2869/S-MOBY/ref-impl/example-providers/mygrid.org Removed Files: .classpath .mymetadata .project Log Message: Use go.org instead moby-live/S-MOBY/ref-impl/example-providers/mygrid.org .classpath,1.2,NONE .mymetadata,1.1,NONE .project,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/RCS/.classpath,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/RCS/.mymetadata,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/RCS/.project,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 01:17:38 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Wed, 31 Mar 2004 20:17:38 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404010117.i311Hcka002963@pub.open-bio.org> gss Wed Mar 31 20:17:38 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/src/org/mygrid/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv2869/S-MOBY/ref-impl/example-providers/mygrid.org/src/org/mygrid/vocabulary Removed Files: MyGrid.java Log Message: Use go.org instead moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/src/org/mygrid/vocabulary MyGrid.java,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/mygrid.org/src/org/mygrid/vocabulary/RCS/MyGrid.java,v: No such file or directory From senger at pub.open-bio.org Thu Apr 1 16:41:03 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 1 Apr 2004 11:41:03 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404011641.i31Gf3t6006392@pub.open-bio.org> senger Thu Apr 1 11:41:03 EST 2004 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv6373/src/Clients Modified Files: MobyGraphs.java Log Message: moby-live/Java/src/Clients MobyGraphs.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2003/11/25 13:18:10 1.3 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2004/04/01 16:41:03 1.4 @@ -179,13 +179,18 @@ } edges = FilterServices.filter (edges, authorities, serviceNames, depth); - String[] pathEnds = cmd.getParam ("-path", 2); - if (pathEnds.length == 2) + if (cmd.hasParam ("-path")) { + String[] pathEnds = cmd.getParam ("-path", 2); + if (pathEnds[0] == null || pathEnds[1] == null) { + System.err.println ("Missing value for parameter '-path'. It should be followed by two service names."); + System.exit (1); + } edges = FilterServices.pathes (edges, pathEnds[0], pathEnds[1]); - if (edges == null) { - System.err.println ("No connection found between '" + - pathEnds[0] + "' and '" + pathEnds[1] + "'"); - System.exit(1); + if (edges == null) { + System.err.println ("No connection found between '" + + pathEnds[0] + "' and '" + pathEnds[1] + "'"); + System.exit(1); + } } // create a graph (in whatever format) From senger at pub.open-bio.org Thu Apr 1 16:41:03 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 1 Apr 2004 11:41:03 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404011641.i31Gf3Vp006415@pub.open-bio.org> senger Thu Apr 1 11:41:03 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv6373/src/main/org/biomoby/client Modified Files: CentralImpl.java ServiceConnections.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.7,1.8 ServiceConnections.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/03/09 00:20:13 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 16:41:03 1.8 @@ -587,8 +587,12 @@ NodeList children = elem.getChildNodes(); for (int j = 0; j < children.getLength(); j++) { if (children.item (j).getNodeName().equals ("Description")) { - results.put (elem.getAttribute ("name"), - children.item (j).getFirstChild().getNodeValue()); + String desc; + if (children.item (j).getFirstChild() == null) + desc = ""; + else + desc = children.item (j).getFirstChild().getNodeValue(); + results.put (elem.getAttribute ("name"), desc); break; } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java 2003/10/17 13:13:34 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java 2004/04/01 16:41:03 1.2 @@ -69,7 +69,7 @@ Hashtable dataTypesTable = new Hashtable(); for (int i = 0; i < dataTypes.length; i++) { MobyDataType dataType = dataTypes[i]; - dataTypesTable.put (dataType.getName().toLowerCase(), dataType); + dataTypesTable.put (Utils.pureName (dataType.getName()).toLowerCase(), dataType); } // here we are going to build the resulting edges @@ -117,12 +117,13 @@ // ...find the data type of this output String dataTypeName = output.getDataType().getName(); MobyDataType dataType = - (MobyDataType)dataTypesTable.get (dataTypeName.toLowerCase()); + (MobyDataType)dataTypesTable.get (Utils.pureName (dataTypeName).toLowerCase()); if (dataType == null) { // this means that there is something wrong with the Moby central registration System.err.println ("Service " + name + " has an unknown output data type '" + Utils.pureName (dataTypeName) + "'"); + System.err.println ("\tLSID: " + dataTypeName); continue; } @@ -239,10 +240,11 @@ String connector = null; MobyDataType outputType = - (MobyDataType)dataTypes.get (output.getDataType().getName().toLowerCase()); - - String outputName = outputType.getName(); - String inputName = input.getDataType().getName(); + (MobyDataType)dataTypes.get (Utils.pureName (output.getDataType().getName()).toLowerCase()); + if (outputType == null) // strange... + return null; + String outputName = Utils.pureName (outputType.getName()); + String inputName = Utils.pureName (input.getDataType().getName()); if (outputName.equals (inputName)) connector = outputName; @@ -275,7 +277,9 @@ if (inputName.equals (parents[i])) return true; MobyDataType outputType = - (MobyDataType)dataTypes.get (parents[i].toLowerCase()); + (MobyDataType)dataTypes.get (Utils.pureName (parents[i]).toLowerCase()); + if (outputType == null) // strange? + return false; if (findMatchInParents (outputType.getParentNames(), inputName, dataTypes)) return true; } From gordonp at pub.open-bio.org Thu Apr 1 17:30:08 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Thu, 1 Apr 2004 12:30:08 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404011730.i31HU8PW006626@pub.open-bio.org> gordonp Thu Apr 1 12:30:08 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv6601 Modified Files: CentralImpl.java Log Message: Implements response caching, and uses JAXP DocumentBuilder to harness a XML parser in a more platform independent way moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 16:41:03 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 17:30:08 1.9 @@ -61,11 +61,12 @@ public class CentralImpl implements Central { - + private Hashtable cache; // To not call MOBY Central everytime the same method is called private URL endpoint; private String uri; - private ParserWrapper parser; + private javax.xml.parsers.DocumentBuilder docBuilder; private boolean debug = false; + private boolean useCache = true; /** Default location (endpoint) of a Moby registry. */ // public static final String DEFAULT_ENDPOINT = "http://mobycentral.cbr.nrc.ca/cgi-bin/MOBY-Central.pl"; @@ -118,8 +119,18 @@ } this.uri = namespace; - // instantiate a DOM parser - parser = Utils.getDOMParser(); + // This method should work on almost all platforms to get an XML parser instance + try { + javax.xml.parsers.DocumentBuilderFactory dbf = + javax.xml.parsers.DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + docBuilder = dbf.newDocumentBuilder(); + } catch (Exception e) { + throw new MobyException ("Could not configure an XML parser: " + e); + } + + cache = new Hashtable(); + useCache = true; } /************************************************************************* @@ -192,8 +203,11 @@ String id = "", success = "0", message = ""; // parse returned XML - Document document = parser.parse (new StringReader (xml)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(xml));} + catch(Exception e){throw new MobyException(e.toString());} Element root = document.getDocumentElement(); + NodeList children = root.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { if (children.item (i).getNodeType() != Node.ELEMENT_NODE) @@ -403,8 +417,11 @@ *************************************************************************/ protected MobyService[] extractServices (String xml) throws MobyException { + + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(xml));} + catch(Exception e){throw new MobyException(e.toString());} - Document document = parser.parse (new StringReader (xml)); NodeList list = document.getElementsByTagName ("Service"); MobyService[] results = new MobyService [list.getLength()]; for (int i = 0; i < list.getLength(); i++) { @@ -491,18 +508,31 @@ *************************************************************************/ public Map getServiceNames() throws MobyException { + + // First, check to se if we have the values cached from a previous call + // in this instance + if(useCache && cache.containsKey("retrieveServiceNames")) + return (Map) cache.get("retrieveServiceNames"); + String result = (String)doCall ("retrieveServiceNames", new Object[] {}); // parse returned XML Map results = new HashMap(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("serviceName"); for (int i = 0; i < list.getLength(); i++) { Element elem = (Element)list.item (i); results.put (elem.getAttribute ("name"), elem.getAttribute ("authURI")); } + + // Add this data to the cache in case we get called again + if(useCache) + cache.put("retrieveServiceNames", results); return results; } @@ -516,15 +546,27 @@ *************************************************************************/ public String[] getProviders() throws MobyException { + + // First, see if we have the values cached from a previous call in this instance + if(useCache && cache.containsKey("retrieveServiceProviders")) + return (String[]) cache.get("retrieveServiceProviders"); + String result = (String)doCall ("retrieveServiceProviders", new Object[] {}); // parse returned XML - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("serviceProvider"); String[] results = new String [list.getLength()]; for (int i = 0; i < list.getLength(); i++) results[i] = ((Element)list.item (i)).getAttribute ("name"); + + // Add this data to the cache in case we get called again + if(useCache) + cache.put("retrieveServiceProviders", results); return results; } @@ -541,12 +583,19 @@ *************************************************************************/ public Map getServiceTypes() throws MobyException { + // First, see if we have the values cached from a previous call in this instance + if(useCache && cache.containsKey("retrieveServiceTypes")) + return (Map) cache.get("retrieveServiceTypes"); + String result = (String)doCall ("retrieveServiceTypes", new Object[] {}); // parse returned XML Map results = new HashMap(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("serviceType"); for (int i = 0; i < list.getLength(); i++) { Element elem = (Element)list.item (i); @@ -559,6 +608,10 @@ } } } + + // Add this data to the cache in case we get called again + if(useCache) + cache.put("retrieveServiceTypes", results); return results; } @@ -575,28 +628,43 @@ *************************************************************************/ public Map getNamespaces() throws MobyException { + + // First, see if we have the values cached from a previous call in this instance + if(useCache && cache.containsKey("retrieveNamespaces")) + return (Map) cache.get("retrieveNamespaces"); + String result = (String)doCall ("retrieveNamespaces", new Object[] {}); // parse returned XML Map results = new HashMap(); - Document document = parser.parse (new StringReader (result)); - NodeList list = document.getElementsByTagName ("Namespace"); - for (int i = 0; i < list.getLength(); i++) { + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + + NodeList list = document.getDocumentElement().getElementsByTagName ("Namespace"); + if(list == null || list.getLength() == 0){ + throw new MobyException("Could not find Namespace children of response root node " + + document.getDocumentElement()); + } + int length = list.getLength(); + for (int i = 0; i < length; i++) { Element elem = (Element)list.item (i); - NodeList children = elem.getChildNodes(); - for (int j = 0; j < children.getLength(); j++) { - if (children.item (j).getNodeName().equals ("Description")) { - String desc; - if (children.item (j).getFirstChild() == null) - desc = ""; - else - desc = children.item (j).getFirstChild().getNodeValue(); - results.put (elem.getAttribute ("name"), desc); - break; - } + NodeList children = elem.getElementsByTagName("Description"); + if(children.item(0).hasChildNodes()){ + children.item(0).normalize(); + results.put (elem.getAttribute ("name"), + children.item(0).getFirstChild().getNodeValue()); + } + else{ + // No description provided + results.put (elem.getAttribute ("name"), ""); } } + + // Add this data to the cache in case we get called again + if(useCache) + cache.put("retrieveNamespaces", results); return results; } @@ -613,12 +681,19 @@ *************************************************************************/ public Map getDataTypeNames() throws MobyException { + // First, see if we have the values cached from a previous call in this instance + if(useCache && cache.containsKey("retrieveObjectNames")) + return (Map) cache.get("retrieveObjectNames"); + String result = (String)doCall ("retrieveObjectNames", new Object[] {}); // parse returned XML Map results = new HashMap(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("Object"); for (int i = 0; i < list.getLength(); i++) { Element elem = (Element)list.item (i); @@ -631,6 +706,9 @@ } } } + + if(useCache) + cache.put("retrieveObjectNames", results); return results; } @@ -655,6 +733,11 @@ *************************************************************************/ public MobyDataType getDataType (String dataTypeName) throws MobyException, NoSuccessException { + + // See if we've already retrieved the DataType and cached it + if(cache.containsKey("retrieveObjectDefinition"+dataTypeName)) + return (MobyDataType) cache.get("retrieveObjectDefinition"+dataTypeName); + String result = (String)doCall ("retrieveObjectDefinition", new Object[] { @@ -664,7 +747,10 @@ }); // parse returned XML - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("retrieveObjectDefinition"); if (list == null || list.getLength() == 0) throw new NoSuccessException ("Data Type name was not founnd.", @@ -717,6 +803,7 @@ } } } + cache.put("retrieveObjectDefinition"+dataTypeName, data); return data; } @@ -778,6 +865,11 @@ *************************************************************************/ public String getServiceWSDL (String serviceName, String authority) throws MobyException, NoSuccessException { + // See if we've already retrieved the DataType and cached it + String cacheKey = "getServiceWSDL" + serviceName + ":" + authority; + if(cache.containsKey(cacheKey)) + return (String) cache.get(cacheKey); + String result = (String)doCall ("retrieveService", new Object[] { @@ -787,12 +879,17 @@ }); // parse returned XML - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + Element service = document.getDocumentElement(); Node wsdl = service.getFirstChild(); if (wsdl == null) throw new NoSuccessException ("Service not found OR WSDL is not available.", serviceName + " (" + authority + ")"); + if(useCache) + cache.put(cacheKey, wsdl.getNodeValue()); return wsdl.getNodeValue(); } @@ -1051,14 +1148,20 @@ if (pattern == null) pattern = new MobyService ("dummy"); - String result = - (String)doCall ("findService", - new Object[] { + String[] query = new String[] { "" + buildQueryObject (pattern, keywords, true, true, false) + "" - }); - return extractServices (result); + }; + if(useCache && cache.containsKey("findService"+query[0])) + return (MobyService[]) cache.get("findService"+query[0]); + + String result = (String) doCall ("findService", query); + MobyService[] services = extractServices (result); + + if(useCache) + cache.put("findService"+query[0], services); + return services; } /************************************************************************** @@ -1106,6 +1209,10 @@ public String[] getServiceTypeRelationships (String serviceTypeName, boolean expand) throws MobyException { + String cacheKey = "Relationships" + serviceTypeName + ":" + expand; + if(useCache && cache.containsKey(cacheKey)) + return (String[]) cache.get(cacheKey); + String result = (String)doCall ("Relationships", new Object[] { @@ -1118,7 +1225,10 @@ // parse returned XML Vector v = new Vector(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("Relationship"); for (int i = 0; i < list.getLength(); i++) { Element elem = (Element)list.item (i); @@ -1131,6 +1241,9 @@ } String[] results = new String [v.size()]; v.copyInto (results); + + if(useCache) + cache.put(cacheKey, results); return results; } @@ -1151,6 +1264,10 @@ *************************************************************************/ public Map getDataTypeRelationships (String dataTypeName) throws MobyException { + String cacheKey = "getDataTypeRelationships"+dataTypeName; + if(useCache && cache.containsKey(cacheKey)) + return (Map) cache.get(cacheKey); + String result = (String)doCall ("Relationships", new Object[] { @@ -1165,7 +1282,10 @@ // parse returned XML Map results = new HashMap(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("Relationship"); for (int i = 0; i < list.getLength(); i++) { @@ -1182,6 +1302,9 @@ v.copyInto (names); results.put (relType, names); } + + if(useCache) + cache.put(cacheKey, results); return results; } @@ -1199,6 +1322,10 @@ public String[] getDataTypeRelationships (String dataTypeName, String relationshipType) throws MobyException { + String cacheKey = "getDataTypeRelationships" + dataTypeName + ":" + relationshipType; + if(useCache && cache.containsKey(cacheKey)) + return (String[]) cache.get(cacheKey); + String result = (String)doCall ("Relationships", new Object[] { @@ -1211,7 +1338,10 @@ // parse returned XML Vector v = new Vector(); - Document document = parser.parse (new StringReader (result)); + Document document = null; + try{document=docBuilder.parse(new StringBufferInputStream(result));} + catch(Exception e){throw new MobyException(e.toString());} + NodeList list = document.getElementsByTagName ("Relationship"); // it should always be just one element in this list @@ -1226,7 +1356,29 @@ } String[] results = new String [v.size()]; v.copyInto (results); + + if(useCache) + cache.put(cacheKey, results); return results; } + /** + * By default, caching is enabled to reduce network traffic and XML parsing. Setting + * this to false will clear the cache, and not cache any further calls unless it is + * set to true again. + * + * @param shouldCache whether retrieveXXX call results should be cached in case they are called again (i.e. don't requery MobyCentral every time) + */ + public void setCacheMode(boolean shouldCache){ + useCache = shouldCache; + if(!useCache) + cache.clear(); + } + + /** + * @return whether retrieveXXX calls will cache their responses + */ + public boolean getCacheMode(){ + return useCache; + } } From senger at pub.open-bio.org Thu Apr 1 21:03:42 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 1 Apr 2004 16:03:42 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012103.i31L3gJf007111@pub.open-bio.org> senger Thu Apr 1 16:03:42 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv7084/src/main/org/biomoby/client Modified Files: FileCache.java GraphsServlet.java ServletFileCache.java Log Message: moby-live/Java/src/main/org/biomoby/client FileCache.java,1.2,1.3 GraphsServlet.java,1.4,1.5 ServletFileCache.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/FileCache.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/FileCache.java 2003/11/09 01:05:02 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/FileCache.java 2004/04/01 21:03:42 1.3 @@ -1,6 +1,6 @@ // FileCache.java // -// A cache used for a data produced by a servlet. +// A cache storing data in files. // // senger at ebi.ac.uk // November 2003 @@ -37,7 +37,10 @@ // given 'rootDirname) protected static String startingDir; - /************************************************************************** + // index of cached files (TBD: put it also in a file?) + Hashtable index = new Hashtable(); + + /************************************************************************** * To be used by the inheriting classes. **************************************************************************/ protected FileCache() { @@ -49,14 +52,14 @@ * Constructor specifying where to create files with the cached * objects. Use this constructor if you cannot store them in the * context of the calling servlet (usually because of the - * unsifficient write permissions). The cache files will created in + * unsifficient write permissions). The cache files will be stored in * *
                      * /cache/
                      * 
                * * The all not yet existing directories (for example the last - * 'cache' diorectory) will be created for you. + * 'cache' directory) will be created for you. *

                * * 'rootURLName' is used by method {@link #getURL} to return back @@ -75,7 +78,11 @@ static final char CLEAR_CHAR = '_'; /************************************************************************** * It creates an 'id' in the form: - * rootName / semanticType / prop1_prop2_... (time).syntaxType + * rootName / semanticType / { prop1_prop2_... } (time).syntaxType + * + * The part between { and } (inclusive) will be replaced by a + * unique shorter string in order to create a reasonably long real + * file name. **************************************************************************/ public String createId (String rootName, String semanticType, String syntaxType, @@ -94,10 +101,13 @@ ps[++i] = it.next().toString(); } Arrays.sort (ps); + buf.append ("{"); for (int i = 0; i < ps.length; i++) { buf.append (CLEAR_CHAR); - buf.append (clean (ps[i].toString())); +// buf.append (clean (ps[i].toString())); + buf.append (ps[i].toString()); } + buf.append ("}"); buf.append ("(" + lastModified + ")"); buf.append ("."); buf.append (clean (syntaxType)); @@ -235,6 +245,20 @@ * dir (as set in a constructor). **************************************************************************/ protected String getRelativeFilename (String id) { - return fileSeparator + startingDir + fileSeparator + id; + String fileName = (String)index.get (id); + if (fileName == null) { + int posFrom = id.indexOf ("{"); + int posTo = id.indexOf ("}"); + StringBuffer buf = new StringBuffer(); + buf.append (fileSeparator); + buf.append (startingDir); + buf.append (fileSeparator); + buf.append (id.substring (0, posFrom)); + buf.append (clean (new java.rmi.server.UID().toString())); + buf.append (id.substring (posTo+1)); + fileName = new String (buf); + index.put (id, fileName); + } + return fileName; } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.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/GraphsServlet.java 2003/11/25 13:18:10 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2004/04/01 21:03:42 1.5 @@ -491,7 +491,7 @@ h.gen (TD, radios[0]) + h.gen (TD, - "Show all services and all connections")) + + "Show all services and all connections " + h.gen (EM, "(very long and big)"))) + h.gen (TR, h.gen (TD, new String[] { VALIGN, "top" }, radios[1]) + =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServletFileCache.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServletFileCache.java 2003/11/08 00:27:24 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServletFileCache.java 2004/04/01 21:03:42 1.2 @@ -40,11 +40,11 @@ * * * The not existing directories (for example the last 'cache' - * diorectory) will be created for you. + * directory) will be created for you. * * The 'contextPath' is a path (relative to the servlet context) * where the cached files will be created (actually starting from - * here, because they may be created ina deeper directory + * here, because they may be created in a deeper directory * structure. Usually you get it in the calling servlet from the * request by method request.getContextPath(). The 'contextPath' * starts with a "/" character but does not end with a "/" From mwilkinson at pub.open-bio.org Thu Apr 1 21:23:48 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 1 Apr 2004 16:23:48 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012123.i31LNmaC007236@pub.open-bio.org> mwilkinson Thu Apr 1 16:23:47 EST 2004 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv7213/MOBY/Client Modified Files: Service.html Service.pm Log Message: update the execute method to allow multiple inputs to a single invocation. Documentation updated. Fixed bug of articleName attribute being attached to the wrong XML element moby-live/Perl/MOBY/Client Service.html,1.3,1.4 Service.pm,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.html 2003/08/06 14:31:21 1.3 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.html 2004/04/01 21:23:47 1.4 @@ -2,7 +2,7 @@ MOBY::Client::Service - an object for communicating with MOBY Services - + @@ -95,12 +95,21 @@ input is named "object1" in both cases. $Service->execute(XMLinputlist => [ - ['collection1', [ + ['', [ '<Object namespace="blah" id="123"/>', '<Object namespace="blah" id="234"/>'] ]); This would invoke the service once with a collection of sequence inputs - called "collection1" + that are not required to be named ('') +

                +                $Service->execute(XMLinputlist => [
                +                                 [
                +                             'input1', '<Object namespace="blah" id="123"/>',
                +                             'input2', '<Object namespace="blah" id="234"/>',
                +                             ]
                +                              ]);
                +                This would cause a single invocation of a service requiring
                +                two input parameters named "input1" and "input2"

                ServiceName

                =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2004/01/05 21:29:08 1.7 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2004/04/01 21:23:47 1.8 @@ -165,12 +165,21 @@ input is named "object1" in both cases. $Service->execute(XMLinputlist => [ - ['collection1', [ + ['', [ '', ''] ]); This would invoke the service once with a collection of sequence inputs - called "collection1" + that are not required to be named ('') + + $Service->execute(XMLinputlist => [ + [ + 'input1', '', + 'input2', '', + ] + ]); + This would cause a single invocation of a service requiring + two input parameters named "input1" and "input2" =cut @@ -183,20 +192,25 @@ my $data; foreach (@inputs){ return "ERROR: expected listref [articleName, XML] for data element" unless (ref($_) =~ /array/i); - my ($articleName, $XML) = @{$_}; my $qID = $self->_nextQueryID; - if (!(ref($XML)=~/array/i)){ - $articleName ||=""; - $XML ||= ""; - $data .= "\n$XML\n\n"; - } elsif (ref($XML)=~/array/i){ - my @objs = @{$XML}; - $data .="\n"; - foreach (@objs){ - $data .= "$_\n"; - } - $data .="\n\n" - } + $data .= ""; + while (my ($articleName, $XML) = splice (@{$_}, 0, 2)){ + if (!(ref($XML)=~/array/i)){ + $articleName ||=""; + $XML ||= ""; + $data .= "\n$XML\n\n"; + + # need to do this for collections also!!!!!! + } elsif (ref($XML)=~/array/i){ + my @objs = @{$XML}; + $data .="\n"; + foreach (@objs){ + $data .= "$_\n"; + } + $data .="\n"; + } + } + $data .="\n"; } $data = " From senger at pub.open-bio.org Thu Apr 1 23:24:27 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 1 Apr 2004 18:24:27 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012324.i31NORH0007750@pub.open-bio.org> senger Thu Apr 1 18:24:26 EST 2004 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv7731/docs Modified Files: ChangeLog Log Message: moby-live/Java/docs ChangeLog,1.9,1.10 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/03/09 00:20:13 1.9 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/04/01 23:24:26 1.10 @@ -1,8 +1,20 @@ +2004-04-02 Martin Senger + + * Fixed producing graphs to deal with situation that some Moby + methods return simple names and some full LSIDs. + + * Fixed servlet producing graphs (proxy is set now correctly, + cached files have no longer too long names). + 2004-03-08 Martin Senger * Fixed extracting URL and emailContact from a service response object. +2004-01-15 Martin Senger + + * Fixed: better error reporting when am empty result is returned. + 2003-11-24 Martin Senger * Added graphs of service types. From senger at pub.open-bio.org Thu Apr 1 23:24:27 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 1 Apr 2004 18:24:27 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012324.i31NOR4d007795@pub.open-bio.org> senger Thu Apr 1 18:24:27 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv7731/src/main/org/biomoby/shared Modified Files: MobyService.java Log Message: moby-live/Java/src/main/org/biomoby/shared MobyService.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2003/09/24 14:33:37 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2004/04/01 23:24:27 1.2 @@ -170,6 +170,7 @@ } public boolean equals (MobyService anotherOne) { + if (anotherOne == null) return false; return this.name.equals (anotherOne.getName()); } From senger at pub.open-bio.org Thu Apr 1 23:24:27 2004 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 1 Apr 2004 18:24:27 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012324.i31NOR54007774@pub.open-bio.org> senger Thu Apr 1 18:24:27 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv7731/src/main/org/biomoby/client Modified Files: CentralImpl.java GraphsServlet.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.9,1.10 GraphsServlet.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 17:30:08 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 23:24:26 1.10 @@ -1174,6 +1174,10 @@ result = doCall (methodName, new Object[] { }); else result = doCall (methodName, new Object[] { inputXML }); + + if (result == null) + throw new MobyException ("Returned result is null."); + if (result instanceof String) return (String)result; if (result instanceof String[]) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2004/04/01 21:03:42 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2004/04/01 23:24:27 1.6 @@ -205,7 +205,7 @@ for (Enumeration en = context.getInitParameterNames(); en.hasMoreElements(); ) { String name = (String)en.nextElement(); if (name != null) - initParams.put (name.toLowerCase(), context.getInitParameter (name)); + initParams.put (name, context.getInitParameter (name)); } // then read config parameters (scope: this servlet) - they may overwrite @@ -213,7 +213,7 @@ for (Enumeration en = getInitParameterNames(); en.hasMoreElements(); ) { String name = (String)en.nextElement(); if (name != null) - initParams.put (name.toLowerCase(), getInitParameter (name)); + initParams.put (name, getInitParameter (name)); } // read some suggested defaults from the init parameters @@ -869,6 +869,7 @@ // do this only the first time if (registry == null) { registry = new CentralImpl (endpoint, namespace); + ((CentralImpl)registry).setCacheMode (false); registry.setDebug (debug); } From gss at pub.open-bio.org Thu Apr 1 23:59:40 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:40 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31Nxeh3008031@pub.open-bio.org> gss Thu Apr 1 18:59:40 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/config-files Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files added to the repository moby-live/S-MOBY/ref-impl/config-files - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 23:59:40 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:40 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxeCB008049@pub.open-bio.org> gss Thu Apr 1 18:59:40 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 23:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfZh008086@pub.open-bio.org> gss Thu Apr 1 18:59:40 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/vocabulary/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 23:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfNQ008145@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/vocabulary/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 23:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31Nxf4v008171@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/queries In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/queries Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/queries added to the repository moby-live/S-MOBY/ref-impl/queries - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 23:59:40 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:40 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31Nxewk008068@pub.open-bio.org> gss Thu Apr 1 18:59:40 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go added to the repository moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF/classes/org/go/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 23:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31Nxf9x008190@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/queries/discovery Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery added to the repository moby-live/S-MOBY/ref-impl/queries/discovery - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 23:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfmQ008127@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/sgd/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 23:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfpH008108@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org added to the repository moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot/WEB-INF/classes/org/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 23:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfA9008234@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref added to the repository moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 23:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfIJ008252@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets added to the repository moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 23:59:41 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:41 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxfbP008208@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/queries/engage Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage added to the repository moby-live/S-MOBY/ref-impl/queries/engage - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 23:59:42 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:42 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxgYH008294@pub.open-bio.org> gss Thu Apr 1 18:59:42 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools added to the repository moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 23:59:42 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:42 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxgOr008314@pub.open-bio.org> gss Thu Apr 1 18:59:42 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db added to the repository moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/tools/db/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Apr 1 23:59:42 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 18:59:42 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404012359.i31NxgVx008275@pub.open-bio.org> gss Thu Apr 1 18:59:41 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev In directory pub.open-bio.org:/tmp/cvs-serv8007/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev added to the repository moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/org/smoby/ref/servlets/dev/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Fri Apr 2 00:01:23 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:01:23 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020001.i3201NBN008511@pub.open-bio.org> gss Thu Apr 1 19:01:23 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/db In directory pub.open-bio.org:/tmp/cvs-serv8489/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/db Removed Files: CitationDB.java Log Message: No longer needed moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/db CitationDB.java,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/db/RCS/CitationDB.java,v: No such file or directory From gss at pub.open-bio.org Fri Apr 2 00:02:04 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:02:04 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020002.i32024CM008540@pub.open-bio.org> gss Thu Apr 1 19:02:03 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/config-files In directory pub.open-bio.org:/tmp/cvs-serv8519/ref-impl/config-files Added Files: for-tomcat-conf-server.xml for-tomcat-conf-catalina.properties Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/config-files for-tomcat-conf-server.xml,NONE,1.1 for-tomcat-conf-catalina.properties,NONE,1.1 From gss at pub.open-bio.org Fri Apr 2 00:03:19 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:03:19 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020003.i3203JpJ008595@pub.open-bio.org> gss Thu Apr 1 19:03:19 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet In directory pub.open-bio.org:/tmp/cvs-serv8570/ref-impl/core/org/smoby/tools/server/servlet Modified Files: AbstractMobyServlet.java Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet AbstractMobyServlet.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet/AbstractMobyServlet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet/AbstractMobyServlet.java 2004/04/01 00:23:46 1.5 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/server/servlet/AbstractMobyServlet.java 2004/04/02 00:03:19 1.6 @@ -93,6 +93,26 @@ } /** + * Helper method for returning the first statement (if any) from a source + * graph's model, that has the given subject, predicate, and object. + * @param source graph from which the model should be queried + * @param subject subject of the matching statement + * @param predicate predicate of the matching statement + * @param object object of the matching statement + * @return the first matching statement + */ + protected Statement getFirstStatement( + MOBYGraph source, Resource subject, Property predicate, RDFNode object) + { + StmtIterator it = source.getModel().listStatements(subject, predicate, object); + if (it.hasNext()) { + return it.nextStatement(); + } else { + return null; + } + } + + /** * By MOBY convention, an HTTP POST equates to a request for the service * provided by a provider. */ From gss at pub.open-bio.org Fri Apr 2 00:03:27 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:03:27 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020003.i3203Rnp008624@pub.open-bio.org> gss Thu Apr 1 19:03:27 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager In directory pub.open-bio.org:/tmp/cvs-serv8603/ref-impl/example-clients/SimpleEngager Added Files: SimpleProviderEngagerPanel$1.class SimpleProviderEngagerPanel$3.class SimpleProviderEngagerPanel$2.class SimpleProviderEngagerPanel.class Log Message: moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager SimpleProviderEngagerPanel$1.class,NONE,1.1 SimpleProviderEngagerPanel$3.class,NONE,1.1 SimpleProviderEngagerPanel$2.class,NONE,1.1 SimpleProviderEngagerPanel.class,NONE,1.1 From gss at pub.open-bio.org Fri Apr 2 00:03:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:03:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020003.i3203ddJ008665@pub.open-bio.org> gss Thu Apr 1 19:03:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv8639/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary Modified Files: AcmePubs.java Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary AcmePubs.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary/AcmePubs.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary/AcmePubs.java 2004/03/30 22:24:28 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/vocabulary/AcmePubs.java 2004/04/02 00:03:39 1.3 @@ -1,7 +1,6 @@ package com.acmepubs.vocabulary; -import org.smoby.tools.common.vocabulary.VocabularyDescription; -import com.hp.hpl.jena.graph.*; +import org.smoby.tools.common.vocabulary.*; import com.hp.hpl.jena.rdf.model.*; public class AcmePubs extends VocabularyDescription @@ -11,6 +10,6 @@ return "http://www.acmepubs.com:8080/"; } - public static final Property geneID = property(getURI(), "geneID"); - public static final Property pubDate = property(getURI(), "pubDate"); + public static final Property geneSymbol = property(getURI(), "geneSymbol"); + public static final Property literatureGuideURL = property(getURI(), "literatureGuideURL"); } From gss at pub.open-bio.org Fri Apr 2 00:03:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:03:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020003.i3203d4k008684@pub.open-bio.org> gss Thu Apr 1 19:03:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets In directory pub.open-bio.org:/tmp/cvs-serv8639/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets Modified Files: CitationSearchServlet.java Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets CitationSearchServlet.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.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/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.java 2004/04/01 00:33:35 1.6 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/src/com/acmepubs/servlets/CitationSearchServlet.java 2004/04/02 00:03:39 1.7 @@ -6,12 +6,12 @@ import javax.servlet.*; import javax.servlet.http.*; +import org.go.vocabulary.Go; import org.smoby.tools.common.graph.MOBYGraph; import org.smoby.tools.common.vocabulary.MOBY; import org.smoby.tools.server.servlet.AbstractMobyServlet; - -import com.acmepubs.db.CitationDB; import com.acmepubs.vocabulary.AcmePubs; + import com.hp.hpl.jena.rdf.model.*; /** @@ -36,125 +36,50 @@ /** * Handle a request for a citation search by looking up - * a gene symbol and returning a list of publication - * abstracts. In this simplistic first cut, only look - * at the first "hasMapping" property, find the "geneID" - * property value as a lookup value, and for each matching - * publication date past the first one, create a copy of - * the entire subgraph and fill in its "pubDate" property. + * a gene symbol and returning a URL for querying the + * SGD database for literature pertaining to that URL. */ protected void handleRequest(MOBYGraph graph) { - // Retrieve the subject of the moby:mapsTo statement + // Retrieve the subject of the moby:operatesOn statement (there is only + // one operatesOn statement in a valid MOBY graph) // Resource mobyGraphSubject = (Resource) graph.getOperatesOnStmt().getObject(); - // Get the subject of the first hasMapping statement (the only one - // considered in this first cut) + // There may be multiple moby:hasMapping statements. For each one, + // map its geneSymbol to a literatureGuideURL // - Resource start = graph.getModel() - .listStatements(mobyGraphSubject, MOBY.hasMapping, (RDFNode) null) - .nextStatement().getSubject(); + StmtIterator it = graph.getModel().listStatements( + mobyGraphSubject, MOBY.hasMapping, (RDFNode) null); - // Retrieve the subgraph that is "reachable" from the subject of the - // first hasMapping statement. - // - Model subgraph = ModelFactory.createDefaultModel(); - subgraph.setNsPrefixes(graph.getModel().getNsPrefixMap()); - addReachableStatements(start, graph.getModel(), subgraph); - - // Find the "geneID" statement in the subgraph; if there isn't one, - // then we can't handle it (really should throw an exception...) - // - StmtIterator it = subgraph.listStatements(null, AcmePubs.geneID, (RDFNode) null); - if (! it.hasNext()) return; - - // Get the object of the geneID statement; if it isn't a String, then - // again we can't handle it. - // - String geneID = null; - try { - geneID = it.nextStatement().getString(); - } catch (Throwable t) { - return; - } - - // Look up the gene symbol; if not found, then there's nothing to do - // - List pubDates = CitationDB.getCitations(geneID); - if (pubDates == null) return; - - // For each publication date found, replace the object of the pubDate - // statement with the publication date in the subgraph (for the first - // pub date) or in a copy (for subsequent pub dates) - // - int i = 0; - for (Iterator iter = pubDates.iterator(); iter.hasNext(); i++) - { - String pubDate = iter.next().toString(); - - // In the first match, we use the subgraph pulled from the original - // graph; in additional matches, we use a copy (whose statements have - // to be added to the original model) - // - if (i > 0) - { - subgraph = copyModel(subgraph); - graph.getModel().add(subgraph); - } - - // Find the "pubDate" statement in the subgraph; if there isn't one, - // then we can't handle it (really should throw an exception...) - // - it = subgraph.listStatements(null, AcmePubs.pubDate, (RDFNode) null); - if (! it.hasNext()) return; - - // Replace the object of the pubDate statement with a literal value, - // namely the publication date - // - Statement stmt = it.nextStatement(); - stmt.changeObject(pubDate); - } - } - - protected Model copyModel(Model model) - { - Model copy = ModelFactory.createDefaultModel(); - copy.setNsPrefixes(model.getNsPrefixMap()); - for (StmtIterator it = model.listStatements(); it.hasNext();) - { - Statement stmt = it.nextStatement(); - copy.add(copy.createStatement( - stmt.getSubject(), - stmt.getPredicate(), - stmt.getObject())); - } - return copy; - } - - /** - * Add to a model the depth-first traversal - * of a source graph starting from a given subject - * @param subject the resource that is the starting poing - * @param source the model containing a set of statements from which to add - * @param subgraph the model to which to add reachable statements - */ - protected void addReachableStatements(Resource subject, Model source, Model subgraph) - { - StmtIterator it = source.listStatements(subject, null, (RDFNode) null); - while (it.hasNext()) - { - Statement stmt = it.nextStatement(); - if (! subgraph.contains(stmt)) - { - subgraph.add(stmt); - addReachableStatements(stmt.getSubject(), source, subgraph); - addReachableStatements(stmt.getPredicate(), source, subgraph); - if (stmt.getObject() instanceof Resource) { - addReachableStatements((Resource) stmt.getObject(), source, subgraph); - } + while (it.hasNext()) + { + try + { + Statement hasMappingStmt = it.nextStatement(); + Resource mobySubject = (Resource) hasMappingStmt.getObject(); + + Statement geneSymbolStmt = + getFirstStatement(graph, mobySubject, AcmePubs.geneSymbol, null); + + String geneSymbol = geneSymbolStmt.getString(); + + Statement mapsToStmt = + getFirstStatement(graph, mobySubject, MOBY.mapsTo, null); + + Resource mobyObject = (Resource) mapsToStmt.getObject(); + + Statement literatureGuideURLStmt = + getFirstStatement(graph, mobyObject, AcmePubs.literatureGuideURL, null); + + String baseURI = "http://db.yeastgenome.org/cgi-bin/SGD/reference/geneinfo.pl?locus="; + literatureGuideURLStmt.changeObject(baseURI + geneSymbol); + } + catch (Throwable t) + { + // Something went wrong, so proceed to next hasMapping statement } - } + } } /** From gss at pub.open-bio.org Fri Apr 2 00:03:39 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:03:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020003.i3203dBB008705@pub.open-bio.org> gss Thu Apr 1 19:03:39 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com In directory pub.open-bio.org:/tmp/cvs-serv8639/ref-impl/example-providers/acmepubs.com Modified Files: .classpath Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com .classpath,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/.classpath,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/.classpath 2004/03/18 23:52:50 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/acmepubs.com/.classpath 2004/04/02 00:03:39 1.3 @@ -5,6 +5,9 @@ + + + From gss at pub.open-bio.org Fri Apr 2 00:04:21 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:04:21 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020004.i3204L20008768@pub.open-bio.org> gss Thu Apr 1 19:04:21 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv8739/ref-impl/example-providers/megapubs.com/WebRoot Modified Files: citationSearch.rdf citationSearch.n3 Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot citationSearch.rdf,1.3,1.4 citationSearch.n3,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.rdf,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.rdf 2004/03/30 23:54:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.rdf 2004/04/02 00:04:21 1.4 @@ -1,32 +1,28 @@ + xmlns:moby="http://www.s-moby.org:8080/terms#" + xmlns:sgd="http://www.sgd.org:8080/terms#" > + + + + + - - + - - - - - + - + + - - - - - - - + @@ -34,9 +30,14 @@ Cool new search - - + + - + + + + + + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.n3 2004/03/30 23:54:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/WebRoot/citationSearch.n3 2004/04/02 00:04:21 1.4 @@ -1,7 +1,8 @@ @prefix pubs: . @prefix xsd: . @prefix megapubs: . - at prefix mygrid: . + at prefix go: . + at prefix sgd: . @prefix moby: . @prefix rdfs: . @prefix rdf: . @@ -17,20 +18,20 @@ moby:hasMapping _:bnode2 . _:bnode2 - a moby:Subject, mygrid:gene_id ; + a moby:Subject, go:GeneSymbol ; moby:mapsTo _:bnode3 ; - megapubs:geneID _:bnode4 . + megapubs:geneSymbol _:bnode4 . _:bnode3 - a moby:Object, pubs:PubAbstract ; - megapubs:pubDate _:bnode6 . + a moby:Object, sgd:LiteratureGuide ; + megapubs:literatureGuideURL _:bnode6 . -megapubs:geneID +megapubs:geneSymbol a owl:DataTypeProperty ; - rdfs:domain mygrid:gene_id ; + rdfs:domain go:GeneSymbol ; rdfs:range xsd:string . -megapubs:pubDate +megapubs:literatureGuideURL a owl:DataTypeProperty ; - rdfs:domain pubs:PubAbstract ; - rdfs:range xsd:date . + rdfs:domain sgd:LiteratureGuide ; + rdfs:range xsd:anyURI . \ No newline at end of file From gss at pub.open-bio.org Fri Apr 2 00:04:21 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:04:21 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020004.i3204LYU008787@pub.open-bio.org> gss Thu Apr 1 19:04:21 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv8739/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary Modified Files: MegaPubs.java Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary MegaPubs.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary/MegaPubs.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary/MegaPubs.java 2004/03/30 23:54:26 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/megapubs.com/src/com/megapubs/vocabulary/MegaPubs.java 2004/04/02 00:04:21 1.2 @@ -1,6 +1,6 @@ package com.megapubs.vocabulary; -import org.smoby.tools.common.vocabulary.VocabularyDescription; -import com.hp.hpl.jena.graph.*; + +import org.smoby.tools.common.vocabulary.*; import com.hp.hpl.jena.rdf.model.*; public class MegaPubs extends VocabularyDescription @@ -10,6 +10,6 @@ return "http://www.megapubs.com:8080/"; } - public static final Property geneID = property(getURI(), "geneID"); - public static final Property pubDate = property(getURI(), "pubDate"); + public static final Property geneSymbol = property(getURI(), "geneSymbol"); + public static final Property literatureGuideURL = property(getURI(), "literatureGuideURL"); } From gss at pub.open-bio.org Fri Apr 2 00:05:06 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:05:06 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020005.i32056lu008825@pub.open-bio.org> gss Thu Apr 1 19:05:06 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src In directory pub.open-bio.org:/tmp/cvs-serv8800/ref-impl/server/src Modified Files: smoby.properties Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/server/src smoby.properties,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties 2004/03/27 01:27:51 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties 2004/04/02 00:05:06 1.3 @@ -1,11 +1,20 @@ # Database information section # -# DB_DRIVER_CLASS_NAME = org.postgresql.Driver -DB_DRIVER_CLASS_NAME = com.mysql.jdbc.Driver + +# Common values for MySQL and PostgreSQL +# DB_USER_ID = smobydev DB_PASSWORD = -# DB_URL = jdbc:postgresql://localhost/smoby-dev -DB_URL = jdbc:mysql://localhost/smoby-dev -# DB_TYPE = PostgreSQL -DB_TYPE = MySQL -DB_REPOSITORY_NAME = gss-test \ No newline at end of file +DB_DRIVER_CLASS_NAME = com.mysql.jdbc.Driver +DB_REPOSITORY_NAME = smoby-dev + +# Uncomment if using MySQL +# +# DB_URL = jdbc:mysql://localhost/smoby-dev +# DB_TYPE = MySQL + +# Uncomment if using PostgreSQL +# +DB_DRIVER_CLASS_NAME = org.postgresql.Driver +DB_TYPE = PostgreSQL +DB_URL = jdbc:postgresql://localhost/smoby-dev \ No newline at end of file From gss at pub.open-bio.org Fri Apr 2 00:05:16 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:05:16 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020005.i3205G0b008854@pub.open-bio.org> gss Thu Apr 1 19:05:16 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/discovery In directory pub.open-bio.org:/tmp/cvs-serv8833/ref-impl/queries/discovery Added Files: query.n3 query.rdf Log Message: moby-live/S-MOBY/ref-impl/queries/discovery query.n3,NONE,1.1 query.rdf,NONE,1.1 From gss at pub.open-bio.org Fri Apr 2 00:05:16 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:05:16 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020005.i3205Gve008869@pub.open-bio.org> gss Thu Apr 1 19:05:16 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/queries/engage In directory pub.open-bio.org:/tmp/cvs-serv8833/ref-impl/queries/engage Added Files: engage-acmepubs-citationSearch.n3 engage-megapubs-citationSearch.rdf engage-megapubs-citationSearch.n3 engage-acmepubs-citationSearch.rdf Log Message: moby-live/S-MOBY/ref-impl/queries/engage engage-acmepubs-citationSearch.n3,NONE,1.1 engage-megapubs-citationSearch.rdf,NONE,1.1 engage-megapubs-citationSearch.n3,NONE,1.1 engage-acmepubs-citationSearch.rdf,NONE,1.1 From gss at pub.open-bio.org Fri Apr 2 00:08:26 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:08:26 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020008.i3208QCs009022@pub.open-bio.org> gss Thu Apr 1 19:08:26 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes In directory pub.open-bio.org:/tmp/cvs-serv8997/ref-impl/server/WebRoot/WEB-INF/classes Added Files: smoby.properties log4j.properties Log Message: moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes smoby.properties,1.2,1.3 log4j.properties,NONE,1.1 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/smoby.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/smoby.properties 2004/03/20 00:33:08 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/server/WebRoot/WEB-INF/classes/smoby.properties 2004/04/02 00:08:26 1.3 @@ -1,8 +1,20 @@ # Database information section # -DB_DRIVER_CLASS_NAME = org.postgresql.Driver + +# Common values for MySQL and PostgreSQL +# DB_USER_ID = smobydev DB_PASSWORD = -DB_URL = jdbc:postgresql://localhost/smoby-dev +DB_DRIVER_CLASS_NAME = com.mysql.jdbc.Driver +DB_REPOSITORY_NAME = smoby-dev + +# Uncomment if using MySQL +# +# DB_URL = jdbc:mysql://localhost/smoby-dev +# DB_TYPE = MySQL + +# Uncomment if using PostgreSQL +# +DB_DRIVER_CLASS_NAME = org.postgresql.Driver DB_TYPE = PostgreSQL -DB_REPOSITORY_NAME = gss-test \ No newline at end of file +DB_URL = jdbc:postgresql://localhost/smoby-dev \ No newline at end of file From gss at pub.open-bio.org Fri Apr 2 00:45:31 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:45:31 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020045.i320jVOk009344@pub.open-bio.org> gss Thu Apr 1 19:45:31 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager In directory pub.open-bio.org:/tmp/cvs-serv9316 Added Files: .cvsignore Removed Files: SimpleProviderEngagerPanel$2.class SimpleProviderEngagerPanel$3.class SimpleProviderEngagerPanel.class SimpleProviderEngagerPanel$1.class Log Message: Major commit just before MOBY meeting at CSHL moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager .cvsignore,NONE,1.1 SimpleProviderEngagerPanel$2.class,1.1,NONE SimpleProviderEngagerPanel$3.class,1.1,NONE SimpleProviderEngagerPanel.class,1.1,NONE SimpleProviderEngagerPanel$1.class,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager/RCS/SimpleProviderEngagerPanel.class,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager/RCS/SimpleProviderEngagerPanel.class,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager/RCS/SimpleProviderEngagerPanel.class,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-clients/SimpleEngager/RCS/SimpleProviderEngagerPanel.class,v: No such file or directory From gss at pub.open-bio.org Fri Apr 2 00:55:59 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:55:59 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020055.i320txLR009423@pub.open-bio.org> gss Thu Apr 1 19:55:59 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core In directory pub.open-bio.org:/tmp/cvs-serv9398 Modified Files: .project Log Message: Change output folder moby-live/S-MOBY/ref-impl/core .project,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.project,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.project 2004/03/27 01:14:22 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.project 2004/04/02 00:55:59 1.4 @@ -16,4 +16,11 @@ org.eclipse.jdt.core.javanature + + + classes + 2 + C:/Tomcat5.0/shared/classes/from-smoby-core + + From gss at pub.open-bio.org Fri Apr 2 00:57:05 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 19:57:05 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020057.i320v57B009454@pub.open-bio.org> gss Thu Apr 1 19:57:05 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv9433/WebRoot Added Files: terms terms.n3 index.html Log Message: Moved moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot terms,NONE,1.1 terms.n3,NONE,1.1 index.html,NONE,1.1 From gss at pub.open-bio.org Fri Apr 2 01:00:19 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 20:00:19 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020100.i3210Jml009608@pub.open-bio.org> gss Thu Apr 1 20:00:19 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF In directory pub.open-bio.org:/tmp/cvs-serv9569/WebRoot/WEB-INF Added Files: .cvsignore Log Message: Moved moby-live/S-MOBY/ref-impl/example-providers/go.org/WebRoot/WEB-INF .cvsignore,NONE,1.1 From gss at pub.open-bio.org Fri Apr 2 01:00:19 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 20:00:19 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020100.i3210Jn6009593@pub.open-bio.org> gss Thu Apr 1 20:00:19 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org In directory pub.open-bio.org:/tmp/cvs-serv9569 Removed Files: terms terms.n3 index.html Log Message: Moved moby-live/S-MOBY/ref-impl/example-providers/go.org terms,1.1,NONE terms.n3,1.1,NONE index.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/RCS/terms,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/RCS/terms.n3,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/go.org/RCS/index.html,v: No such file or directory From gss at pub.open-bio.org Fri Apr 2 01:01:12 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 20:01:12 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020101.i3211C56009691@pub.open-bio.org> gss Thu Apr 1 20:01:12 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org In directory pub.open-bio.org:/tmp/cvs-serv9667 Removed Files: index.html terms terms.n3 Log Message: Moved moby-live/S-MOBY/ref-impl/example-providers/sgd.org index.html,1.1,NONE terms,1.1,NONE terms.n3,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/RCS/index.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/RCS/terms,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/RCS/terms.n3,v: No such file or directory From gss at pub.open-bio.org Fri Apr 2 01:21:06 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 20:21:06 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020121.i321L60f010234@pub.open-bio.org> gss Thu Apr 1 20:21:06 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv10213/WebRoot Added Files: terms terms.n3 index.html Log Message: Moved moby-live/S-MOBY/ref-impl/example-providers/sgd.org/WebRoot terms,NONE,1.1 terms.n3,NONE,1.1 index.html,NONE,1.1 From gss at pub.open-bio.org Fri Apr 2 01:24:59 2004 From: gss at pub.open-bio.org (Gary Schlitz) Date: Thu, 1 Apr 2004 20:24:59 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404020124.i321Oxbi010272@pub.open-bio.org> gss Thu Apr 1 20:24:59 EST 2004 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src In directory pub.open-bio.org:/tmp/cvs-serv10247/src Modified Files: smoby.properties Log Message: Fixed properties file moby-live/S-MOBY/ref-impl/server/src smoby.properties,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties 2004/04/02 00:05:06 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/smoby.properties 2004/04/02 01:24:59 1.4 @@ -5,11 +5,11 @@ # DB_USER_ID = smobydev DB_PASSWORD = -DB_DRIVER_CLASS_NAME = com.mysql.jdbc.Driver DB_REPOSITORY_NAME = smoby-dev # Uncomment if using MySQL # +# DB_DRIVER_CLASS_NAME = com.mysql.jdbc.Driver # DB_URL = jdbc:mysql://localhost/smoby-dev # DB_TYPE = MySQL From gordonp at pub.open-bio.org Fri Apr 2 16:40:23 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Fri, 2 Apr 2004 11:40:23 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404021640.i32GeN2R013343@pub.open-bio.org> gordonp Fri Apr 2 11:40:23 EST 2004 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv13318/docs Modified Files: ChangeLog Log Message: Revised documentation, interfaces and classes pertaining to XML parsing and server cache to reflect new parsing and caching schemes moby-live/Java/docs ChangeLog,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/04/01 23:24:26 1.10 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/04/02 16:40:23 1.11 @@ -1,3 +1,9 @@ +2004-04-02 Paul Gordon + + * Changed XML parsing to JAXP based interface that works on more platforms + + * Implemented Central response caching to reduce network and XML parsing loads + 2004-04-02 Martin Senger * Fixed producing graphs to deal with situation that some Moby From gordonp at pub.open-bio.org Fri Apr 2 16:40:23 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Fri, 2 Apr 2004 11:40:23 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404021640.i32GeNaY013386@pub.open-bio.org> gordonp Fri Apr 2 11:40:23 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv13318/src/main/org/biomoby/shared Modified Files: Central.java Utils.java Log Message: Revised documentation, interfaces and classes pertaining to XML parsing and server cache to reflect new parsing and caching schemes moby-live/Java/src/main/org/biomoby/shared Central.java,1.3,1.4 Utils.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2003/11/25 13:18:11 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2004/04/02 16:40:23 1.4 @@ -323,4 +323,15 @@ *************************************************************************/ void setDebug (boolean debug); + /************************************************************************** + * Set whether the server responses should cached or not to speedup + * multiple calls for the same data. + * @param shouldCache if set to false, any previously cached documents should be deleted + *************************************************************************/ + void setCacheMode(boolean shouldCache); + + /************************************************************************** + * Reports whether server responses are being cached or not. + *************************************************************************/ + boolean getCacheMode(); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java 2003/11/25 13:18:11 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java 2004/04/02 16:40:23 1.4 @@ -7,8 +7,6 @@ package org.biomoby.shared; -import org.biomoby.shared.dom.*; - import org.apache.axis.AxisFault; import javax.xml.namespace.QName; import java.io.*; @@ -24,16 +22,6 @@ public abstract class Utils { - /** Java property name ('dom.parser'). - * The property value is a fully qualified name of a class of type - * org.biomoby.shared.dom.ParserWrapper. - */ - public static final String PROP_PARSER_WRAPPER = "dom.parser"; - - /** Default parser wrapper. */ - public static final String DEFAULT_PARSER_WRAPPER = - "org.biomoby.shared.dom.wrappers.Xerces"; - /************************************************************************* * Format an exception 'e' and return it back. *

                @@ -122,72 +110,6 @@ } /************************************************************************* - * Find and return an instance of a DOM parser wrapper. A parser - * wrapper is a class allowing a uniform access to DOM parsers - - * because it defines a way how a Document is created and returned - * (see details in interface - * org.biomoby.shared.dom.ParseWrappers, or in samples in - * the distribution of Apache Xerces-2 where this is all taken - * from). - *

                - * - * The DOM parser wrapper class name is taken from, in this order: - *

                  - *
                1. Java property {@link #PROP_PARSER_WRAPPER} - *
                2. parameter parserClassName - *
                3. default value {@link #DEFAULT_PARSER_WRAPPER} - *
                - *

                - * - * This is based on the samples shown int the Apache Xerces-2 distribution. - * See more details there. This implementation differ from those samples - * in few not too crucial details: - *

                  - *
                • It can take parser class name also from a Java property - * ({@link #DEFAULT_PARSER_WRAPPER}) - *
                • It raises Moby specific exception - *
                - *

                - * @param parserClassName is a class to be instatiated (unless there is - * a Java property {@link #PROP_PARSER_WRAPPER}) - * @return an instance of a DOM parser wrapper - * @throws MobyException if unable to instantiate specified DOM parser - *************************************************************************/ - public static ParserWrapper getDOMParser (String parserClassName) - throws MobyException { - - // which parser do we want - String name = System.getProperty (PROP_PARSER_WRAPPER); - if (name != null) - parserClassName = name; - if (parserClassName == null) - parserClassName = DEFAULT_PARSER_WRAPPER; - - // create parser - try { - return (ParserWrapper)Class.forName (parserClassName).newInstance(); - } - catch (Exception e) { - throw new MobyException ("Unable to instantiate parser (" + parserClassName +")"); - } - } - - /************************************************************************* - * Find and return an instance of a DOM parser wrapper. - * It does the same as method {@link #getDOMParser(String)} except that it - * does not get any parser class name in the parameter. - *

                - * - * @return an instance of a DOM parser wrapper - * @see #getDOMParser(String) - * @throws MobyException if unable to instantiate the specified DOM parser - *************************************************************************/ - public static ParserWrapper getDOMParser() - throws MobyException { - return getDOMParser (null); - } - - /************************************************************************* * Return just the last part of the LSID identifier. An example of * an LSID identifier as used by and returned from the Moby * registry is urn:lsid:biomoby.org:objectclass:object. From gordonp at pub.open-bio.org Fri Apr 2 16:40:23 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Fri, 2 Apr 2004 11:40:23 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200404021640.i32GeNlC013362@pub.open-bio.org> gordonp Fri Apr 2 11:40:23 EST 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv13318/src/main/org/biomoby/client Modified Files: CentralImpl.java Log Message: Revised documentation, interfaces and classes pertaining to XML parsing and server cache to reflect new parsing and caching schemes moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/01 23:24:26 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/02 16:40:23 1.11 @@ -8,7 +8,6 @@ package org.biomoby.client; import org.biomoby.shared.*; -import org.biomoby.shared.dom.*; import org.apache.axis.client.*; import org.apache.axis.*; From mwilkinson at pub.open-bio.org Sun Apr 4 18:53:14 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Sun, 4 Apr 2004 14:53:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404041853.i34IrECT029372@pub.open-bio.org> mwilkinson Sun Apr 4 14:53:13 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv29353/MOBY Modified Files: Central.pm Log Message: bug in the registration object - it should return LSID's in the 'id' tag. I think it now does this properly moby-live/Perl/MOBY Central.pm,1.123,1.124 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.123 retrieving revision 1.124 diff -u -r1.123 -r1.124 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/01/15 16:04:54 1.123 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/04 18:53:13 1.124 @@ -2887,7 +2887,7 @@ my $reg = &Registration({ success => 0, message => "$message", - registration_id => "$id", + id => "$id", }); return $reg; } @@ -2897,7 +2897,7 @@ my $reg = &Registration({ success => 1, message => "$message", - registration_id => "$id", + id => "$id", }); return $reg; } From mwilkinson at pub.open-bio.org Sun Apr 4 19:08:41 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Sun, 4 Apr 2004 15:08:41 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404041908.i34J8fLj029465@pub.open-bio.org> mwilkinson Sun Apr 4 15:08:41 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv29446/MOBY Modified Files: Central.pm Log Message: bug in the registration object - it should return LSID's in the 'id' tag. I think it now does this properly moby-live/Perl/MOBY Central.pm,1.124,1.125 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.124 retrieving revision 1.125 diff -u -r1.124 -r1.125 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/04 18:53:13 1.124 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/04 19:08:41 1.125 @@ -109,7 +109,7 @@ sub Registration { my ( $details) = @_; - my $id = $details->{registration_id}; + my $id = $details->{id}; my $success = $details->{success}; my $message = $details->{message}; From mwilkinson at pub.open-bio.org Wed Apr 14 19:56:59 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 14 Apr 2004 15:56:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404141956.i3EJuxi2013404@pub.open-bio.org> mwilkinson Wed Apr 14 15:56:59 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv13353/Perl/MOBY/Client Modified Files: Central.pm CollectionArticle.pm ServiceInstance.pm SimpleArticle.pm Log Message: CommonSubs now includes support for services that use Secondary Parameter's. I am also almost finished writing an OO-interface for building/deconstructing MOBY objects, so that people don't have to learn the XML::DOM API. This is incomplete and untested yet, so don't shoot me if it doesn't work. See the docs for CommonSubs 'complexServiceInputParser' for details on how to manage services that use multiple inputs and/or secondary parameters. As soon as I get this OO interface working I will create an equivalent subroutine that parses the input into objects (but I wont remove this routine, so it wont break you servies if you use it) moby-live/Perl/MOBY/Client Central.pm,1.73,1.74 CollectionArticle.pm,1.6,1.7 ServiceInstance.pm,1.10,1.11 SimpleArticle.pm,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2004/03/26 16:10:40 1.73 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2004/04/14 19:56:59 1.74 @@ -1487,7 +1487,19 @@ } } } - + my @SECONDARIES; + my $secs = $Service->getElementsByTagName("secondaryArticles"); # there should only be one, but... who knows what + for my $in(0..$secs->getLength-1){ + my $current = $secs->item($in); + + foreach my $param($current->getChildNodes){ # child nodes will be "Parameter" tag names + next unless $param->getNodeType == ELEMENT_NODE && $param->getTagName eq "Parameter"; + my $THIS; + $THIS = MOBY::Client::SecondaryArticle->new(XML_DOM => $param); + push @SECONDARIES, $THIS; + } + } + my $Instance = MOBY::Client::ServiceInstance->new( authority => $AuthURI, authoritative => $authoritative, @@ -1498,6 +1510,7 @@ category => $cat, input => \@INPUTS, output => \@OUTPUTS, + secondary => \@SECONDARIES, description => $Description, registry => $Registry, XML => $Service->toString, @@ -1597,7 +1610,7 @@ # my ($self, $xml) = @_; my $Parser = new XML::DOM::Parser; - + #print STDERR $xml; my $doc = $Parser->parse($xml); my $Object = $doc->getDocumentElement(); my $obj = $Object->getTagName; @@ -1608,7 +1621,8 @@ my $reg = MOBY::Client::Registration->new( success => $success, message => $message, - registration_id => $id,); + registration_id => $id, + id => $id); return $reg; } =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm 2003/12/02 00:23:23 1.6 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm 2004/04/14 19:56:59 1.7 @@ -19,9 +19,42 @@ =head1 DESCRIPTION -This describes the Collection articles from the findService Response of MOBY Central -(i.e. the description of the service), it DOES NOT create collection articles -as provided by a service provider (i.e. simple articles containing data) +This describes the Collection articles from either the findService Response of MOBY Central +(i.e. the description of the service), or Collection articles +as provided in a service invocation or response message +(i.e. simple articles containing data) + +Basically it parses the following part of a findService response: + + + + someNbject + someNamespace + someNamespace2 + + + someNbject + someNamespace + someNamespace2 + + + +OR it parses the following part of a service invocation or response message: + + + + ..... + + + ..... + + + + +The articleName is retrieved with ->articleName +The contained Simples are retrieved as MOBY::Client::SimpleArticle objects +using the ->Simples method call. + =head1 AUTHORS @@ -38,8 +71,11 @@ Usage : my $IN = MOBY::Client::CollectionArticle->new(%args) Function : create CollectionArticle object Returns : MOBY::Client::SimpleArticle object - Args : articleName => $articleName (optional) - Simples => $objectType (required) + Args : either of the following two methods may be used to auto-generate the + object by passing the appropriate XML node as a string, or XML::DOM node object + + XML => $XML + XML_DOM => $XML::DOM::NODE =cut @@ -76,6 +112,29 @@ =cut + +=head2 XML + + Title : XML + Usage : $SA = $SA->XML($XML) + Function : set/reset all parameters for this object from the XML + Returns : MOBY::Client::SimpleArticle + Arguments : (optional) XML fragment from and including ... + +=cut + + +=head2 XML_DOM + + Title : XML_DOM + Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) + Function : set/reset all parameters for this object from the XML::DOM node for + Returns : MOBY::Client::SimpleArticle + Arguments : (optional) an $XML::DOM node from the article of a DOM + +=cut + + =head2 isSimple Title : isSimple @@ -104,6 +163,17 @@ =cut +=head2 isSecondary + + Title : isSecondary + Usage : $boolean = $IN->isSecondary() + Function : is this a SecondaryArticle type? + (yes, I know this is obvious) + Returns : 0 (true) + +=cut + + { # Encapsulated: # DATA @@ -115,6 +185,7 @@ articleName => [undef, 'read/write'], Simples => [[], 'read/write'], isSimple => [0, 'read' ], + isSecondary => [0, 'read' ], isCollection => [1, 'read' ], XML => [undef, 'read/write'], XML_DOM => [undef, 'read/write'], @@ -188,7 +259,7 @@ sub createFromXML { my ($self) = @_; - my $p = XML::DOM->new; + my $p = XML::DOM::Parser->new; my $doc = $p->parse($self->XML); my $root = $doc->getDocumentElement; return 0 unless ($root && ($root->getTagName eq "Collection")); @@ -198,6 +269,7 @@ sub createFromDOM { my ($self, $dom) = @_; return 0 unless ($dom && ($dom->getTagName eq "Collection")); + $self->XML($dom->toString); # set the string version of the DOM $self->articleName(""); $self->Simples([]); @@ -209,7 +281,7 @@ for my $n(0..$objects->getLength - 1){ foreach my $child($objects->item($n)->getChildNodes){ next unless $child->getNodeType == ELEMENT_NODE; - $self->addSimple(MOBY::Client::SimpleArticle->new(XML_DOM => $objects->item($n))); + $self->addSimple(MOBY::Client::SimpleArticle->new(articleName=>$self->articleName, XML_DOM => $objects->item($n))); } } return $self; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm 2004/03/18 23:10:34 1.10 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm 2004/04/14 19:56:59 1.11 @@ -186,6 +186,7 @@ type => [undef, 'read/write'], input => [[], 'read/write'], # listref of Simple and Collection articles output => [[], 'read/write'], # listref of Simple and Collection articles + secondary => [[], 'read/write'], # listref of SecondaryArticles category => [undef, 'read/write'], description => [undef, 'read/write'], registry => ['MOBY_Central', 'read/write'], =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm 2003/12/02 00:23:23 1.3 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm 2004/04/14 19:56:59 1.4 @@ -18,9 +18,30 @@ =head1 DESCRIPTION -This describes the Simple articles from the findService Response of MOBY Central -(i.e. the description of the service), it DOES NOT create simple articles -as provided by a service provider (i.e. simple articles containing data) +This describes the Simple articles from either the findService Response of MOBY Central +(i.e. the description of the service), or Simple articles +as provided in a service invocation or response message +(i.e. simple articles containing data) + +Basically it parses the following part of a findService response: + + + someNbject + someNamespace + someNamespace2 + + +OR it parses the following part of a service invocation or response message: + + + ..... + + +The articleName is retrieved with ->articleName +The namespace(s) are retrieved with ->namespaces +The objectType is retrieved with ->objectType +the id (if instantiated) is retrieved with ->id + =head1 AUTHORS @@ -37,11 +58,12 @@ Usage : my $SA = MOBY::Client::SimpleArticle->new(%args) Function : create SimpleArticle object Returns : MOBY::Client::SimpleArticle object - Args : articleName => $articleName (optional) - objectType => $objectType (required) - namespaces => \@namesapces (optional) - XML_DOM => $XML_DOM node of the simple article (optional) - XML => $XML XML string representing the simple article (optional) + Args : either of the following two methods may be used to auto-generate the + object by passing the appropriate XML node as a string, or XML::DOM node object + + XML => $XML + XML_DOM => $XML::DOM::NODE + =cut @@ -76,27 +98,27 @@ =cut -# -#=head2 XML -# -# Title : XML -# Usage : $SA = $SA->XML($XML) -# Function : set/reset all parameters for this object from the XML -# Returns : MOBY::Client::SimpleArticle -# Arguments : (optional) XML fragment from and including ... -# -#=cut -# -# -#=head2 XML_DOM -# -# Title : XML_DOM -# Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) -# Function : set/reset all parameters for this object from the XML::DOM node for -# Returns : MOBY::Client::SimpleArticle -# Arguments : (optional) an $XML::DOM node from the article of a DOM -# -#=cut + +=head2 XML + + Title : XML + Usage : $SA = $SA->XML($XML) + Function : set/reset all parameters for this object from the XML + Returns : MOBY::Client::SimpleArticle + Arguments : (optional) XML fragment from and including ... + +=cut + + +=head2 XML_DOM + + Title : XML_DOM + Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) + Function : set/reset all parameters for this object from the XML::DOM node for + Returns : MOBY::Client::SimpleArticle + Arguments : (optional) an $XML::DOM node from the article of a DOM + +=cut =head2 addNamespace @@ -136,6 +158,17 @@ =cut +=head2 isSecondary + + Title : isSecondary + Usage : $boolean = $IN->isSecondary() + Function : is this a SecondaryArticle type? + (yes, I know this is obvious) + Returns : 0 (true) + +=cut + + { # Encapsulated: # DATA @@ -147,8 +180,10 @@ articleName => [undef, 'read/write'], objectType => [undef, 'read/write'], namespaces => [[], 'read/write'], + id => [undef, 'read/write'], XML_DOM => [undef, 'read/write'], XML => [undef, 'read/write'], + isSecondary => [0, 'read' ], isSimple => [1, 'read' ], isCollection => [0, 'read' ], ); @@ -218,7 +253,7 @@ sub createFromXML { my ($self) = @_; - my $p = XML::DOM->new; + my $p = XML::DOM::Parser->new; my $doc = $p->parse($self->XML); my $root = $doc->getDocumentElement; return 0 unless ($root && ($root->getTagName eq "Simple")); @@ -228,7 +263,7 @@ sub createFromDOM { my ($self, $dom) = @_; return 0 unless ($dom && ($dom->getTagName eq "Simple")); - + $self->XML($dom->toString); # set the string version of the DOM $self->namespaces([]); # reset! $self->articleName(""); $self->objectType(""); @@ -236,7 +271,46 @@ my $attr = $dom->getAttributeNode('articleName'); my $articleName = ""; $articleName = $attr->getValue if $attr; - $self->articleName($articleName); + $self->articleName($articleName) if $articleName; # it may have already been set if this Simple is part of a Collection... + +# fork here - it may be an instantiated object (coming from a service invocation/response) +# or it may be a template object as in the SimpleArticle element of a registration call + +# if the objectType tag exists, then it is a template object + if (@{$dom->getElementsByTagName("objectType")}[0]){ + return $self->_createTemplateArticle($dom) + } + else { return $self->_createInstantiatedArticle($dom)} +# otherwise it should simpy contain an instantiated MOBY object + + +} + +sub _createInstantiatedArticle { + my ($self, $dom) = @_; + + # this will take a node from a MOBY invocation message + # and extract the object-type and namespace from the + # contained data object + + foreach my $child($dom->getChildNodes){ # there should be only one child node, and that is the data object itself; ignore whitespace + next unless $child->getNodeType == ELEMENT_NODE; + $self->objectType($child->getTagName); + my $attr = $child->getAttributeNode('namespace'); + $self->addNamespace($attr->getValue) if $attr; + my $id = $child->getAttributeNode('id'); + $self->id($id->getValue) if $id; + } + return $self; +} + +sub _createTemplateArticle { + my ($self, $dom) = @_; + + # this will take a node from a MOBY findServiceResponse + # message and extract the objectType and namespace array + # from the service signature. + my $objects = $dom->getElementsByTagName("objectType"); foreach my $child($objects->item(0)->getChildNodes){ # there must be only one in a simple! so take element 0 next unless $child->getNodeType == TEXT_NODE; @@ -254,7 +328,6 @@ return $self; } - sub AUTOLOAD { no strict "refs"; my ($self, $newval) = @_; From mwilkinson at pub.open-bio.org Wed Apr 14 19:56:59 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 14 Apr 2004 15:56:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404141956.i3EJuxs1013372@pub.open-bio.org> mwilkinson Wed Apr 14 15:56:59 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv13353/Perl/MOBY Modified Files: CommonSubs.pm Log Message: CommonSubs now includes support for services that use Secondary Parameter's. I am also almost finished writing an OO-interface for building/deconstructing MOBY objects, so that people don't have to learn the XML::DOM API. This is incomplete and untested yet, so don't shoot me if it doesn't work. See the docs for CommonSubs 'complexServiceInputParser' for details on how to manage services that use multiple inputs and/or secondary parameters. As soon as I get this OO interface working I will create an equivalent subroutine that parses the input into objects (but I wont remove this routine, so it wont break you servies if you use it) moby-live/Perl/MOBY CommonSubs.pm,1.43,1.44 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/03/19 00:24:10 1.43 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/14 19:56:59 1.44 @@ -16,51 +16,49 @@ =head2 Service-Side Paradigm The following is a generalized architecture for *all* -BioMOBY services showing how to parse incoming messages... +BioMOBY services showing how to parse incoming messages +using the subroutines provided in CommonSubs sub myServiceName { - my ($caller, $message) = @_; # get the incoming MOBY query XML - - my @queries = getInputs($message); # returns XML::DOM nodes - my $MOBY_RESPONSE = ""; # set empty response - - foreach my $query(@queries){ - - my $queryID = getInputID($query); # get the queryID attribute of the queryInput - - my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query - foreach my $input(@input_articles){ # input is a listref - - my ($articleName, $article) = @{$input}; # get the named article - - my $simple = isSimpleArticle($article); # articles may be simple or collection - my $collection = isCollectionArticle($article); - - if ($collection){ - - # do something wtih the collection... - # for example... - my @simples = getCollectedSimples($article); - # blah blah blah... - - } elsif ($simple){ - # maybe you just need the ID of the incoming query: - my ($id) = getSimpleArticleIDs('NCBI_gi', $article); # if you need the ID - - # or maybe you are going to do something with the content? - # for example, this will get the array of text lines - # for the moby:String object with the articleName 'SequenceString' - # that is in this $article - my @sequence = getNodeContentWithArticle($article, "String", "SequenceString"); - - # DO YOUR ANALYSIS HERE - my $result = ""; #whatever you analysis says - - $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename", $queryID); + my ($caller, $data) = @_; + my $MOBY_RESPONSE; # holds the response raw XML + + # genericServiceInputParser + # unpacks incoming message into an array of arrarefs. + # Each element of the array is a queryInput block, or a mobyData block + # the arrayref has the following structure: + # [SIMPLE, $queryID, $simple] + # the first element is a constant "SIMPLE" or "COLLECTION" + # the second element is the queryID (required for enumerating the responses) + # the third element is the XML::DOM for the Simple or Collection block + my (@inputs)= genericServiceInputParser($data); + # or fail properly with an empty response + return SOAP::Data->type('base64' => responseHeader("my.authURI.com") . responseFooter()) unless (scalar(@inputs)); + + # you only need to do this if you are intending to be namespace aware + # some services might not care what namespace the data is in, so long + # as there is data... + my @validNS_LSID = validateNamespaces("NCBI_gi"); # returns LSID's for each human-readable + + foreach (@inputs){ + my ($articleType, $qID, $input) = @{$_}; + unless (($articleType == SIMPLE) && ($input)){ + # in this example, we are only accepting SIMPLE types as input + # so write back an empty response block and move on to the next + $MOBY_RESPONSE .= simpleResponse("", "", $qID) ; + next; + } else { + # now take the namespace and ID from our input article + # (see pod docs for other possibilities) + my $namespace = getSimpleArticleNamespaceURI($input); # get namespace + my ($identifier) = getSimpleArticleIDs($input); # get ID (note array output! see pod) + + # here is where you do whatever manipulation you need to do + # for your particular service. + # you will be building an XML document into $MOBY_RESPONSE } - } - } - return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter; + } + return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter)); } =cut @@ -72,46 +70,63 @@ This is a service that: -CONSUMES: Object in the NCBI_Acc namespace +CONSUMES: base Object in the GO namespace EXECUTES: Retrieval -PRODUCES: GenericSequence (in the NCBI_Acc namespace) +PRODUCES: GO_Term (in the GO namespace) - use Bio::Perl; - # this subroutine is called from your dispatch_with line # in your SOAP daemon - - sub myServiceName { - my ($caller, $message) = @_; # get the incoming MOBY query XML - my @queries = getInputs($message); # returns XML::DOM nodes - my $MOBY_RESPONSE = ""; # set empty response - - foreach my $query(@queries){ - - my $queryID = getInputID($query); # get the queryID attribute of the queryInput - - my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query - foreach my $input(@input_articles){ # input is a listref - my ($articleName, $article) = @{$input}; # get the named article - next unless isSimpleArticle($article); # I only allow simple inputs in my service signature - my ($id) = getSimpleArticleIDs('NCBI_Acc', $article); # if you need the ID - my $seq; - eval {$seq = get_sequence('genbank',$id);} # suppress bioperl error messages - my $response = ""; - if ($seq){ - $length = length($seq); - $response = " - $length - $seq - "; - } - $MOBY_RESPONSE .= simpleResponse($response, '', $queryID); + + sub getGoTerm { + my ($caller, $message) = @_; + my $MOBY_RESPONSE; + my (@inputs)= genericServiceInputParser($message); # ([SIMPLE, $queryID, $simple],...) + return SOAP::Data->type('base64' => responseHeader('my.authURI.com') . responseFooter()) unless (scalar(@inputs)); + + my @validNS = validateNamespaces("GO"); # ONLY do this if you are intending to be namespace aware! + + my $dbh = _connectToGoDatabase(); + return SOAP::Data->type('base64' => responseHeader('my.authURI.com') . responseFooter()) unless $dbh; + my $sth = $dbh->prepare(q{ + select name, term_definition + from term, term_definition + where term.id = term_definition.term_id + and acc=?}); + + foreach (@inputs){ + my ($articleType, $ID, $input) = @{$_}; + unless ($articleType == SIMPLE){ + $MOBY_RESPONSE .= simpleResponse("", "", $ID); + next; + } else { + my $ns = getSimpleArticleNamespaceURI($input); + (($MOBY_RESPONSE .= simpleResponse("", "", $ID)) && (next)) + unless validateThisNamespace($ns, @validNS); # only do this if you are truly validating namespaces + my ($accession) = defined(getSimpleArticleIDs($ns, [$input]))?getSimpleArticleIDs($ns,[$input]):undef; + unless (defined($accession)){ + $MOBY_RESPONSE .= simpleResponse("", "", $ID); + next; + } + unless ($accession =~/^GO:/){ + $accession = "GO:$accession"; # we still haven't decided on whether id's should include the prefix... + } + $sth->execute($accession); + my ($term, $def) = $sth->fetchrow_array; + if ($term){ + $MOBY_RESPONSE .= simpleResponse(" + + $term + $def + ", "GO_Term_From_ID", $ID) + } else { + $MOBY_RESPONSE .= simpleResponse("", "", $ID) + } } - } - } - return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter; + } + + return SOAP::Data->type('base64' => (responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter)); } @@ -121,7 +136,8 @@ both Client and Service side to construct and parse MOBY Messages, and ensure that the message structure is valid as per the API. -It DOES NOT connect to MOBY Central for any of its functions. +It DOES NOT connect to MOBY Central for any of its functions, though it does +contact the ontology server, so it will require a network connection. =head1 AUTHORS @@ -148,11 +164,13 @@ use constant COLLECTION => 1; use constant SIMPLE => 2; +use constant SECONDARY => 3; +use constant PARAMETER => 3; # be friendly in case they use this instead use constant BE_NICE => 1; use constant BE_STRICT => 0; our @ISA = qw(Exporter); -our @EXPORT = qw(COLLECTION SIMPLE BE_NICE BE_STRICT); +our @EXPORT = qw(COLLECTION SIMPLE SECONDARY PARAMETER BE_NICE BE_STRICT); our @EXPORT_OK = qw( getSimpleArticleIDs getSimpleArticleNamespaceURI @@ -175,10 +193,13 @@ getResponseArticles getCrossReferences genericServiceInputParser + complexServiceInputParser whichDeepestParentObject getServiceNotes COLLECTION SIMPLE + SECONDARY + PARAMETER BE_NICE BE_STRICT ); @@ -204,40 +225,270 @@ getResponseArticles getCrossReferences genericServiceInputParser + complexServiceInputParser whichDeepestParentObject getServiceNotes COLLECTION SIMPLE + SECONDARY + PARAMETER BE_NICE BE_STRICT )]); +=head2 genericServiceInputParser + + name : genericServiceInputParser + function : For the MOST SIMPLE SERVICES that take single Simple or Collection inputs + and no Secondaries this routine takes the MOBY message and + breaks the objects out of it in a useful way + usage : my @inputs = genericServiceInputParser($MOBY_mssage)); + args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message + returns : @inputs - the structure of @inputs is a list of listrefs. + Each listref has three components: + 1. COLLECTION|SIMPLE|SECONDARY (i.e. constants 1, 2, 3) + 2. queryID (undef for Secondary parameters) + 3. $data - the data takes several forms + a. $article XML::DOM node for Simples + ... + b. \@article XML:DOM nodes for Collections + c. $secondary XML::DOM node + +=cut + + sub genericServiceInputParser { my ($message) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = getInputs($message); # returns XML::DOM nodes + my @queries = getInputs($message); # returns XML::DOM nodes ... foreach my $query(@queries){ my $queryID = getInputID($query); # get the queryID attribute of the queryInput - my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query + my @input_articles = getArticles($query); # get the Simple/Collection/Secondary articles making up this query ... or ... or ... foreach my $input(@input_articles){ # input is a listref my ($articleName, $article) = @{$input}; # get the named article - my $simple = isSimpleArticle($article); # articles may be simple or collection - my $collection = isCollectionArticle($article); - if ($collection){ + if (isCollectionArticle($article)){ my @simples = getCollectedSimples($article); push @inputs, [COLLECTION,$queryID, \@simples]; + } elsif (isSimpleArticle($article)){ + push @inputs, [SIMPLE,$queryID,$article]; + } elsif (isSecondaryArticle($article)){ + push @inputs, [SECONDARY,$queryID,$article]; + } + } + } + return @inputs; +} + + + + +=head2 complexServiceInputParser + + name : complexServiceInputParser + function : For more complex services taht have multiple articles for each input + and/or accept parameters, this routine will take a MOBY message and + extract the Simple/Collection/Parameter objects out of it in a + useful way. + usage : my $inputs = complexServiceInputParser($MOBY_mssage)); + args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message + returns : $inputs is a hashref with the following structure: + + $inputs->{$queryID} = [ [TYPE, $DOM], [TYPE, $DOM], [TYPE, $DOM] ] + + Simples ------------------------ + + for example, the input message: + + + + + + + Float + 10 + + + + will become: + (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module) + + $inputs->{1} = [ [SIMPLE, $DOM_name1], + [SECONDARY, $DOM_cutoff] + ] + + Please see the XML::DOM pod documentation for information about how + to parse XML DOM objects. + + + Collections -------------------- + + With inputs that have collections these are presented as a + listref of Simple article DOM's. So for the following message: + + + + + + + + + + + + Float + 10 + + + + will become + + $inputs->{1} = [ [COLLECTION, [$DOM, $DOM] ], + [SECONDARY, $DOM_cutoff] + ] + + Please see the XML::DOM pod documentation for information about how + to parse XML DOM objects. + + +=cut + + +sub complexServiceInputParser { + my ($message) = @_; # get the incoming MOBY query XML + my @inputs; # set empty response + my @queries = getInputs($message); # returns XML::DOM nodes ... + my %input_parameters; # $input_parameters{$queryID} = [ + + foreach my $query(@queries){ + my $queryID = getInputID($query); # get the queryID attribute of the queryInput + my @input_articles = getArticles($query); # get the Simple/Collection/Secondary articles making up this query ... or ... or ... + foreach my $input(@input_articles){ # input is a listref + my ($articleName, $article) = @{$input}; # get the named article + if (isCollectionArticle($article)){ + my @simples = getCollectedSimples($article); + push @{$input_parameters{$queryID}}, [COLLECTION, \@simples]; + } elsif (isSimpleArticle($article)){ + push @{$input_parameters{$queryID}}, [SIMPLE, $article]; + } elsif (isSecondaryArticle($article)){ + push @{$input_parameters{$queryID}}, [SECONDARY, $article]; + } + } + } + return \%input_parameters; +} + + +=head2 getArticles + + name : getArticles + function : get the Simple/Collection/Parameter articles for a single queryInput + or queryResponse node + usage : @articles = getArticles($XML) + args : raw XML or XML::DOM of a queryInput, mobyData, or queryResponse block (e.g. from getInputs) + returns : a list of listrefs; each listref is one component of the queryInput. + a single queryInput/Response may consist of one or more named or unnamed + simple, collection, or parameter articles. + The listref structure is thus [name, $ARTICLE_DOM]: + + e.g.: @articles = ['name1', $SIMPLE_DOM] + + generated from the following sample XML: + + + + + + + + or : @articles = ['name1', $COLL_DOM], ['paramname1', $PARAM_DOM] + + generated from the following sample XML: + + + + + + + + + + + + Float + 10 + + + +=cut + + +sub getArticles { + + my ($moby) = @_; + unless (ref($moby) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($moby); + $moby = $doc->getDocumentElement(); + } + + return undef unless $moby->getNodeType == ELEMENT_NODE; + return undef unless (($moby->getTagName =~ /queryInput/) || ($moby->getTagName =~ /queryResponse/) || ($moby->getTagName =~ /mobyData/)); + my @articles; + foreach my $child($moby->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them + next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace + next unless ($child->getTagName =~ /Simple/ || $child->getTagName =~ /Collection/ || $child->getTagName =~ /Parameter/); + my $articleName = $child->getAttribute('articleName'); + $articleName ||= $child->getAttribute('moby:articleName'); + push @articles, [$articleName, $child]; # push the named child DOM elements (which are or , ) + } + return @articles; # return them. +} + - } elsif ($simple){ + +=head2 genericServiceInputParserAsObject + + name : DO NOT USE! + function : to take a MOBY message and break the objects out of it. This is identical + to the subroutine above, except that it returns the data as + Objects rather than XML::DOM nodes + usage : my @inputs = genericServiceInputParser($MOBY_mssage)); + args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message + returns : @inputs - the structure of @inputs is a list of listrefs. + Each listref has three components: + 1. COLLECTION|SIMPLE|SECONDARY (i.e. constants 1, 2, 3) + 2. queryID (undef for Secondary parameters) + 3. $data - either MOBY::Client::SimpleArticle, CollectionArticle, or SecondaryArticle + +=cut + + +sub genericServiceInputParserAsObject { + my ($message) = @_; # get the incoming MOBY query XML + my @inputs; # set empty response + my @queries = getInputs($message); # returns XML::DOM nodes ... + + foreach my $query(@queries){ + my $queryID = getInputID($query); # get the queryID attribute of the queryInput + my @input_articles = getArticlesAsObjects($query); # get the Simple/Collection articles making up this query ... or ... or ...isCollection){ + my @simples = getCollectedSimples($article->XML); + push @inputs, [COLLECTION,$queryID, \@simples]; + } elsif ($article->isSimple){ push @inputs, [SIMPLE,$queryID,$article]; + } elsif ($article->isSecondary){ + push @inputs, [SECONDARY,$queryID,$article]; } } } return @inputs; } + ################################################# ################################## ################################## @@ -392,17 +643,16 @@ $data ||=''; # initialize to avoid uninit value errors $qID ||=""; $articleName ||=""; - if ($articleName) { return " - $data + $data "; } elsif($data) { return " - $data + $data "; } else { @@ -449,7 +699,7 @@ $data ||=[]; $qID ||= ''; unless ((ref($data) =~ /array/i) && $data->[0]){ # we're expecting an arrayref as input data,and it must not be empty - return ""; + return ""; } foreach (@{$data}){ @@ -465,7 +715,7 @@ } if ($articleName) { return " - + $content @@ -473,7 +723,7 @@ "; } else { return " - + $content "; @@ -545,8 +795,8 @@ function : get the queryInput block(s) as XML::DOM nodes usage : @queryInputs = getInputArticles($XML) args : the raw XML of a query, or an XML::DOM document - returns : a list of XML::DOM::Node's, each is a queryInput. - Note : Remember that queryInputs are numbered! This is what you + returns : a list of XML::DOM::Node's, each is a queryInput or mobyData block. + Note : Remember that these blocks are enumerated! This is what you pass as the third argument to the simpleResponse or collectionResponse subroutine to associate the numbered input to the numbered response @@ -562,16 +812,14 @@ my $doc = $parser->parse($XML); $moby = $doc->getDocumentElement(); } + my @queries; - my $x = $moby->getElementsByTagName('queryInput'); # get the queryInput block - unless ($x->item(0)){ - $x = $moby->getElementsByTagName('moby:queryInput'); + foreach my $querytag('queryInput', 'moby:queryInput', 'mobyData', 'moby:mobyData'){ + my $x = $moby->getElementsByTagName($querytag); # get the queryInput block + for (0..$x->getLength-1){ # there may be more than one queryInput per message + push @queries, $x->item($_); + } } - - my @queries; - for (0..$x->getLength-1){ # there may be more than one queryInput per message - push @queries, $x->item($_); - } return @queries; # return them in the order that they were discovered. } @@ -581,9 +829,9 @@ name : getInputID function : get the value of the queryID element usage : @queryInputs = getInputID($XML) - args : the raw XML or XML::DOM of a block + args : the raw XML or XML::DOM of a queryInput or mobyData block (e.g. from getInputs) returns : integer, or '' - Note : queryInputs and queryResponses are coordinately enumerated! + Note : Inputs and Responses are coordinately enumerated! The integer you get here is what you pass as the third argument to the simpleResponse or collectionResponse subroutine to associate the numbered input to the numbered response @@ -598,44 +846,61 @@ my $doc = $parser->parse($XML); $XML = $doc->getDocumentElement(); } - return '' unless $XML->getTagName =~ /queryInput/; + return '' unless (($XML->getTagName =~ /queryInput/) || ($XML->getTagName =~ /mobyData/)); my $qid = $XML->getAttribute('queryID'); + $qid ||= $XML->getAttribute('moby:queryID'); + return defined($qid)?$qid:''; } -=head2 getArticles +=head2 getArticlesAsObjects - name : getArticles + name : getArticlesAsObjects function : get the Simple/Collection articles for a single queryInput - or queryResponse node + or queryResponse node, rethrning them as SimpleArticle, + SecondaryArticle, or ServiceInstance objects usage : @articles = getArticles($XML) - args : raw XML or XML::DOM of a moby:queryInput or a moby:queryResponse block + args : raw XML or XML::DOM of a moby:queryInput, moby:queryResponse block returns : a list of listrefs; each listref is one component of the queryInput. - a single queryInput/Responsemay consist of one or more named or unnamed - simple or collection articles. The listref structure is thus [name, $ARTICLE]: + a single queryInput/Response may consist of one or more named or unnamed + simple, collection, or parameter articles. + The listref structure is thus [name, $ARTICLE_OBJECT]: - e.g.: @articles = ['name1', $SIMPLE_DOM] - or : @articles = ['name1', $COLLECTION_DOM], ['name2', $SIMPLE_DOM]... + e.g.: @articles = ['name1', $SimpleArticle] - the former is generated from the following sample XML: + generated from the following sample XML: + + or : @articles = ['name1', $CollectionArticle], ['paramname1', $SecondaryArticle] + + generated from the following sample XML: + - - - + + + + + + + + + + Float + 10 + =cut -sub getArticles { +sub getArticlesAsObjects { my ($moby) = @_; unless (ref($moby) =~ /XML\:\:DOM/){ @@ -645,14 +910,21 @@ } return undef unless $moby->getNodeType == ELEMENT_NODE; - return undef unless ($moby->getTagName =~ /queryInput/ || $moby->getTagName =~ /queryResponse/); + return undef unless (($moby->getTagName =~ /queryInput/) || ($moby->getTagName =~ /queryResponse/) || ($moby->getTagName =~ /mobyData/)); my @articles; foreach my $child($moby->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace - next unless ($child->getTagName =~ /Simple/ || $child->getTagName =~ /Collection/); - my $articleName = $child->getAttribute('articleName'); - $articleName ||= $child->getAttribute('moby:articleName'); - push @articles, [$articleName, $child]; # take the child elements, which are or + next unless ($child->getTagName =~ /Simple/ || $child->getTagName =~ /Collection/ || $child->getTagName =~ /Parameter/); + my $object; + if ($child->getTagName =~ /Simple/){ + $object = MOBY::Client::SimpleArticle->new(XML_DOM => $child); + } elsif ($child->getTagName =~ /Collection/){ + $object = MOBY::Client::CollectionArticle->new(XML_DOM => $child); + } elsif ($child->getTagName =~ /Parameter/){ + $object = MOBY::Client::CollectionArticle->new(XML_DOM => $child); + } + next unless $object; + push @articles, $object; # take the child elements, which are or } return @articles; # return them. } @@ -707,18 +979,18 @@ the former is generated from the following XML: ... - - + + - - + + - - + + ... =cut @@ -733,11 +1005,13 @@ $moby = $doc->getDocumentElement(); } - my $x = $moby->getElementsByTagName('queryInput'); # get the queryInput block - unless ($x->item(0)){ - $x = $moby->getElementsByTagName('moby:queryInput'); + my $x; + foreach ('queryInput', 'moby:queryInput', 'mobyData', 'moby:mobyData'){ + $x = $moby->getElementsByTagName($_); # get the queryInput block + last if $x->item(0); } - + return undef unless $x->item(0); # in case there was no match at all + my @queries; for (0..$x->getLength-1){ # there may be more than one queryInput per message my @this_query; @@ -750,6 +1024,7 @@ return @queries; # return them in the order that they were discovered. } + =head2 isSimpleArticle name : isSimpleArticle @@ -798,6 +1073,57 @@ return 0; } + +=head2 isSecondaryArticle + + name : isSecondaryArticle + function : tests XML (text) or an XML DOM node to see if it represents a Secondary article + usage : if (isSecondaryArticle($node)){do something to it} + input : an XML::DOM node, an XML::DOM::Document or straight XML + returns : boolean + +=cut + +sub isSecondaryArticle { + my ($DOM) = @_; + unless (ref($DOM) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc; + eval {$doc = $parser->parse($DOM);}; + return 0 if ($@); + $DOM = $doc->getDocumentElement(); + } + $DOM = $DOM->getDocumentElement if ($DOM->isa("XML::DOM::Document")); + return 1 if ($DOM->getTagName =~ /Parameter/); + return 0; +} + + +=head2 extractRawContent + + name : extractRawContent + function : pass me an article (Simple, or Collection) and I'll give you the + content AS A STRING - i.e. the raw XML of the contained MOBY Object(s) + usage : extractRawContent($simple) + input : the one element of the output from getArticles + returns : string + +=cut + + +sub extractRawContent { + my ($article) = @_; + return "" unless $article; + return "" unless ref($article) =~ /XML::DOM/; + my $response; + foreach ($article->getChildNodes){ + $response .= $_->toString; + } + return $response; + +} + + =head2 getNodeContentWithArticle name : getNodeContentWithArticle @@ -815,16 +1141,16 @@ For example, in the following XML: ... ... - - + + 3 ATG - - + + ... ... @@ -843,32 +1169,6 @@ =cut - -=head2 extractRawContent - - name : extractRawContent - function : pass me an article (Simple, or Collection) and I'll give you the - content AS A STRING - i.e. the raw XML of the contained MOBY Object(s) - usage : extractRawContent($simple) - input : the one element of the output from getArticles - returns : string - -=cut - - -sub extractRawContent { - my ($article) = @_; - return "" unless $article; - return "" unless ref($article) =~ /XML::DOM/; - my $response; - foreach ($article->getChildNodes){ - $response .= $_->toString; - } - return $response; - -} - - sub getNodeContentWithArticle{ # give me a DOM, a TagName, an articleName and I will return you the content # of that node **as a string** (beware if there are additional XML tags in there!) @@ -989,30 +1289,32 @@ my @collections; my @Xrefs; my $success = 0; - my $responses = $moby->getElementsByTagName('moby:queryResponse'); - $responses ||= $moby->getElementsByTagName('queryResponse'); - foreach my $n(0..($responses->getLength - 1)){ - my $resp = $responses->item($n); - foreach my $response_component($resp->getChildNodes){ - next unless $response_component->getNodeType == ELEMENT_NODE; - if (($response_component->getTagName eq "Simple") || ($response_component->getTagName eq "moby:Simple")){ - foreach my $Object($response_component->getChildNodes) { - next unless $Object->getNodeType == ELEMENT_NODE; - $success = 1; - push @objects,$Object; - } - } elsif (($response_component->getTagName eq "Collection") || ($response_component->getTagName eq "moby:Collection")){ - my @objects; - foreach my $simple($response_component->getChildNodes){ - next unless $simple->getNodeType == ELEMENT_NODE; - next unless (($simple->getTagName eq "Simple") || ($simple->getTagName eq "moby:Simple")); - foreach my $Object($simple->getChildNodes) { + foreach my $which ('moby:queryResponse', 'queryResponse', 'mobyData', 'moby:mobyData'){ + my $responses = $moby->getElementsByTagName($which); + next unless $responses; + foreach my $n(0..($responses->getLength - 1)){ + my $resp = $responses->item($n); + foreach my $response_component($resp->getChildNodes){ + next unless $response_component->getNodeType == ELEMENT_NODE; + if (($response_component->getTagName eq "Simple") || ($response_component->getTagName eq "moby:Simple")){ + foreach my $Object($response_component->getChildNodes) { next unless $Object->getNodeType == ELEMENT_NODE; $success = 1; push @objects,$Object; } + } elsif (($response_component->getTagName eq "Collection") || ($response_component->getTagName eq "moby:Collection")){ + my @objects; + foreach my $simple($response_component->getChildNodes){ + next unless $simple->getNodeType == ELEMENT_NODE; + next unless (($simple->getTagName eq "Simple") || ($simple->getTagName eq "moby:Simple")); + foreach my $Object($simple->getChildNodes) { + next unless $Object->getNodeType == ELEMENT_NODE; + $success = 1; + push @objects,$Object; + } + } + push @collections, \@objects; #I'm not using collections yet, so we just use Simples. } - push @collections, \@objects; #I'm not using collections yet, so we just use Simples. } } } From mwilkinson at pub.open-bio.org Wed Apr 14 20:10:35 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 14 Apr 2004 16:10:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404142010.i3EKAZia013510@pub.open-bio.org> mwilkinson Wed Apr 14 16:10:35 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv13487/MOBY Modified Files: CommonSubs.html CommonSubs.pm Log Message: updating docs and HTML docs moby-live/Perl/MOBY CommonSubs.html,1.8,1.9 CommonSubs.pm,1.44,1.45 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html 2003/12/27 20:24:52 1.8 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html 2004/04/14 20:10:35 1.9 @@ -15,9 +15,9 @@ @@ -61,57 +68,55 @@ MOBY Services

                -
                -

                Client Side Paradigm

                +

                Client Side Paradigm

                +

                not written yet

                Service-Side Paradigm

                The following is a generalized architecture for *all* -BioMOBY services showing how to parse incoming messages...

                +BioMOBY services showing how to parse incoming messages +using the subroutines provided in CommonSubs

                  sub myServiceName {
                -   my ($caller, $message) = @_;  # get the incoming MOBY query XML
                -
                -   my @queries = getInputs($message);  # returns XML::DOM nodes
                -   my $MOBY_RESPONSE = "";           # set empty response
                - 
                -   foreach my $query(@queries){
                -
                -     my $queryID = getInputID($query);  # get the queryID attribute of the queryInput
                -     
                -     my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query
                -     foreach my $input(@input_articles){       # input is a listref
                -
                -        my ($articleName, $article) = @{$input}; # get the named article
                -        
                -        my $simple = isSimpleArticle($article);  # articles may be simple or collection
                -        my $collection = isCollectionArticle($article);
                -
                -        if ($collection){
                -
                -            # do something wtih the collection...
                -            # for example...
                -            my @simples = getCollectedSimples($article);
                -            # blah blah blah...
                -            
                -        } elsif ($simple){
                -            # maybe you just need the ID of the incoming query:
                -            my ($id) = getSimpleArticleIDs('NCBI_gi', $article); # if you need the ID
                -
                -            # or maybe you are going to do something with the content?
                -            # for example, this will get the array of text lines
                -            # for the moby:String object with the articleName 'SequenceString'
                -            # that is in this $article
                -            my @sequence = getNodeContentWithArticle($article, "String", "SequenceString");
                -
                -            #  DO YOUR ANALYSIS HERE
                -            my $result = ""; #whatever you analysis says
                -            
                -            $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename", $queryID);
                +    my ($caller, $data) = @_;
                +    my $MOBY_RESPONSE; # holds the response raw XML
                +    
                +        # genericServiceInputParser
                +        # unpacks incoming message into an array of arrarefs.
                +        # Each element of the array is a queryInput block, or a mobyData block
                +        # the arrayref has the following structure:
                +        # [SIMPLE, $queryID, $simple]
                +        # the first element is a constant "SIMPLE" or "COLLECTION"
                +        # the second element is the queryID (required for enumerating the responses)
                +        # the third element is the XML::DOM for the Simple or Collection block    
                +    my (@inputs)= genericServiceInputParser($data); 
                +        # or fail properly with an empty response
                +    return SOAP::Data->type('base64' => responseHeader("my.authURI.com") . responseFooter()) unless (scalar(@inputs));
                +    
                +        # you only need to do this if you are intending to be namespace aware
                +        # some services might not care what namespace the data is in, so long
                +        # as there is data...
                +    my @validNS_LSID = validateNamespaces("NCBI_gi");  # returns LSID's for each human-readable
                +
                +    foreach (@inputs){
                +        my ($articleType, $qID, $input) = @{$_};
                +        unless (($articleType == SIMPLE) && ($input)){
                +                # in this example, we are only accepting SIMPLE types as input
                +                # so write back an empty response block and move on to the next
                +            $MOBY_RESPONSE .= simpleResponse("", "", $qID) ;
                +            next;
                +        } else {
                +                # now take the namespace and ID from our input article
                +                # (see pod docs for other possibilities)
                +            my $namespace = getSimpleArticleNamespaceURI($input); # get namespace
                +            my ($identifier) = getSimpleArticleIDs($input);  # get ID (note array output! see pod)
                +                        
                +            # here is where you do whatever manipulation you need to do
                +            # for your particular service.
                +            # you will be building an XML document into $MOBY_RESPONSE            
                         }
                -     }
                -   }
                -   return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter;
                +    }
                +    return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter));    
                  }

                @@ -119,45 +124,62 @@

                EXAMPLE

                A COMPLETE EXAMPLE OF AN EASY MOBY SERVICE

                This is a service that:

                -

                CONSUMES: Object in the NCBI_Acc namespace -EXECUTES: Retrieval -PRODUCES: GenericSequence (in the NCBI_Acc namespace)

                - use Bio::Perl;
                - 
                + CONSUMES:  base Object in the GO namespace
                + EXECUTES:  Retrieval
                + PRODUCES:  GO_Term (in the GO namespace)
                +
                  # this subroutine is called from your dispatch_with line
                - # in your SOAP daemon
                - 
                - sub myServiceName {
                -   my ($caller, $message) = @_;  # get the incoming MOBY query XML
                + # in your SOAP daemon
                -   my @queries = getInputs($message);  # returns XML::DOM nodes
                -   my $MOBY_RESPONSE = "";           # set empty response
                - 
                -   foreach my $query(@queries){
                -
                -     my $queryID = getInputID($query);  # get the queryID attribute of the queryInput
                -     
                -     my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query
                -     foreach my $input(@input_articles){       # input is a listref
                -        my ($articleName, $article) = @{$input}; # get the named article
                -        next unless isSimpleArticle($article);   # I only allow simple inputs in my service signature
                -        my ($id) = getSimpleArticleIDs('NCBI_Acc', $article); # if you need the ID
                -        my $seq;
                -        eval {$seq = get_sequence('genbank',$id);} # suppress bioperl error messages
                -        my $response = "";
                -        if ($seq){
                -            $length = length($seq);
                -            $response = "<GenericSequence namespace='NCBI_Acc' id='$id'>
                -                           <Integer namespace='' id='' articleName='Length'>$length</Integer>
                -                           <String namespace='' id='' articleName='SequenceString'>$seq</String>
                -                         </GenericSequence>";
                -        }
                -            $MOBY_RESPONSE .= simpleResponse($response, '', $queryID);
                + sub getGoTerm {
                +    my ($caller, $message) = @_;
                +    my $MOBY_RESPONSE;
                +    my (@inputs)= genericServiceInputParser($message); # ([SIMPLE, $queryID, $simple],...)
                +    return SOAP::Data->type('base64' => responseHeader('my.authURI.com') . responseFooter()) unless (scalar(@inputs));
                +
                +    my @validNS = validateNamespaces("GO");  # ONLY do this if you are intending to be namespace aware!
                +
                +    my $dbh = _connectToGoDatabase();
                +    return SOAP::Data->type('base64' => responseHeader('my.authURI.com') . responseFooter()) unless $dbh;
                +    my $sth = $dbh->prepare(q{
                +       select name, term_definition
                +       from term, term_definition
                +       where term.id = term_definition.term_id
                +       and acc=?});
                +
                +    foreach (@inputs){
                +        my ($articleType, $ID, $input) = @{$_};
                +        unless ($articleType == SIMPLE){
                +            $MOBY_RESPONSE .= simpleResponse("", "", $ID);
                +            next;
                +        } else {
                +            my $ns = getSimpleArticleNamespaceURI($input);
                +            (($MOBY_RESPONSE .= simpleResponse("", "", $ID)) && (next))
                +                unless validateThisNamespace($ns, @validNS);  # only do this if you are truly validating namespaces
                +            my ($accession) = defined(getSimpleArticleIDs($ns, [$input]))?getSimpleArticleIDs($ns,[$input]):undef;
                +            unless (defined($accession)){
                +                $MOBY_RESPONSE .= simpleResponse("", "", $ID);
                +                next;
                +            }
                +            unless ($accession =~/^GO:/){
                +                 $accession = "GO:$accession";  # we still haven't decided on whether id's should include the prefix...
                +            }
                +            $sth->execute($accession);        
                +            my ($term, $def) = $sth->fetchrow_array;
                +            if ($term){
                +                 $MOBY_RESPONSE .= simpleResponse("
                +                 <moby:GO_Term namespace='GO' id='$accession'>
                +                  <moby:String namespace='' id='' articleName='Term'>$term</moby:String>
                +                  <moby:String namespace='' id='' articleName='Definition'>$def</moby:String>
                +                 </moby:GO_Term>", "GO_Term_From_ID", $ID)
                +            } else {
                +                 $MOBY_RESPONSE .= simpleResponse("", "", $ID)
                +            }
                         }
                -     }
                -   }
                -   return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter;
                +    }
                +    
                +    return SOAP::Data->type('base64' => (responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter));    
                  }

                @@ -166,7 +188,8 @@

                CommonSubs are used to do various manipulations of MOBY Messages. It is useful both Client and Service side to construct and parse MOBY Messages, and ensure that the message structure is valid as per the API.

                -

                It DOES NOT connect to MOBY Central for any of its functions.

                +

                It DOES NOT connect to MOBY Central for any of its functions, though it does +contact the ontology server, so it will require a network connection.


                @@ -179,6 +202,150 @@

                METHODS

                +

                genericServiceInputParser

                +
                + name     : genericServiceInputParser
                + function : For the MOST SIMPLE SERVICES that take single Simple or Collection inputs
                +            and no Secondaries this routine takes the MOBY message and
                +            breaks the objects out of it in a useful way
                + usage    : my @inputs = genericServiceInputParser($MOBY_mssage));
                + args     : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message
                + returns  : @inputs - the structure of @inputs is a list of listrefs.
                +            Each listref has three components:
                +                1. COLLECTION|SIMPLE|SECONDARY (i.e. constants 1, 2, 3)
                +                2. queryID (undef for Secondary parameters)
                +                3. $data - the data takes several forms
                +                         a. $article XML::DOM node for Simples
                +                            <queryInput...>...</queryInput>
                +                         b. \@article XML:DOM nodes for Collections
                +                         c. $secondary XML::DOM node
                +

                +

                +

                complexServiceInputParser

                +
                + name     : complexServiceInputParser
                + function : For more complex services taht have multiple articles for each input
                +            and/or accept parameters, this routine will take a MOBY message and
                +            extract the Simple/Collection/Parameter objects out of it in a
                +            useful way.
                + usage    : my $inputs = complexServiceInputParser($MOBY_mssage));
                + args     : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message
                + returns  : $inputs is a hashref with the following structure:
                +            
                +            $inputs->{$queryID} = [ [TYPE, $DOM], [TYPE, $DOM], [TYPE, $DOM] ]
                +            
                +            Simples ------------------------
                +            
                +            for example, the input message:
                +            
                +                <queryInput queryID = '1'>
                +                    <Simple articleName='name1'>
                +                       <Object namespace=blah id=blah/>
                +                    </Simple>
                +                    <Parameter articleName='cutoff'>
                +                       <datatype>Float</datatype>
                +                       <default>10</default>
                +                    </Parameter>
                +                </queryInput>
                +
                +            will become:
                +            (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module)
                +            
                +            $inputs->{1} = [ [SIMPLE, $DOM_name1],
                +                             [SECONDARY, $DOM_cutoff]
                +                           ]
                +
                +            Please see the XML::DOM pod documentation for information about how
                +            to parse XML DOM objects.
                +            
                +            
                +            Collections --------------------
                +            
                +            With inputs that have collections these are presented as a
                +            listref of Simple article DOM's.  So for the following message:
                +            
                +                <queryInput>
                +                    <Collection articleName='name1'>
                +                      <Simple>
                +                       <Object namespace=blah id=blah/>
                +                      </Simple>
                +                      <Simple>
                +                       <Object namespace=blah id=blah/>
                +                      </Simple>
                +                    </Collection>
                +                    <Parameter articleName='cutoff'>
                +                       <datatype>Float</datatype>
                +                       <default>10</default>
                +                    </Parameter>
                +                </queryInput>
                +
                +            will become
                +            
                +            $inputs->{1} = [ [COLLECTION, [$DOM, $DOM] ],
                +                             [SECONDARY, $DOM_cutoff]
                +                           ]
                +
                +            Please see the XML::DOM pod documentation for information about how
                +            to parse XML DOM objects.
                +

                +

                +

                getArticles

                +
                + name     : getArticles
                + function : get the Simple/Collection/Parameter articles for a single queryInput
                +            or queryResponse node
                + usage    : @articles = getArticles($XML)
                + args     : raw XML or XML::DOM of a queryInput, mobyData, or queryResponse block (e.g. from getInputs)
                + returns  : a list of listrefs; each listref is one component of the queryInput.
                +            a single queryInput/Response may consist of one or more named or unnamed
                +            simple, collection, or parameter articles.
                +            The listref structure is thus [name, $ARTICLE_DOM]:
                +            
                +    e.g.:  @articles = ['name1', $SIMPLE_DOM]
                +
                +            generated from the following sample XML:
                +
                +                <queryInput>
                +                    <Simple articleName='name1'>
                +                      <Object namespace=blah id=blah/>
                +                    </Simple>
                +                </queryInput>
                +        
                +    or  :  @articles = ['name1', $COLL_DOM], ['paramname1', $PARAM_DOM]
                +
                +            generated from the following sample XML:
                +
                +                <queryInput>
                +                    <Collection articleName='name1'>
                +                      <Simple>
                +                       <Object namespace=blah id=blah/>
                +                      </Simple>
                +                      <Simple>
                +                       <Object namespace=blah id=blah/>
                +                      </Simple>
                +                    </Collection>
                +                    <Parameter articleName='e value cutoff'>
                +                       <datatype>Float</datatype>
                +                       <default>10</default>
                +                    </Parameter>
                +                </queryInput>
                +

                +

                +

                genericServiceInputParserAsObject

                +
                + name     : DO NOT USE!
                + function : to take a MOBY message and break the objects out of it.  This is identical
                +            to the subroutine above, except that it returns the data as
                +            Objects rather than XML::DOM nodes
                + usage    : my @inputs = genericServiceInputParser($MOBY_mssage));
                + args     : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message
                + returns  : @inputs - the structure of @inputs is a list of listrefs.
                +            Each listref has three components:
                +                1. COLLECTION|SIMPLE|SECONDARY (i.e. constants 1, 2, 3)
                +                2. queryID (undef for Secondary parameters)
                +                3. $data - either MOBY::Client::SimpleArticle, CollectionArticle, or SecondaryArticle
                +

                +

                getSimpleArticleIDs

                  name     : getSimpleArticleIDs
                @@ -243,12 +410,16 @@
                 

                responseHeader

                - name     : responseHeader($auth)
                - function : print the XML string of a MOBY response header
                - usage    : return responseHeader('illuminae.com') . $DATA . responseFooter;
                - args     : a string representing the service providers authority URI
                - caveat   : will soon be expanded to include service provision info
                -            and additional namespace declarations
                + name     : responseHeader
                + function : print the XML string of a MOBY response header +/- serviceNotes
                + usage    : responseHeader('illuminae.com')
                +            responseHeader(
                +                -authority => 'illuminae.com',
                +                -note => 'here is some data from the service provider')
                + args     : a string representing the service providers authority URI,
                +            OR a set of named arguments with the authority and the
                +            service provision notes.
                + caveat   : 
                  notes    :  returns everything required up to the response articles themselves.
                              i.e. something like:
                  <?xml version='1.0' encoding='UTF-8'?>
                @@ -274,8 +445,8 @@
                  function : get the queryInput block(s) as XML::DOM nodes
                  usage    : @queryInputs = getInputArticles($XML)
                  args     : the raw XML of a <MOBY> query, or an XML::DOM document
                - returns  : a list of XML::DOM::Node's, each is a queryInput.
                - Note     : Remember that queryInputs are numbered!  This is what you
                + returns  : a list of XML::DOM::Node's, each is a queryInput or mobyData block.
                + Note     : Remember that these blocks are enumerated!  This is what you
                             pass as the third argument to the simpleResponse or collectionResponse
                             subroutine to associate the numbered input to the numbered response

                @@ -285,40 +456,23 @@ name : getInputID function : get the value of the queryID element usage : @queryInputs = getInputID($XML) - args : the raw XML or XML::DOM of a <queryInput> block + args : the raw XML or XML::DOM of a queryInput or mobyData block (e.g. from getInputs) returns : integer, or '' - Note : queryInputs and queryResponses are coordinately enumerated! + Note : Inputs and Responses are coordinately enumerated! The integer you get here is what you pass as the third argument to the simpleResponse or collectionResponse subroutine to associate the numbered input to the numbered response

                -

                getArticles

                +

                getArticlesAsObjects

                - name     : getArticles
                + name     : DO NOT USE!!
                  function : get the Simple/Collection articles for a single queryInput
                -            or queryResponse node
                +            or queryResponse node, rethrning them as SimpleArticle,
                +            SecondaryArticle, or ServiceInstance objects
                  usage    : @articles = getArticles($XML)
                - args     : raw XML or XML::DOM of a moby:queryInput or a moby:queryResponse block
                - returns  : a list of listrefs; each listref is one component of the queryInput.
                -            a single queryInput/Responsemay consist of one or more named or unnamed
                -            simple or collection articles.  The listref structure is thus [name, $ARTICLE]:
                -            
                -            e.g.:  @articles = ['name1', $SIMPLE_DOM]
                -            or  :  @articles = ['name1', $COLLECTION_DOM], ['name2', $SIMPLE_DOM]...
                -
                -            the former is generated from the following sample XML:
                -
                -                <queryInput>
                -                    <Simple articleName='name1'>
                -                      <Object namespace=blah id=blah/>
                -                    </Simple>
                -                </queryInput>
                -                <queryInput>
                -                    <Simple articleName='name1'>
                -                      <Object namespace=blah id=blah/>
                -                    </Simple>
                -                </queryInput>
                + args : raw XML or XML::DOM of a moby:queryInput, moby:queryResponse block + returns :

                getCollectedSimples

                @@ -346,18 +500,18 @@ the former is generated from the following XML: ... - <moby:Query> - <queryInput> + <moby:mobyContent> + <moby:mobyData> <Simple> <Object namespace=blah id=blah/> </Simple> - </queryInput> - <queryInput> + </moby:mobyData> + <moby:mobyData> <Simple> <Object namespace=blah id=blah/> </Simple> - </queryInput> - </moby:Query> + </moby:mobyData> + </moby:mobyContent> ...

                @@ -379,6 +533,25 @@ returns : boolean

                +

                isSecondaryArticle

                +
                + name     : isSecondaryArticle
                + function : tests XML (text) or an XML DOM node to see if it represents a Secondary article
                + usage    : if (isSecondaryArticle($node)){do something to it}
                + input    : an XML::DOM node, an XML::DOM::Document or straight XML
                + returns  : boolean
                +

                +

                +

                extractRawContent

                +
                + name     : extractRawContent
                + function : pass me an article (Simple, or Collection) and I'll give you the
                +            content AS A STRING - i.e. the raw XML of the contained MOBY Object(s)
                + usage    : extractRawContent($simple)
                + input    : the one element of the output from getArticles
                + returns  : string
                +

                +

                getNodeContentWithArticle

                  name     : getNodeContentWithArticle
                @@ -396,16 +569,16 @@
                             For example, in the following XML:
                              ...
                              ...
                -             <moby:Query>
                -                <queryInput>
                +             <moby:mobyContent>
                +                <moby:mobyData>
                                     <Simple>
                                       <Sequence namespace=blah id=blah>
                                            <Integer namespace='' id='' articleName="Length">3</Integer>
                                            <String namespace='' id='' articleName="SequenceString">ATG</String>
                                       </Sequence>
                                     </Simple>
                -                </queryInput>
                -             </moby:Query>
                +                </moby:mobyData>
                +             </moby:mobyContent>
                              ...
                              ...
                              
                @@ -422,16 +595,6 @@
                               }

                -

                extractRawContent

                -
                - name     : extractRawContent
                - function : pass me an article (Simple, or Collection) and I'll give you the
                -            content AS A STRING - i.e. the raw XML of the contained MOBY Object(s)
                - usage    : extractRawContent($simple)
                - input    : the one element of the output from getArticles
                - returns  : string
                -

                -

                validateNamespaces

                  name     : validateNamespaces
                @@ -462,6 +625,15 @@
                             an array-ref of Simple article XML::DOM::Node's

                +

                getServiceNotes

                +
                + name     : getServiceNotes
                + function : to get the content of the Service Notes block of the MOBY message
                + usage    : getServiceNotes($message)
                + args     : $message is either the XML::DOM of the MOBY message, or plain XML
                + returns  : String content of the ServiceNotes block of the MOBY Message
                +

                +

                getCrossReferences

                  name     : getCrossReferences
                @@ -496,8 +668,78 @@
                  args     : $CENTRAL - your MOBY::Client::Central object
                             $queryTerm - the object type I am interested in
                             \@termlist - the list of object types that I know about
                - returns  : an ontology term as a scalar, or undef if there
                -            is no parent of this node in the nodelist
                + returns : an ontology term and LSID as a scalar, or undef if there + is no parent of this node in the nodelist. + (note that it will only return the term if you give it + term names in the @termList. If you give it + LSID's in the termList, then both the parameters + returned will be LSID's - it doesn't back-translate...) +

                +

                +

                _rearrange (stolen from BioPerl ;-) )

                +
                + Usage     : $object->_rearrange( array_ref, list_of_arguments)
                + Purpose   : Rearranges named parameters to requested order.
                + Example   : $self->_rearrange([qw(SEQUENCE ID DESC)], at param);
                +           : Where @param = (-sequence => $s,
                +           :                    -desc     => $d,
                +           :                    -id       => $i);
                + Returns   : @params - an array of parameters in the requested order.
                +           : The above example would return ($s, $i, $d).
                +           : Unspecified parameters will return undef. For example, if
                +           :        @param = (-sequence => $s);
                +           : the above _rearrange call would return ($s, undef, undef)
                + Argument  : $order : a reference to an array which describes the desired
                +           :          order of the named parameters.
                +           : @param : an array of parameters, either as a list (in
                +           :          which case the function simply returns the list),
                +           :          or as an associative array with hyphenated tags
                +           :          (in which case the function sorts the values 
                +           :          according to @{$order} and returns that new array.)
                +           :          The tags can be upper, lower, or mixed case
                +           :          but they must start with a hyphen (at least the
                +           :          first one should be hyphenated.)
                + Source    : This function was taken from CGI.pm, written by Dr. Lincoln
                +           : Stein, and adapted for use in Bio::Seq by Richard Resnick and
                +           : then adapted for use in Bio::Root::Object.pm by Steve Chervitz,
                +           : then migrated into Bio::Root::RootI.pm by Ewan Birney.
                + Comments  :
                +           : Uppercase tags are the norm, 
                +           : (SAC)
                +           : This method may not be appropriate for method calls that are
                +           : within in an inner loop if efficiency is a concern.
                +           :
                +           : Parameters can be specified using any of these formats:
                +           :  @param = (-name=>'me', -color=>'blue');
                +           :  @param = (-NAME=>'me', -COLOR=>'blue');
                +           :  @param = (-Name=>'me', -Color=>'blue');
                +           :  @param = ('me', 'blue');
                +           : A leading hyphenated argument is used by this function to 
                +           : indicate that named parameters are being used.
                +           : Therefore, the ('me', 'blue') list will be returned as-is.
                +           :
                +           : Note that Perl will confuse unquoted, hyphenated tags as 
                +           : function calls if there is a function of the same name 
                +           : in the current namespace:
                +           :    -name => 'foo' is interpreted as -&name => 'foo'
                +           :
                +           : For ultimate safety, put single quotes around the tag:
                +           :    ('-name'=>'me', '-color' =>'blue');
                +           : This can be a bit cumbersome and I find not as readable
                +           : as using all uppercase, which is also fairly safe:
                +           :    (-NAME=>'me', -COLOR =>'blue');
                +           :
                +           : Personal note (SAC): I have found all uppercase tags to
                +           : be more managable: it involves less single-quoting,
                +           : the key names stand out better, and there are no method naming 
                +           : conflicts.
                +           : The drawbacks are that it's not as easy to type as lowercase,
                +           : and lots of uppercase can be hard to read.
                +           :
                +           : Regardless of the style, it greatly helps to line
                +           : the parameters up vertically for long/complex lists.
                +
                +
                =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/14 19:56:59 1.44 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/14 20:10:35 1.45 @@ -8,7 +8,9 @@ =cut -=head1 Client Side Paradigm +=head2 Client Side Paradigm + +not written yet =cut @@ -51,7 +53,7 @@ # now take the namespace and ID from our input article # (see pod docs for other possibilities) my $namespace = getSimpleArticleNamespaceURI($input); # get namespace - my ($identifier) = getSimpleArticleIDs($input); # get ID (note array output! see pod) + my ($identifier) = getSimpleArticleIDs($input); # get ID (note array output! see pod) # here is where you do whatever manipulation you need to do # for your particular service. @@ -70,9 +72,9 @@ This is a service that: -CONSUMES: base Object in the GO namespace -EXECUTES: Retrieval -PRODUCES: GO_Term (in the GO namespace) + CONSUMES: base Object in the GO namespace + EXECUTES: Retrieval + PRODUCES: GO_Term (in the GO namespace) # this subroutine is called from your dispatch_with line @@ -101,28 +103,28 @@ $MOBY_RESPONSE .= simpleResponse("", "", $ID); next; } else { - my $ns = getSimpleArticleNamespaceURI($input); - (($MOBY_RESPONSE .= simpleResponse("", "", $ID)) && (next)) - unless validateThisNamespace($ns, @validNS); # only do this if you are truly validating namespaces - my ($accession) = defined(getSimpleArticleIDs($ns, [$input]))?getSimpleArticleIDs($ns,[$input]):undef; - unless (defined($accession)){ - $MOBY_RESPONSE .= simpleResponse("", "", $ID); - next; - } - unless ($accession =~/^GO:/){ - $accession = "GO:$accession"; # we still haven't decided on whether id's should include the prefix... - } - $sth->execute($accession); - my ($term, $def) = $sth->fetchrow_array; - if ($term){ - $MOBY_RESPONSE .= simpleResponse(" - - $term - $def - ", "GO_Term_From_ID", $ID) - } else { - $MOBY_RESPONSE .= simpleResponse("", "", $ID) - } + my $ns = getSimpleArticleNamespaceURI($input); + (($MOBY_RESPONSE .= simpleResponse("", "", $ID)) && (next)) + unless validateThisNamespace($ns, @validNS); # only do this if you are truly validating namespaces + my ($accession) = defined(getSimpleArticleIDs($ns, [$input]))?getSimpleArticleIDs($ns,[$input]):undef; + unless (defined($accession)){ + $MOBY_RESPONSE .= simpleResponse("", "", $ID); + next; + } + unless ($accession =~/^GO:/){ + $accession = "GO:$accession"; # we still haven't decided on whether id's should include the prefix... + } + $sth->execute($accession); + my ($term, $def) = $sth->fetchrow_array; + if ($term){ + $MOBY_RESPONSE .= simpleResponse(" + + $term + $def + ", "GO_Term_From_ID", $ID) + } else { + $MOBY_RESPONSE .= simpleResponse("", "", $ID) + } } } @@ -857,45 +859,13 @@ =head2 getArticlesAsObjects - name : getArticlesAsObjects + name : DO NOT USE!! function : get the Simple/Collection articles for a single queryInput or queryResponse node, rethrning them as SimpleArticle, SecondaryArticle, or ServiceInstance objects usage : @articles = getArticles($XML) args : raw XML or XML::DOM of a moby:queryInput, moby:queryResponse block - returns : a list of listrefs; each listref is one component of the queryInput. - a single queryInput/Response may consist of one or more named or unnamed - simple, collection, or parameter articles. - The listref structure is thus [name, $ARTICLE_OBJECT]: - - e.g.: @articles = ['name1', $SimpleArticle] - - generated from the following sample XML: - - - - - - - - or : @articles = ['name1', $CollectionArticle], ['paramname1', $SecondaryArticle] - - generated from the following sample XML: - - - - - - - - - - - - Float - 10 - - + returns : =cut @@ -1327,10 +1297,10 @@ =head2 getServiceNotes name : getServiceNotes - function : - usage : - args : - returns : + function : to get the content of the Service Notes block of the MOBY message + usage : getServiceNotes($message) + args : $message is either the XML::DOM of the MOBY message, or plain XML + returns : String content of the ServiceNotes block of the MOBY Message =cut @@ -1518,7 +1488,7 @@ # _rearrange stolen from BioPerl's Bio::RootI.pm # because it is just so useful! -=head2 _rearrange +=head2 _rearrange (stolen from BioPerl ;-) ) Usage : $object->_rearrange( array_ref, list_of_arguments) Purpose : Rearranges named parameters to requested order. From mwilkinson at pub.open-bio.org Thu Apr 15 14:38:22 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 15 Apr 2004 10:38:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404151438.i3FEcM5S016350@pub.open-bio.org> mwilkinson Thu Apr 15 10:38:22 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv16304/Client Modified Files: CollectionArticle.html ServiceInstance.html SimpleArticle.html Log Message: updating all documentation that has gone out of sync with the code moby-live/Perl/MOBY/Client CollectionArticle.html,1.1,1.2 ServiceInstance.html,1.7,1.8 SimpleArticle.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.html 2003/07/01 15:00:47 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.html 2004/04/15 14:38:22 1.2 @@ -1,8 +1,8 @@ -MOBY::Client::CollectionArticle - a small object describing a MOBY Collection input or output - +MOBY::Client::CollectionArticle - a small object describing the Collection articles from the findService Response message of MOBY Central + @@ -23,8 +23,11 @@
              • articleName
              • Simples
              • addSimple
              • +
              • XML
              • +
              • XML_DOM
              • isSimple
              • isCollection
              • +
              • isSecondary
              • @@ -34,19 +37,52 @@

                NAME

                -

                MOBY::Client::CollectionArticle - a small object describing a MOBY Collection input or output

                +

                MOBY::Client::CollectionArticle - a small object describing the Collection articles from the findService Response message of MOBY Central


                SYNOPSIS

                +

                experimental - please do not use in your code


                DESCRIPTION

                +

                This describes the Collection articles from either the findService Response of MOBY Central +(i.e. the description of the service), or Collection articles +as provided in a service invocation or response message +(i.e. simple articles containing data)

                +

                Basically it parses the following part of a findService response:

                +
                + <Collection articleName="foo">
                +  <Simple>
                +     <objectType>someNbject</objectType>
                +     <Namespace>someNamespace</Namespace>
                +     <Namespace>someNamespace2</Namespace>
                +  </Simple>
                +  <Simple>
                +     <objectType>someNbject</objectType>
                +     <Namespace>someNamespace</Namespace>
                +     <Namespace>someNamespace2</Namespace>
                +  </Simple>
                + </Collection>
                +

                OR it parses the following part of a service invocation or response message:

                +
                + <Collection articleName="foo">
                +  <Simple>
                +    <SomeObject namespace='someNamespace' id='someID'>.....</SomeObject>
                +  </Simple>
                +  <Simple>
                +    <SomeObject namespace='someNamespace' id='someID'>.....</SomeObject>
                +  </Simple>
                + </Collection>
                +

                The articleName is retrieved with ->articleName +The contained Simples are retrieved as MOBY::Client::SimpleArticle objects +using the ->Simples method call.


                AUTHORS

                +

                Mark Wilkinson (markw at illuminae dot com)


                @@ -59,8 +95,11 @@ Usage : my $IN = MOBY::Client::CollectionArticle->new(%args) Function : create CollectionArticle object Returns : MOBY::Client::SimpleArticle object - Args : articleName => $articleName (optional) - Simples => $objectType (required) + Args : either of the following two methods may be used to auto-generate the + object by passing the appropriate XML node as a string, or XML::DOM node object + + XML => $XML + XML_DOM => $XML::DOM::NODE

                articleName

                @@ -91,6 +130,24 @@ Arguments : a new MOBY::Client::SimpleArticle to add to collection

                +

                XML

                +
                + Title     :    XML
                + Usage     :   $SA = $SA->XML($XML)
                + Function  :    set/reset all parameters for this object from the XML
                + Returns   :    MOBY::Client::SimpleArticle
                + Arguments :    (optional) XML fragment from and including <Simple>...</Simple>
                +

                +

                +

                XML_DOM

                +
                + Title     :    XML_DOM
                + Usage     :    $namespaces = $SA->XML_DOM($XML_DOM_NODE)
                + Function  :    set/reset all parameters for this object from the XML::DOM node for <Simple>
                + Returns   :    MOBY::Client::SimpleArticle
                + Arguments :    (optional) an $XML::DOM node from the <Simple> article of a DOM
                +

                +

                isSimple

                  Title     :    isSimple
                @@ -100,7 +157,7 @@
                                  get both Simple and Collection objects in your
                                  Input and output lists, it is good to be able
                                  to test what you have in-hand)
                - Returns   :    1 (true)
                + Returns : 0 (false)

                isCollection

                @@ -112,7 +169,16 @@ get both Simple and Collection objects in your Input and output lists, it is good to be able to test what you have in-hand) - Returns : 0 for false + Returns : 1 (true) +

                +

                +

                isSecondary

                +
                + Title     :    isSecondary
                + Usage     :    $boolean = $IN->isSecondary()
                + Function  :    is this a SecondaryArticle type?
                +                (yes, I know this is obvious)
                + Returns   :    0 (true)
                =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html 2003/11/01 18:05:55 1.7 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html 2004/04/15 14:38:22 1.8 @@ -2,7 +2,7 @@ MOBY::Client::ServiceInstance - a small object describing a MOBY service - + @@ -126,10 +126,10 @@

                input

                - Title     :    output
                - Usage     :    $output = $Service->output($args)
                + Title     :    input
                + Usage     :    $input = $Service->input($args)
                  Args      :    (optional) listref of SimpleArticle and/or CollectionArticle objects
                - Function  :    get/set output
                + Function  :    get/set input
                  Returns   :    listref of MOBY::Client::SimpleArticle
                                 and/or MOBY::Client::CollectionArticle objects

                =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.html 2003/07/01 15:00:47 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.html 2004/04/15 14:38:22 1.2 @@ -1,8 +1,8 @@ -MOBY::Client::SimpleArticle - a small object describing a MOBY Simple input/output article - +MOBY::Client::SimpleArticle - a small object describing the Simple articles from the findService Response message of MOBY Central + @@ -23,9 +23,12 @@

              • articleName
              • objectType
              • namespaces
              • +
              • XML
              • +
              • XML_DOM
              • addNamespace
              • isSimple
              • isCollection
              • +
              • isSecondary
              • @@ -35,19 +38,39 @@

                NAME

                -

                MOBY::Client::SimpleArticle - a small object describing a MOBY Simple input/output article

                +

                MOBY::Client::SimpleArticle - a small object describing the Simple articles from the findService Response message of MOBY Central


                SYNOPSIS

                +

                experimental - please do not use in your code


                DESCRIPTION

                +

                This describes the Simple articles from either the findService Response of MOBY Central +(i.e. the description of the service), or Simple articles +as provided in a service invocation or response message +(i.e. simple articles containing data)

                +

                Basically it parses the following part of a findService response:

                +

                <Simple articleName='foo'> + <objectType>someNbject</objectType> + <Namespace>someNamespace</Namespace> + <Namespace>someNamespace2</Namespace> +</Simple>

                +

                OR it parses the following part of a service invocation or response message:

                +

                <Simple articleName='foo'> + <SomeObject namespace='someNamespace' id='someID'>.....</SomeObject> +</Simple>

                +

                The articleName is retrieved with ->articleName +The namespace(s) are retrieved with ->namespaces +The objectType is retrieved with ->objectType +the id (if instantiated) is retrieved with ->id


                AUTHORS

                +

                Mark Wilkinson (markw at illuminae dot com)


                @@ -60,11 +83,11 @@ Usage : my $SA = MOBY::Client::SimpleArticle->new(%args) Function : create SimpleArticle object Returns : MOBY::Client::SimpleArticle object - Args : articleName => $articleName (optional) - objectType => $objectType (required) - namespaces => \@namesapces (optional) - XML_DOM => $XML_DOM node of the simple article (optional) - XML => $XML XML string representing the simple article (optional) + Args : either of the following two methods may be used to auto-generate the + object by passing the appropriate XML node as a string, or XML::DOM node object + + XML => $XML + XML_DOM => $XML::DOM::NODE

                articleName

                @@ -94,6 +117,24 @@ Arguments : (optional) arrayref of namespace strings to set

                +

                XML

                +
                + Title     :    XML
                + Usage     :   $SA = $SA->XML($XML)
                + Function  :    set/reset all parameters for this object from the XML
                + Returns   :    MOBY::Client::SimpleArticle
                + Arguments :    (optional) XML fragment from and including <Simple>...</Simple>
                +

                +

                +

                XML_DOM

                +
                + Title     :    XML_DOM
                + Usage     :    $namespaces = $SA->XML_DOM($XML_DOM_NODE)
                + Function  :    set/reset all parameters for this object from the XML::DOM node for <Simple>
                + Returns   :    MOBY::Client::SimpleArticle
                + Arguments :    (optional) an $XML::DOM node from the <Simple> article of a DOM
                +

                +

                addNamespace

                  Title     :    addNamespace
                @@ -124,6 +165,15 @@
                                  Input and output lists, it is good to be able
                                  to test what you have in-hand)
                  Returns   :    0 for false
                +

                +

                +

                isSecondary

                +
                + Title     :    isSecondary
                + Usage     :    $boolean = $IN->isSecondary()
                + Function  :    is this a SecondaryArticle type?
                +                (yes, I know this is obvious)
                + Returns   :    0 (true)
                From mwilkinson at pub.open-bio.org Thu Apr 15 14:38:22 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 15 Apr 2004 10:38:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404151438.i3FEcMdP016323@pub.open-bio.org> mwilkinson Thu Apr 15 10:38:22 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv16304 Modified Files: Central.html Log Message: updating all documentation that has gone out of sync with the code moby-live/Perl/MOBY Central.html,1.12,1.13 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.html,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Perl/MOBY/Central.html 2003/12/02 01:08:24 1.12 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.html 2004/04/15 14:38:22 1.13 @@ -2,7 +2,7 @@ MOBY::Central.pm - API for communicating with the MOBY Central registry - + @@ -155,14 +155,14 @@
              • MOBY, by default, supports three types of Class Relationships: ISA, HAS, and HASA (these are the relationship ontology terms)
              • -
              • notice that, in a HAS and HASA relationships, it is necessary to indicate an article name for each contained object type. Thus, for example, you could have a sequence object that contained a String object with name ``nucleotideSequence'' and an Integer object with the name ``sequenceLength''.
                +
              • notice that, in a HAS and HASA relationships, it is necessary to indicate an article name for each contained object type. Thus, for example, you could have a sequence object that contained a String object with name ``nucleotideSequence'' and an Integer object with the name ``sequenceLength''.
              • Input XML :

                @@ -215,7 +215,7 @@
              • the ISA ontology terms must exist or this registration will fail.
              • -
              • all parameters are required.
                +
              • all parameters are required.
              • email must be valid for later deregistration or updates
              • @@ -306,13 +306,13 @@
              • a service must have at least one Input OR Output Object Class. Either Input or Output may be blank to represent ``PUT'' or ``GET'' services respectively
              • -
              • the contactEmail address must be valid, as it is used to authorize deregistrations and changes to the service you registered.
                +
              • the contactEmail address must be valid, as it is used to authorize deregistrations and changes to the service you registered.
              • -
              • the ``authoritativeService'' tag is used to indicate whether or not the registered service is ``authoritative'' for that transformation. i.e. if anyone else were to perform the same transformation they would have to have obtained the information to do so from you. This is similar to, but not necessarily identical to, mirroring someone elses data, since the data in question may not exist prior to service invocation.
                +
              • the ``authoritativeService'' tag is used to indicate whether or not the registered service is ``authoritative'' for that transformation. i.e. if anyone else were to perform the same transformation they would have to have obtained the information to do so from you. This is similar to, but not necessarily identical to, mirroring someone elses data, since the data in question may not exist prior to service invocation.
              • only Input Secondary articles are defined during registration; Output Secondary objects are entirely optional and may or may not be interpreted Client-side using their articleName tags.
              • -
              • Service Categories:
                +
              • Service Categories:
              • @@ -394,14 +394,14 @@
                  There are two forms of Primary articles:
                  -
                • Simple - the article consists of a single MOBY Object
                  +
                • Simple - the article consists of a single MOBY Object
                • Collection - the article consists of a collection (``bag'') of MOBY Objects (not necessarily the same object type).
                  • -
                  • Their number/order is not relevant, nor predictable
                    +
                  • Their number/order is not relevant, nor predictable
                  • -
                  • If order is important to the service provider, then a collection should not be used, rather the collection should be broken into named Simple parameters. This may impose limitations on the the types of services that can be registered in MOBY Central. If it becomes a serious problem, a new Primary article type will be added in a future revision.
                    +
                  • If order is important to the service provider, then a collection should not be used, rather the collection should be broken into named Simple parameters. This may impose limitations on the the types of services that can be registered in MOBY Central. If it becomes a serious problem, a new Primary article type will be added in a future revision.
                  • The use of more than one Class in a collection is difficult to interpret, though it is equally difficult to envision a service that would require this. It is purposely left losely defined since any given Service Instance can tighten up this definition during the registration process.
                  • @@ -416,14 +416,14 @@

                    An example of the use of each of these might be another BLAST service, where you provide the sequences that make up the Blast database as well as the sequence to Blast against it. The sequences used to construct the database might be passed as a Collection input article containing multiple Sequence Objects, while the sequence to Blast against it would be a Simple input article consisting of a single Sequence Object.

                    There is currently only one form of Secondary article:

                      -
                    • Secondary - the article may or may not be specifically configured by the client as Input, and may or may not be returned by the Service as output.
                      +
                    • Secondary - the article may or may not be specifically configured by the client as Input, and may or may not be returned by the Service as output.
                    • From simont at pub.open-bio.org Mon Apr 19 14:59:02 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 10:59:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191459.i3JEx2RH008573@pub.open-bio.org> simont Mon Apr 19 10:59:02 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment In directory pub.open-bio.org:/tmp/cvs-serv8555/OntologyDevelopment Log Message: Directory /home/repository/moby/moby-live/Docs/OntologyDevelopment added to the repository moby-live/Docs/OntologyDevelopment - New directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/RCS/directory,v: No such file or directory From simont at pub.open-bio.org Mon Apr 19 14:59:39 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 10:59:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191459.i3JExdJe008636@pub.open-bio.org> simont Mon Apr 19 10:59:39 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs In directory pub.open-bio.org:/tmp/cvs-serv8618/MyGridDocs Log Message: Directory /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs added to the repository moby-live/Docs/OntologyDevelopment/MyGridDocs - New directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs/RCS/directory,v: No such file or directory From simont at pub.open-bio.org Mon Apr 19 15:00:10 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 11:00:10 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191500.i3JF0Awd008727@pub.open-bio.org> simont Mon Apr 19 11:00:10 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv8709/MobyServiceOntologyProtege Log Message: Directory /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege added to the repository moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege - New directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/RCS/directory,v: No such file or directory From simont at pub.open-bio.org Mon Apr 19 15:01:02 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 11:01:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191501.i3JF12Q9008789@pub.open-bio.org> simont Mon Apr 19 11:01:02 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment In directory pub.open-bio.org:/tmp/cvs-serv8772 Added Files: README Log Message: Initial commit of service ontology development moby-live/Docs/OntologyDevelopment README,NONE,1.1 From simont at pub.open-bio.org Mon Apr 19 15:01:03 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 11:01:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191501.i3JF13T1008804@pub.open-bio.org> simont Mon Apr 19 11:01:02 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv8772/MobyServiceOntologyProtege Added Files: MobyServiceOntology.pprj Log Message: Initial commit of service ontology development moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MobyServiceOntology.pprj,NONE,1.1 From simont at pub.open-bio.org Mon Apr 19 15:01:03 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 11:01:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191501.i3JF13Ee008825@pub.open-bio.org> simont Mon Apr 19 11:01:03 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MyGridDocs In directory pub.open-bio.org:/tmp/cvs-serv8772/MyGridDocs Added Files: mygrid-reasoned.daml mygrid.daml Log Message: Initial commit of service ontology development moby-live/Docs/OntologyDevelopment/MyGridDocs mygrid-reasoned.daml,NONE,1.1 mygrid.daml,NONE,1.1 From simont at pub.open-bio.org Mon Apr 19 15:10:17 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 11:10:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191510.i3JFAHhx008927@pub.open-bio.org> simont Mon Apr 19 11:10:17 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv8912 Added Files: MobyServiceOntology.owl Log Message: Service ontology from Protege in OWL format moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MobyServiceOntology.owl,NONE,1.1 From simont at pub.open-bio.org Mon Apr 19 15:10:34 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Mon, 19 Apr 2004 11:10:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404191510.i3JFAYnV008966@pub.open-bio.org> simont Mon Apr 19 11:10:34 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv8951 Added Files: MOBY_Service_ontology.png Log Message: Service ontology graph from OWLviz plugin moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MOBY_Service_ontology.png,NONE,1.1 From mwilkinson at pub.open-bio.org Tue Apr 20 18:49:45 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 14:49:45 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404201849.i3KInjdG014321@pub.open-bio.org> mwilkinson Tue Apr 20 14:49:45 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14302 Modified Files: OntologyServer.pm Log Message: moving toward LSID compabitibility for the ontology server. moby-live/Perl/MOBY OntologyServer.pm,1.33,1.34 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/02/18 22:23:55 1.33 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 18:49:45 1.34 @@ -164,6 +164,10 @@ =head2 objectExists + moby:newterm will return (0, $message, $MOBYLSID) + newterm will return (0, $message, $MOBYLSID + oldterm will return (1, $message, undef) + newLSID will return (0, $desc, $lsid) =cut @@ -174,9 +178,9 @@ my $sth; return (0, "WRONG ONTOLOGY!",'') unless ($self->ontology eq 'object'); - if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objecttype/)){ - return (1, "external ontology", $term); - } +# if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objecttype/)){ +# return (1, "external ontology", $term); +# } if ($term =~ /^urn\:lsid/){ $sth = $self->dbh->prepare("select object_lsid, object_type, description, authority, contact_email from object where object_lsid = ?"); @@ -184,14 +188,31 @@ $sth = $self->dbh->prepare("select object_lsid, object_type, description, authority, contact_email from object where object_type = ?"); } $sth->execute($term); - my ($id, $type, $desc, $auth, $email) = $sth->fetchrow_array; - if ($id){ - return (1,$desc,$id); - } else { - return (0, "Object Type $term does not exist in the biomoby.org Object Class system\n",''); - } + my ($lsid, $type, $desc, $auth, $email) = $sth->fetchrow_array; + if ($lsid){ # if it is in there, then it has been discovered regardless of being foreign or not + return (1,$desc,$lsid); + } elsif (_isForeignLSID($term)){ # if not in our ontology, but is a foreign LSID, then pass it back verbatim + return (0, "LSID $term does not exist in the biomoby.org Object Class system\n", $term); + } else { # under all other circumstances (i.e. not a term, or a non-existent biomoby LSID) then fail + return (0, "Object type $term does not exist in the biomoby.org Object Class system\n", ''); + } } + +sub _isMOBYLSID { + my ($lsid) = @_; + return 1 if $lsid =~ /^urn\:lsid\:biomoby.org/; + return 0 +} + + +sub _isForeignLSID { + my ($lsid) = @_; + return 0 if $lsid =~ /^urn\:lsid\:biomoby.org/; + return 1 +} + + =head2 createObject =cut From mwilkinson at pub.open-bio.org Tue Apr 20 18:58:05 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 14:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404201858.i3KIw5NH014378@pub.open-bio.org> mwilkinson Tue Apr 20 14:58:05 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14359 Modified Files: OntologyServer.pm Log Message: moving toward LSID compabitibility for the ontology server. moby-live/Perl/MOBY OntologyServer.pm,1.34,1.35 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 18:49:45 1.34 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 18:58:05 1.35 @@ -230,13 +230,26 @@ return (0, "requires a contact email address",'') unless ($args{contact_email}); return (0, "requires a object description",'') unless ($args{description}); my $term = $args{node}; - if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ # if it is an LSID, but not a MOBY LSID, than barf - return (0, "can't create a term in a non-MOBY ontology!", $term); - } + +# if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ # if it is an LSID, but not a MOBY LSID, than barf +# return (0, "can't create a term in a non-MOBY ontology!", $term); +# } my $LSID = ($args{'node'} =~ /urn\:lsid/)?$args{'node'}:$self->setURI($args{'node'}); unless ($LSID){return (0, "Failed during creation of an LSID",'')} + if ($args{'node'} =~ /^urn\:lsid/){ + $sth = $self->dbh->prepare("select object_lsid, object_type, description, authority, contact_email from object where object_lsid = ?"); + } else { + $sth = $self->dbh->prepare("select object_lsid, object_type, description, authority, contact_email from object where object_type = ?"); + } + $sth->execute($term); + my ($lsid, $type, $desc, $auth, $email) = $sth->fetchrow_array; + if ($lsid){ # if it is in there, then the object exists + return (0,"This term already exists: $lsid",$lsid); + } + + $args{description} =~ s/^\s+(.*?)\s+$/$1/s; $args{node} =~ s/^\s+(.*?)\s+$/$1/s; $args{contact_email} =~ s/^\s+(.*?)\s+$/$1/s; @@ -368,20 +381,32 @@ # adds a relationship #subject_node => $term, #relationship => $reltype, -#predicate_node => $objectType, +#object_node => $objectType, #articleName => $articleName, #authority => $auth, #contact_email => $email my ($self, %args) = @_; + return (0, "WRONG ONTOLOGY!",'') unless ($self->ontology eq 'object'); - my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{subject_node}); + + if ($args{subject_node} =~ /^urn:lsid/){ + my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{subject_node}); + } else { + my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{subject_node}); + } return (0, qq{Object type $args{subject_node} does not exist in the ontology},'') unless defined $subj_id; + if ($args{object_node} =~ /^urn:lsid/){ + my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{object_node}); + } else { + my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{object_node}); + } + return (0, qq{Object type $args{object_node} does not exist in the ontology},'') unless defined $subj_id; + + my (@isa) = $self->dbh->selectrow_array(q{select * from object_term2term where object2_id = ?},undef, $subj_id); if (scalar @isa){return (0, qq{Object type $args{subject_node} has existing object dependencies in the ontology. It cannot be changed.},$subj_lsid);} - - my ($obj_id, $obj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{object_node}); # get ID of the related object - defined $obj_lsid || return (0, qq{Object $args{object_node} does not exist in the ontology},''); + my $OE = MOBY::OntologyServer->new(ontology => 'relationship'); my ($success, $desc, $rel_lsid) = $OE->relationshipExists(term => $args{relationship}, ontology => 'object'); From mwilkinson at pub.open-bio.org Tue Apr 20 19:02:19 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 15:02:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404201902.i3KJ2JnR014465@pub.open-bio.org> mwilkinson Tue Apr 20 15:02:19 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14446/MOBY Modified Files: OntologyServer.pm Log Message: more LSID compatibility for object registration moby-live/Perl/MOBY OntologyServer.pm,1.35,1.36 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 18:58:05 1.35 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:02:19 1.36 @@ -238,6 +238,7 @@ my $LSID = ($args{'node'} =~ /urn\:lsid/)?$args{'node'}:$self->setURI($args{'node'}); unless ($LSID){return (0, "Failed during creation of an LSID",'')} + my $sth; if ($args{'node'} =~ /^urn\:lsid/){ $sth = $self->dbh->prepare("select object_lsid, object_type, description, authority, contact_email from object where object_lsid = ?"); } else { @@ -388,20 +389,21 @@ my ($self, %args) = @_; return (0, "WRONG ONTOLOGY!",'') unless ($self->ontology eq 'object'); - + + my ($subj_id, $subj_lsid, $obj_id, $obj_lsid); if ($args{subject_node} =~ /^urn:lsid/){ - my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{subject_node}); + ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{subject_node}); } else { - my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{subject_node}); + ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{subject_node}); } return (0, qq{Object type $args{subject_node} does not exist in the ontology},'') unless defined $subj_id; if ($args{object_node} =~ /^urn:lsid/){ - my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{object_node}); + ($obj_id, $obj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_lsid = ?},undef,$args{object_node}); } else { - my ($subj_id, $subj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{object_node}); + ($obj_id, $obj_lsid) = $self->dbh->selectrow_array(q{select object_id, object_lsid from object where object_type = ?},undef,$args{object_node}); } - return (0, qq{Object type $args{object_node} does not exist in the ontology},'') unless defined $subj_id; + return (0, qq{Object type $args{object_node} does not exist in the ontology},'') unless defined $obj_id; my (@isa) = $self->dbh->selectrow_array(q{select * from object_term2term where object2_id = ?},undef, $subj_id); From mwilkinson at pub.open-bio.org Tue Apr 20 19:10:38 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 15:10:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404201910.i3KJAcND014565@pub.open-bio.org> mwilkinson Tue Apr 20 15:10:38 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14546/MOBY Modified Files: OntologyServer.pm Log Message: allow deregistration of LSIDs from Object ontology moby-live/Perl/MOBY OntologyServer.pm,1.36,1.37 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:02:19 1.36 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:10:38 1.37 @@ -73,7 +73,7 @@ use Carp; use vars qw($AUTOLOAD); use DBI; -use DBD::mysql; +#use DBD::mysql; my $debug = 1; @@ -308,9 +308,9 @@ return (0, "WRONG ONTOLOGY",'') unless ($self->ontology eq 'object'); my $term = $args{term}; - if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ - return (0, "can't delete from external ontology", $term); - } +# if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ +# return (0, "can't delete from external ontology", $term); +# } my $LSID; unless ($term =~ /urn\:lsid/){$LSID = $self->getObjectURI($term)} else {$LSID=$term} From mwilkinson at pub.open-bio.org Tue Apr 20 19:12:32 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 15:12:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404201912.i3KJCWZk014674@pub.open-bio.org> mwilkinson Tue Apr 20 15:12:32 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14655/MOBY Modified Files: OntologyServer.pm Log Message: allow deregistration of LSIDs from Object ontology moby-live/Perl/MOBY OntologyServer.pm,1.37,1.38 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:10:38 1.37 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:12:32 1.38 @@ -73,7 +73,7 @@ use Carp; use vars qw($AUTOLOAD); use DBI; -#use DBD::mysql; +use DBD::mysql; my $debug = 1; From mwilkinson at pub.open-bio.org Tue Apr 20 23:16:31 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 19:16:31 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202316.i3KNGVxq015448@pub.open-bio.org> mwilkinson Tue Apr 20 19:16:31 EDT 2004 Update of /home/repository/moby/moby-live/Perl/Accessories In directory pub.open-bio.org:/tmp/cvs-serv15430/Accessories Log Message: Directory /home/repository/moby/moby-live/Perl/Accessories added to the repository moby-live/Perl/Accessories - New directory rcsdiff: /home/repository/moby/moby-live/Perl/Accessories/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/Accessories/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/Accessories/RCS/directory,v: No such file or directory From mwilkinson at pub.open-bio.org Tue Apr 20 23:19:19 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 19:19:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202319.i3KNJJ4h015550@pub.open-bio.org> mwilkinson Tue Apr 20 19:19:19 EDT 2004 Update of /home/repository/moby/moby-live/Perl/Accessories In directory pub.open-bio.org:/tmp/cvs-serv15535/Accessories Added Files: NamespaceMaintenance.cgi Log Message: adding a cgi page to maintain the MOBY Namespace GO XrefAbbs document. moby-live/Perl/Accessories NamespaceMaintenance.cgi,NONE,1.1 From mwilkinson at pub.open-bio.org Tue Apr 20 23:19:29 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 19:19:29 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202319.i3KNJTTK015597@pub.open-bio.org> mwilkinson Tue Apr 20 19:19:29 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv15574/MOBY Modified Files: Central.pm OntologyServer.pm Log Message: done moby-live/Perl/MOBY Central.pm,1.125,1.126 OntologyServer.pm,1.38,1.39 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.125 retrieving revision 1.126 diff -u -r1.125 -r1.126 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/04 19:08:41 1.125 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/20 23:19:29 1.126 @@ -236,6 +236,7 @@ } return &_error("Malformed authURI - must not have an http:// prefix","") if $auth =~ '[/:]'; return &_error("Malformed authURI - must take the form NNN.NNN.NNN","") unless $auth =~ /\./; +print STDERR "\n\nemail was $email\n\n"; return &_error("Malformed email - must be a valid email address of the form name\@organization.foo","") unless $email =~ /\S\@\S+\.\S+/; # validate that the final ontology will be valid by testing against existing relationships and such @@ -2329,10 +2330,10 @@ return undef unless $term; # and bail out if we didn't succeed $ontology ||="service"; # if we have now succeeded and haven't already taken the ontology then it must be the service ontology - &_LOG("Ontology was $ontology; Term was $term\n"); + &_LOG("Ontology was $ontology; Term was: $term\n"); my $OS = MOBY::OntologyServer->new(ontology => $ontology); my %rels = %{$OS->Relationships(term => $term, expand => $expand_relationship)}; # %rels = $rels{relationship} = [lsid, lsid,lsid] - + &_LOG("\nrels ",(keys %rels),"\n"); my $response="\n"; my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship'); foreach (keys %reltypes){ # for each of our desired types @@ -2340,6 +2341,7 @@ delete $reltypes{$_}; # remove the non-LSID version from the hash $reltypes{$rellsid} = 1; # set the LSID as valid } + &_LOG("\nvalid rels ",(keys %reltypes),"\n"); # now for each of the relationship types that we were returned foreach (keys %rels){ my $rellsid = $OSrel->getRelationshipURI($ontology, $_); @@ -2356,6 +2358,7 @@ $response .= "\n"; } $response .="\n"; + &_LOG("returning $response\n"); return $response; } =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 19:12:32 1.38 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 23:19:29 1.39 @@ -593,7 +593,7 @@ } if ($term =~ /^urn:lsid:biomoby.org:namespacetype/){ - $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_lsid = ?"); + $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_lsid= ?"); } else { $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_type = ?"); } From mwilkinson at pub.open-bio.org Tue Apr 20 23:19:30 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 19:19:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202319.i3KNJUhi015616@pub.open-bio.org> mwilkinson Tue Apr 20 19:19:29 EDT 2004 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv15574/scripts Modified Files: testMOBYClientCentral_v05.pl Log Message: done moby-live/Perl/scripts testMOBYClientCentral_v05.pl,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2004/01/02 20:39:23 1.13 +++ /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2004/04/20 23:19:29 1.14 @@ -5,7 +5,7 @@ ($reg, $test, $expect) = @_; die "\a\a\aREG OBJECT MALFORMED" unless $reg; if ($reg->success == $expect){ - print "test $test\t\t[PASS]\n"; + print "test $test\t\t[PASS]",($reg->registration_id),"\n"; } else { print "test $test\t\t[FAIL]\n",$reg->message,"\n\n"; } From mwilkinson at pub.open-bio.org Tue Apr 20 23:24:25 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 19:24:25 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202324.i3KNOPFe015724@pub.open-bio.org> mwilkinson Tue Apr 20 19:24:25 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv15701/MOBY Modified Files: Central.pm OntologyServer.pm Log Message: backing out incorrect changes I just committed moby-live/Perl/MOBY Central.pm,1.126,1.127 OntologyServer.pm,1.39,1.40 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.126 retrieving revision 1.127 diff -u -r1.126 -r1.127 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/20 23:19:29 1.126 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2004/04/20 23:24:25 1.127 @@ -236,7 +236,6 @@ } return &_error("Malformed authURI - must not have an http:// prefix","") if $auth =~ '[/:]'; return &_error("Malformed authURI - must take the form NNN.NNN.NNN","") unless $auth =~ /\./; -print STDERR "\n\nemail was $email\n\n"; return &_error("Malformed email - must be a valid email address of the form name\@organization.foo","") unless $email =~ /\S\@\S+\.\S+/; # validate that the final ontology will be valid by testing against existing relationships and such @@ -2330,10 +2329,10 @@ return undef unless $term; # and bail out if we didn't succeed $ontology ||="service"; # if we have now succeeded and haven't already taken the ontology then it must be the service ontology - &_LOG("Ontology was $ontology; Term was: $term\n"); + &_LOG("Ontology was $ontology; Term was $term\n"); my $OS = MOBY::OntologyServer->new(ontology => $ontology); my %rels = %{$OS->Relationships(term => $term, expand => $expand_relationship)}; # %rels = $rels{relationship} = [lsid, lsid,lsid] - &_LOG("\nrels ",(keys %rels),"\n"); + my $response="\n"; my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship'); foreach (keys %reltypes){ # for each of our desired types @@ -2341,7 +2340,6 @@ delete $reltypes{$_}; # remove the non-LSID version from the hash $reltypes{$rellsid} = 1; # set the LSID as valid } - &_LOG("\nvalid rels ",(keys %reltypes),"\n"); # now for each of the relationship types that we were returned foreach (keys %rels){ my $rellsid = $OSrel->getRelationshipURI($ontology, $_); @@ -2358,7 +2356,6 @@ $response .= "\n"; } $response .="\n"; - &_LOG("returning $response\n"); return $response; } =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 23:19:29 1.39 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2004/04/20 23:24:25 1.40 @@ -593,7 +593,7 @@ } if ($term =~ /^urn:lsid:biomoby.org:namespacetype/){ - $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_lsid= ?"); + $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_lsid = ?"); } else { $sth = $self->dbh->prepare("select namespace_id, namespace_type, namespace_lsid,description, authority, contact_email from namespace where namespace_type = ?"); } From mwilkinson at pub.open-bio.org Tue Apr 20 23:24:26 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 20 Apr 2004 19:24:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404202324.i3KNOQMH015743@pub.open-bio.org> mwilkinson Tue Apr 20 19:24:25 EDT 2004 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv15701/scripts Modified Files: testMOBYClientCentral_v05.pl Log Message: backing out incorrect changes I just committed moby-live/Perl/scripts testMOBYClientCentral_v05.pl,1.14,1.15 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2004/04/20 23:19:29 1.14 +++ /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2004/04/20 23:24:25 1.15 @@ -5,7 +5,7 @@ ($reg, $test, $expect) = @_; die "\a\a\aREG OBJECT MALFORMED" unless $reg; if ($reg->success == $expect){ - print "test $test\t\t[PASS]",($reg->registration_id),"\n"; + print "test $test\t\t[PASS]\n"; } else { print "test $test\t\t[FAIL]\n",$reg->message,"\n\n"; } From gordonp at pub.open-bio.org Wed Apr 21 17:22:26 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Wed, 21 Apr 2004 13:22:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404211722.i3LHMQ3e014293@pub.open-bio.org> gordonp Wed Apr 21 13:22:26 EDT 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv14268/client Modified Files: CentralImpl.java Log Message: Fixed bug (extra input def closing tags) in service search template building moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.11,1.12 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/02 16:40:23 1.11 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2004/04/21 17:22:26 1.12 @@ -19,9 +19,6 @@ import java.io.*; import java.net.*; -//import org.apache.xerces.parsers.*; - - /** * A default implementation of the * interface {@link org.biomoby.shared.Central Central} @@ -337,7 +334,6 @@ buf.append ("\n\n"); MobyData[] pi = service.getPrimaryInputs(); if (pi.length > 0) { - buf.append ("\n\n"); for (int i = 0; i < pi.length; i++) buf.append (pi[i].toXML()); } @@ -1173,10 +1169,8 @@ result = doCall (methodName, new Object[] { }); else result = doCall (methodName, new Object[] { inputXML }); - - if (result == null) - throw new MobyException ("Returned result is null."); - + if (result == null) + throw new MobyException ("Returned result is null."); if (result instanceof String) return (String)result; if (result instanceof String[]) { From gordonp at pub.open-bio.org Wed Apr 21 17:26:47 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Wed, 21 Apr 2004 13:26:47 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404211726.i3LHQlsu014346@pub.open-bio.org> gordonp Wed Apr 21 13:26:46 EDT 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv14325 Added Files: MobyDataInstance.java MobyDataSecondaryInstance.java MobyDataServiceAssocInstance.java MobyDataSetInstance.java MobyDataSimpleInstance.java MobyPrefixResolver.java SOAPException.java Log Message: Added initial version of core classes required to create/display/query with instances of MOBY data moby-live/Java/src/main/org/biomoby/shared MobyDataInstance.java,NONE,1.1 MobyDataSecondaryInstance.java,NONE,1.1 MobyDataServiceAssocInstance.java,NONE,1.1 MobyDataSetInstance.java,NONE,1.1 MobyDataSimpleInstance.java,NONE,1.1 MobyPrefixResolver.java,NONE,1.1 SOAPException.java,NONE,1.1 From gordonp at pub.open-bio.org Wed Apr 21 17:28:58 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Wed, 21 Apr 2004 13:28:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404211728.i3LHSwQt014386@pub.open-bio.org> gordonp Wed Apr 21 13:28:58 EDT 2004 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv14365 Added Files: MobyRequest.java Log Message: Initial version of Java class implementing service invocation (input MobyData objects, output MobyData objects) moby-live/Java/src/main/org/biomoby/client MobyRequest.java,NONE,1.1 From gordonp at pub.open-bio.org Wed Apr 21 17:56:49 2004 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Wed, 21 Apr 2004 13:56:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404211756.i3LHunGx014626@pub.open-bio.org> gordonp Wed Apr 21 13:56:49 EDT 2004 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv14601 Modified Files: ChangeLog Log Message: Included service invocation implementation info moby-live/Java/docs ChangeLog,1.11,1.12 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/04/02 16:40:23 1.11 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2004/04/21 17:56:49 1.12 @@ -1,3 +1,31 @@ +2004-04-21 Paul Gordon + + * Implemented Moby data instance classes for simples, collections, + secondary inputs in org.biomoby.shared.*; + + * Implemented namespace resolver for retrieval of MOBY attributes in DOM fragments, + default namespace mapping for XPath, etc. + + * Implemented org.biomoby.client.MobyRequest, which handles the SOAP transactions + for service invocation. Takes in Moby data objects, outputs Moby data objects + e.g. + // Assumes you already have a service (mobyService) and data (mobyInputData) around + mobyRequest = new MobyRequest(new CentralImpl()); + mobyRequest.setDebugMode(true); + mobyRequest.setService(mobyService); + mobyRequest.setInput((MobyDataInstance[]) mobyInputData); + try{ + mobyRequest.invokeService(); + } catch(MobyException mobye){ + System.err.println("Failure in MOBY protocol: " + mobye); + } catch(SOAPException soape){ + System.err.println("Failure in SOAP transaction: " + soape); + } catch(NOsUccessException nse){ + System.err.println("Failure in MOBY logic (input was not acceptable " + + "for this service)" + nse); + } + + 2004-04-02 Paul Gordon * Changed XML parsing to JAXP based interface that works on more platforms From simont at pub.open-bio.org Wed Apr 28 15:56:14 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Wed, 28 Apr 2004 11:56:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404281556.i3SFuESq017669@pub.open-bio.org> simont Wed Apr 28 11:56:14 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv17654 Added Files: MobyServiceOntology.rdf-xml Log Message: rdf-xml document that is needed by Protege for the .pprj file moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MobyServiceOntology.rdf-xml,NONE,1.1 From simont at pub.open-bio.org Wed Apr 28 18:45:19 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Wed, 28 Apr 2004 14:45:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404281845.i3SIjJTP018191@pub.open-bio.org> simont Wed Apr 28 14:45:19 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv18172 Modified Files: MobyServiceOntology.owl Log Message: updated OWL file in sync with .pprj moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MobyServiceOntology.owl,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MobyServiceOntology.owl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MobyServiceOntology.owl 2004/04/19 15:10:16 1.1 +++ /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MobyServiceOntology.owl 2004/04/28 18:45:19 1.2 @@ -20,291 +20,412 @@ >0.1 - + + + + + + + + + + + - + + takes input object and returns a visual representation of that object - plot, graph, image, etc. - + - + - + + returns a translation of the input into a different form - + - + - + - + - + + TODO: Need to explore this more closely, current subclass structure seems limiting + - + takes group of input objects and filters them by a specified criteria, returns a subset of the group + >takes input object and converts it to another format or representation - + + removal of services from central repository - + - + takes input object and returns a visual representation of that object - plot, graph, image, etc. + >a service that performs an bioinformatic analysis upon the input object(s). Inputs are biologically meaningful things. - + - + searches a protein database + >operate on databases to add, delete, update data - + - + + searches a literature database - + - + returns a translation of the input into a different form + >searches nucleotide database - + - + + + + A dictionary-type service that provides definitions for supplied terms + - - true - - - - + - + + + + - + + alignment using tertiary structure comparison, eg. STAMP - - - - + - + + operate on collections of objects - + + + takes input and predicts some property of the input object based on specific algorithms + + - + + + + + + + + + All services that do something related to the bioinformatics applications, data, analyses, etc. themselves. As distinct from services that deal with webservice computing infrastructure - service registration, deregisration, etc. - + >Service that aligns two objects - + + takes object(s) and breaks apart into subobjects + + + + root of bioMOBY Object ontology + + + service that takes an input and parses it, analyzing the parts of the input document, returning an organized collection of the parts back to the calling application. - + - + - - - - - TODO: Need to explore this more closely, current subclass structure seems limiting - - + + takes input object and converts it to another format or representation + >inserts input object into something - database, file - + - + - takes input object and performs digestion, returns collection of subobjects - eg. restriction analysis of DNA, digestion of protein by trypsin, etc. - + - + + + + + + - - - - - - + - + - + - - + + prediction of structural features - eg coils, sheets in protein + + + + - + - + operate on databases to add, delete, update data + >provides a resolution service, eg LSID resolution - + a service that performs an bioinformatic analysis upon the input object(s). Inputs are biologically meaningful things. - + >validates the format of the input, eg SQUIZZ tool + - - takes a list of input objects and groups them accoring to criteria, returns a collection of the grouped objects or the same list with group information included. + - + - - + + + takes input and finds features based on comparisons to known things, eg. restriction site sequence (as opposed to prediction by algorithm) - + returns a summarized version of the input - + >service that calculates something: pI of protein sequence, MWt, Hydrophobicity, etc. + - + - + - + + + + - + + + + searches a literature database + >predicts the physical location of the input object based on some analysis - eg. protein location within the cell based on signal peptide, transmembrane regions, etc. - + - + + + searches nucleotide database + >predicts the existence of various features in the input object through the use of a specific algorithm - eg. gene prediction. + - - + + + Calculates a protein's accurate molecular weight - - + + + + - + + + + + + + + + + + + + + A dictionary-type service that provides definitions for supplied terms - + >services that send data to and from a registry - that perform a registry transaction of some kind. - + - - + + + takes group of input objects and filters them by a specified criteria, returns a subset of the group - + - + alignment using tertiary structure comparison, eg. STAMP + >searches a protein database - - + + + + - + - + + + + + + + + + + true + + + + operate on collections of objects + >service that is related to computing infrastructure, does not operate on biological object(s). Eg. performing webservice registration + + + - + searches a database using supplied input objects as search criteria, returns a list of hits + >a service that performs a task upon biological or objects - + + + + + + + + + + + + + + + + + + + + + + takes input object and performs digestion, returns collection of subobjects - eg. restriction analysis of DNA, digestion of protein by trypsin, etc. + + + + + + + + + takes a list of input objects and groups them accoring to criteria, returns a collection of the grouped objects or the same list with group information included. + + + + + + + returns a summarized version of the input + + + + + calculates a protein's isoelectric point + + + + + + + Service thats main function is to take an input and retrieves information related to the input, eg. using a term to retrieve a definition, a genbank accession to get a flat file. - - + takes input and predicts some property of the input object based on specific algorithms + >searches a database using supplied input objects as search criteria, returns a list of hits + + + - translates a nucleic acid sequence to a protein sequence - - - + - - - - - - - - + Root of the bioMOBY service ontology - - - Service that aligns two objects - - - - - - registers services with central repository, eg. MOBY Central - - - takes object(s) and breaks apart into subobjects - + + @@ -313,43 +434,26 @@ service searches sequence data for known patterns - - - - - - - - - root of bioMOBY Object ontology - - - service that takes an input and parses it, analyzing the parts of the input document, returning an organized collection of the parts back to the calling application. - + manipulation services - take input objects and manipulate them in some way - - + + searches for the occurance of known pattern(s) - eg. transcription factor binding sites + Not sure if the method should be defined by the ontology at this level + performs some type of cluster analysis on input data - - searches for the occurance of known pattern(s) - eg. transcription factor binding sites - - - - @@ -359,46 +463,25 @@ - repeat finding in sequence data - - - - inserts input object into something - database, file - - - + - - - - - - - - - returns the definition of a keyword as defined in a particular dictionary of terms. - - - - + + prediction of structural features - eg coils, sheets in protein - - + >Calculates the melting point of a given DNA sequence - - - provides a resolution service, eg LSID resolution - - - - - - validates the format of the input, eg SQUIZZ tool - - service deletes data from a database - - - takes input and finds features based on comparisons to known things, eg. restriction site sequence (as opposed to prediction by algorithm) - + - - - - service that calculates something: pI of protein sequence, MWt, Hydrophobicity, etc. - Allows registration of objects (and/or services) in specified repositories. - - - - - - - - - - - - - - predicts the physical location of the input object based on some analysis - eg. protein location within the cell based on signal peptide, transmembrane regions, etc. + @@ -490,24 +536,16 @@ - - - - - - - - predicts the existence of various features in the input object through the use of a specific algorithm - eg. gene prediction. - - - + + Predicts the hydrophilic/hydrophobic proile of a sequence + From simont at pub.open-bio.org Wed Apr 28 18:48:41 2004 From: simont at pub.open-bio.org (Simon Twigger) Date: Wed, 28 Apr 2004 14:48:41 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404281848.i3SImfuD018245@pub.open-bio.org> simont Wed Apr 28 14:48:41 EDT 2004 Update of /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege In directory pub.open-bio.org:/tmp/cvs-serv18226 Modified Files: MOBY_Service_ontology.png Log Message: Updated to be in sync with OWL and pprj files. moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege MOBY_Service_ontology.png,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MOBY_Service_ontology.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MOBY_Service_ontology.png 2004/04/19 15:10:34 1.1 and /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MOBY_Service_ontology.png 2004/04/28 18:48:41 1.2 differ rcsdiff: /home/repository/moby/moby-live/Docs/OntologyDevelopment/MobyServiceOntologyProtege/MOBY_Service_ontology.png: diff failed From ambrose at pub.open-bio.org Thu Apr 29 18:03:52 2004 From: ambrose at pub.open-bio.org (Ambrose Ng) Date: Thu, 29 Apr 2004 14:03:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404291803.i3TI3q7S022533@pub.open-bio.org> ambrose Thu Apr 29 14:03:52 EDT 2004 Update of /home/repository/moby/moby-live/Perl/Accessories In directory pub.open-bio.org:/tmp/cvs-serv22507/Perl/Accessories Modified Files: NamespaceMaintenance.cgi Log Message: updated error catching on namespace maintenance cgi page moby-live/Perl/Accessories NamespaceMaintenance.cgi,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Accessories/NamespaceMaintenance.cgi,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/Accessories/NamespaceMaintenance.cgi 2004/04/20 23:19:19 1.1 +++ /home/repository/moby/moby-live/Perl/Accessories/NamespaceMaintenance.cgi 2004/04/29 18:03:52 1.2 @@ -68,7 +68,7 @@ print "* = required fields",p, " --------",p, - "Full abbreviation will be \"authority abbr_identifier abbreviation\" \"GeneDB_Tbrucei\"", + "Full abbreviation will be \"authority abbreviation_identifier abbreviation\" e.g. \"GeneDB_Tbrucei\"", start_form, table( Tr(td("authority abbreviation* "),td(textfield(-name => 'authabvr', -class => "require"),"e.g.: GeneDB")), @@ -79,8 +79,8 @@ Tr(td("contact email* "),td(textfield(-name =>'email1', -class => "require"),"@",textfield(-name => 'email2', -class => "require" ),"e.g.: example\@email.ca")), Tr(td("object "),td(textfield('object'),"e.g.: Gene identifier.")), Tr(td("generic url* "), - td(popup_menu(-name=>'urltype', - -values=>['choose','http://','https://'], -class => "require" ),textfield(-name => 'url', -class => "require"),"e.g.: http\:\/\/www.genedb.org\/tryp ")), + td(popup_menu(-name=>'urltype',-class => "require" , + -values=>['choose','http://','https://']),textfield(-name => 'url', -class => "require"),"e.g.: http\:\/\/www.genedb.org\/tryp ")), Tr(td("synonym "),td(textarea('syn'),"e.g.: SP, SWP, SWISS-PROT. one entry per line")), Tr(td("example_id "),td(textfield('example_id'),"e.g.: Tb927.1.5250")), Tr(td("url_syntax "), @@ -112,13 +112,13 @@ Tr(td("authority abbreviation: "),td($authabvr),(hidden('authabvr')),(hidden('namespace_id'))), Tr(td("identifier abbreviation: "),td($namespacetype),(hidden('namespacetype'))), Tr(td"--------"), - Tr(td("description* "),td(textarea('desc'),"Type a short description here about the entry.")), - Tr(td("authority* "),td(textfield('auth'),"e.g.: www.genedb.org")), - Tr(td("contact email* "),td(textfield('email1'),"@",textfield('email2'),"e.g.: example\@email.ca")), + Tr(td("description* "),td(textarea(-name =>'desc', -class => "require"),"Type a short description here about the entry.")), + Tr(td("authority* "),td(textfield(-name =>'auth', -class => "require"),"e.g.: www.genedb.org")), + Tr(td("contact email* "),td(textfield(-name=>'email1', -class => "require"),"@",textfield(-name =>'email2', -class=> "require"),"e.g.: example\@email.ca")), Tr(td("object "),td(textfield('object'),"e.g.: Gene identifier.")), Tr(td("generic url* "), - td(popup_menu(-name=>'urltype', - -values=>['choose','http://','https://']),textfield('url'),"e.g.: http\:\/\/www.genedb.org\/tryp ")), + td(popup_menu(-name=>'urltype',-class=>"require", + -values=>['choose','http://','https://']),textfield(-name=>'url',-class=>"require"),"e.g.: http\:\/\/www.genedb.org\/tryp ")), Tr(td("synonym "),td(textarea('syn'),"e.g.: SP, SWP, SWISS-PROT. one entry per line")), Tr(td("example_id "),td(textfield('example_id'),"e.g.: Tb927.1.5250")), Tr(td("url_syntax "), @@ -231,7 +231,7 @@ print "unfilled description field",hr; return 1; } - elsif (!$Param{email1} or !$Param{email2}) { + elsif (!$Param{email1} or !$Param{email2} or !($Param{email2} =~ /\./)) { print "invalid email address",hr; return 1; } From mwilkinson at pub.open-bio.org Thu Apr 29 22:28:03 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 29 Apr 2004 18:28:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404292228.i3TMS3K6023057@pub.open-bio.org> mwilkinson Thu Apr 29 18:28:03 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv23038/MOBY Modified Files: CommonSubs.pm Log Message: implementing API changes into CommonSubs. It is only the messaging structure that has changed, so MOBY::Central and Clinet::Central did not need to be updated. Testing this now...hopefully it will work moby-live/Perl/MOBY CommonSubs.pm,1.45,1.46 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/14 20:10:35 1.45 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/29 22:28:03 1.46 @@ -254,7 +254,7 @@ 2. queryID (undef for Secondary parameters) 3. $data - the data takes several forms a. $article XML::DOM node for Simples - ... + ... b. \@article XML:DOM nodes for Collections c. $secondary XML::DOM node @@ -264,10 +264,10 @@ sub genericServiceInputParser { my ($message) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = getInputs($message); # returns XML::DOM nodes ... + my @queries = getInputs($message); # returns XML::DOM nodes ... foreach my $query(@queries){ - my $queryID = getInputID($query); # get the queryID attribute of the queryInput + my $queryID = getInputID($query); # get the queryID attribute of the mobyData my @input_articles = getArticles($query); # get the Simple/Collection/Secondary articles making up this query ... or ... or ... foreach my $input(@input_articles){ # input is a listref my ($articleName, $article) = @{$input}; # get the named article @@ -304,7 +304,7 @@ for example, the input message: - + @@ -312,7 +312,7 @@ Float 10 - + will become: (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module) @@ -330,7 +330,7 @@ With inputs that have collections these are presented as a listref of Simple article DOM's. So for the following message: - + @@ -343,7 +343,7 @@ Float 10 - + will become @@ -361,11 +361,11 @@ sub complexServiceInputParser { my ($message) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = getInputs($message); # returns XML::DOM nodes ... + my @queries = getInputs($message); # returns XML::DOM nodes ... my %input_parameters; # $input_parameters{$queryID} = [ foreach my $query(@queries){ - my $queryID = getInputID($query); # get the queryID attribute of the queryInput + my $queryID = getInputID($query); # get the queryID attribute of the mobyData my @input_articles = getArticles($query); # get the Simple/Collection/Secondary articles making up this query ... or ... or ... foreach my $input(@input_articles){ # input is a listref my ($articleName, $article) = @{$input}; # get the named article @@ -386,12 +386,11 @@ =head2 getArticles name : getArticles - function : get the Simple/Collection/Parameter articles for a single queryInput - or queryResponse node + function : get the Simple/Collection/Parameter articles for a single mobyData usage : @articles = getArticles($XML) args : raw XML or XML::DOM of a queryInput, mobyData, or queryResponse block (e.g. from getInputs) - returns : a list of listrefs; each listref is one component of the queryInput. - a single queryInput/Response may consist of one or more named or unnamed + returns : a list of listrefs; each listref is one component of the queryInput or mobyData block + a single block may consist of one or more named or unnamed simple, collection, or parameter articles. The listref structure is thus [name, $ARTICLE_DOM]: @@ -399,17 +398,17 @@ generated from the following sample XML: - + - + or : @articles = ['name1', $COLL_DOM], ['paramname1', $PARAM_DOM] generated from the following sample XML: - + @@ -422,7 +421,7 @@ Float 10 - + =cut @@ -471,10 +470,10 @@ sub genericServiceInputParserAsObject { my ($message) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = getInputs($message); # returns XML::DOM nodes ... - + my @queries = getInputs($message); # returns XML::DOM nodes ... + foreach my $query(@queries){ - my $queryID = getInputID($query); # get the queryID attribute of the queryInput + my $queryID = getInputID($query); # get the queryID attribute of the mobyData my @input_articles = getArticlesAsObjects($query); # get the Simple/Collection articles making up this query ... or ... or ...isCollection){ @@ -621,16 +620,17 @@ } + =head2 simpleResponse name : simpleResponse - function : wraps a simple article in the appropriate queryResponse structure + function : wraps a simple article in the appropriate (mobyData) structure usage : $resp .= &simpleResponse($object, 'MyArticleName', $queryID); args : (in order) $object - (optional) a MOBY Object as raw XML $article - (optional) an articeName for this article $query - (optional, but strongly recommended) the queryID value for the - queryInput block to which you are responding + mobyData block to which you are responding notes : as required by the API you must return a response for every input. If one of the inputs was invalid, you return a valid (empty) MOBY response by calling &simpleResponse(undef, undef, $queryID) with no arguments. @@ -647,19 +647,19 @@ $articleName ||=""; if ($articleName) { return " - + $data - + "; } elsif($data) { return " - + $data - + "; } else { return " - + "; } } @@ -671,7 +671,7 @@ my $doc = $parser->parse($query); $query = $doc->getDocumentElement(); } - return '' unless $query->getTagName =~/queryInput/; + return '' unless ($query->getTagName =~/queryInput/ || $query->getTagName =~/mobyData/); my $id = $query->getAttribute('queryID'); $id ||= $query->getAttribute('moby:queryID'); return $id; @@ -681,12 +681,12 @@ =head2 collectionResponse name : collectionResponse - function : wraps a set of articles in the appropriate queryResponse structure + function : wraps a set of articles in the appropriate mobyData structure usage : return responseHeader . &collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter; args : (in order) \@objects - (optional) a listref of MOBY Objects as raw XML $article - (optional) an articeName for this article - $queryID - (optional, but strongly recommended) the queryInput ID + $queryID - (optional, but strongly recommended) the mobyData ID to which you are responding notes : as required by the API you must return a response for every input. If one of the inputs was invalid, you return a valid (empty) MOBY @@ -701,7 +701,7 @@ $data ||=[]; $qID ||= ''; unless ((ref($data) =~ /array/i) && $data->[0]){ # we're expecting an arrayref as input data,and it must not be empty - return ""; + return ""; } foreach (@{$data}){ @@ -717,17 +717,17 @@ } if ($articleName) { return " - + $content - + "; } else { return " - + $content - + "; } } @@ -762,7 +762,7 @@ $notes ||=""; my $xml = "". "". - ""; + ""; if ($notes){ my $encodednotes = HTML::Entities::encode($notes); $xml .="$encodednotes"; @@ -786,7 +786,7 @@ sub responseFooter { - return ""; + return ""; } @@ -794,7 +794,7 @@ =head2 getInputs name : getInputs - function : get the queryInput block(s) as XML::DOM nodes + function : get the mobyData block(s) as XML::DOM nodes usage : @queryInputs = getInputArticles($XML) args : the raw XML of a query, or an XML::DOM document returns : a list of XML::DOM::Node's, each is a queryInput or mobyData block. @@ -817,8 +817,8 @@ my @queries; foreach my $querytag('queryInput', 'moby:queryInput', 'mobyData', 'moby:mobyData'){ - my $x = $moby->getElementsByTagName($querytag); # get the queryInput block - for (0..$x->getLength-1){ # there may be more than one queryInput per message + my $x = $moby->getElementsByTagName($querytag); # get the mobyData block + for (0..$x->getLength-1){ # there may be more than one mobyData per message push @queries, $x->item($_); } } @@ -860,11 +860,11 @@ =head2 getArticlesAsObjects name : DO NOT USE!! - function : get the Simple/Collection articles for a single queryInput + function : get the Simple/Collection articles for a single mobyData or queryResponse node, rethrning them as SimpleArticle, SecondaryArticle, or ServiceInstance objects usage : @articles = getArticles($XML) - args : raw XML or XML::DOM of a moby:queryInput, moby:queryResponse block + args : raw XML or XML::DOM of a moby:mobyData block returns : =cut @@ -977,13 +977,13 @@ my $x; foreach ('queryInput', 'moby:queryInput', 'mobyData', 'moby:mobyData'){ - $x = $moby->getElementsByTagName($_); # get the queryInput block + $x = $moby->getElementsByTagName($_); # get the mobyData block last if $x->item(0); } return undef unless $x->item(0); # in case there was no match at all my @queries; - for (0..$x->getLength-1){ # there may be more than one queryInput per message + for (0..$x->getLength-1){ # there may be more than one mobyData per message my @this_query; foreach my $child($x->item($_)->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace From mwilkinson at pub.open-bio.org Thu Apr 29 22:37:57 2004 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 29 Apr 2004 18:37:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200404292237.i3TMbv5I023169@pub.open-bio.org> mwilkinson Thu Apr 29 18:37:57 EDT 2004 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv23150/MOBY Modified Files: CommonSubs.pm Log Message: mismatched XML tag fixed moby-live/Perl/MOBY CommonSubs.pm,1.46,1.47 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/29 22:28:03 1.46 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2004/04/29 22:37:57 1.47 @@ -786,7 +786,7 @@ sub responseFooter { - return ""; + return ""; }