From gordonp at dev.open-bio.org Fri Mar 9 12:13:07 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 12:13:07 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703091713.l29HD7vc023316@dev.open-bio.org> gordonp Fri Mar 9 12:13:07 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services In directory dev.open-bio.org:/tmp/cvs-serv23282/src/main/ca/ucalgary/services Log Message: Directory /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services added to the repository moby-live/Java/src/main/ca/ucalgary/services - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 9 12:13:57 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 12:13:57 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703091713.l29HDvi1023358@dev.open-bio.org> gordonp Fri Mar 9 12:13:57 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util In directory dev.open-bio.org:/tmp/cvs-serv23324/src/main/ca/ucalgary/services/util Log Message: Directory /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util added to the repository moby-live/Java/src/main/ca/ucalgary/services/util - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 9 12:14:11 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 12:14:11 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703091714.l29HEBP4023400@dev.open-bio.org> gordonp Fri Mar 9 12:14:11 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test In directory dev.open-bio.org:/tmp/cvs-serv23366/src/main/ca/ucalgary/services/util/test Log Message: Directory /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test added to the repository moby-live/Java/src/main/ca/ucalgary/services/util/test - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 9 12:16:55 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 12:16:55 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703091716.l29HGtpa023495@dev.open-bio.org> gordonp Fri Mar 9 12:16:55 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test In directory dev.open-bio.org:/tmp/cvs-serv23450/src/main/ca/ucalgary/services/util/test Added Files: ACDFileTestCase.java ACDFileTestCase.java~ transeq.acd Log Message: Start of commit for ACD service wrapping moby-live/Java/src/main/ca/ucalgary/services/util/test ACDFileTestCase.java,NONE,1.1 ACDFileTestCase.java~,NONE,1.1 transeq.acd,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 9 12:16:55 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 12:16:55 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703091716.l29HGtSJ023481@dev.open-bio.org> gordonp Fri Mar 9 12:16:55 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util In directory dev.open-bio.org:/tmp/cvs-serv23450/src/main/ca/ucalgary/services/util Added Files: ACDFile.java Log Message: Start of commit for ACD service wrapping moby-live/Java/src/main/ca/ucalgary/services/util ACDFile.java,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 9 12:18:01 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 12:18:01 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703091718.l29HI1MD023582@dev.open-bio.org> gordonp Fri Mar 9 12:18:01 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test In directory dev.open-bio.org:/tmp/cvs-serv23549/src/main/ca/ucalgary/services/util/test Removed Files: ACDFileTestCase.java~ Log Message: Mistaken import of editor backup file moby-live/Java/src/main/ca/ucalgary/services/util/test ACDFileTestCase.java~,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/RCS/ACDFileTestCase.java~,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 9 13:01:10 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 13:01:10 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703091801.l29I1A6h023649@dev.open-bio.org> gordonp Fri Mar 9 13:01:09 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util In directory dev.open-bio.org:/tmp/cvs-serv23614/src/main/ca/ucalgary/services/util Modified Files: ACDFile.java Log Message: Updated javadoc moby-live/Java/src/main/ca/ucalgary/services/util ACDFile.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/09 17:16:55 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/09 18:01:09 1.2 @@ -141,6 +141,13 @@ return application; } + /** + * Returns a list representing the blocks of the section. Each block + * is a map of key/value pairs corresponding to the tag-name/tag-value pairs + * of the ACD block. Two hardcoded keys are the block name (BLOCK_NAME_KEY) + * such as "sequence", "trim", "clean" + * and the block type (BLOCK_TYPE_KEY) such as "list", "boolean", "range", etc. + */ public List> getInputSection(){ return input; } From gordonp at dev.open-bio.org Fri Mar 9 19:33:16 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 19:33:16 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703100033.l2A0XGJX028345@dev.open-bio.org> gordonp Fri Mar 9 19:33:16 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util In directory dev.open-bio.org:/tmp/cvs-serv28310/src/main/ca/ucalgary/services/util Modified Files: ACDFile.java Log Message: Added handling for ACD file subsections (ignore by MOBY, as all secondary params are at the same level) moby-live/Java/src/main/ca/ucalgary/services/util ACDFile.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/09 18:01:09 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/10 00:33:16 1.3 @@ -12,6 +12,7 @@ public class ACDFile{ private List> application; private List> input; + private List> required; private List> additional; private List> advanced; private List> output; @@ -52,6 +53,7 @@ StringBuffer applicationSection = new StringBuffer(); StringBuffer inputSection = new StringBuffer(); + StringBuffer requiredSection = new StringBuffer(); StringBuffer additionalParamsSection = new StringBuffer(); StringBuffer advancedParamsSection = new StringBuffer(); StringBuffer outputSection = new StringBuffer(); @@ -84,6 +86,20 @@ inputSection.append(line+"\n"); } } + + else if(line.matches("^\\s*section\\s*:\\s*required\\s*\\[")){ + for(line = reader.readLine(); line != null; line = reader.readLine()){ + if(line.matches("^\\s*]")){ + break; + } + } + for(line = reader.readLine(); line != null; line = reader.readLine()){ + if(line.matches("^\\s*endsection\\s*:\\s*required")){ + break; + } + requiredSection.append(line+"\n"); + } + } else if(line.matches("^\\s*section:\\s*additional\\s*\\[")){ for(line = reader.readLine(); line != null; line = reader.readLine()){ @@ -131,6 +147,7 @@ // Populate the sections application = acdSectionToTagValuePairs(applicationSection.toString()); input = acdSectionToTagValuePairs(inputSection.toString()); + required = acdSectionToTagValuePairs(requiredSection.toString()); additional = acdSectionToTagValuePairs(additionalParamsSection.toString()); advanced = acdSectionToTagValuePairs(advancedParamsSection.toString()); output = acdSectionToTagValuePairs(outputSection.toString()); @@ -152,6 +169,10 @@ return input; } + public List> getRequiredParamsSection(){ + return required; + } + public List> getAdditionalParamsSection(){ return additional; } @@ -180,9 +201,14 @@ if(line.matches("^\\s*\\S+\\s*:\\s*\\S+\\s*\\[\\s*$")){ String blockType = line.replaceAll("^\\s*(\\S+)\\s*:\\s*\\S+\\s*\\[\\s*$", "$1"); String blockName = line.replaceAll("^\\s*\\S+\\s*:\\s*(\\S+)\\s*\\[\\s*$", "$1"); + boolean subsection = line.matches("^\\s*section\\s*:\\s*\\S*\\s*\\["); for(line = reader.readLine(); line != null; line = reader.readLine()){ if(line.matches("^\\s*]")){ + if(subsection){ + System.err.println("Ignoring subsection:\n" + blockText.toString()); + break; // ignore subsection specifications (MOBY 2ndary params don't hav'em) + } Map block = acdBlockToTagValuePairs(blockText.toString()); block.put(BLOCK_TYPE_KEY, blockType); block.put(BLOCK_NAME_KEY, blockName); @@ -192,6 +218,9 @@ blockText.append(line+"\n"); } } + else if(line.matches("^\\s*endsection:\\s*\\S+")){ + // ignore subsection info + } else{ throw new Exception("Unexpected content where blocks expected: "+line); } From gordonp at dev.open-bio.org Fri Mar 9 19:33:16 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 19:33:16 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703100033.l2A0XGe2028363@dev.open-bio.org> gordonp Fri Mar 9 19:33:16 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test In directory dev.open-bio.org:/tmp/cvs-serv28310/src/main/ca/ucalgary/services/util/test Modified Files: ACDFileTestCase.java Added Files: dan.acd Log Message: Added handling for ACD file subsections (ignore by MOBY, as all secondary params are at the same level) moby-live/Java/src/main/ca/ucalgary/services/util/test dan.acd,NONE,1.1 ACDFileTestCase.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/ACDFileTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/ACDFileTestCase.java 2007/03/09 17:16:55 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/ACDFileTestCase.java 2007/03/10 00:33:16 1.2 @@ -8,12 +8,13 @@ public class ACDFileTestCase extends TestCase{ private final static String ACDFILE_RESOURCE = "ca/ucalgary/services/util/test/transeq.acd"; + private final static String ACDFILE_SUBSECTION_RESOURCE = "ca/ucalgary/services/util/test/dan.acd"; public ACDFileTestCase(String name){ super(name); } - public void testParsing(){ + public void testParsingBasic(){ URL u = getClass().getClassLoader().getResource(ACDFILE_RESOURCE); assertNotNull("Could not find the test ACD file resource ("+ACDFILE_RESOURCE+")", u); @@ -35,6 +36,11 @@ assertTrue("The number of blocks (" + section.size() +") in the input section of " + u + " was not as expected (expected 1)", section.size() == 1); + section = file.getRequiredParamsSection(); + assertNotNull("The required parameters section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the required parameter section of " + + u + " was not as expected (expected 0)", section.size() == 0); + section = file.getAdditionalParamsSection(); assertNotNull("The additional parameters section for the test data file was unexpectedly null", section); assertTrue("The number of blocks (" + section.size() +") in the additional parameter section of " + @@ -51,13 +57,57 @@ u + " was not as expected (expected 1)", section.size() == 1); } + public void testParsingSubsections(){ + URL u = getClass().getClassLoader().getResource(ACDFILE_SUBSECTION_RESOURCE); + assertNotNull("Could not find the test ACD file resource ("+ACDFILE_SUBSECTION_RESOURCE+")", u); + + ACDFile file = null; + try{ + file = new ACDFile(u); + } catch(Exception e){ + e.printStackTrace(); + fail("Could not load and parse the test input resource ("+u+"): " + e); + } + + List> section = file.getApplicationSection(); + assertNotNull("The application section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the application section of " + + u + " was not as expected (expected 1)", section.size() == 1); + + section = file.getInputSection(); + assertNotNull("The input section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the input section of " + + u + " was not as expected (expected 1)", section.size() == 1); + + section = file.getRequiredParamsSection(); + assertNotNull("The required parameters section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the required parameter section of " + + u + " was not as expected (expected 0)", section.size() == 4); + + section = file.getAdditionalParamsSection(); + assertNotNull("The additional parameters section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the additional parameter section of " + + u + " was not as expected (expected 5)", section.size() == 6); + + section = file.getAdvancedParamsSection(); + assertNotNull("The advanced parameters section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the advanced parameter section of " + + u + " was not as expected (expected 1)", section.size() == 1); + + section = file.getOutputSection(); + assertNotNull("The output section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the output section of " + + u + " was not as expected (expected 1)", section.size() == 4); + } + /** * @return a test suite for all the test methods of this test case. */ public static Test suite() { TestSuite suite = new TestSuite(); - suite.addTest(new ACDFileTestCase("testParsing")); + suite.addTest(new ACDFileTestCase("testParsingBasic")); + suite.addTest(new ACDFileTestCase("testParsingSubsections")); return suite; } From gordonp at dev.open-bio.org Mon Mar 12 10:29:46 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:29:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121429.l2CETkV8002946@dev.open-bio.org> gordonp Mon Mar 12 10:29:45 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/resources In directory dev.open-bio.org:/tmp/cvs-serv2910/src/main/ca/ucalgary/services/resources Log Message: Directory /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/resources added to the repository moby-live/Java/src/main/ca/ucalgary/services/resources - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/resources/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/resources/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/resources/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Mon Mar 12 10:29:46 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:29:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121429.l2CETkoC002963@dev.open-bio.org> gordonp Mon Mar 12 10:29:46 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/test In directory dev.open-bio.org:/tmp/cvs-serv2910/src/main/ca/ucalgary/services/test Log Message: Directory /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/test added to the repository moby-live/Java/src/main/ca/ucalgary/services/test - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/test/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/test/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/test/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Mon Mar 12 10:30:56 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:30:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121430.l2CEUu19003006@dev.open-bio.org> gordonp Mon Mar 12 10:30:56 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv2975/src/main/ca/ucalgary/seahawk/services Added Files: TextClient.java Log Message: Initial commit of XSLT based MOBY to text transformer moby-live/Java/src/main/ca/ucalgary/seahawk/services TextClient.java,NONE,1.1 From gordonp at dev.open-bio.org Mon Mar 12 10:30:56 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:30:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121430.l2CEUuL5003020@dev.open-bio.org> gordonp Mon Mar 12 10:30:56 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/test In directory dev.open-bio.org:/tmp/cvs-serv2975/src/main/ca/ucalgary/seahawk/services/test Added Files: TextClientTestCase.java Log Message: Initial commit of XSLT based MOBY to text transformer moby-live/Java/src/main/ca/ucalgary/seahawk/services/test TextClientTestCase.java,NONE,1.1 From gordonp at dev.open-bio.org Mon Mar 12 10:32:02 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:32:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121432.l2CEW200003063@dev.open-bio.org> gordonp Mon Mar 12 10:32:02 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services In directory dev.open-bio.org:/tmp/cvs-serv3032/src/main/ca/ucalgary/services Added Files: ACDService.java Log Message: Initial commit of ACD service interface moby-live/Java/src/main/ca/ucalgary/services ACDService.java,NONE,1.1 From gordonp at dev.open-bio.org Mon Mar 12 10:32:02 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:32:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121432.l2CEW2Iv003079@dev.open-bio.org> gordonp Mon Mar 12 10:32:02 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util In directory dev.open-bio.org:/tmp/cvs-serv3032/src/main/ca/ucalgary/services/util Added Files: TempDir.java Log Message: Initial commit of ACD service interface moby-live/Java/src/main/ca/ucalgary/services/util TempDir.java,NONE,1.1 From gordonp at dev.open-bio.org Mon Mar 12 10:33:39 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:33:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121433.l2CEXc2B003204@dev.open-bio.org> gordonp Mon Mar 12 10:33:38 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/resources In directory dev.open-bio.org:/tmp/cvs-serv3173/src/main/ca/ucalgary/services/resources Added Files: acdRules.xml mobyRules.xsl Log Message: Initial commit of ACD service interface moby-live/Java/src/main/ca/ucalgary/services/resources acdRules.xml,NONE,1.1 mobyRules.xsl,NONE,1.1 From gordonp at dev.open-bio.org Mon Mar 12 10:33:39 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:33:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121433.l2CEXdF9003218@dev.open-bio.org> gordonp Mon Mar 12 10:33:39 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/test In directory dev.open-bio.org:/tmp/cvs-serv3173/src/main/ca/ucalgary/services/test Added Files: ACDServiceTestCase.java Log Message: Initial commit of ACD service interface moby-live/Java/src/main/ca/ucalgary/services/test ACDServiceTestCase.java,NONE,1.1 From gordonp at dev.open-bio.org Mon Mar 12 10:35:02 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:35:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121435.l2CEZ2A8003324@dev.open-bio.org> gordonp Mon Mar 12 10:35:01 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/test In directory dev.open-bio.org:/tmp/cvs-serv3293/src/main/ca/ucalgary/services/test Added Files: mobyTest1.png mobyTest2.png mobyDNASeq.xml Log Message: Support files for ACDService test cases moby-live/Java/src/main/ca/ucalgary/services/test mobyTest1.png,NONE,1.1 mobyTest2.png,NONE,1.1 mobyDNASeq.xml,NONE,1.1 From gordonp at dev.open-bio.org Mon Mar 12 10:37:24 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:37:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121437.l2CEbOPq003450@dev.open-bio.org> gordonp Mon Mar 12 10:37:24 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv3415/src/main/ca/ucalgary/seahawk/services Modified Files: MobyClient.java Log Message: Added several functions to parse multi-part data and binary data (because ACDService has these). Also added processing attriubutes to member fields for whitespace stripping and Base64 encoding. moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyClient.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2007/02/08 17:05:11 1.5 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2007/03/12 14:37:24 1.6 @@ -35,8 +35,7 @@ * described * here. Used in Seahawk to provide the service options popup items. */ -public class MobyClient -{ +public class MobyClient{ public static final String DATA_MAPPING_XML_RESOURCE = "ca/ucalgary/seahawk/resources/mobyBuilderRules.xml"; public static final String RESOURCE_SYSTEM_PROPERTY = "seahawk.rules"; public static final String RULE_SET_TAG = "object"; @@ -52,12 +51,20 @@ public static final String URL_REGEX_TAG = "url_regex"; public static final String REGEX_TAG = "regex"; public static final String XPATH_TAG = "xpath"; + public static final String WHITESPACE_ATTR = "whitespace"; + public static final String WHITESPACE_ATTR_STRIP_VAL = "strip"; + public static final String WHITESPACE_ATTR_NORMALIZE_VAL = "normalize"; + public static final String WHITESPACE_ATTR_KEEP_VAL = "keep"; + public static final String ENCODING_ATTR = "encoding"; + public static final String ENCODING_ATTR_BASE64_VAL = "Base64"; + public static final String ENCODING_ATTR_NONE_VAL = "none"; + public static final String SINGLE_RETURNED_VALUE_KEY = "_no_acd_param_should_have_this_name"; private NamespaceContextImpl nsContext; private CentralImpl c; private HashMap xpathMap; private HashMap urlRegexMap; - private HashMap regexMap; + private Map regexMap; private URL dataMappingXMLURL; private DocumentBuilder docBuilder; private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(MobyClient.class); @@ -68,7 +75,7 @@ c = new CentralCachedCallsImpl(); xpathMap = new HashMap(); urlRegexMap = new HashMap(); - regexMap = new HashMap(); + regexMap = new HashMap(); nsContext = new NamespaceContextImpl(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -88,7 +95,12 @@ if(rulesResource == null){ dataMappingXMLURL = cl.getResource(DATA_MAPPING_XML_RESOURCE); } - else{ + + // See if it's a URL + try{ + dataMappingXMLURL = new URL(rulesResource); + } + catch(Exception e){ dataMappingXMLURL = cl.getResource(rulesResource); } if(dataMappingXMLURL == null){ @@ -376,6 +388,30 @@ "have a non-blank " + DATATYPE_RULE_ATTR + " attribute as required"); } + String memberWhitespaceSetting = memTag.getAttribute(WHITESPACE_ATTR); + if(memberWhitespaceSetting == null || memberWhitespaceSetting.length() == 0){ + memberWhitespaceSetting = WHITESPACE_ATTR_KEEP_VAL; // default is to keep whitespace + } + else if(!memberWhitespaceSetting.equals(WHITESPACE_ATTR_KEEP_VAL) && + !memberWhitespaceSetting.equals(WHITESPACE_ATTR_NORMALIZE_VAL) && + !memberWhitespaceSetting.equals(WHITESPACE_ATTR_STRIP_VAL)){ + System.err.println("Object member " + memberNameKey + + " has an unrecognized value for the " + WHITESPACE_ATTR + + " attribute, overriding with default of " + WHITESPACE_ATTR_KEEP_VAL); + memberWhitespaceSetting = WHITESPACE_ATTR_KEEP_VAL; + } + String memberEncodingSetting = memTag.getAttribute(ENCODING_ATTR); + if(memberEncodingSetting == null || memberEncodingSetting.length() == 0){ + memberEncodingSetting = ENCODING_ATTR_NONE_VAL; // default is to not encode + } + else if(!memberEncodingSetting.equals(ENCODING_ATTR_NONE_VAL) && + !memberEncodingSetting.equals(ENCODING_ATTR_BASE64_VAL)){ + System.err.println("Object member " + memberNameKey + + " has an unrecognized value for the " + ENCODING_ATTR + + " attribute, overriding with default of " + ENCODING_ATTR_NONE_VAL); + memberWhitespaceSetting = ENCODING_ATTR_NONE_VAL; + } + if(membersMap.containsKey(memberNameKey)){ System.err.println("Object member " + memberNameKey + " already exists, ignoring new definition"); return; @@ -385,7 +421,9 @@ if(ruleValue == null || ruleValue.length() == 0){ System.err.println("Object member " + memberNameKey + " has a blank value rule"); } - membersMap.put(memberNameKey, ruleValue); + membersMap.put(memberNameKey, new String[]{ruleValue, + memberWhitespaceSetting, + memberEncodingSetting}); } protected void addNamespaceMapping(Element nsTag, Map namespaceStrings) throws Exception{ @@ -458,9 +496,206 @@ /** * Using the regular expression mappings that have been set up, + * maps a string using rules producing moby objects of the given type. + */ + public MobyDataObject[] getMobyObjects(String textData, MobyDataType targetDataType){ + Vector objectVector = new Vector(); + + for(Pattern pattern: regexMap.keySet()){ + MobyComplexBuilder rule = regexMap.get(pattern); + if(rule.getDataType().inheritsFrom(targetDataType)){ + Matcher matcher = pattern.matcher(textData); + + while(matcher.find()){ + try{ + MobyDataObject mobyObj = rule.apply(matcher); + if(mobyObj != null){ + objectVector.add(mobyObj); + } + } + catch(MobyException me){ + System.err.println("Could not build Moby object from match:" + me); + me.printStackTrace(); + } + } + } + } + + return (MobyDataObject[]) objectVector.toArray(new MobyDataObject[objectVector.size()]); + } + + /** + * Create a MOBY data instance from a map of name->bytes[] by applying the rules of the given MobyClient. + * The creation of a single object or collection is done according to the dataTemplate provided. + * + * @throws MobyServiceException NOTE: these are just warning level exceptions about collection-simple casting that you can add to the service response, or ignore if you like + */ + public MobyDataInstance getMobyObject(Map resultParts, MobyPrimaryData dataTemplate) + throws Exception, MobyServiceException{ + Vector results = new Vector(); + // The output parameter *potentially* has multiple parts + // (e.g. multiple .png file from EMBOSS's "banana" program) + // hence the nested for loops (part iteration, followed by created-object iteration) + for(String resultPartName: resultParts.keySet()){ + for(MobyDataObject resultPart: getMobyObjects(resultParts.get(resultPartName), dataTemplate.getDataType())){ + // Maintain the name for the object in the collection, as banana.1.png, banana.2.png, etc. + // is useful information for the end-user for making sense of them together! (left to right) + if(!resultPartName.equals(SINGLE_RETURNED_VALUE_KEY)){ // except for trivial single-byte-array case + resultPart.setName(resultPartName); + } + results.add(resultPart); + } + } + + if(results.size() == 0){ + if(dataTemplate instanceof MobyPrimaryDataSimple){ + if(resultParts != null && resultParts.size() > 0){ + // Is it a single-byte-array response? + if(resultParts.containsKey(SINGLE_RETURNED_VALUE_KEY)){ + if(resultParts.get(SINGLE_RETURNED_VALUE_KEY).length != 0){ + throw new MobyServiceException(MobyServiceException.WARNING, + MobyServiceException.INTERNAL_PROCESSING_ERROR, + null, + dataTemplate.getName(), + "The non-blank data provided " + + "did not match any MOBY Object rules, " + + "therefore a blank response is being returned. Contact " + + " the service provider to fix the MOBY Object rules."); + } + } + // Otherwise it's a multi-part result + else{ + for(String partName: resultParts.keySet()){ + if(resultParts.get(partName).length != 0){ + throw new MobyServiceException(MobyServiceException.WARNING, + MobyServiceException.INTERNAL_PROCESSING_ERROR, + null, + dataTemplate.getName(), + "The non-blank data provided (" + partName + + ") did not match any MOBY Object rules, " + + "therefore a blank response is being returned. Contact " + + " the service provider to fix the MOBY Object rules."); + } + } + } //end multi-part result + } //end if some results present + return null; //nothing to report + } + else{ // Empty set + return new MobyDataObjectSet(dataTemplate.getName()); + } + } + else if(results.size() > 1){ + if(dataTemplate instanceof MobyPrimaryDataSimple){ + System.err.println("The data map provided " + + "was a collection, but the request was to return a simple. " + + "Only the first value in the collection has been returned."); + // TODO: should we instead return the one deepest in the heirarchy (or with the most members)? + return results.elementAt(0); + } + else{ + MobyDataObjectSet resultSet = new MobyDataObjectSet(dataTemplate.getName()); + resultSet.addAll(results); + return resultSet; + } + } + // One result + else{ + if(dataTemplate instanceof MobyPrimaryDataSimple){ + return results.elementAt(0); + } + else{ // Collection of 1 + MobyDataObjectSet resultSet = new MobyDataObjectSet(dataTemplate.getName()); + resultSet.add(results.elementAt(0)); + return resultSet; + } + } + } + + /** + * Using the regular expression mappings that have been set up, + * maps a string using rules producing moby objects of the given type. + * Particularly, the regex is assumed to include only ASCII characters at first, + * and the byte-translation of it is checked against the raw data's bytes. + * If no rules match, the raw data is converted to a String, and the regex + * are tried as normal... + * + * The net effect is that you specify magic signatures for file types as regular expression rules, + * and calling this method will match up the file type by byte-wise comparing the data and pattern. + */ + public MobyDataObject[] getMobyObjects(byte[] rawData, MobyDataType targetDataType){ + // Only do the magic check if the target data type inherits from MOBY's base64 class (i.e. might encode binary data) + if(!targetDataType.inheritsFrom(MobyDataType.getDataType(MobyDataBytes.BASE64_DATATYPE))){ + return getMobyObjects(new String(rawData)); + } + + String rawDataAsString = null; + + Vector objectVector = new Vector(); + + for(Pattern pattern: regexMap.keySet()){ + MobyComplexBuilder rule = regexMap.get(pattern); + if(rule.getDataType().inheritsFrom(targetDataType)){ + // Only build the string representation of the byte array if we + // found a rule that applies (since it's a somewhat expensive operation + // to do the conversion) + if(rawDataAsString == null){ + rawDataAsString = bytesToString(rawData); + System.err.println("Start of data is " + rawDataAsString.substring(0, 4)); + } + Matcher matcher = pattern.matcher(rawDataAsString); + + while(matcher.find()){ + System.err.println("Found match for binary data"); + try{ + MobyDataObject mobyObj = rule.apply(matcher, rawData); + if(mobyObj != null){ + objectVector.add(mobyObj); + } + } + catch(MobyException me){ + System.err.println("Could not build Moby object from match:" + me); + me.printStackTrace(); + } + } + } + } + + if(objectVector.size() != 0){ + return (MobyDataObject[]) objectVector.toArray(new MobyDataObject[objectVector.size()]); + } + // Didn't find anything in the raw form, but there was a rule that applies to the data type, so try as a string... + //else if(rawDataAsString != null){ + // return getMobyObjects(new String(rawData)); + //} + else{ + return new MobyDataObject[0]; + } + } + + //Pad out the bytes (8-bit) into chars (16-bits), for regex checking of the data + private String bytesToString(byte[] bytes){ +// return new String(bytes); + StringBuffer stringBuffer = new StringBuffer(bytes.length); + + for(int i = 0; i < bytes.length; i++){ + // Casting byte to char pads it out with a byte e.g. 0x34 become 0x0034 (Unicode 16-bit) + // Do this because regex use unicode, not ASCII + stringBuffer.append((char) bytes[i]); + } + + return stringBuffer.toString(); + } + + /** + * Using the regular expression mappings that have been set up, * maps a string to moby objects. */ public MobyDataObject[] getMobyObjects(String textData){ + return getMobyObjects(textData, (byte[]) null); + } + + public MobyDataObject[] getMobyObjects(String textData, byte[] bytes){ if(regexMap.isEmpty()){ System.out.println("The MOBY Client has not been provided any regex->moby data mappings!"); return new MobyDataObject[0]; @@ -478,7 +713,7 @@ MobyComplexBuilder rule = (MobyComplexBuilder) regexMap.get(pattern); try{ - MobyDataObject mobyObj = rule.apply(matcher); + MobyDataObject mobyObj = rule.apply(matcher, bytes); if(mobyObj != null){ objectVector.add(mobyObj); } @@ -519,7 +754,7 @@ Matcher matcher = pattern.matcher(urlString); while(matcher.find()){ - MobyComplexBuilder rule = (MobyComplexBuilder) regexMap.get(pattern); + MobyComplexBuilder rule = (MobyComplexBuilder) urlRegexMap.get(pattern); try{ MobyDataObject mobyObj = rule.apply(matcher); @@ -771,9 +1006,10 @@ } public void addRegexMapping(String regexp, Map nsRules, String mobyDataType, Map membersMap){ //mobyObj<--mobyNamespaces - //System.out.println("regex addMapping: " + regexp); try{ - Pattern pattern = Pattern.compile(processRegExp(regexp)); + // Pattern.DOTALL to allow ".*" to span multiple lines, also allow comments (# to EOL) and whitespace + // for better readability in the rules file. + Pattern pattern = Pattern.compile(processRegExp(regexp), Pattern.DOTALL | Pattern.COMMENTS); // Base object if(mobyDataType == null || mobyDataType.length() == 0){ @@ -873,6 +1109,7 @@ public void clear(){ xpathMap.clear(); regexMap.clear(); + (new Exception()).printStackTrace(); } public void clearXPaths(){ @@ -881,6 +1118,7 @@ public void clearRegexs(){ regexMap.clear(); + (new Exception()).printStackTrace(); } public void clearURLRegexs(){ @@ -899,5 +1137,19 @@ } //System.out.println("the number of key-value mappings in this map: " + map.size()); } + + /** + * Indicates whether at least one production rule exists for the data type or one of its children. + */ + public boolean canProduceDataTypeFromString(MobyDataType targetDataType){ + //System.err.println("The rules database has " + regexMap.size() + " entries"); + for(MobyComplexBuilder rule: regexMap.values()){ + //System.err.println("Checking regex rule " + rule); + if(rule.getDataType().inheritsFrom(targetDataType)){ + return true; + } + } + return false; + } } From gordonp at dev.open-bio.org Mon Mar 12 10:38:38 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:38:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121438.l2CEccIN003516@dev.open-bio.org> gordonp Mon Mar 12 10:38:38 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv3481/src/main/ca/ucalgary/seahawk/services Modified Files: MobyComplexBuilder.java Log Message: Added XPath evaluation to regex rules, and added function to get the returned data type from the rule moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyComplexBuilder.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java 2007/02/08 16:59:58 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java 2007/03/12 14:38:38 1.3 @@ -1,13 +1,13 @@ package ca.ucalgary.seahawk.services; -import org.biomoby.shared.MobyDataType; -import org.biomoby.shared.MobyException; -import org.biomoby.shared.MobyNamespace; -import org.biomoby.shared.MobyRelationship; +import org.biomoby.shared.*; import org.biomoby.shared.data.MobyDataObject; import org.biomoby.shared.data.MobyDataComposite; +import org.w3c.dom.Document; + import javax.xml.xpath.*; +import javax.xml.parsers.*; import javax.xml.namespace.NamespaceContext; import java.util.Iterator; @@ -20,12 +20,26 @@ public class MobyComplexBuilder{ + private static XPathFactory xPathFactory; + private static DocumentBuilder docBuilder; + private Map namespaceRules; private Map memberRules; private MobyDataType mobyDataType; private MobyNamespace[] mobyNS; private MobyRelationship[] children; + static{ + xPathFactory = XPathFactory.newInstance(); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + try{ + docBuilder = dbf.newDocumentBuilder(); + } catch(Exception e){ + e.printStackTrace(); + } + } + public MobyComplexBuilder(String dataType, Map members, Map nameSpaces) throws Exception{ mobyDataType = MobyDataType.getDataType(dataType); // Not an existing Ontology data type @@ -87,6 +101,10 @@ } public MobyDataObject apply(Matcher matcher) throws MobyException{ + return apply(matcher, null); + } + + public MobyDataObject apply(Matcher matcher, byte[] data) throws MobyException{ MobyDataObject mobyObj = null; if(mobyDataType.getName().equals("Object")){ @@ -123,16 +141,87 @@ } } + Document doc = docBuilder.newDocument(); // Set members if available and required if(mobyObj instanceof MobyDataComposite){ if(children != null){ for(int i = 0; i < children.length; i++){ String memberName = children[i].getName(); - String result = (String) memberRules.get(memberName); + String[] resultSpec = (String[]) memberRules.get(memberName); + String result = resultSpec[0]; + byte[] resultBytes = result.getBytes(); + String whitespaceMode = resultSpec[1]; + String encodingMode = resultSpec[2]; + + boolean nonBasic = result.length() != 2 || result.indexOf("$") != 0; + MobyPrefixResolver.MobyNodeList nodeList = new MobyPrefixResolver.MobyNodeList(); // Replace any $0, $1, etc. in the replacement string with the values found in the matcher + // Note that this is not perfect: if you had "$1 $2", and $1 had value "$250", you'd get $250$2, + // then you'd substitute $2's value of "per metre", you'd get "per metre50 per metre" instead of + // "$250 per metre". Not sure of a good way around this yet (i.e. when varValue had $k in it where k > j)... for(int j = 0; j <= matcher.groupCount(); j++){ - result = result.replaceAll("\\$"+j, matcher.group(j)); + // A replaceAll() for binary data + if(data != null){ + (new Exception("Binary replaceAll()")).printStackTrace(); + int srcPos = 0; + for(int varIndex = result.indexOf("\\$"+j, srcPos); + varIndex != -1; + varIndex = result.indexOf("\\$"+j, srcPos)){ + int varValueLength = matcher.end(j)-matcher.start(j)+1; + + byte[] newResultBytes = new byte[resultBytes.length+varValueLength]; + if(varIndex > 0){ + System.arraycopy(resultBytes, 0, newResultBytes, 0, varIndex); + } + System.arraycopy(data, matcher.start(j), newResultBytes, varIndex, varValueLength); + int remaining = result.length()-varIndex-2; + if(remaining > 0){ + System.arraycopy(resultBytes, varIndex+2, newResultBytes, varIndex+varValueLength, + result.length()-varIndex-2); + } + srcPos += varIndex + varValueLength + 1; + resultBytes = newResultBytes; + } + } + // $# substitution in a string, considerably simpler! + else{ + String varValue = matcher.group(j); + if(whitespaceMode.equals(MobyClient.WHITESPACE_ATTR_NORMALIZE_VAL)){ + varValue = varValue.replaceAll("\\s+"," "); + } + else if(whitespaceMode.equals(MobyClient.WHITESPACE_ATTR_STRIP_VAL)){ + varValue = varValue.replaceAll("\\s+",""); + } + result = result.replaceAll("\\$"+j, varValue); + + // Binary data and XPath are incompatible, since many bytes are not allowed in XML + // so only create the node list if not Base64 encoding + nodeList.add(doc.createTextNode(result)); + } } + + if(encodingMode.equals(MobyClient.ENCODING_ATTR_BASE64_VAL)){ + (new Exception("Base 64 encoding")).printStackTrace(); + result = org.apache.axis.encoding.Base64.encode(data == null ? result.getBytes() : resultBytes); + } + else{ + System.err.println("NO BASE64 (" + MobyClient.ENCODING_ATTR_BASE64_VAL + + ") ENCODING for " +memberName+": " + encodingMode); + } + + // If the value contains anything other than $#, treat it as a XPath expression + // to be evaluated on a text node containing the result value + if(nonBasic && data == null){ + XPath xpath = xPathFactory.newXPath(); + try{ + result = xpath.evaluate(result, nodeList); + }catch(Exception e){ + e.printStackTrace(); + throw new MobyException("Could not evaluate result of XPath expression for object member " + + memberName + " (" + result + "): " + e); + } + } + ((MobyDataComposite) mobyObj).put(memberName, MobyDataObject.createInstanceFromString(children[i].getDataTypeName(), result)); } @@ -143,7 +232,7 @@ } public MobyDataObject applyXPath(Object result, NamespaceContext nsContext) throws MobyException, XPathExpressionException{ - XPath xpath = XPathFactory.newInstance().newXPath(); + XPath xpath = xPathFactory.newXPath(); xpath.setNamespaceContext(nsContext); MobyDataObject mobyObj = null; @@ -184,7 +273,7 @@ if(children != null){ for(int i = 0; i < children.length; i++){ String memberName = children[i].getName(); - String expr = (String) memberRules.get(memberName); + String expr = ((String[]) memberRules.get(memberName))[0]; String value = xpath.evaluate(expr, result); ((MobyDataComposite) mobyObj).put(memberName, @@ -195,4 +284,12 @@ return mobyObj; } + + /** + * Reports the data type of the objects returned by matched rules. + */ + public MobyDataType getDataType(){ + //System.err.println("Returning data type of " + mobyDataType.getName()); + return mobyDataType; + } } From gordonp at dev.open-bio.org Mon Mar 12 12:57:30 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 12:57:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121657.l2CGvUh2004230@dev.open-bio.org> gordonp Mon Mar 12 12:57:30 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service In directory dev.open-bio.org:/tmp/cvs-serv4195/src/main/org/biomoby/service Modified Files: MobyServlet.java Log Message: Updates to base service for better extensibility moby-live/Java/src/main/org/biomoby/service MobyServlet.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/MobyServlet.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/service/MobyServlet.java 2007/02/08 16:59:58 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/MobyServlet.java 2007/03/12 16:57:30 1.6 @@ -77,7 +77,7 @@ protected boolean isDebug = false; public void doGet(HttpServletRequest request, - HttpServletResponse response) + HttpServletResponse response) throws ServletException, java.io.IOException{ if(thisService == null){ try{ @@ -1142,9 +1142,10 @@ } MobyServlet servlet = new MobyServlet(); + ClassLoader classLoader = servlet.getClass().getClassLoader(); try{ // This line can throw many different exception if you didn't get the class right! - Class servletClass = servlet.getClass().getClassLoader().loadClass(args[0]); + Class servletClass = classLoader.loadClass(args[0]); if(servletClass == null){ System.err.println("The Class to test (" + args[0] + ") was not found"); System.err.println("Assuming you don't want to run a servlet test, executing main() method from subclass"); @@ -1189,7 +1190,14 @@ MobyContentInstance testResults = new MobyContentInstance(); // Configure the service, minimally, to check the input data - servlet.init(new TestServletConfig(args[0], new TestServletContext())); + java.net.URL webXMLURL = classLoader.getResource("WEB-INF/web.xml"); + if(webXMLURL == null){ + System.err.println("No WEB-INF/web.xml, assuming you don't need any of its settings for the servlet to work!"); + servlet.init(new TestServletConfig(args[0], new TestServletContext())); + } + else{ + servlet.init(new TestServletConfig(new TestServletContext(), webXMLURL)); + } servlet.thisService = servlet.createServiceFromConfig(null); // It should populate the testResults @@ -1210,7 +1218,7 @@ for(ServiceException se: testResults.getExceptions()){ se.printStackTrace(); } - throw new Exception("Executing service " + args[0] + " cause exceptions"); + throw new Exception("Executing service " + args[0] + " caused exceptions"); } else{ System.out.println(testResults.toString()); From gordonp at dev.open-bio.org Mon Mar 12 12:57:30 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 12:57:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121657.l2CGvUK2004256@dev.open-bio.org> gordonp Mon Mar 12 12:57:30 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test In directory dev.open-bio.org:/tmp/cvs-serv4195/src/main/org/biomoby/service/test Modified Files: MobyServletTestCase.java ServletTester.java TestServletConfig.java Log Message: Updates to base service for better extensibility moby-live/Java/src/main/org/biomoby/service/test MobyServletTestCase.java,1.2,1.3 ServletTester.java,1.1,1.2 TestServletConfig.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/MobyServletTestCase.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/service/test/MobyServletTestCase.java 2006/12/07 16:37:36 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/MobyServletTestCase.java 2007/03/12 16:57:30 1.3 @@ -22,6 +22,7 @@ public class MobyServletTestCase extends TestCase{ private final static String TEST_MOBY_XML = "org/biomoby/service/test/mobyAASeq.xml"; private final static String SERVLET_TEST_URL = "http://moby.ucalgary.ca:8089/MobyServlet"; + private final static String TEST_MAIN_CLASS_NAME = "org.biomoby.service.test.ConvertAAtoFASTA_AA"; /** * @param name Test case name. */ @@ -29,18 +30,6 @@ super(name); } - /** - * Sets up the test fixture. - * Called before every test case method. - */ - protected void setUp() throws Exception{ - super.setUp(); - } - - protected void tearDown() throws Exception{ - super.tearDown(); - } - protected URL getExampleURL(){ URL testDataURL = getClass().getClassLoader().getResource(TEST_MOBY_XML); if(testDataURL == null){ @@ -50,16 +39,54 @@ return testDataURL; } + /** + * Override this method to run the main method of more specific servlets + * you want to test (e.g. ACDServlet overrides this and specifies itself + * as the class to test). + */ + protected String getExampleClass(){ + return TEST_MAIN_CLASS_NAME; + } + + /** + * Override this method to run the main method of more specific servlets + * you want to test (e.g. ACDServlet overrides this and specifies itself + * as the class to test). + */ + protected String getExampleServlet(){ + return SERVLET_TEST_URL; + } + public void testMain() throws Exception{ // Should execute main URL testDataURL = getExampleURL(); + String className = getExampleClass(); + + // Use reflection to load the class whose main method should be called + // TODO: Maybe we should check that it inherits from MobyServlet first? + Class targetClass = null; + try { + targetClass = Class.forName(className); + } catch(Exception e){ + e.printStackTrace(); + fail("Could not find class load " + className + ": " + e); + } + + java.lang.reflect.Method mainMethod = null; + try{ + mainMethod = targetClass.getMethod("main", new Class[] {String[].class}); + } catch(Exception e){ + e.printStackTrace(); + fail("Could not find main method in class " + className + ": " + e); + } MobyServlet.setMainTerminationExit(false); + String[] args = new String[]{className, testDataURL.toString()}; try{ - ConvertAAtoFASTA_AA.main(new String[]{"org.biomoby.service.test.ConvertAAtoFASTA_AA",testDataURL.toString()}); + mainMethod.invoke(null, new Object[]{args}); } catch(Exception e){ e.printStackTrace(); - fail("Main method for org.biomoby.service.test.ConvertAAtoFASTA_AA had an exception"); + fail("Main method for " + className + " had an exception: " +e); } // Should execute subclass main @@ -210,7 +237,7 @@ public void testServletTester(){ try{ - ServletTester.main(new String[]{SERVLET_TEST_URL, "ignored"}); + ServletTester.main(new String[]{getExampleServlet(), getExampleURL().toString()}); } catch(Exception e){ e.printStackTrace(); fail("Could not run servlet tester successfully: " + e); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/ServletTester.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/service/test/ServletTester.java 2006/12/06 16:07:10 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/ServletTester.java 2007/03/12 16:57:30 1.2 @@ -1,7 +1,9 @@ /** + * This class is used by the MobyServlet framework + * to test a deployed service, and register it with MOBY Central. * This is the simplest Java MOBY client you can have. A fully documented version - * is available in the TestRequest class, with all the proper error checking. + * of a client is available in the TestRequest class, with all the proper error checking. */ package org.biomoby.service.test; @@ -14,8 +16,9 @@ import org.w3c.dom.*; import javax.xml.parsers.*; +import java.net.URL; import java.util.*; -import java.io.FileInputStream; +import java.io.*; public class ServletTester{ public static void main(String[] args) throws Exception{ @@ -46,49 +49,17 @@ String testServiceClassName = null; String inParams = null; String outParams = null; - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(false); - DocumentBuilder docBuilder = dbf.newDocumentBuilder(); - - Element docRoot = null; - try{ - docRoot = docBuilder.parse(webXmlURL.openStream()).getDocumentElement(); - if(docRoot == null || !docRoot.getNodeName().equals("web-app")){ - System.err.println("Could not find /web-app tag in " + - webXmlURL + ", aborting!"); - throw new Exception("Invalid web.xml, no web-app tag"); - } - } catch(Exception e){ - System.err.println("There appears to be a problem with the \"WEB-INF/web.xml\" file (XML syntax?)." + - "While parsing it I encountered the error: " + e); - e.printStackTrace(); - throw new Exception("Unparseable web.xml"); - } - Element servletNode = getChildElement(docRoot, "servlet"); - if(servletNode == null){ - System.err.println("Could not find /web-app/servlet/ tag in " + - webXmlURL + ", aborting!"); - throw new Exception("Invalid web.xml, no servlet tag"); - } - Element servletName = getChildElement(servletNode, "servlet-name"); - if(servletName == null){ - System.err.println("Could not find /web-app/servlet/servlet-name tag in " + - webXmlURL + ", aborting!"); - throw new Exception("Invalid web.xml, no servlet-name tag"); - } - Element servletClassName = getChildElement(servletNode, "servlet-class"); - if(servletClassName == null){ - System.err.println("Could not find /web-app/servlet/servlet-class tag in " + - webXmlURL + ", aborting!"); - throw new Exception("Invalid web.xml, no servlet-class tag"); - } + // Parse the web.xml config to set the servlet environment + TestServletConfig servletConfig = new TestServletConfig(new TestServletContext(), + webXmlURL); MobyServlet servlet = null; try{ // This line can throw many different exception if you didn't get the class right! - Class servletClass = MobyServlet.class.getClassLoader().loadClass(servletClassName.getTextContent()); + Class servletClass = MobyServlet.class.getClassLoader().loadClass(servletConfig.getServletClassName()); if(servletClass == null){ - throw new ClassNotFoundException("The servlet Class to run (" + servletClassName.getTextContent() + + throw new ClassNotFoundException("The servlet Class to run (" + + servletConfig.getServletClassName() + ") was not found, please ensure the web.xml is up-to-date."); } servlet = (MobyServlet) servletClass.newInstance(); @@ -98,16 +69,16 @@ throw new Exception("Invalid web.xml, the servlet-class tag was not useable"); } - // TODO: should properly parse the web.xml config - servlet.init(new TestServletConfig(servletName.getTextContent(), new TestServletContext())); + servlet.init(servletConfig); TestHttpServletRequest request = new TestHttpServletRequest(); request.setRequestURL(args[0]); MobyService testService = servlet.createServiceFromConfig(request); - // When we GET this URL, the RDF is returned + // When we GET this URL, the RDF is returned, populated with all the pertinent data for registration if(args.length != 3 || !("register_permanent".equals(args[2]))){ testService.setSignatureURL(null); //signature not set == MOBY agent, please delete this service if requested! } + // Otherwise we keep the signature URL that servlet.createServiceFromConfig() generated // Setup communication with MOBY Central Central worker = null; @@ -127,11 +98,18 @@ MobyContentInstance testData = null; MobyData[] inputTypes = testService.getPrimaryInputs(); if(inputTypes.length > 0){ - FileInputStream dataIn = null; + InputStream dataIn = null; try{ dataIn = new FileInputStream(args[1]); } catch(Exception e){ - e.printStackTrace(); + System.err.println("The specified resource " + args[1] + " is not a file, trying as a URL"); + } + if(dataIn == null){ + try{ + dataIn = (new URL(args[1])).openStream(); + } catch(Exception e){ + e.printStackTrace(); + } } if(dataIn == null){ System.err.println("Could not read example data file \"" + args[1] + "\", aborting!"); @@ -203,24 +181,4 @@ // TO DO: check RDF discrepancies? System.err.println("Service Successfully Unregistered!"); } - - public static Element getChildElement(Element parent, String elementName){ - if(elementName == null || parent == null){ - return null; - } - - NodeList children = parent.getChildNodes(); - for(int i = 0; children != null && i < children.getLength(); i++){ - // Make sure it's an element, not a processing instruction, text, etc. - if(!(children.item(i) instanceof Element)){ - continue; - } - Element child = (Element) children.item(i); - // Make sure it has the right name, or wildcard - if(elementName.equals(child.getTagName())){ - return child; - } - } - return null; - } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/TestServletConfig.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/service/test/TestServletConfig.java 2006/12/06 16:07:10 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/TestServletConfig.java 2007/03/12 16:57:30 1.2 @@ -8,6 +8,10 @@ package org.biomoby.service.test; +import org.biomoby.shared.MobyPrefixResolver; +import org.w3c.dom.*; + +import javax.xml.parsers.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.*; @@ -15,6 +19,7 @@ public class TestServletConfig implements ServletConfig{ private String name = null; + private String className = null; private Hashtable initParams = new Hashtable(); private ServletContext context = null; @@ -23,6 +28,66 @@ context = cont; } + public TestServletConfig(ServletContext cont, java.net.URL u) throws Exception{ + context = cont; + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + DocumentBuilder docBuilder = dbf.newDocumentBuilder(); + + Element docRoot = null; + try{ + docRoot = docBuilder.parse(u.openStream()).getDocumentElement(); + if(docRoot == null || !docRoot.getNodeName().equals("web-app")){ + throw new Exception("Invalid web.xml (" + u + "), no root web-app tag"); + } + } catch(Exception e){ + throw new Exception("There appears to be a problem with the \"WEB-INF/web.xml\" file (" + + u + ", XML syntax?).\n" + + "While parsing it I encountered the error: " + e); + } + + Element servletNode = MobyPrefixResolver.getChildElement(docRoot, "servlet"); + if(servletNode == null){ + System.err.println("Could not find /web-app/servlet/ tag in " + + u + ", aborting!"); + throw new Exception("Invalid web.xml (" + u +"), no servlet tag"); + } + Element servletName = MobyPrefixResolver.getChildElement(servletNode, "servlet-name"); + if(servletName == null){ + System.err.println("Could not find /web-app/servlet/servlet-name tag in " + + u + ", aborting!"); + throw new Exception("Invalid web.xml (" + u +"), no servlet-name tag"); + } + name = servletName.getTextContent(); + if(name.length() == 0){ + throw new Exception("Invalid web.xml (" + u +"), servlet-name tag is blank (cannot have nameless servlet)"); + } + + Element servletClassName = MobyPrefixResolver.getChildElement(servletNode, "servlet-class"); + if(servletClassName == null){ + System.err.println("Could not find /web-app/servlet/servlet-class tag in " + + u + ", aborting!"); + throw new Exception("Invalid web.xml (" + u + "), no servlet-class tag"); + } + className = servletClassName.getTextContent(); + if(className.length() == 0){ + throw new Exception("Invalid web.xml (" + u +"), servlet-class tag is blank (cannot have nameless class)"); + } + + NodeList paramNodes = docRoot.getElementsByTagName("context-param"); + for(int i = 0; i < paramNodes.getLength(); i++){ + Element paramNameTag = MobyPrefixResolver.getChildElement((Element) paramNodes.item(i), "param-name"); + Element paramValueTag = MobyPrefixResolver.getChildElement((Element) paramNodes.item(i), "param-value"); + if(paramNameTag == null || paramValueTag == null){ + System.err.println("Skipping context parameter #" + (i+1) + + " because of undefined param-name or param-value tag"); + continue; + } + addInitParameter(paramNameTag.getTextContent(), paramValueTag.getTextContent()); + } + } + public String getInitParameter(String name){ return (String) initParams.get(name); } @@ -42,4 +107,9 @@ public String getServletName(){ return name; } + + public String getServletClassName(){ + return className; + } + } From gordonp at dev.open-bio.org Mon Mar 12 12:58:48 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 12:58:48 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121658.l2CGwmIR004326@dev.open-bio.org> gordonp Mon Mar 12 12:58:48 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv4291/src/main/org/biomoby/shared Modified Files: MobyPrefixResolver.java Log Message: Doc updates, made node list class static for use externally moby-live/Java/src/main/org/biomoby/shared MobyPrefixResolver.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.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/shared/MobyPrefixResolver.java 2006/10/26 01:32:06 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.java 2007/03/12 16:58:48 1.8 @@ -18,6 +18,9 @@ * Using this class is the only way to compile XPaths that are independent * of the namespace declarations in the document (since those are the default ones * used by XPath evaluators). + * + * NOTE: the methods of this class rely on the DOM being parsed with a namespace-aware + * parser! */ public class MobyPrefixResolver implements PrefixResolver{ @@ -77,7 +80,7 @@ /** * Convenience method that matches child elements in the MOBY namespace or, for now * at least, with no declared namespace. "*" acts as a wildcard. - * @return the list of children, or null if either the elemtn or name is null does not exist + * @return the list of children, or null if either the element or name is null does not exist */ public static NodeList getChildElements(org.w3c.dom.Element e, String elementName){ if(elementName == null || e == null){ @@ -109,7 +112,7 @@ return matches; } - static class MobyNodeList implements NodeList{ + public static class MobyNodeList implements NodeList{ private Vector nodes; public MobyNodeList(){nodes = new Vector();} public int getLength(){return nodes.size();} From gordonp at dev.open-bio.org Mon Mar 12 13:00:33 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 13:00:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121700.l2CH0XWt004445@dev.open-bio.org> gordonp Mon Mar 12 13:00:33 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv4410/src/main/org/biomoby/shared Modified Files: MobyService.java Log Message: Added ability to delete inputs and outputs, also made get method for outputs downcasted moby-live/Java/src/main/org/biomoby/shared MobyService.java,1.15,1.16 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2006/11/11 23:04:34 1.15 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2007/03/12 17:00:33 1.16 @@ -297,6 +297,11 @@ rdf = (value == null ? "" : value); } + /** + * Adds an array of input parameter to the service. + * NOTE: the "set" is a bit of a misnomer: parameters will be added to the existing list. + * To clear the existing list of parameters, call this finction with 'null' first. + */ public void setInputs (MobyData[] value) { if (value == null) { primaryInputs.clear(); @@ -304,35 +309,83 @@ } else { for (int i = 0 ; i < value.length; i++) { if (value[i].isPrimary()) - primaryInputs.addElement (value[i]); + addOrReplaceData(primaryInputs, value[i]); else - secondaryInputs.addElement (value[i]); + addOrReplaceData(secondaryInputs, value[i]); } } } public void addInput (MobyData value) { if (value != null) { if (value.isPrimary()) - primaryInputs.addElement (value); + addOrReplaceData(primaryInputs, value); else - secondaryInputs.addElement (value); + addOrReplaceData(secondaryInputs, value); } } + public void removeInput(MobyData value) { + if (value != null) { + if (value.isPrimary()) + removeData(primaryInputs, value); + else + removeData(secondaryInputs, value); + } + } + + private void addOrReplaceData(Vector vector, MobyData value){ + for(int i = 0; i < vector.size(); i++){ + // Replace an existing parameter with the same name + if(vector.elementAt(i).getName().equals(value.getName())){ + vector.removeElementAt(i); + vector.insertElementAt(value, i); + return; + } + } + // Isn't a replacement, add to the end + vector.addElement(value); + } + + private void removeData(Vector vector, MobyData value){ + for(int i = 0; i < vector.size(); i++){ + // Remove an existing parameter with the same name + if(vector.elementAt(i).getName().equals(value.getName())){ + vector.removeElementAt(i--); + } + } + } + + /** + * Adds an array of output parameter to the service. + * NOTE: Unless the parameter is Primary, it will be ignored. + * ALSO NOTE: the "set" is a bit of a misnomer: parameters will be added to the existing list. + * To clear the existing list of parameters, call this finction with 'null' first. + */ public void setOutputs (MobyData[] value) { if (value == null) { primaryOutputs.clear(); } else { for (int i = 0 ; i < value.length; i++) { if (value[i].isPrimary()) - primaryOutputs.addElement (value[i]); + addOrReplaceData(primaryOutputs, value[i]); } } } + + /** + * Adds an output parameter to the service. NOTE: Unless the parameter is Primary, it will be ignored. + */ public void addOutput (MobyData value) { if (value != null) { if (value.isPrimary()) - primaryOutputs.addElement (value); + addOrReplaceData(primaryOutputs, value); + } + } + + public void removeOutput (MobyData value) { + if (value != null) { + if (value.isPrimary()) + removeData(primaryOutputs, value); } } @@ -352,9 +405,9 @@ } } - public MobyData[] getPrimaryOutputs() { + public MobyPrimaryData[] getPrimaryOutputs() { synchronized (primaryOutputs) { - MobyData[] results = new MobyData [primaryOutputs.size()]; + MobyPrimaryData[] results = new MobyPrimaryData [primaryOutputs.size()]; primaryOutputs.copyInto (results); return results; } From gordonp at dev.open-bio.org Mon Mar 12 13:01:29 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 13:01:29 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121701.l2CH1TEW004513@dev.open-bio.org> gordonp Mon Mar 12 13:01:29 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv4478/src/main/org/biomoby/shared/data Modified Files: MobyDataBytes.java Log Message: Chaged to a complex rather than string, as this is more correct moby-live/Java/src/main/org/biomoby/shared/data MobyDataBytes.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataBytes.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/shared/data/MobyDataBytes.java 2006/07/07 04:12:40 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataBytes.java 2007/03/12 17:01:29 1.5 @@ -2,6 +2,7 @@ package org.biomoby.shared.data; import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.MobyException; import java.io.*; /** @@ -9,17 +10,20 @@ * binary data that will be Base64 encoded to fit in the MOBY XML envelope. * It will also decode Base64 and UUEncoded strings. * - * Because getObject() returns a reference to the underlying byte array - * for the MOBY Object, the object content can be modified by changing - * members of this array. + * All members of the object can be accessed as they normally would be in + * a MobyDataComposite (including the Base64 representation of the bytes in the "contents" member), + * but the getBytes() and getObject() method, for + * convenience, return the bytes encoded by the "contents" member of the class. + * + * Note: changing the "contents" member's underlying StringBuffer changes the byte output! * * This class could be used to handle a JPEG's raw data for example. */ -public class MobyDataBytes extends MobyDataObject{ +public class MobyDataBytes extends MobyDataComposite{ - private byte[] bytes; - public static String BASE64_DATATYPE = "text-base64"; + public static final String BASE64_DATATYPE = "text-base64"; + public static final String ENCODED_MEMBER_NAME = "contents"; /** How much is read from a input stream (e.g. file) at once */ public static final int BYTE_READ_SIZE = 4096; @@ -27,21 +31,57 @@ /** * Construct the object using a DOM fragment. * - * @throws IllegalArgumentException if the element is not a text-base64 tag + * @throws IllegalArgumentException if the element is not a text-base64 tag, or doesn't inherit from it */ - public MobyDataBytes(org.w3c.dom.Element element) throws IllegalArgumentException{ - this(getName(element), getTextContents(element)); + public MobyDataBytes(org.w3c.dom.Element element) throws MobyException{ + super(MobyDataType.getDataType(BASE64_DATATYPE), getName(element)); setId(getId(element)); addNamespace(getNamespace(element)); + + MobyDataType inputDataType = MobyDataType.getDataType(element.getLocalName()); + if(!inputDataType.inheritsFrom(MobyDataType.getDataType(BASE64_DATATYPE))){ + throw new MobyException("The given tag ("+ element.getLocalName() + + ") does not inherit from " + BASE64_DATATYPE + + " in the MOBY Object Class Ontology, cannot " + + "consider its contents as binary data"); + } + setDataType(inputDataType); + + // Now, we know we have one field that represents the bytes, + // and there may be others which we will treat as regular composite members + populateMembersFromDOM(element); + + MobyDataObject contents = get(ENCODED_MEMBER_NAME); + if(!(contents instanceof MobyDataString)){ + throw new MobyException("The encoded binary member (" + ENCODED_MEMBER_NAME + + ") of the given element (" + + element.getLocalName()+ + ") was not a String primitive as expected"); + } } /** * C-tor to use when you have binary data to encode + * + * @throws MobyException if the data provided is null, or could not be encoded(?!) */ - public MobyDataBytes(String name, byte[] data){ - super(name); - setDataType(MobyDataType.getDataType(BASE64_DATATYPE)); - bytes = data; + public MobyDataBytes(String name, byte[] data) throws MobyException{ + super(MobyDataType.getDataType(BASE64_DATATYPE), name); + storeBytes(data); + } + + /** + * C-tor to use when you have binary data to encode + */ + public MobyDataBytes(String name, byte[] data, MobyDataType inputDataType) throws MobyException{ + this(name, data); + if(!inputDataType.inheritsFrom(MobyDataType.getDataType(BASE64_DATATYPE))){ + throw new MobyException("The given data type ("+ inputDataType.getName() + + ") does not inherit from " + BASE64_DATATYPE + + " in the MOBY Object Class Ontology, cannot " + + "consider the data given as binary data"); + } + setDataType(inputDataType); } /** @@ -50,11 +90,26 @@ * Currently Base64 encoding is acceptable, UU Decoding has yet to be implemented.. */ public MobyDataBytes(String name, CharSequence data){ - super(name); + super(MobyDataType.getDataType(BASE64_DATATYPE), name); setDataType(MobyDataType.getDataType(BASE64_DATATYPE)); - if(data != null){ - bytes = org.apache.axis.encoding.Base64.decode(data.toString()); + // TODO: add check that the data is valid Base64 format! + put(ENCODED_MEMBER_NAME, new MobyDataString(ENCODED_MEMBER_NAME, data)); + } + + /** + * C-tor to use when you have received text-encoded binary. + * + * Currently Base64 encoding is acceptable, UU Decoding has yet to be implemented.. + */ + public MobyDataBytes(String name, CharSequence data, MobyDataType inputDataType) throws MobyException{ + this(name, data); + if(!inputDataType.inheritsFrom(MobyDataType.getDataType(BASE64_DATATYPE))){ + throw new MobyException("The given data type ("+ inputDataType.getName() + + ") does not inherit from " + BASE64_DATATYPE + + " in the MOBY Object Class Ontology, cannot " + + "consider the data given as binary data"); } + setDataType(inputDataType); } /** @@ -62,14 +117,40 @@ * * @param resourceURL the URL of the resource to encode, such as "file:..." or "http:..." */ - public MobyDataBytes(String name, java.net.URL resourceURL) throws IOException{ - super(name); - setDataType(MobyDataType.getDataType(BASE64_DATATYPE)); + public MobyDataBytes(String name, java.net.URL resourceURL) throws MobyException, IOException{ + super(MobyDataType.getDataType(BASE64_DATATYPE), name); if(resourceURL == null){ return; } InputStream inputStream = resourceURL.openStream(); - bytes = readStream(inputStream); + storeBytes(readStream(inputStream)); + } + + protected void storeBytes(byte[] bytes) throws MobyException{ + if(bytes == null){ + throw new MobyException("The given byte data to Base64 encode was null"); + } + String contents = org.apache.axis.encoding.Base64.encode(bytes); + if(contents == null){ + throw new MobyException("The byte contents could not be encoded in Base64 format"); + } + put(ENCODED_MEMBER_NAME, new MobyDataString(ENCODED_MEMBER_NAME, contents)); + } + + /** + * C-tor to use when you want to encode a resource, such as an image file. + * + * @param resourceURL the URL of the resource to encode, such as "file:..." or "http:..." + */ + public MobyDataBytes(String name, java.net.URL resourceURL, MobyDataType inputDataType) throws IOException, MobyException{ + this(name, resourceURL); + if(!inputDataType.inheritsFrom(MobyDataType.getDataType(BASE64_DATATYPE))){ + throw new MobyException("The given data type ("+ inputDataType.getName() + + ") does not inherit from " + BASE64_DATATYPE + + " in the MOBY Object Class Ontology, cannot " + + "consider the data at the given URL as binary data"); + } + setDataType(inputDataType); } protected byte[] readStream(InputStream in) throws IOException { @@ -92,39 +173,20 @@ * file savers, etc. */ public java.io.InputStream getInputStream(){ - return new java.io.ByteArrayInputStream(bytes); + return new java.io.ByteArrayInputStream(getBytes()); } /** * @return byte[] representing the (mutable) underlying data in this object */ public Object getObject(){ - return bytes; + return getBytes(); } /** * The same as getObject, but doesn't require a cast of the result */ public byte[] getBytes(){ - return bytes; - } - - /** - * This method base64 encodes the binary data held in this MOBY Object - * if in service mode. - */ - public String toXML(){ - if(xmlMode == MobyDataInstance.SERVICE_XML_MODE){ - StringBuffer out = new StringBuffer(); - out.append(""); - if(bytes != null){ - out.append(org.apache.axis.encoding.Base64.encode(bytes)); - } - out.append(""); - return out.toString(); - } - else{ - return super.toXML(); - } - } + return org.apache.axis.encoding.Base64.decode(((MobyDataString) get(ENCODED_MEMBER_NAME)).getValue()); + } } From gordonp at dev.open-bio.org Mon Mar 12 13:02:30 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 13:02:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121702.l2CH2Uf1004577@dev.open-bio.org> gordonp Mon Mar 12 13:02:30 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv4542/src/main/org/biomoby/shared/data Modified Files: MobyDataComposite.java Log Message: Slightly refactoring of DOM parsing so child classes can use it too (e.g. MobyDataBytes) moby-live/Java/src/main/org/biomoby/shared/data MobyDataComposite.java,1.11,1.12 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.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/shared/data/MobyDataComposite.java 2007/01/23 19:36:25 1.11 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java 2007/03/12 17:02:30 1.12 @@ -34,6 +34,10 @@ public MobyDataComposite(org.w3c.dom.Element element) throws MobyException{ this(MobyDataType.getDataType(element.getLocalName()), getName(element), getNamespace(element), getId(element)); + populateMembersFromDOM(element); + } + + protected void populateMembersFromDOM(org.w3c.dom.Element element) throws MobyException{ // Decompose the children org.w3c.dom.NodeList substructures = MobyPrefixResolver.getChildElements(element, "*"); //wildcard int numSubstructures = substructures.getLength(); From gordonp at dev.open-bio.org Mon Mar 12 13:03:24 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 13:03:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121703.l2CH3ObW004662@dev.open-bio.org> gordonp Mon Mar 12 13:03:24 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv4627/src/main/org/biomoby/shared/data Modified Files: MobyDataObject.java Log Message: Added special case for Base64 encoded data to create MobyDataBytes objects moby-live/Java/src/main/org/biomoby/shared/data MobyDataObject.java,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java 2006/12/13 23:15:58 1.13 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java 2007/03/12 17:03:24 1.14 @@ -113,10 +113,11 @@ else if(MobyTags.MOBYDATETIME.equals(typeName)){ return new MobyDataDateTime("", value); } - else if("text-base64".equals(typeName)){ - return new MobyDataBytes("", value); - } else{ + MobyDataType type = MobyDataType.getDataType(typeName); + if(type != null && type.inheritsFrom(MobyDataBytes.BASE64_DATATYPE)){ + return new MobyDataBytes("", value, type); + } throw new MobyException("Attempted to construct a data instance from a string " + "value for a non-primitive data type (" + typeName + ")"); } @@ -172,9 +173,6 @@ else if(MobyTags.MOBYDATETIME.equals(objectClass)){ return new MobyDataDateTime(objectTag); } - else if("text-base64".equals(objectClass)){ - return new MobyDataBytes(objectTag); - } else if(MobyTags.COLLECTION.equals(objectClass)){ return new MobyDataObjectSet(objectTag); } @@ -182,8 +180,15 @@ return new MobyDataSecondaryInstance(objectTag); } // Must otherwise be a composite - else{ - return new MobyDataComposite(objectTag); + else{ + MobyDataType type = MobyDataType.getDataType(objectClass); + // Treat base64-encoded binary data as a special case, as we have a convenience class for it + if(type != null && type.inheritsFrom(MobyDataType.getDataType(MobyDataBytes.BASE64_DATATYPE))){ + return new MobyDataBytes(objectTag); + } + else{ + return new MobyDataComposite(objectTag); + } } } From gordonp at dev.open-bio.org Mon Mar 12 13:05:15 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 13:05:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121705.l2CH5FpJ004767@dev.open-bio.org> gordonp Mon Mar 12 13:05:14 EDT 2007 Update of /home/repository/moby/moby-live/Java/xmls/servlet In directory dev.open-bio.org:/tmp/cvs-serv4732/xmls/servlet Modified Files: build.xml Log Message: Added trailing slash to servlet URL, also fixed doc typo moby-live/Java/xmls/servlet build.xml,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/servlet/build.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/xmls/servlet/build.xml 2006/12/11 18:36:07 1.3 +++ /home/repository/moby/moby-live/Java/xmls/servlet/build.xml 2007/03/12 17:05:14 1.4 @@ -13,7 +13,7 @@ 3. ant test 4. ant war 5. Deploy the WAR file to your servlet container - 6. ant register + 6. ant registerService __________________________________________________________ @@ -223,7 +223,7 @@ - + @@ -234,7 +234,7 @@ - + @@ -245,7 +245,7 @@ - + From gordonp at dev.open-bio.org Mon Mar 12 13:57:51 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 13:57:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121757.l2CHvpVQ005028@dev.open-bio.org> gordonp Mon Mar 12 13:57:51 EDT 2007 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv4993/docs Modified Files: deployingServicesBasic.html Log Message: Added trailing slash to servlet URL moby-live/Java/docs deployingServicesBasic.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/deployingServicesBasic.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/deployingServicesBasic.html 2006/12/11 19:02:01 1.1 +++ /home/repository/moby/moby-live/Java/docs/deployingServicesBasic.html 2007/03/12 17:57:51 1.2 @@ -213,7 +213,7 @@ A testing client program is automagically included in your WAR, so type (with the fully qualified host name, and change 8080 appropriately if you had follow Step 0): -
java -jar ConvertAAtoFASTA_AA.war http://your.servlet.host:8080/ConvertAAtoFASTA_AA mobyAASeq.xml
+
java -jar ConvertAAtoFASTA_AA.war http://your.servlet.host:8080/ConvertAAtoFASTA_AA/ mobyAASeq.xml
If the service fails, a useful error message should be printed to help you diagnose the problem. This would usually be an incorrect web.xml, or the data type you return isn't what you declared (this is the first occasion your output is thoroughly checked). @@ -227,7 +227,7 @@ (no errors or faults, a real object is returned), you're ready to register your service with MobyCentral so anyone can use it. To do this, simply do the previous command, with an extra argument: -
java -jar ConvertAAtoFASTA_AA.war http://your.servlet.host:8080/ConvertAAtoFASTA_AA mobyAASeq.xml register
+
java -jar ConvertAAtoFASTA_AA.war http://your.servlet.host:8080/ConvertAAtoFASTA_AA/ mobyAASeq.xml register

This will run the service to make sure it works, then register it with MOBY Central. You'll see @@ -243,7 +243,7 @@

Since it isn't useful for everyone who uses this tutorial to host this service, please unregister it now with the following command: -

java -jar ConvertAAtoFASTA_AA.war http://your.servlet.host:8080/ConvertAAtoFASTA_AA unregister
+
java -jar ConvertAAtoFASTA_AA.war http://your.servlet.host:8080/ConvertAAtoFASTA_AA/ unregister

You should get "Service Successfully Unregistered!" if it worked.

@@ -320,7 +320,7 @@
Paul Gordon
-Last modified: Wed Dec 6 08:36:43 MST 2006 +Last modified: Thu Feb 22 09:20:25 MST 2007 From gordonp at dev.open-bio.org Mon Mar 12 14:51:35 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 14:51:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121851.l2CIpZL0005196@dev.open-bio.org> gordonp Mon Mar 12 14:51:35 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util In directory dev.open-bio.org:/tmp/cvs-serv5161/src/main/ca/ucalgary/services/util Modified Files: ACDFile.java Log Message: Added fix to parse variable blocks in ACD files (e.g. emma) moby-live/Java/src/main/ca/ucalgary/services/util ACDFile.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/10 00:33:16 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/12 18:51:35 1.4 @@ -206,7 +206,7 @@ for(line = reader.readLine(); line != null; line = reader.readLine()){ if(line.matches("^\\s*]")){ if(subsection){ - System.err.println("Ignoring subsection:\n" + blockText.toString()); + //System.err.println("Ignoring subsection:\n" + blockText.toString()); break; // ignore subsection specifications (MOBY 2ndary params don't hav'em) } Map block = acdBlockToTagValuePairs(blockText.toString()); @@ -218,6 +218,11 @@ blockText.append(line+"\n"); } } + else if(line.matches("^\\s*variable:\\s*\\S+\\s+\".*\"\\s*$")){ + // Ignore variable declarations (for the moment) + // since EMBOSS will figure out their values for itself, + // they are not passed in + } else if(line.matches("^\\s*endsection:\\s*\\S+")){ // ignore subsection info } From gordonp at dev.open-bio.org Mon Mar 12 14:51:35 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 14:51:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121851.l2CIpZrR005216@dev.open-bio.org> gordonp Mon Mar 12 14:51:35 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test In directory dev.open-bio.org:/tmp/cvs-serv5161/src/main/ca/ucalgary/services/util/test Modified Files: ACDFileTestCase.java Added Files: emma.acd Log Message: Added fix to parse variable blocks in ACD files (e.g. emma) moby-live/Java/src/main/ca/ucalgary/services/util/test emma.acd,NONE,1.1 ACDFileTestCase.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/ACDFileTestCase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/ACDFileTestCase.java 2007/03/10 00:33:16 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/ACDFileTestCase.java 2007/03/12 18:51:35 1.3 @@ -9,6 +9,7 @@ public class ACDFileTestCase extends TestCase{ private final static String ACDFILE_RESOURCE = "ca/ucalgary/services/util/test/transeq.acd"; private final static String ACDFILE_SUBSECTION_RESOURCE = "ca/ucalgary/services/util/test/dan.acd"; + private final static String ACDFILE_VARIABLE_RESOURCE = "ca/ucalgary/services/util/test/emma.acd"; public ACDFileTestCase(String name){ super(name); @@ -82,12 +83,12 @@ section = file.getRequiredParamsSection(); assertNotNull("The required parameters section for the test data file was unexpectedly null", section); assertTrue("The number of blocks (" + section.size() +") in the required parameter section of " + - u + " was not as expected (expected 0)", section.size() == 4); + u + " was not as expected (expected 4)", section.size() == 4); section = file.getAdditionalParamsSection(); assertNotNull("The additional parameters section for the test data file was unexpectedly null", section); assertTrue("The number of blocks (" + section.size() +") in the additional parameter section of " + - u + " was not as expected (expected 5)", section.size() == 6); + u + " was not as expected (expected 6)", section.size() == 6); section = file.getAdvancedParamsSection(); assertNotNull("The advanced parameters section for the test data file was unexpectedly null", section); @@ -97,7 +98,50 @@ section = file.getOutputSection(); assertNotNull("The output section for the test data file was unexpectedly null", section); assertTrue("The number of blocks (" + section.size() +") in the output section of " + - u + " was not as expected (expected 1)", section.size() == 4); + u + " was not as expected (expected 4)", section.size() == 4); + } + + public void testParsingVariable(){ + URL u = getClass().getClassLoader().getResource(ACDFILE_VARIABLE_RESOURCE); + assertNotNull("Could not find the test ACD file resource ("+ACDFILE_VARIABLE_RESOURCE+")", u); + + ACDFile file = null; + try{ + file = new ACDFile(u); + } catch(Exception e){ + e.printStackTrace(); + fail("Could not load and parse the test input resource ("+u+"): " + e); + } + + List> section = file.getApplicationSection(); + assertNotNull("The application section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the application section of " + + u + " was not as expected (expected 1)", section.size() == 1); + + section = file.getInputSection(); + assertNotNull("The input section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the input section of " + + u + " was not as expected (expected 10)", section.size() == 10); + + section = file.getRequiredParamsSection(); + assertNotNull("The required parameters section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the required parameter section of " + + u + " was not as expected (expected 0)", section.size() == 0); + + section = file.getAdditionalParamsSection(); + assertNotNull("The additional parameters section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the additional parameter section of " + + u + " was not as expected (expected 16)", section.size() == 16); + + section = file.getAdvancedParamsSection(); + assertNotNull("The advanced parameters section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the advanced parameter section of " + + u + " was not as expected (expected 0)", section.size() == 0); + + section = file.getOutputSection(); + assertNotNull("The output section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the output section of " + + u + " was not as expected (expected 2)", section.size() == 2); } /** @@ -108,6 +152,7 @@ TestSuite suite = new TestSuite(); suite.addTest(new ACDFileTestCase("testParsingBasic")); suite.addTest(new ACDFileTestCase("testParsingSubsections")); + suite.addTest(new ACDFileTestCase("testParsingVariable")); return suite; } From deandres at dev.open-bio.org Tue Mar 13 11:50:58 2007 From: deandres at dev.open-bio.org (Enrique de Andres Saiz) Date: Tue, 13 Mar 2007 11:50:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703131550.l2DFowxD007152@dev.open-bio.org> deandres Tue Mar 13 11:50:58 EDT 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Async In directory dev.open-bio.org:/tmp/cvs-serv7113 Modified Files: Service.pm SimpleServer.pm Log Message: Replaced calls to the deprecated getInputs and getInputID functions moby-live/Perl/MOBY/Async Service.pm,1.2,1.3 SimpleServer.pm,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Async/Service.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/MOBY/Async/Service.pm 2007/02/08 14:19:37 1.2 +++ /home/repository/moby/moby-live/Perl/MOBY/Async/Service.pm 2007/03/13 15:50:58 1.3 @@ -445,9 +445,9 @@ } # Get queries - my @query = getInputs($data); - foreach my $query (@query) { - push(@queries, $query->toString()); + my @mobyData = ($moby->getElementsByTagName('mobyData'), $moby->getElementsByTagName('moby:mobyData')); + foreach my $mobyData (@mobyData) { + push(@queries, $mobyData->toString()); } } =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Async/SimpleServer.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/Async/SimpleServer.pm 2006/12/04 08:27:52 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/Async/SimpleServer.pm 2007/03/13 15:50:58 1.2 @@ -92,28 +92,6 @@ @ISA = qw(WSRF::FileBasedMobyResourceLifetimes); #=============================================================================== -# authority -# -# This variable is a subroutine which gets the authority of a MOBY message -# and returns it. -# -my $authority = sub { - my ($data) = @_; - - # Get moby document - my $parser = XML::LibXML->new(); - my $doc = $parser->parse_string($data); - my $moby = $doc->getDocumentElement(); - - # Get authority - my @mobyContents = ($moby->getChildrenByTagName('mobyContent'), $moby->getChildrenByTagName('moby:mobyContent')); - my $mobyContent = shift(@mobyContents); - my $authority = $mobyContent->getAttribute('authority') || $mobyContent->getAttribute('moby:authority'); - - return $authority; -}; - -#=============================================================================== # async_create # # This variable is a subroutine which creates a WS-Resource and returns @@ -153,19 +131,25 @@ # Get input queryIDs and store them my $lock = WSRF::MobyFile->new($envelope); - my @queries = getInputs($data); - my @queryIDs; - foreach my $query (@queries) { - my $queryID = getInputID($query); - push(@queryIDs, $queryID); - } + my $inputs = serviceInputParser($data); + my @queryIDs = keys %$inputs; $WSRF::WSRP::Private{queryIDs} = \@queryIDs; $lock->toFile(); - # Iterate in order to run the service for each mobyData - my $auth = $authority->($data); - foreach my $query (@queries) { - my $queryID = getInputID($query); + # Get moby document + my $parser = XML::LibXML->new(); + my $doc = $parser->parse_string($data); + my $moby = $doc->getDocumentElement(); + + # Get authority + my @mobyContents = ($moby->getChildrenByTagName('mobyContent'), $moby->getChildrenByTagName('moby:mobyContent')); + my $mobyContent = shift(@mobyContents); + my $auth = $mobyContent->getAttribute('authority') || $mobyContent->getAttribute('moby:authority'); + + # Get mobyData and iterate over them in order to run the service for each one + my @mobyData = ($moby->getElementsByTagName('mobyData'), $moby->getElementsByTagName('moby:mobyData')); + foreach my $mobyData (@mobyData) { + my $queryID = $mobyData->getAttribute('queryID') || $mobyData->getAttribute('moby:queryID'); my $property_pid = "pid_$queryID"; my $property_input = "input_$queryID"; my $property_status = "status_$queryID"; @@ -179,7 +163,7 @@ # Input my $parser = XML::LibXML->new(); - my $doc = $parser->parse_string(responseHeader($auth).$query->toString.responseFooter()); + my $doc = $parser->parse_string(responseHeader($auth).$mobyData->toString().responseFooter()); my $input = $doc->getDocumentElement->toString; # Fork @@ -335,8 +319,7 @@ # Compose response using the status properties my $lock = WSRF::MobyFile->new($envelope); my $ans = ''; - foreach my $query (@queries) { - my $queryID = getInputID($query); + foreach my $queryID (@queryIDs) { my $property_status = "status_$queryID"; $ans .= "<".$WSRF::WSRP::PropertyNamespaceMap->{$property_status}{prefix}.":$property_status"; my $ns = defined($WSRF::WSRP::PropertyNamespaceMap->{$property_status}{namespace}) ? @@ -377,13 +360,12 @@ my $exception = ''; my $response = ''; - my @queries = getInputs($data); - foreach my $query (@queries) { - my $queryID = getInputID($query); + my $inputs = serviceInputParser($data); + foreach my $queryID (keys %$inputs) { $exception .= ""; $exception .= "701"; - $exception .= "Timeout exceeded. Try to invoke the service asynch-ronously."; + $exception .= "Timeout exceeded. Try to invoke the service asynchronously."; $exception .= ""; $response .= simpleResponse('', '', $queryID); @@ -412,9 +394,8 @@ my $exception = ''; my $response = ''; - my @queries = getInputs($data); - foreach my $query (@queries) { - my $queryID = getInputID($query); + my $inputs = serviceInputParser($data); + foreach my $queryID (keys %$inputs) { $exception .= ""; $exception .= "701"; From deandres at dev.open-bio.org Thu Mar 15 05:50:50 2007 From: deandres at dev.open-bio.org (Enrique de Andres Saiz) Date: Thu, 15 Mar 2007 05:50:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703150950.l2F9ooeH024953@dev.open-bio.org> deandres Thu Mar 15 05:50:50 EDT 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Async In directory dev.open-bio.org:/tmp/cvs-serv24918 Modified Files: Service.pm Log Message: Added enumerated_execute and enumerated_submit methods moby-live/Perl/MOBY/Async Service.pm,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Async/Service.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/MOBY/Async/Service.pm 2007/03/13 15:50:58 1.3 +++ /home/repository/moby/moby-live/Perl/MOBY/Async/Service.pm 2007/03/15 09:50:50 1.4 @@ -53,6 +53,23 @@ Comment : for more information about arguments look up execute method at MOBY::Client::Service. +=head2 enumerated_execute + + Name : enumerated_execute + Function : execute the asynchronous MOBY service using self-enumerated + inputs; this method invoke internally to the enumerated_submit, + poll and result methods. It calculates polling time according + to the status messages received from the provider. If from + that messages is not possible to infer the polling time, it + calculates a pseudo-random polling time, whoose value increases + until is up to around 1 hour. + Usage : $result = $Service->execute(%args) + Args : Input => \%data + Returns : a MOBY message containing whatever the service provides + as output. + Comment : for more information about arguments look up enumerated_execute + method at MOBY::Client::Service. + =head2 submit Name : submit @@ -63,6 +80,17 @@ Comment : for more information about arguments look up execute method at MOBY::Client::Service. +=head2 enumerated_submit + + Name : enumerated_submit + Function : submit the asynchronous MOBY service using self-enumerated + inputs. + Usage : ($EPR, @queryIDs) = $Service->submit(%args) + Args : XMLinputlist => \%data + Returns : WSRF::WS_Address object with an EPR and the input queryIDs. + Comment : for more information about arguments look up enumerated_execute + method at MOBY::Client::Service. + =head2 poll Name : poll @@ -245,6 +273,130 @@ return ($EPR, @queryIDs); } +sub enumerated_execute { + my ($self, %args) = @_; + + print "Creating WS-Resource...\n\n" unless ($self->{silent}); + + my $start = time; + my ($EPR, @queryIDs) = $self->enumerated_submit(%args); + + print XML::LibXML->new->parse_string($EPR->XML)->getDocumentElement()->toString."\n\n" unless ($self->{silent}); + + my $pollingTime; + my ($i, $j) = (0, 1); + my @status; + while ( $pollingTime = &_getPollingTime($i, $j, $start, @status) ) { + ($i, $j) = ($j, $i+$j); + + print "Next polling in $pollingTime seconds...\n\n" unless ($self->{silent}); + + sleep $pollingTime; + @status = $self->poll($EPR, @queryIDs); + + unless ($self->{silent}) { + foreach my $st (@status) { + print $st->XML."\n"; + } + print "\n"; + } + } + + print "Retrieving results and destroying WS-Resource...\n\n" unless ($self->{silent}); + + my @responses = $self->result($EPR, @queryIDs); + $self->destroy($EPR); + my $response = &_composeResponse(@responses); + + print "Finished.\n" unless ($self->{silent}); + + return $response; +} + +sub enumerated_submit { + my ($self, %args) = @_; + + # Compose the moby message (part of this block is copied from MOBY::Client::Service) + die "ERROR: expected Input to be a HASH ref" unless ( ref( $args{Input} ) eq 'HASH' ); + my %inputs = %{$args{Input}}; + my @queryIDs = keys %inputs; + my $data; + foreach my $qID ( @queryIDs ) { + + die "ERROR: expected hashref {articleName => XML} for each queryID" unless ( ref($inputs{$qID}) eq 'HASH' ); + my %articles = %{$inputs{$qID}}; + $data .= ""; + + foreach my $articleName(keys %articles){ + + my $XML = $articles{$articleName}; + if ( ref( $XML ) ne 'ARRAY' ) { + + $XML ||= ""; + if ( $XML =~ /\<(moby\:|)Value\>/ ){ + $data .= "$XML"; + } else { + $data .= "\n$XML\n\n"; + } + + } elsif ( ref( $XML ) eq 'ARRAY' ) { + + my @objs = @{$XML}; + $data .= "\n"; + foreach ( @objs ) { + $data .= "$_\n"; + } + $data .= "\n"; + } + } + $data .= "\n"; + } + my $version = $self->{smessageVersion}; + $data = " + + + $data + + "; + + # Create the resource and submit the batch-call + my $func = $self->{serviceName}.'_submit'; + my $ans = WSRF::Lite + -> proxy(&_getServiceEndpoint($self->{service})) + -> uri($WSRF::Constants::MOBY) + -> $func(SOAP::Data->value($data)->type('string')); + die "ERROR: ".$ans->faultstring if ($ans->fault); + + # Get address from the returned Endpoint Reference + my $address = $ans->match("//Body//{$WSRF::Constants::WSA}Address") ? + $ans->valueof("//Body//{$WSRF::Constants::WSA}Address") : + die "ERROR: no EndpointReference returned"; + die "ERROR: no address into returned EndpointReference" unless ($address); + + # Get resource identifier from the returned Endpoint Reference + my $identifier; + if ($ans->dataof('//Body//ReferenceParameters/*')) { + foreach my $a ($ans->dataof('//Body//ReferenceParameters/*')) { + my $name = $a->name(); + my $uri = $a->uri(); + my $value = $a->value(); + if ($name eq "ServiceInvocationId") { + $identifier = $value; + last; + } + } + } + die "ERROR: no identifier into returned EndpointReference" unless ($identifier); + + # Compose the Endpoint Reference + my $EPR = WSRF::WS_Address->new(); + $EPR->Address($address); + $EPR->ReferenceParameters(''.$identifier.''); + + # Return Endpoint Reference and the queryIDs + return ($EPR, @queryIDs); +} + sub poll { my ($self, $EPR, @queryIDs) = @_; From gordonp at dev.open-bio.org Thu Mar 15 13:55:59 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 15 Mar 2007 13:55:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703151755.l2FHtx6B025837@dev.open-bio.org> gordonp Thu Mar 15 13:55:59 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util In directory dev.open-bio.org:/tmp/cvs-serv25802/src/main/ca/ucalgary/services/util Modified Files: ACDFile.java Log Message: Fixed javadoc typo moby-live/Java/src/main/ca/ucalgary/services/util ACDFile.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/12 18:51:35 1.4 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/15 17:55:59 1.5 @@ -25,7 +25,7 @@ * Reads an EMBOSS ACD file and populates data structures representing the sections of the file * (see the getXXXSection() methods). * - * @throw Exception if the file cannot be read or parsed + * @throws Exception if the file cannot be read or parsed */ public ACDFile(File acdFile) throws Exception{ if(!acdFile.exists()){ From gordonp at dev.open-bio.org Wed Mar 21 12:22:56 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 21 Mar 2007 12:22:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703211622.l2LGMuFd015731@dev.open-bio.org> gordonp Wed Mar 21 12:22:56 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util In directory dev.open-bio.org:/tmp/cvs-serv15695/src/main/ca/ucalgary/seahawk/util Modified Files: Sequence.java Log Message: Made sequence finding more lenient w.r.t. whitespace moby-live/Java/src/main/ca/ucalgary/seahawk/util Sequence.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/Sequence.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/Sequence.java 2007/02/08 16:59:58 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/Sequence.java 2007/03/21 16:22:56 1.3 @@ -12,6 +12,7 @@ * @return true if ACGTUX comprise > 2/3 of the sequence, and all non-IUPAC letters comprise less than 5% */ public static boolean isNucleicAcid(String sequence){ + sequence = sequence.replaceAll("\\s", ""); String naChars = sequence.replaceAll("[^acgtunxACGTUNX]", ""); String nonNAChars = sequence.replaceAll("[acgtumrwsykvhdbnxACGTUMRWSYKVHDBNX \\-\t\r\n]", ""); double seqLen = (double) sequence.length(); // not int, because we don't want integer division @@ -20,6 +21,7 @@ } public static boolean isDNA(String sequence){ + sequence = sequence.replaceAll("\\s", ""); String dnaChars = sequence.replaceAll("[^acgtnxACGTNX]", ""); String nonDNAChars = sequence.replaceAll("[acgtmrwsykvhdbnxACGTMRWSYKVHDBNX \\-\t\r\n]", ""); double seqLen = (double) sequence.length(); // not int, because we don't want integer division @@ -27,6 +29,7 @@ } public static boolean isRNA(String sequence){ + sequence = sequence.replaceAll("\\s", ""); String rnaChars = sequence.replaceAll("[^acgunxACGUNX]", ""); String nonRNAChars = sequence.replaceAll("[acgumrwsykvhdbnxACGUMRWSYKVHDBNX \\-\t\r\n]", ""); double seqLen = (double) sequence.length(); // not int, because we don't want integer division @@ -34,6 +37,7 @@ } public static boolean isProtein(String sequence){ + sequence = sequence.replaceAll("\\s", ""); String protChars = sequence.replaceAll("[^ARNDCQEGHILKMFPSTWYVBZXarndcqeghilkmfpstwyvbz*]", ""); String nonProtChars = sequence.replaceAll("[ARNDCQEGHILKMFPSTWYVBZXarndcqeghilkmfpstwyvbz \\-\t\r\n]", ""); double seqLen = (double) sequence.length(); // not int, because we don't want integer division From gordonp at dev.open-bio.org Wed Mar 21 12:23:43 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 21 Mar 2007 12:23:43 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703211623.l2LGNhEB015775@dev.open-bio.org> gordonp Wed Mar 21 12:23:43 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv15739/src/main/ca/ucalgary/seahawk/services Modified Files: MobyClient.java Log Message: Fixed logic for loading rule file moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyClient.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2007/03/12 14:37:24 1.6 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2007/03/21 16:23:43 1.7 @@ -95,14 +95,15 @@ if(rulesResource == null){ dataMappingXMLURL = cl.getResource(DATA_MAPPING_XML_RESOURCE); } - - // See if it's a URL - try{ - dataMappingXMLURL = new URL(rulesResource); + else{ + // See if it's a URL + try{ + dataMappingXMLURL = new URL(rulesResource); + } + catch(Exception e){ + dataMappingXMLURL = cl.getResource(rulesResource); + } } - catch(Exception e){ - dataMappingXMLURL = cl.getResource(rulesResource); - } if(dataMappingXMLURL == null){ System.err.println("Could not find MOBY data mapping resource '"+ rulesResource+"'"); From gordonp at dev.open-bio.org Wed Mar 21 12:24:42 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 21 Mar 2007 12:24:42 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703211624.l2LGOgfa015819@dev.open-bio.org> gordonp Wed Mar 21 12:24:42 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv15783/src/main/ca/ucalgary/seahawk/gui Modified Files: MobyContentGUI.java Log Message: Changed default startup page to 3 simple instructions for beginners moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyContentGUI.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2007/02/08 16:59:57 1.4 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2007/03/21 16:24:42 1.5 @@ -47,6 +47,7 @@ public final static String DEFAULT_STATUS_MSG = "Click hyperlink to explore MOBY Web services"; public final static String RESOURCE_SYSTEM_PROPERTY = "seahawk.stylesheet"; + public final static String DEFAULT_STARTUP_PAGE_RESOURCE = "ca/ucalgary/seahawk/resources/startup.html"; public final static String DEFAULT_XSLT_CONVERTER_URL = "ca/ucalgary/seahawk/resources/moby2HTML.xsl"; public final static int MAX_TAB_NAME_LENGTH = 25; public final static String CLOSE_TAB_OPTION = "Close This Tab"; @@ -880,12 +881,19 @@ } } else{ - gui.showHelpTab(); + URL startURL = gui.getClass().getClassLoader().getResource(DEFAULT_STARTUP_PAGE_RESOURCE); + if(startURL == null){ + logger.error("Could not load "+DEFAULT_STARTUP_PAGE_RESOURCE+" - loading help file instead"); + gui.showHelpTab(); + } + else{ + gui.loadPaneFromURL(startURL, true); + } } } /** - * Method to be called when an applet is decommissioning. + * Method to be called when an applet is being decommissioned. */ public static void destroy(){ ca.ucalgary.seahawk.util.MobyUtils.destroyMobyGUI(); From gordonp at dev.open-bio.org Wed Mar 21 12:25:36 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 21 Mar 2007 12:25:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703211625.l2LGPalK015859@dev.open-bio.org> gordonp Wed Mar 21 12:25:36 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources In directory dev.open-bio.org:/tmp/cvs-serv15827/src/main/ca/ucalgary/seahawk/resources Added Files: startup.html Log Message: Changed default startup page to 3 simple instructions for beginners moby-live/Java/src/main/ca/ucalgary/seahawk/resources startup.html,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 23 16:22:53 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 23 Mar 2007 16:22:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703232022.l2NKMrfT020358@dev.open-bio.org> gordonp Fri Mar 23 16:22:53 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv20323/src/main/ca/ucalgary/seahawk/gui Modified Files: MobyContentPane.java Log Message: Added ability to paste data into Seahawk (as opposed to existing drag 'n' drop functionality), using ctrl-v, paste keyboard button and middle mouse button moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyContentPane.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java 2007/02/08 16:59:57 1.4 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java 2007/03/23 20:22:52 1.5 @@ -24,38 +24,24 @@ import ca.ucalgary.seahawk.util.MobyUtils; import javax.swing.*; -import javax.swing.event.CaretEvent; -import javax.swing.event.CaretListener; -import javax.swing.event.HyperlinkEvent; -import javax.swing.event.HyperlinkListener; +import javax.swing.event.*; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Point; -import java.awt.print.Printable; -import java.awt.print.PageFormat; -import java.awt.print.PrinterException; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.io.File; -import java.io.FileWriter; -import java.io.InputStream; -import java.io.IOException; -import java.io.StringWriter; +import java.awt.print.*; +import java.awt.event.*; +import java.io.*; import java.net.URL; import java.net.URLConnection; -import java.util.AbstractMap; -import java.util.HashMap; -import java.util.Iterator; -import java.util.StringTokenizer; -import java.util.Vector; +import java.util.*; /** * Text area contained in a Seahawk GUI tab. Displays HTML, RTF, text etc. using a JEditorPane. * Also provides link handling (including service options popup) and drag 'n' drop capabilities. */ -public class MobyContentPane extends JPanel implements Printable, CaretListener, HyperlinkListener, MouseListener, MobyRequestEventHandler{ +public class MobyContentPane extends JPanel implements Printable, CaretListener, HyperlinkListener, MouseListener, MobyRequestEventHandler, KeyListener{ public static final String MOBY_SERVICE_POPUP_NAME = "seahawkServicePopup"; public static final String WAITING_TAB_ICON_RESOURCE = "ca/ucalgary/seahawk/resources/images/hourglass.gif"; public static final String FAILED_TAB_ICON_RESOURCE = "ca/ucalgary/seahawk/resources/images/failed.gif"; @@ -93,10 +79,13 @@ contentGUI = cGUI; servicesGUI = sGUI; + // The next line is what provides the drag 'n' drop capability + addKeyListener(this); setTransferHandler(new FileAndTextTransferHandler(cGUI)); // The following is a non-user editable pane for showing HTML editorPane = new PrintableJEditorPane(); + editorPane.addKeyListener(this); editorPane.setTransferHandler(getTransferHandler()); //editorPane.setPreferredSize(parentComponent.getPreferredSize()); editorPane.setEditable(false); @@ -883,9 +872,23 @@ // MouseListener interface implementation public void mouseClicked(MouseEvent e){ + // Allow middle button paste + if(e.getButton() == MouseEvent.BUTTON3 || + e.getButton() == MouseEvent.BUTTON2 && e.isAltDown()){ + paste(); + } } - public void mouseEntered(MouseEvent e){} + /** + * Grabs the keyboard focus for the component if the mouse is over it, + * which eliminates the need for clicking before using keyboard shortcuts + * like Control-v to paste. + */ + public void mouseEntered(MouseEvent e){ + if(!requestFocusInWindow()){ + requestFocus(); + } + } public void mouseExited(MouseEvent e){} @@ -1067,4 +1070,25 @@ return scufl.toString(); } + + /** + * Implemented to provide paste functonality (control-v or the paste button on a Sun keyboard), + * since the editor panes are not editable and therefore by default do not respond to + * paste events. + */ + public void keyPressed(KeyEvent e){ + System.err.println("Key pressed " + e.getKeyChar()); + if(e.getKeyCode() == KeyEvent.VK_PASTE || + e.getKeyCode() == KeyEvent.VK_V && e.isControlDown()){ + System.err.println("Paste (pressed)!"); + paste(); + } + } + + public void keyReleased(KeyEvent e){} + public void keyTyped(KeyEvent e){} + + public void paste(){ + getTransferHandler().importData(editorPane, java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().getContents(this)); + } } From gordonp at dev.open-bio.org Fri Mar 23 16:23:52 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 23 Mar 2007 16:23:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703232023.l2NKNqMn020401@dev.open-bio.org> gordonp Fri Mar 23 16:23:52 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv20366/src/main/ca/ucalgary/seahawk/gui Modified Files: FileAndTextTransferHandler.java Log Message: Improved pasted data handling: RTF now interpreted as such, HTML somewhat cleaned up moby-live/Java/src/main/ca/ucalgary/seahawk/gui FileAndTextTransferHandler.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java 2007/02/08 16:59:57 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java 2007/03/23 20:23:52 1.4 @@ -174,17 +174,29 @@ } // Otherwise save the data to a temp file and load it as a URL - File savedFile = File.createTempFile("seahawkDataDrop", ""); + String suffix = ""; + if(text.indexOf("{\\rtf") == 0){ + suffix = ".rtf"; + } + else if(text.indexOf("<") != -1 && text.indexOf(">") > text.indexOf("<") && + text.indexOf("/") != -1){ + suffix = ".html"; + } + File savedFile = File.createTempFile("seahawkDataDrop", suffix); savedFile.deleteOnExit(); FileOutputStream out = new FileOutputStream(savedFile); - if(text.indexOf("") > text.indexOf("<") && - text.indexOf("/") != -1){ - // Add html tag around the contents if it's hypertext, so it's a full document and - // JEditorPane doesn't do funny stuff. - out.write("".getBytes()); - out.write(text.getBytes()); - out.write("".getBytes()); + if(suffix.equals(".html")){ + // Sometimes you get ?? at the start of pasted html, we'll clean it up + if(text.indexOf("??") == 0){ + text = text.substring(2); + } + if(text.indexOf("".getBytes()); + out.write(text.getBytes()); + out.write("".getBytes()); + } } else{ // Treat as plain text if there are no hyperlinks From mwilkinson at dev.open-bio.org Mon Mar 26 18:49:23 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Mon, 26 Mar 2007 18:49:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703262249.l2QMnNPC027500@dev.open-bio.org> mwilkinson Mon Mar 26 18:49:22 EDT 2007 Update of /home/repository/moby/moby-live/Docs In directory dev.open-bio.org:/tmp/cvs-serv27482 Added Files: BioMoby 1_0 version 6.pdf Log Message: first draft of the BioMoby manuscript moby-live/Docs BioMoby 1_0 version 6.pdf,NONE,1.1 rcsdiff: /home/repository/moby/moby-live/Docs/RCS/BioMoby,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/RCS/1_0,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/RCS/version,v: No such file or directory From gordonp at dev.open-bio.org Tue Mar 27 10:01:36 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 27 Mar 2007 10:01:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703271401.l2RE1aUM003022@dev.open-bio.org> gordonp Tue Mar 27 10:01:36 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources In directory dev.open-bio.org:/tmp/cvs-serv2986/src/main/ca/ucalgary/seahawk/resources Modified Files: startup.html Log Message: Minor doc updates moby-live/Java/src/main/ca/ucalgary/seahawk/resources startup.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/startup.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/startup.html 2007/03/21 16:25:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/startup.html 2007/03/27 14:01:36 1.2 @@ -7,12 +7,12 @@ Seahawk Quick Start:
    -
  1. Drag a desktop file (text, RTF or HTML), a Web link, a URL, or a part of an open Web page from your browser onto this window.
  2. +
  3. Drag a desktop file (text, RTF or HTML), a Web link, a URL, or a part of an open Web page from your browser onto this window. It will open in a new tab.
  4. Highlight the part of document you want to explore further (e.g. a DNA sequence or a database ID).
  5. Click the highlighted data and wait for analysis services options to pop up.
-For more help on using Seahawk to automatically discover and run Web-based analysis services, +For example data, and more help on using Seahawk to automatically discover and run Web-based analysis services, please click the help icon at the bottom of this window. From gordonp at dev.open-bio.org Tue Mar 27 10:01:36 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 27 Mar 2007 10:01:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703271401.l2RE1agE003044@dev.open-bio.org> gordonp Tue Mar 27 10:01:36 EDT 2007 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv2986/docs Modified Files: deployingServices.html Seahawk.html Log Message: Minor doc updates moby-live/Java/docs deployingServices.html,1.13,1.14 Seahawk.html,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/deployingServices.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/docs/deployingServices.html 2006/12/11 18:36:42 1.13 +++ /home/repository/moby/moby-live/Java/docs/deployingServices.html 2007/03/27 14:01:36 1.14 @@ -18,6 +18,10 @@ You do not need to checkout the jMOBY CVS, or install Apache Axis. Alternatively, you can do this tutorial without Apache Ant too.

+ +

For scientific publications using this methdology, please cite + this paper +

If, on the other hand, you are planning on directly hacking the jMOBY classes, the other approach to developing services (using a code generator and the full jMOBY CVS) @@ -316,7 +320,7 @@

Paul Gordon
-Last modified: Mon Dec 11 11:28:17 MST 2006 +Last modified: Sun Mar 25 08:19:42 MDT 2007 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/Seahawk.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/docs/Seahawk.html 2006/12/11 18:37:21 1.5 +++ /home/repository/moby/moby-live/Java/docs/Seahawk.html 2007/03/27 14:01:36 1.6 @@ -71,7 +71,7 @@ Axis, Jena, Xalan, Xerces, etc.) is available here, and is signed by the University of Calgary Bioinformatics Lab. You can also - build your own version of the jar with the jMOBY cvs Ant target "servlet-war". + build your own version of the jar with the jMOBY CVS Ant target "seahawk-jar". Either jar file can be used as an application with the command:
java -jar seahawk.jar
@@ -122,7 +122,7 @@
Paul Gordon
-Last modified: Mon Dec 11 08:49:26 MST 2006 +Last modified: Sun Mar 25 08:20:27 MDT 2007 From gordonp at dev.open-bio.org Tue Mar 27 10:02:53 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 27 Mar 2007 10:02:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703271402.l2RE2rfE003092@dev.open-bio.org> gordonp Tue Mar 27 10:02:53 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv3056/src/main/ca/ucalgary/seahawk/gui Modified Files: MobySecondaryInputGUI.java Log Message: Make sure the windows ends up on top when created, so the user sees it moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobySecondaryInputGUI.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobySecondaryInputGUI.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobySecondaryInputGUI.java 2006/12/07 16:37:36 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobySecondaryInputGUI.java 2007/03/27 14:02:53 1.3 @@ -164,6 +164,8 @@ // Make the window the preferred size of its widget contents if(showGUI){ pack(); + toFront(); + requestFocus(); confirmButton.requestFocusInWindow(); } } From mwilkinson at dev.open-bio.org Tue Mar 27 16:37:06 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Tue, 27 Mar 2007 16:37:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703272037.l2RKb6pj004121@dev.open-bio.org> mwilkinson Tue Mar 27 16:37:05 EDT 2007 Update of /home/repository/moby/moby-live/Docs In directory dev.open-bio.org:/tmp/cvs-serv4103 Added Files: BioMoby 1_0 version 7.pdf Log Message: next version of the manuscript with first set of suggested modifications from the community moby-live/Docs BioMoby 1_0 version 7.pdf,NONE,1.1 rcsdiff: /home/repository/moby/moby-live/Docs/RCS/BioMoby,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/RCS/1_0,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/RCS/version,v: No such file or directory From gordonp at dev.open-bio.org Wed Mar 28 14:53:11 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 28 Mar 2007 14:53:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703281853.l2SIrBFS008008@dev.open-bio.org> gordonp Wed Mar 28 14:53:11 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv7972/src/main/org/biomoby/shared/data Modified Files: MobyDataUtils.java Log Message: Added more methods, providing greater I/O flexibility for serialization/deserialization moby-live/Java/src/main/org/biomoby/shared/data MobyDataUtils.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataUtils.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/shared/data/MobyDataUtils.java 2006/10/26 00:32:20 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataUtils.java 2007/03/28 18:53:11 1.5 @@ -2,6 +2,7 @@ import org.biomoby.shared.parser.MobyTags; import org.biomoby.shared.*; +import org.xml.sax.InputSource; import org.w3c.dom.*; import java.io.*; @@ -10,7 +11,21 @@ * such as serialization and deserialization. */ public class MobyDataUtils{ + + /** + * Writes the XML version of the contents, with an XML declaration. + */ public static boolean toXMLDocument(OutputStream os, MobyContentInstance mci) throws Exception{ + return toXMLDocument(os, mci, true); + } + + /** + * Output the XML representation of the data to an OutputStream + * (i.e. an output that takes byte data, not character-encoded strings). + * Note that the character decoding will depend on your runtime environment. + */ + public static boolean toXMLDocument(OutputStream os, MobyContentInstance mci, boolean includeXMLDeclaration) + throws Exception{ // May want to check character encoding before doing getBytes(), implement this later os.write("\n".getBytes()); os.write(("\n").getBytes()); @@ -18,9 +33,40 @@ os.write("\n".getBytes()); return true; } - - public static MobyContentInstance fromXMLDocument(InputStream is) throws Exception{ + + /** + * Writes the XML version of the contents, with an XML declaration. + */ + public static boolean toXMLDocument(Writer writer, MobyContentInstance mci) throws Exception{ + return toXMLDocument(writer, mci, true); + } + + /** + * Output the XML representation of the data to a Writer (i.e. an output that understands + * character-encoded strings). + */ + public static boolean toXMLDocument(Writer writer, MobyContentInstance mci, boolean includeXMLDeclaration) + throws Exception{ + writer.write("\n"); + writer.write(("\n")); + writer.write(mci.toXML()); + writer.write("\n"); + return true; + } + + /** + * Create a MOBY Java object representation from a MOBY XML payload stored in a String. + */ + public static MobyContentInstance fromXMLDocument(String xmlData) throws Exception{ + return fromXMLDocument(new StringReader(xmlData)); + } + + /** + * Create a MOBY Java object representation from a MOBY XML payload coming from an InputStream + * (a byte stream that will becoverted by the parser into character data). + */ + public static MobyContentInstance fromXMLDocument(InputStream is) throws Exception{ // Load an XML document javax.xml.parsers.DocumentBuilder docBuilder = null; try{ @@ -48,6 +94,72 @@ return fromXMLDocument(doc_root); } + /** + * Create a MOBY Java object representation from a MOBY XML payload at the given URL. + */ + public static MobyContentInstance fromXMLDocument(java.net.URL url) throws Exception{ + // Load an XML document + javax.xml.parsers.DocumentBuilder docBuilder = null; + try{ + javax.xml.parsers.DocumentBuilderFactory dbf = + javax.xml.parsers.DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + docBuilder = dbf.newDocumentBuilder(); + } + catch(javax.xml.parsers.ParserConfigurationException pce){ + throw new Exception("An XML parser could not be found or configured: " + pce); + } + + Document domDoc = null; + try{ + domDoc = docBuilder.parse(url.toURI().toString()); + } catch(org.xml.sax.SAXException saxe){ + throw new Exception("The XML data could not be parsed (not well-formed): " + saxe); + } catch(java.io.IOException ioe){ + throw new Exception("The XML data could not be loaded (I/O problem): " + ioe); + } + + // Select a node from the document and see if any of the mappings + // work out, in which case we can check what services we can run + Element doc_root = domDoc.getDocumentElement(); + return fromXMLDocument(doc_root); + } + + /** + * Create a MOBY Java object representation from a MOBY XML payload coming from a Reader (character data). + */ + public static MobyContentInstance fromXMLDocument(Reader reader) throws Exception{ + // Load an XML document + javax.xml.parsers.DocumentBuilder docBuilder = null; + try{ + javax.xml.parsers.DocumentBuilderFactory dbf = + javax.xml.parsers.DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + docBuilder = dbf.newDocumentBuilder(); + } + catch(javax.xml.parsers.ParserConfigurationException pce){ + throw new Exception("An XML parser could not be found or configured: " + pce); + } + + Document domDoc = null; + try{ + domDoc = docBuilder.parse(new InputSource(reader)); + } catch(org.xml.sax.SAXException saxe){ + throw new Exception("The XML data could not be parsed (not well-formed): " + saxe); + } catch(java.io.IOException ioe){ + throw new Exception("The XML data could not be loaded (I/O problem): " + ioe); + } + + // Select a node from the document and see if any of the mappings + // work out, in which case we can check what services we can run + Element doc_root = domDoc.getDocumentElement(); + return fromXMLDocument(doc_root); + } + + + /** + * Create a MOBY Java object representation from a MOBY XML payload represented in a DOM. + */ public static MobyContentInstance fromXMLDocument(Element doc_root) throws Exception{ if(doc_root == null){ throw new MobyException("The passed in element was null"); From gordonp at dev.open-bio.org Thu Mar 29 15:40:53 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 29 Mar 2007 15:40:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703291940.l2TJerOF012866@dev.open-bio.org> gordonp Thu Mar 29 15:40:52 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv12830/src/main/org/biomoby/shared/data Modified Files: MobyDataUtils.java Log Message: Javadoc clarification moby-live/Java/src/main/org/biomoby/shared/data MobyDataUtils.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataUtils.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/shared/data/MobyDataUtils.java 2007/03/28 18:53:11 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataUtils.java 2007/03/29 19:40:52 1.6 @@ -159,6 +159,8 @@ /** * Create a MOBY Java object representation from a MOBY XML payload represented in a DOM. + * + * @param doc_root the document's base MOBY tag */ public static MobyContentInstance fromXMLDocument(Element doc_root) throws Exception{ if(doc_root == null){ From gordonp at dev.open-bio.org Thu Mar 29 15:41:37 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 29 Mar 2007 15:41:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703291941.l2TJfbe7012932@dev.open-bio.org> gordonp Thu Mar 29 15:41:37 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv12896/src/main/org/biomoby/shared Modified Files: MobyService.java Log Message: Added isAsynchronous() method moby-live/Java/src/main/org/biomoby/shared MobyService.java,1.16,1.17 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2007/03/12 17:00:33 1.16 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2007/03/29 19:41:37 1.17 @@ -527,4 +527,8 @@ // Wasn't found if we got to here return null; } + + public boolean isAsynchronous(){ + return category.equals("moby-async"); + } } From gordonp at dev.open-bio.org Fri Mar 30 14:35:15 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 14:35:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301835.l2UIZFYF016544@dev.open-bio.org> gordonp Fri Mar 30 14:35:14 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/test In directory dev.open-bio.org:/tmp/cvs-serv16509/src/main/org/biomoby/client/test Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/test added to the repository moby-live/Java/src/main/org/biomoby/client/test - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/test/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/test/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/test/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 14:35:26 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 14:35:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301835.l2UIZQM8016587@dev.open-bio.org> gordonp Fri Mar 30 14:35:26 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c In directory dev.open-bio.org:/tmp/cvs-serv16552/src/main/org/biomoby/w3c Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c added to the repository moby-live/Java/src/main/org/biomoby/w3c - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 14:35:36 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 14:35:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301835.l2UIZavx016630@dev.open-bio.org> gordonp Fri Mar 30 14:35:35 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/addressing In directory dev.open-bio.org:/tmp/cvs-serv16595/src/main/org/biomoby/w3c/addressing Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/addressing added to the repository moby-live/Java/src/main/org/biomoby/w3c/addressing - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/addressing/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/addressing/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/addressing/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 14:55:31 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 14:55:31 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301855.l2UItVOc016697@dev.open-bio.org> gordonp Fri Mar 30 14:55:31 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/w3c In directory dev.open-bio.org:/tmp/cvs-serv16662/org/w3c Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/w3c added to the repository moby-live/Java/src/main/org/w3c - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 14:55:31 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 14:55:31 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301855.l2UItVXl016716@dev.open-bio.org> gordonp Fri Mar 30 14:55:31 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing In directory dev.open-bio.org:/tmp/cvs-serv16662/org/w3c/addressing Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing added to the repository moby-live/Java/src/main/org/w3c/addressing - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 14:55:31 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 14:55:31 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301855.l2UItVSD016733@dev.open-bio.org> gordonp Fri Mar 30 14:55:31 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/sax In directory dev.open-bio.org:/tmp/cvs-serv16662/org/w3c/addressing/sax Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/sax added to the repository moby-live/Java/src/main/org/w3c/addressing/sax - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/sax/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/sax/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/sax/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 15:04:14 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:04:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301904.l2UJ4EV8016784@dev.open-bio.org> gordonp Fri Mar 30 15:04:14 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap In directory dev.open-bio.org:/tmp/cvs-serv16749/org/soap Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/soap added to the repository moby-live/Java/src/main/org/soap - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 15:04:14 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:04:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301904.l2UJ4E5s016801@dev.open-bio.org> gordonp Fri Mar 30 15:04:14 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap/sax In directory dev.open-bio.org:/tmp/cvs-serv16749/org/soap/sax Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/soap/sax added to the repository moby-live/Java/src/main/org/soap/sax - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/sax/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/sax/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/sax/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 15:04:14 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:04:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301904.l2UJ4EC4016820@dev.open-bio.org> gordonp Fri Mar 30 15:04:14 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap/sax/test In directory dev.open-bio.org:/tmp/cvs-serv16749/org/soap/sax/test Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/soap/sax/test added to the repository moby-live/Java/src/main/org/soap/sax/test - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/sax/test/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/sax/test/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/sax/test/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 15:16:49 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:16:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301916.l2UJGnYL016931@dev.open-bio.org> gordonp Fri Mar 30 15:16:49 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap In directory dev.open-bio.org:/tmp/cvs-serv16899/org/soap Added Files: SOAPFault.java WSRFFault.java Log Message: Support files written by Eddie for use in asynchronous service invocations moby-live/Java/src/main/org/soap SOAPFault.java,NONE,1.1 WSRFFault.java,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 30 15:16:49 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:16:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301916.l2UJGnEx016945@dev.open-bio.org> gordonp Fri Mar 30 15:16:49 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap/sax In directory dev.open-bio.org:/tmp/cvs-serv16899/org/soap/sax Added Files: FaultTags.java SOAPFaultParser.java Log Message: Support files written by Eddie for use in asynchronous service invocations moby-live/Java/src/main/org/soap/sax FaultTags.java,NONE,1.1 SOAPFaultParser.java,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 30 15:17:41 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:17:41 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301917.l2UJHfEh017033@dev.open-bio.org> gordonp Fri Mar 30 15:17:41 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/sax In directory dev.open-bio.org:/tmp/cvs-serv17001/org/w3c/addressing/sax Added Files: EndpointReferenceParser.java EprTags.java Log Message: Support files written by Eddie for use in asynchronous service invocations moby-live/Java/src/main/org/w3c/addressing/sax EndpointReferenceParser.java,NONE,1.1 EprTags.java,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 30 15:18:53 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:18:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301918.l2UJIr6C017120@dev.open-bio.org> gordonp Fri Mar 30 15:18:53 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg In directory dev.open-bio.org:/tmp/cvs-serv17085/org/omg Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/omg added to the repository moby-live/Java/src/main/org/omg - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 15:19:24 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:19:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301919.l2UJJOUn017163@dev.open-bio.org> gordonp Fri Mar 30 15:19:24 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg/lsae In directory dev.open-bio.org:/tmp/cvs-serv17128/org/omg/lsae Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/omg/lsae added to the repository moby-live/Java/src/main/org/omg/lsae - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 15:19:24 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:19:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301919.l2UJJOVn017199@dev.open-bio.org> gordonp Fri Mar 30 15:19:24 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax In directory dev.open-bio.org:/tmp/cvs-serv17128/org/omg/lsae/sax Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax added to the repository moby-live/Java/src/main/org/omg/lsae/sax - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 15:19:24 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:19:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301919.l2UJJOae017182@dev.open-bio.org> gordonp Fri Mar 30 15:19:24 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/notifications In directory dev.open-bio.org:/tmp/cvs-serv17128/org/omg/lsae/notifications Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/notifications added to the repository moby-live/Java/src/main/org/omg/lsae/notifications - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/notifications/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/notifications/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/notifications/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 15:19:50 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:19:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301919.l2UJJoiA017248@dev.open-bio.org> gordonp Fri Mar 30 15:19:49 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/test In directory dev.open-bio.org:/tmp/cvs-serv17213/org/omg/lsae/sax/test Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/test added to the repository moby-live/Java/src/main/org/omg/lsae/sax/test - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/test/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/test/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/test/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 15:42:56 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:42:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301942.l2UJguvp017369@dev.open-bio.org> gordonp Fri Mar 30 15:42:56 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax In directory dev.open-bio.org:/tmp/cvs-serv17323/src/main/org/omg/lsae/sax Added Files: EventParser.java LsaeTags.java Log Message: Support code from Eddie for use in asynchronous service invocation moby-live/Java/src/main/org/omg/lsae/sax EventParser.java,NONE,1.1 LsaeTags.java,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 30 15:42:56 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:42:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301942.l2UJguKL017355@dev.open-bio.org> gordonp Fri Mar 30 15:42:56 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/notifications In directory dev.open-bio.org:/tmp/cvs-serv17323/src/main/org/omg/lsae/notifications Added Files: AnalysisEvent.java HeartBeatEvent.java PercentEvent.java StateEvent.java StepEvent.java TimeProgressEvent.java Log Message: Support code from Eddie for use in asynchronous service invocation moby-live/Java/src/main/org/omg/lsae/notifications AnalysisEvent.java,NONE,1.1 HeartBeatEvent.java,NONE,1.1 PercentEvent.java,NONE,1.1 StateEvent.java,NONE,1.1 StepEvent.java,NONE,1.1 TimeProgressEvent.java,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 30 15:48:12 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:48:12 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301948.l2UJmCGD017439@dev.open-bio.org> gordonp Fri Mar 30 15:48:12 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv17403/src/main/org/biomoby/shared Modified Files: MobyPrefixResolver.java Log Message: Added WSRF/P and WS-Addressing support moby-live/Java/src/main/org/biomoby/shared MobyPrefixResolver.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.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/shared/MobyPrefixResolver.java 2007/03/12 16:58:48 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.java 2007/03/30 19:48:12 1.9 @@ -36,6 +36,10 @@ public static final String XSI2001_PREFIX = "xsi2001"; public static final String SOAP_ENC_NAMESPACE ="http://schemas.xmlsoap.org/soap/encoding/"; public static final String SOAP_ENC_PREFIX ="soap-enc"; + public static final String WS_ADDRESSING_PREFIX = "wsa"; + public static final String WS_ADDRESSING_NAMESPACE = "http://schemas.xmlsoap.org/ws/2004/03/addressing"; + public static final String WSRP_PREFIX = "wsrp"; + public static final String WSRP_NAMESPACE = "http://docs.oasis-open.org/wsrf/rp-2"; /** * We don't really implement this as it can be extremely complicated. @@ -145,6 +149,12 @@ else if(SOAP_ENC_PREFIX.equals(prefix)){ return SOAP_ENC_NAMESPACE; } + else if(WS_ADDRESSING_PREFIX.equals(prefix)){ //used by async services + return WS_ADDRESSING_NAMESPACE; + } + else if(WSRP_PREFIX.equals(prefix)){ //used by async services + return WSRP_NAMESPACE; + } else{ return ""; // Indicates that we don't have a mapping for this prefix } From gordonp at dev.open-bio.org Fri Mar 30 15:48:37 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:48:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301948.l2UJmbJc017505@dev.open-bio.org> gordonp Fri Mar 30 15:48:37 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv17469/src/main/org/biomoby/shared/data Modified Files: MobyContentInstance.java Log Message: Javadoc update moby-live/Java/src/main/org/biomoby/shared/data MobyContentInstance.java,1.9,1.10 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyContentInstance.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/shared/data/MobyContentInstance.java 2006/12/14 22:17:28 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyContentInstance.java 2007/03/30 19:48:37 1.10 @@ -526,7 +526,8 @@ } /** - * Retrieves a list of the query names in this object + * Retrieves a list of the query names in this object. + * NOTE: IF YOU DELETE OBJECTS FROM THIS SET, THEY ARE REMOVED FROM THE MOBY PAYLOAD TOO! */ public Set keySet(){ return members.keySet(); From gordonp at dev.open-bio.org Fri Mar 30 15:49:33 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:49:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301949.l2UJnX2r017567@dev.open-bio.org> gordonp Fri Mar 30 15:49:33 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/addressing In directory dev.open-bio.org:/tmp/cvs-serv17535/src/main/org/biomoby/w3c/addressing Added Files: EndpointReference.java Log Message: Support file for asynchronous moby service invocation moby-live/Java/src/main/org/biomoby/w3c/addressing EndpointReference.java,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 30 17:17:27 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 17:17:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703302117.l2ULHRHt017863@dev.open-bio.org> gordonp Fri Mar 30 17:17:27 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/test In directory dev.open-bio.org:/tmp/cvs-serv17813/src/main/org/biomoby/client/test Added Files: AsyncClientTestCase.java TestFASTACollection.xml Log Message: Initial commit of asynchronous client code, somewhat tested (single jobs) moby-live/Java/src/main/org/biomoby/client/test AsyncClientTestCase.java,NONE,1.1 TestFASTACollection.xml,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 30 17:17:27 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 17:17:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703302117.l2ULHRg9017849@dev.open-bio.org> gordonp Fri Mar 30 17:17:27 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory dev.open-bio.org:/tmp/cvs-serv17813/src/main/org/biomoby/client Modified Files: MobyRequest.java Added Files: AsyncClient.java Log Message: Initial commit of asynchronous client code, somewhat tested (single jobs) moby-live/Java/src/main/org/biomoby/client AsyncClient.java,NONE,1.1 MobyRequest.java,1.22,1.23 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java 2007/02/08 16:59:58 1.22 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java 2007/03/30 21:17:27 1.23 @@ -1,9 +1,6 @@ package org.biomoby.client; -// Defines Web service input, output, access -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; +import java.io.*; import java.util.*; import javax.xml.namespace.QName; @@ -21,9 +18,13 @@ import org.apache.xpath.XPathContext; import org.apache.xpath.objects.XNodeSet; import org.apache.xpath.objects.XObject; + import org.biomoby.shared.*; import org.biomoby.shared.data.*; import org.biomoby.shared.parser.MobyTags; // defined the Moby XML element names +import org.biomoby.w3c.addressing.EndpointReference; +import org.omg.lsae.notifications.AnalysisEvent; + import org.w3c.dom.*; /** @@ -150,14 +151,14 @@ } /** - * @param service the MobyService that should be executed when invokeService is called + * @param mobyservice the MobyService that should be executed when invokeService is called */ - public void setService(MobyService service){ - if(service == null){ + public void setService(MobyService mobyservice){ + if(mobyservice == null){ mobyService = null; } - else if(mobyService == null || !service.equals(mobyService)){ - mobyService = service; + else if(mobyService == null || !mobyservice.equals(mobyService)){ + mobyService = mobyservice; } } @@ -263,19 +264,94 @@ // Used internally for asynchronous thread calls that all need the XML data // and can't rely on the answer from thread-insensitive getResponseXML() - private MobyContentInstance invokeService(StringBuffer contentsXML) throws Exception, MobyException, SOAPException, NoSuccessException{ + private MobyContentInstance invokeService(StringBuffer contentsXML) + throws Exception, MobyException, SOAPException, NoSuccessException{ + return invokeService(contentsXML, null, 0); + } + + private MobyContentInstance invokeService(StringBuffer contentsXML, MobyRequestEventHandler handler, int requestId) + throws Exception, MobyException, SOAPException, NoSuccessException{ if(mobyService == null){ throw new MobyException("Tried to invoke null service from MobyRequest (call setService first)"); } - Call call = getServiceFromWSDL(); - verifyInput(); - String mobyXML = convertMOBYDataToMOBYRequest(inputData); - Element mobyDOM = performSOAPRequest(call, mobyXML, contentsXML); - // The following parses the DOM and extracts all the appropriate jMOBY objects to represent the XML in Java - outputData = MobyDataUtils.fromXMLDocument(mobyDOM); - return outputData; + Element mobyDOM = null; + if(mobyService.isAsynchronous()){ + // Async is "simpler", because it had to merge DOMs together into a single MobyContentInstance anyway + return performAsyncSOAPRequest(mobyService, inputData, handler, requestId); + } + else{ + String mobyXML = convertMOBYDataToMOBYRequest(inputData); + Call call = getServiceFromWSDL(); + mobyDOM = performSOAPRequest(call, mobyXML, contentsXML); + // The following parses the DOM and extracts all the appropriate jMOBY objects to represent the XML in Java + return MobyDataUtils.fromXMLDocument(mobyDOM); + } + } + + protected MobyContentInstance performAsyncSOAPRequest(MobyService mservice, MobyContentInstance inData, + MobyRequestEventHandler handler, int requestId) + throws Exception{ + String mobyXML = convertMOBYDataToMOBYRequest(inData); + EndpointReference epr = AsyncClient.sendRequest(mservice, mobyXML); + + // Essentially cloning, so removing ids doesn't change the + // MobyContentInstance "data" (which we will use again later on) + MobyContentInstance finalContents = new MobyContentInstance(); + Set queryIDs = new HashSet(inData.keySet()); + try { + // Should add some timeout here... + while(!queryIDs.isEmpty()){ + // todo: make this setable + Thread.sleep(5000); + + AnalysisEvent[] events = + AsyncClient.poll(epr, queryIDs); + + Vector newDataAvailable = new Vector(); + for(AnalysisEvent event: events){ + if(event != null && event.isCompleted()){ + queryIDs.remove(event.getQueryId()); + newDataAvailable.add(event.getQueryId()); + } + } + + // Parse and merge the new data into the existing contents + InputStream resultStream = AsyncClient.getResultStream(epr, newDataAvailable); + Element mobyDOM = asyncSoapTextToMobyDOM(resultStream); + MobyContentInstance newResults = MobyDataUtils.fromXMLDocument(mobyDOM); + // The merge + for(String jobid: newResults.keySet()){ + finalContents.put(jobid, newResults.get(jobid)); + } + + // Inform the handler that some data has been added to the response (for incremental display?) + if(newDataAvailable.size() > 0 && handler != null){ + MobyRequestEvent mre = new MobyRequestEvent(finalContents, this, null, requestId); + StringWriter xmlWriter = new StringWriter(); + MobyDataUtils.toXMLDocument(xmlWriter, finalContents); + + mre.setContentsXML(xmlWriter.toString()); + handler.processEvent(mre); + } + } + } catch (Exception e) { + e.printStackTrace(); + AsyncClient.destroy(epr); + throw new Exception("Exception occured while polling the service invocation: " + e); + } + + return finalContents; + } + + private Element asyncSoapTextToMobyDOM(InputStream inStream) throws Exception{ + Element soapDOM = null; + synchronized(docBuilder){ + soapDOM = docBuilder.parse(inStream).getDocumentElement(); + } + final boolean IS_ASYNC_SERVICE_CALL = true; + return decodeSOAPMessage(soapDOM, null, null, IS_ASYNC_SERVICE_CALL); } /** @@ -296,19 +372,19 @@ // This is the class that asynchronously calls the service and does a callback to // the handler specified in the invocation. class InvocationThread extends Thread { - MobyService service; + MobyService mservice; MobyRequest mobyRequest; MobyRequestEventHandler handler; int requestId; InvocationThread(MobyRequest mr, MobyRequestEventHandler h, int id){ mobyRequest = mr; - service = mobyRequest.getService(); + mservice = mobyRequest.getService(); handler = h; requestId = id; // Name the thread after the service being run, mostly for ease of debugging - setName(service.getName()+requestId); + setName(mservice.getName()+requestId); } public void run() { @@ -317,7 +393,7 @@ handler.start(mobyRequest, requestId); StringBuffer contentsXML = new StringBuffer(); //to be filled in by the RPC call below try{ - content = mobyRequest.invokeService(contentsXML); //RPC call... + content = mobyRequest.invokeService(contentsXML, handler, requestId); //RPC call... } catch(Exception e){ responseEvent = new MobyRequestEvent(content, mobyRequest, e, requestId); @@ -348,33 +424,6 @@ } /** - * @throws MobyException if the number of input parameters was wrong, or the paramters were of the wrong type. - */ - protected void verifyInput() throws MobyException{ - /*MobyData[] requiredInputData = mobyService.getPrimaryInputs(); - - if(requiredInputData == null){ - if(inputData != null && inputData.size() != 0){ - throw new MobyException("Service invocation expects no input parameters, " + - "but setInput has not been called with a null or zero-length array argument"); - } - return; // otherwise there are no parameters to check - } - if(inputData == null || inputData.size() == 0){ - throw new MobyException("Service invocation expects " + requiredInputData.length + " input " + - "parameters, but setInput has not been called to provide any input"); - } - if (requiredInputData.length != inputData.length){ - throw new MobyException("Wrong number of input parameters to service invocation method: expected " + - requiredInputData.length + ", but setInput was provided " + inputData.length); - }*/ - - // BUG WORKAROUND: Since the Moby-generated WSDL doesn't define the input, we assume the - // data types are right, and we just have to check the number of them. - - } - - /** * This method retrieves from Moby Central a copy of the WSDL document for the service * (or uses an internally cached copy from a previous invocation), and sets the variables for the * SOAP call appropriately so you can consequently call performSOAPRequest. @@ -469,6 +518,11 @@ } + public Element decodeSOAPMessage(Element n, StringBuffer contentsXMLOutput, String inputXML) + throws SOAPException, MobyException{ + return decodeSOAPMessage(n, contentsXMLOutput, inputXML, false); + } + /** * Isolates the MOBY Data from the SOAP message returned by the remote service host. * @@ -477,22 +531,29 @@ * * @return The root element of the MOBY response DOM */ - public Element decodeSOAPMessage(Element n, StringBuffer contentsXMLOutput, String inputXML) throws SOAPException, MobyException{ + public Element decodeSOAPMessage(Element n, StringBuffer contentsXMLOutput, String inputXML, boolean async) + throws SOAPException, MobyException{ if(n == null){ throw new SOAPException("SOAP Message given to decode is null"); } NodeList node_list = null; - Node responseNode = null; XPath responseElementXPath = null; try{ - responseElementXPath = new XPath("//"+ MobyPrefixResolver.MOBY_TRANSPORT_PREFIX+ - ":"+mobyService.getName()+"Response | //" + - mobyService.getName()+"Response | " + - "//"+ MobyPrefixResolver.MOBY_TRANSPORT_PREFIX+ - ":"+mobyService.getName() + " | //" + - mobyService.getName(), - null, mobyPrefixResolver, XPath.SELECT); + if(async){ + responseElementXPath = new XPath("//"+MobyPrefixResolver.WSRP_PREFIX + + ":"+AsyncClient.WSRP_MULTI_PROPERTY_TAG_NAME+"Response", + null, mobyPrefixResolver, XPath.SELECT); + } + else{ + responseElementXPath = new XPath("//"+ MobyPrefixResolver.MOBY_TRANSPORT_PREFIX+ + ":"+mobyService.getName()+"Response | //" + + mobyService.getName()+"Response | " + + "//"+ MobyPrefixResolver.MOBY_TRANSPORT_PREFIX+ + ":"+mobyService.getName() + " | //" + + mobyService.getName(), + null, mobyPrefixResolver, XPath.SELECT); + } }catch(TransformerException te){ throw new SOAPException("Cannot select SOAP nodes due to exception "+ "while compiling XPath statement (code bug?):" +te); @@ -513,8 +574,29 @@ throw new SOAPException("Found more than one response element in SOAP payload, " + "unable to resolve ambiguity of the payload (service provider error?)"); } - responseNode = node_list.item(0); + Node[] responseNodes = null; + if(async){ + Vector nodes = new Vector(); + NodeList resultNodeList = node_list.item(0).getChildNodes(); + for(int i = 0; resultNodeList != null && i < resultNodeList.getLength(); i++){ + if(!(resultNodeList.item(i) instanceof Element)){ + continue; + } + Element resultElement = (Element) resultNodeList.item(i); + if(resultElement.getLocalName().startsWith(AsyncClient.MOBY_RESULT_PROPERTY_PREFIX)){ + nodes.add(resultElement); + } + } + responseNodes = nodes.toArray(new Node[nodes.size()]); + } + else{ + responseNodes = new Node[]{node_list.item(0)}; + } + + Element domRoot = null; // Where the result will be put + + for(Node responseNode: responseNodes){ // Find base64 encoded elements in the SOAP message using XPath and // replace them with the real decoded contents node_list = null; @@ -597,7 +679,8 @@ } } - String localResponseString = ""; + Element predefinedDOM = null; // Choice of ripping DOM Element for moby payload out of SOAP DOM + String localResponseString = ""; // or storing raw XML strings, to be converted to a DOM later for(int j = 0; j < children.getLength(); j++){ Node child = children.item(j); if(child instanceof CDATASection || child instanceof Text){ @@ -612,16 +695,27 @@ } localResponseString += child.getNodeValue();//.replaceAll("<", "<").replaceAll(">", ">").replaceAll("(&|F)", "&"); } + if(child instanceof Element && child.getLocalName().equals(MobyTags.MOBY)){ + debugPS.println("Warning: The MOBY contents was found as raw XML inside the SOAP response!\n" + + "This is illegal according to the MOBY-API, please inform the service\n " + + " provider, as parsing such text may not be supported in the future"); + localResponseString = null; + // Store the moby payload root element's DOM represntation, so we don't + // have to serialize it to the localResponseString and then parse it out + // again (that would be wasteful). + predefinedDOM = (Element) child; + break; + } } - if(localResponseString.length() == 0){ + if(localResponseString != null && localResponseString.length() == 0){ throw new MobyException("The MOBY payload has no text contents at all"); } // Check if the payload is an XML document. If not, try a last ditch effort // by base64 decoding the contents. This is technically not allowable in the // MOBY spec, but we are being lenient. - if(!localResponseString.startsWith("\n"+localResponseString; @@ -652,15 +746,58 @@ // later on because once the document is parsed, there is no way to get the // spaces back! I set the attribute explicitly at the top level of each data // element to compensate. Unless of course this was already done. - if(localResponseString.indexOf("xml:space=\"preserve\"") == -1){ + if(localResponseString != null && localResponseString.indexOf("xml:space=\"preserve\"") == -1){ localResponseString = localResponseString.replaceAll(" gordonp Sat Mar 31 11:44:04 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap/sax/test In directory dev.open-bio.org:/tmp/cvs-serv23625/src/main/org/soap/sax/test Added Files: SOAPFaultTestCase.java SOAPMessage.xml WSRFMessage.xml Log Message: JUnit test cases for the SOAP/WSRF fault parsing moby-live/Java/src/main/org/soap/sax/test SOAPFaultTestCase.java,NONE,1.1 SOAPMessage.xml,NONE,1.1 WSRFMessage.xml,NONE,1.1 From gordonp at dev.open-bio.org Sat Mar 31 11:44:44 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Sat, 31 Mar 2007 11:44:44 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703311544.l2VFiikD023720@dev.open-bio.org> gordonp Sat Mar 31 11:44:44 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap In directory dev.open-bio.org:/tmp/cvs-serv23685/src/main/org/soap Modified Files: SOAPFault.java Log Message: Javadoc update moby-live/Java/src/main/org/soap SOAPFault.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/soap/SOAPFault.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/soap/SOAPFault.java 2007/03/30 19:16:49 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/soap/SOAPFault.java 2007/03/31 15:44:44 1.2 @@ -98,8 +98,7 @@ /** * - * @param xmlData - * the xml to parse into a SOAPFault object + * @param xmlData the xml to parse into a SOAPFault object. One of byte[], File or String * @return a SOAPFault object obtained by parsing the XML * @throws MobyException * if there was a problem parsing the xml From gordonp at dev.open-bio.org Sat Mar 31 11:45:30 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Sat, 31 Mar 2007 11:45:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703311545.l2VFjUJd023763@dev.open-bio.org> gordonp Sat Mar 31 11:45:30 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap/sax In directory dev.open-bio.org:/tmp/cvs-serv23728/src/main/org/soap/sax Modified Files: SOAPFaultParser.java Log Message: Got rid of superfluous new line characters in date and fualt code fields moby-live/Java/src/main/org/soap/sax SOAPFaultParser.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/soap/sax/SOAPFaultParser.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/soap/sax/SOAPFaultParser.java 2007/03/30 19:16:49 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/soap/sax/SOAPFaultParser.java 2007/03/31 15:45:30 1.2 @@ -239,7 +239,7 @@ sb.append(ch, start, length); if (inSoapFault && readingFaultCode) { - faultCodeBuffer.append(sb.toString().trim()+"\n"); + faultCodeBuffer.append(sb.toString().trim()); return; } if (inSoapFault && readingFaultString) { @@ -251,7 +251,7 @@ return; } if (inSoapFault && inWsrfFault && readingWsrfTimestamp) { - wsrfTimeBuffer.append(sb.toString().trim()+"\n"); + wsrfTimeBuffer.append(sb.toString().trim()); return; } From gordonp at dev.open-bio.org Sat Mar 31 13:22:09 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Sat, 31 Mar 2007 13:22:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703311722.l2VHM94K023967@dev.open-bio.org> gordonp Sat Mar 31 13:22:09 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/test In directory dev.open-bio.org:/tmp/cvs-serv23935/src/main/org/omg/lsae/sax/test Added Files: LSAEMessage.xml SOAPMessage.xml AnalysisEventTestCase.java Log Message: Basic JUnit test cases for the SOAP/LSAE event parsing moby-live/Java/src/main/org/omg/lsae/sax/test LSAEMessage.xml,NONE,1.1 SOAPMessage.xml,NONE,1.1 AnalysisEventTestCase.java,NONE,1.1 From dag at dev.open-bio.org Tue Mar 20 16:05:46 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 20 Mar 2007 20:05:46 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703202005.l2KK5jO4013111@dev.open-bio.org> dag Tue Mar 20 16:05:45 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/moby/owldoc In directory dev.open-bio.org:/home/dag/s-moby/ontologies/moby/owldoc Log Message: Directory /home/repository/moby/s-moby/ontologies/moby/owldoc added to the repository s-moby/ontologies/moby/owldoc - New directory rcsdiff: /home/repository/moby/s-moby/ontologies/moby/owldoc/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/s-moby/ontologies/moby/owldoc/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/s-moby/ontologies/moby/owldoc/RCS/directory,v: No such file or directory From dag at dev.open-bio.org Tue Mar 20 16:06:18 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 20 Mar 2007 20:06:18 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703202006.l2KK6Hsk013138@dev.open-bio.org> dag Tue Mar 20 16:06:17 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/sswap/owldoc In directory dev.open-bio.org:/home/dag/s-moby/ontologies/sswap/owldoc Log Message: Directory /home/repository/moby/s-moby/ontologies/sswap/owldoc added to the repository s-moby/ontologies/sswap/owldoc - New directory rcsdiff: /home/repository/moby/s-moby/ontologies/sswap/owldoc/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/s-moby/ontologies/sswap/owldoc/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/s-moby/ontologies/sswap/owldoc/RCS/directory,v: No such file or directory From dag at dev.open-bio.org Tue Mar 20 16:10:22 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 20 Mar 2007 20:10:22 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703202010.l2KKAL6C013200@dev.open-bio.org> dag Tue Mar 20 16:10:21 EDT 2007 Update of /home/repository/moby/s-moby/ontologies In directory dev.open-bio.org:/home/dag/s-moby/ontologies Added Files: MO.tar.gz Log Message: Added files from s-moby_ncgr_20070314.tar provided by Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies MO.tar.gz,NONE,1.1 From dag at dev.open-bio.org Tue Mar 20 16:10:28 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 20 Mar 2007 20:10:28 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703202010.l2KKAR2w013223@dev.open-bio.org> dag Tue Mar 20 16:10:27 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/moby In directory dev.open-bio.org:/home/dag/s-moby/ontologies/moby Added Files: moby.owl Log Message: Added files from s-moby_ncgr_20070314.tar provided by Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies/moby moby.owl,NONE,1.1 From dag at dev.open-bio.org Tue Mar 20 16:10:33 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 20 Mar 2007 20:10:33 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703202010.l2KKAR0g013239@dev.open-bio.org> dag Tue Mar 20 16:10:27 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/moby/owldoc In directory dev.open-bio.org:/home/dag/s-moby/ontologies/moby/owldoc Added Files: IndexAllResources.html IndexAnnotationProperties.html IndexClasses.html IndexDatatypeProperties.html IndexIndividuals.html IndexObjectProperties.html IndexnullAllResources.html IndexnullAnnotationProperties.html IndexnullClasses.html IndexnullDatatypeProperties.html IndexnullIndividuals.html IndexnullObjectProperties.html abouturi.html contents.html datatypeproperty.html graph.html hasmapping.html index.html inputuri.html mapsto.html metadata.html name.html object.html objectproperty.html onelinedescription.html ontology.html operateson.html outputuri.html providedby.html provider.html providesresource.html resource.html subject.html Log Message: Added files from s-moby_ncgr_20070314.tar provided by Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies/moby/owldoc IndexAllResources.html,NONE,1.1 IndexAnnotationProperties.html,NONE,1.1 IndexClasses.html,NONE,1.1 IndexDatatypeProperties.html,NONE,1.1 IndexIndividuals.html,NONE,1.1 IndexObjectProperties.html,NONE,1.1 IndexnullAllResources.html,NONE,1.1 IndexnullAnnotationProperties.html,NONE,1.1 IndexnullClasses.html,NONE,1.1 IndexnullDatatypeProperties.html,NONE,1.1 IndexnullIndividuals.html,NONE,1.1 IndexnullObjectProperties.html,NONE,1.1 abouturi.html,NONE,1.1 contents.html,NONE,1.1 datatypeproperty.html,NONE,1.1 graph.html,NONE,1.1 hasmapping.html,NONE,1.1 index.html,NONE,1.1 inputuri.html,NONE,1.1 mapsto.html,NONE,1.1 metadata.html,NONE,1.1 name.html,NONE,1.1 object.html,NONE,1.1 objectproperty.html,NONE,1.1 onelinedescription.html,NONE,1.1 ontology.html,NONE,1.1 operateson.html,NONE,1.1 outputuri.html,NONE,1.1 providedby.html,NONE,1.1 provider.html,NONE,1.1 providesresource.html,NONE,1.1 resource.html,NONE,1.1 subject.html,NONE,1.1 From dag at dev.open-bio.org Tue Mar 20 16:10:35 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 20 Mar 2007 20:10:35 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703202010.l2KKAROc013271@dev.open-bio.org> dag Tue Mar 20 16:10:27 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/sswap/owldoc In directory dev.open-bio.org:/home/dag/s-moby/ontologies/sswap/owldoc Added Files: IndexAllResources.html IndexAnnotationProperties.html IndexClasses.html IndexDatatypeProperties.html IndexIndividuals.html IndexObjectProperties.html IndexnullAllResources.html IndexnullAnnotationProperties.html IndexnullClasses.html IndexnullDatatypeProperties.html IndexnullIndividuals.html IndexnullObjectProperties.html abouturi.html contents.html datatypeproperty.html graph.html hasmapping.html index.html inputuri.html mapsto.html metadata.html name.html object.html objectproperty.html onelinedescription.html ontology.html operateson.html outputuri.html providedby.html provider.html providesresource.html resource.html subject.html Log Message: Added files from s-moby_ncgr_20070314.tar provided by Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies/sswap/owldoc IndexAllResources.html,NONE,1.1 IndexAnnotationProperties.html,NONE,1.1 IndexClasses.html,NONE,1.1 IndexDatatypeProperties.html,NONE,1.1 IndexIndividuals.html,NONE,1.1 IndexObjectProperties.html,NONE,1.1 IndexnullAllResources.html,NONE,1.1 IndexnullAnnotationProperties.html,NONE,1.1 IndexnullClasses.html,NONE,1.1 IndexnullDatatypeProperties.html,NONE,1.1 IndexnullIndividuals.html,NONE,1.1 IndexnullObjectProperties.html,NONE,1.1 abouturi.html,NONE,1.1 contents.html,NONE,1.1 datatypeproperty.html,NONE,1.1 graph.html,NONE,1.1 hasmapping.html,NONE,1.1 index.html,NONE,1.1 inputuri.html,NONE,1.1 mapsto.html,NONE,1.1 metadata.html,NONE,1.1 name.html,NONE,1.1 object.html,NONE,1.1 objectproperty.html,NONE,1.1 onelinedescription.html,NONE,1.1 ontology.html,NONE,1.1 operateson.html,NONE,1.1 outputuri.html,NONE,1.1 providedby.html,NONE,1.1 provider.html,NONE,1.1 providesresource.html,NONE,1.1 resource.html,NONE,1.1 subject.html,NONE,1.1 From dag at dev.open-bio.org Tue Mar 20 16:10:38 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 20 Mar 2007 20:10:38 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703202010.l2KKARVQ013253@dev.open-bio.org> dag Tue Mar 20 16:10:27 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/sswap In directory dev.open-bio.org:/home/dag/s-moby/ontologies/sswap Added Files: sswap.owl Log Message: Added files from s-moby_ncgr_20070314.tar provided by Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies/sswap sswap.owl,NONE,1.1 From dag at dev.open-bio.org Tue Mar 27 11:25:22 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 27 Mar 2007 15:25:22 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703271525.l2RFPLUo003395@dev.open-bio.org> dag Tue Mar 27 11:25:21 EDT 2007 Update of /home/repository/moby/s-moby/ontologies In directory dev.open-bio.org:/home/dag/s-moby/ontologies Removed Files: MGED.tar.gz Log Message: Removed MGED.tar.gz and replaced ~35 files per Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies MGED.tar.gz,1.1,NONE rcsdiff: /home/repository/moby/s-moby/ontologies/RCS/MGED.tar.gz,v: No such file or directory From dag at dev.open-bio.org Tue Mar 27 11:25:32 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 27 Mar 2007 15:25:32 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703271525.l2RFPSNK003430@dev.open-bio.org> dag Tue Mar 27 11:25:28 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util In directory dev.open-bio.org:/home/dag/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util Modified Files: OBOFileClassCreator.java OBOFileIndividualCreator.java OwlFileSplitter.java Log Message: Removed MGED.tar.gz and replaced ~35 files per Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies/src/java/org/semanticmoby/ontologies/util OBOFileClassCreator.java,1.1,1.2 OBOFileIndividualCreator.java,1.5,1.6 OwlFileSplitter.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util/OBOFileClassCreator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util/OBOFileClassCreator.java 2006/12/04 00:26:55 1.1 +++ /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util/OBOFileClassCreator.java 2007/03/27 15:25:28 1.2 @@ -199,19 +199,9 @@ // standard namespaces, plus namespaces for "obo" and this ontology // file's namespace RDFFormatter formatter = newRDFFormatter(); - if (date != null) { - formatter.addNamespace("dc", "http://purl.org/dc/elements/1.1/"); - } // Write the header out in a standard format formatter.writeHeader(out); - - // If dc:date and dc:creator are used in the ontology, they must first - // be declared to be annotation properties (see OWL reference manual) - out.println(); - if (date != null) { - out.println(" "); - } out.println(); // Write out the Ontology header, as well as version information, date, @@ -219,16 +209,6 @@ out.println(" "); out.println(); - if (version != null) { - out.println(" " + xmlSafeString(version) + ""); - if (date == null) { - out.println(); - } - } - if (date != null) { - out.println(" " + xmlSafeString(date) + ""); - out.println(); - } for (Iterator it = classURIs.iterator(); it.hasNext();) { String uri = it.next().toString(); out.println(" "); @@ -262,6 +242,10 @@ // Write the RDF header out in standard format formatter.writeRDFHeader(out); out.println(); + out.println(" "); + out.println(" "); + out.println(" "); + out.println(); // Write the term as an OWL class with associated annotation properties out.println(" "); @@ -275,13 +259,14 @@ formatter.writeWrapped(out, term.classDef, 12, null); out.println(); out.println(" "); - out.println(); + out.println(); } if (term.classComment != null) { out.println(" "); formatter.writeWrapped(out, term.classComment, 12, null); out.println(); out.println(" "); + out.println(); } if (term.classIsObsolete != null) { out.println(" " + term.classIsObsolete + ""); @@ -290,20 +275,19 @@ Iterator it = term.supers.iterator(); if (it.hasNext()) { while (it.hasNext()) { - String className = it.next().toString(); - out.println(" "); + String className = (it.next().toString()).replaceAll(":", "_"); + out.println(" "); + out.println(" "); + out.println(" "); } out.println(); } else { - out.println(" "); + out.println(" "); + out.println(" "); + out.println(" "); out.println(); } - out.println(" "); - out.println(" "); - out.println(" "); out.println(); out.println(" "); out.println(); =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util/OBOFileIndividualCreator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util/OwlFileSplitter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util/OwlFileSplitter.java 2007/01/15 23:13:23 1.3 +++ /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util/OwlFileSplitter.java 2007/03/27 15:25:28 1.4 @@ -33,6 +33,11 @@ private Resource ontologyResource = null; /** + * A resource referring to the base URI + */ + private Resource baseURIResource = null; + + /** * The Jena model from which the components to be written are read */ private Model source = null; @@ -52,18 +57,15 @@ this.contentWriter = writer; this.contentFile = saveContents(in, inputName, writer); - File owldocDir = new File(contentWriter.getContentDirectory(), "owldoc"); - owldocDir.mkdir(); - - this.owldocWriter = new OwlDocWriter(contentFile, owldocDir); - try { // Read the OWL file as a Jena2 Model object and replace hashes // with slashes among the resources in the model FileInputStream fileIn = new FileInputStream(contentFile); this.source = ModelFactory.createDefaultModel(); source.read(fileIn, ""); - replaceHashesWithSlashes(); + this.source = replaceHashesWithSlashes(); + this.baseURIResource = ResourceFactory.createResource( + source.getNsPrefixURI("")); } catch (Throwable t) { IOException e = new IOException( "Specified OWL file could not be parsed:"); @@ -157,13 +159,18 @@ * @throws IOException if any of these files could not be written */ public void process() throws Exception { + +// File owldocDir = new File(contentWriter.getContentDirectory(), "owldoc"); +// owldocDir.mkdir(); +// this.owldocWriter = new OwlDocWriter(contentFile, owldocDir); + writeContentFile(); writeOntologyFile(); writeFilesFor(OWL.Class); writeFilesFor(OWL.DatatypeProperty); writeFilesFor(OWL.ObjectProperty); - owldocWriter.write(); - writeOwldocFiles(); +// owldocWriter.write(); +// writeOwldocFiles(); contentWriter.close(); } @@ -174,39 +181,37 @@ * base-uri/name), and updates statements whose subjects or objects point * at them to point at the replacement resources */ - private void replaceHashesWithSlashes() { + private Model replaceHashesWithSlashes() { + + // A new model to return + Model newModel = ModelFactory.createDefaultModel(); + newModel.setNsPrefixes(source.getNsPrefixMap()); // Collect all the non-blank resources that are declared to be of // rdf:type owl:Class, owl:DatatypeProperty, or owl:ObjectProperty List allResources = classesAndProperties(source); - // Look at all the resources, and for those that have hashes, - // create a replacement that has the hash changed to a slash + // Create a replacement for each resource, replacing a hash with a slash Map newResources = new HashMap(); for (Iterator it = allResources.iterator(); it.hasNext();) { Resource currentResource = (Resource) it.next(); String uri = currentResource.getURI(); - if (uri.indexOf('#') > -1) { - newResources.put( - currentResource, - ResourceFactory.createResource( - uri.replaceFirst("#", "/"))); - } + newResources.put( + currentResource, + ResourceFactory.createResource( + uri.indexOf('#') > -1 + ? uri.replaceFirst("#", "/") + : uri)); } - // Statements to remove (because their subjects need to be changed) - // or add (because they replace the ones that need removing). These - // are collected since it's unwise to modify the model while iterating - // over its statements - Model toRemove = ModelFactory.createDefaultModel(); - Model toAdd = ModelFactory.createDefaultModel(); - - // Check each statement in the model to see if its subject - // or object points to a resource that has a replacement + // Create a replacement statement for each one in the model, + // nd add the new statement to the new model for (StmtIterator it = source.listStatements(); it.hasNext();) { Statement stmt = it.nextStatement(); + Resource subj = stmt.getSubject(); + Property pred = stmt.getPredicate(); RDFNode obj = stmt.getObject(); // Check to see if there is a replacement resource for the @@ -214,30 +219,15 @@ Resource newSubj = (Resource) newResources.get(subj); Resource newObj = (Resource) newResources.get(obj); - if (newSubj != null) { - // The subject of a statement can't be changed, so a new - // statement must be created and the old one marked for - // removal. Note that the object of the statement could - // also be in need of replacement, hence the check for - // newObj - toRemove.add(stmt); - toAdd.add( - source.createStatement( - newSubj, - stmt.getPredicate(), - newObj == null ? obj : newObj)); - - } else if (newObj != null) { - // The object of a statement can be changed. Since we don't - // need to add or remove any statements, it's safe to do it - // right here in the loop - stmt.changeObject(newObj); - } + Statement newStmt = newModel.createStatement( + ((newSubj == null) ? subj : newSubj), + pred, + ((newObj == null) ? obj : newObj)); + + newModel.add(newStmt); } - - // Remove the statements marked for removal and add their replacements - source.remove(toRemove); - source.add(toAdd); + + return newModel; } /** @@ -256,12 +246,12 @@ */ private void writeOntologyFile() throws IOException { - // Find the statement, if any, that says that some URI - // is of rdf:type owl:Ontology. + // Find the statement, if any, that says that some URI + // is of rdf:type owl:Ontology. StmtIterator it = source.listStatements(null, RDF.type, OWL.Ontology); - if (! it.hasNext()) return; - - String uri = it.nextStatement().getSubject().getURI(); + if (! it.hasNext()) return; + + String uri = it.nextStatement().getSubject().getURI(); // The base URI of all elements will be the above URI with a // trailing forward slash (if it doesn't already have one) @@ -351,14 +341,12 @@ source, head, null, visited); reachable.setNsPrefixes(source.getNsPrefixMap()); - // Assert that the resource is itself an ontology - reachable.add(reachable.createStatement( - head, RDF.type, OWL.Ontology)); - // Import the owlOntology "master ontology" if (ontologyResource != null) { reachable.add(reachable.createStatement( - head, OWL.imports, ontologyResource)); + baseURIResource, RDF.type, OWL.Ontology)); + reachable.add(reachable.createStatement( + baseURIResource, OWL.imports, ontologyResource)); } reachable.write(contentWriter.outputStreamFor(elementName)); } From dag at dev.open-bio.org Tue Mar 27 11:25:34 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 27 Mar 2007 15:25:34 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703271525.l2RFPSsw003524@dev.open-bio.org> dag Tue Mar 27 11:25:28 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/sswap In directory dev.open-bio.org:/home/dag/s-moby/ontologies/sswap Modified Files: Graph Object Provider Resource Subject aboutURI datatypeProperty hasMapping inputURI mapsTo name objectProperty oneLineDescription operatesOn outputURI owlOntology providedBy providesResource sswap.owl Log Message: Removed MGED.tar.gz and replaced ~35 files per Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies/sswap Graph,1.1,1.2 Object,1.1,1.2 Provider,1.1,1.2 Resource,1.1,1.2 Subject,1.1,1.2 aboutURI,1.1,1.2 datatypeProperty,1.1,1.2 hasMapping,1.1,1.2 inputURI,1.1,1.2 mapsTo,1.1,1.2 name,1.1,1.2 objectProperty,1.1,1.2 oneLineDescription,1.1,1.2 operatesOn,1.1,1.2 outputURI,1.1,1.2 owlOntology,1.1,1.2 providedBy,1.1,1.2 providesResource,1.1,1.2 sswap.owl,1.1,1.2 =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/Graph,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/Graph 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/Graph 2007/03/27 15:25:28 1.2 @@ -9,21 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - + A required class. A sswap:Graph delineates a root or entry point for a suite of mappings. For services, a "mapping" embeds the concept of taking some input and returning some output. An individual of this class is the object of the sswap:hasMapping relationship from sswap:Resource. By differentially using sswap:operatesOn and sswap:hasMapping, one can, for example, differentiate between a pair of lists and a list of pairs. - - A required class. A sswap:Graph delineates a root or entry - point for a suite of mappings. For services, a "mapping" - embeds the concept of taking some input and returning some - output. An individual of this class is the object of the - sswap:hasMapping relationship from sswap:Resource. By - differentially using sswap:operatesOn and sswap:hasMapping, - one can, for example, differentiate between a pair of lists - and a list of pairs. - + + + =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/Object,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/Object 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/Object 2007/03/27 15:25:28 1.2 @@ -9,20 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + - - + A required class. In the concept of a service mapping an input to an output, the sswap:Object corresponds to the output. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from an input to this output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject. - - A required class. In the concept of a service mapping an input to - an output, the sswap:Object corresponds to the output. The property - sswap:mapsTo explicitly demarcates the mapping (or transformation) - from an input to this output. One can also use sswap:mapsTo to - describe inverse mappings where the stated relationship is *from* - sswap:Object to sswap:Subject. - + + + =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/Provider,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/Provider 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/Provider 2007/03/27 15:25:28 1.2 @@ -9,19 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + - - + A required class. This class designates the provider of one or more resources. Providers claim ownership of resources and are anticipated to be associated with actual organizations such as W3C, NCBI, etc. Providers may state that they provide multiple resources by using multiple providesResource properties. - - A required class. This class designates the provider of one or - more resources. Providers claim ownership of resources and are - anticipated to be associated with actual organizations such as - W3C, NCBI, etc. Providers may state that they provide multiple - resources by using multiple providesResource properties. - + + + =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/Resource,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/Resource 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/Resource 2007/03/27 15:25:28 1.2 @@ -9,18 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + - - + A required class. This class designates the semantically described resource. Resources that "do things," for example, transform input (sswap:Subject) to output (sswap:Object) are commonly called services. Resources may also be web pages, ontologies, etc. - - A required class. This class designates the semantically described - resource. Resources that "do things," for example, transform input - (sswap:Subject) to output (sswap:Object) are commonly called services. - Resources may also be web pages, ontologies, etc. - + + + =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/Subject,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/Subject 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/Subject 2007/03/27 15:25:28 1.2 @@ -9,20 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + - - + A required class. In the concept of a service mapping an input to an output, the sswap:Subject corresponds to the input. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from this input to its output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject. - - A required class. In the concept of a service mapping an input - to an output, the sswap:Subject corresponds to the input. The - property sswap:mapsTo explicitly demarcates the mapping (or - transformation) from this input to its output. One can also - use sswap:mapsTo to describe inverse mappings where the stated - relationship is *from* sswap:Object to sswap:Subject. - + + + =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/aboutURI,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/aboutURI 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/aboutURI 2007/03/27 15:25:28 1.2 @@ -9,22 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - Points to a URI for additional information about its domain - object. It is expected that the URI may be a human-readable - web page (an HTML resource). Programs may dereference the URI - to provide users with additional information describing a - sswap:Resource or sswap:Provider. - + Points to a URI for additional information about its domain object. It is expected that the URI may be a human-readable web page (an HTML resource). Programs may dereference the URI to provide users with additional information describing a sswap:Resource or sswap:Provider. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/datatypeProperty,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/datatypeProperty 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/datatypeProperty 2007/03/27 15:25:28 1.2 @@ -9,16 +9,14 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + - - - - - Super property for all sswap datatype properties. This property - is not used directly so it has no domain and range. - + Super property for all sswap datatype properties. This property is not used directly so it has no domain and range. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/hasMapping,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/hasMapping 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/hasMapping 2007/03/27 15:25:28 1.2 @@ -9,20 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - A property that connects a sswap:Graph to a sswap:Subject. The - sswap:Subject's subgraph then contains the relevant mappings of - an input (sswap:Subject) to its output (sswap:Object). - + A property that connects a sswap:Graph to a sswap:Subject. The sswap:Subject's subgraph then contains the relevant mappings of an input (sswap:Subject) to its output (sswap:Object). =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/inputURI,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/inputURI 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/inputURI 2007/03/27 15:25:28 1.2 @@ -9,21 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - Resources may require special user interfaces to gather input - such as using web pages to solicit input from users. Programs - that are preparing to invoke a resource may direct users to the - URI pointed to by this property for the appropriate user interface. - + Resources may require special user interfaces to gather input such as using web pages to solicit input from users. Programs that are preparing to invoke a resource may direct users to the URI pointed to by this property for the appropriate user interface. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/mapsTo,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/mapsTo 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/mapsTo 2007/03/27 15:25:28 1.2 @@ -9,24 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - A property that connects a sswap:Subject to a sswap:Object, or - vice-versa. For services, this is usually used to establish the - transformation from the input to the output. This property is - directional (imples a mapping from the domain to the range), but - can be used as its own inverse. So one may delineate a mapping - from sswap:Subject to sswap:Object, and use another sswap:mapsTo - to delineate a mapping from sswap:Object to sswap:Subject. - + A property that connects a sswap:Subject to a sswap:Object, or vice-versa. For services, this is usually used to establish the transformation from the input to the output. This property is directional (imples a mapping from the domain to the range), but can be used as its own inverse. So one may delineate a mapping from sswap:Subject to sswap:Object, and use another sswap:mapsTo to delineate a mapping from sswap:Object to sswap:Subject. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/name,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/name 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/name 2007/03/27 15:25:28 1.2 @@ -9,19 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - A human-readable name of an sswap:Resource or sswap:Provider. This - property may be used by programs to display a name to users. - + A human-readable name of an sswap:Resource or sswap:Provider. This property may be used by programs to display a name to users. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/objectProperty,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/objectProperty 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/objectProperty 2007/03/27 15:25:28 1.2 @@ -9,15 +9,14 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> - - - + + + + - - Super property for all sswap object properties. This property is - not used directly so it has no domain and range. - + Super property for all sswap object properties. This property is not used directly so it has no domain and range. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/oneLineDescription,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/oneLineDescription 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/oneLineDescription 2007/03/27 15:25:28 1.2 @@ -9,19 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - A one line, human-readable description that programs may use to - display brief information about a sswap:Resource or sswap:Provider. - + A one line, human-readable description that programs may use to display brief information about a sswap:Resource or sswap:Provider. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/operatesOn,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/operatesOn 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/operatesOn 2007/03/27 15:25:28 1.2 @@ -9,20 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - A property that connects a sswap:Resource to a sswap:Graph. The - sswap:Graph's subgraph then contains the relevant mappings of an - input (sswap:Subject) to its output (sswap:Object). - + A property that connects a sswap:Resource to a sswap:Graph. The sswap:Graph's subgraph then contains the relevant mappings of an input (sswap:Subject) to its output (sswap:Object). =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/outputURI,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/outputURI 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/outputURI 2007/03/27 15:25:28 1.2 @@ -9,6 +9,9 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + @@ -16,15 +19,8 @@ - - - - - Resources may require special user interfaces to display output - such as using web pages to dispay output to users. Programs that - are handling a resource's response may direct users to the URI - pointed to by this property to handle the result graph. - + Resources may require special user interfaces to display output such as using web pages to dispay output to users. Programs that are handling a resource's response may direct users to the URI pointed to by this property to handle the result graph. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owlOntology,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owlOntology 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owlOntology 2007/03/27 15:25:28 1.2 @@ -12,47 +12,18 @@ - - The SSWAP Protocol. Importing this one file causes a cascade - of imports to bring in all definitions of the entire ontology. - - - - - - - - - - - - - - - - - - - - - - - - - + Definitions of the classes and properties that make up the SSWAP Protocol. + + March 2007 A + http://ontologies.ncgr.org/moby + http://ontologies.ncgr.org/moby + + + =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/providedBy,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/providedBy 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/providedBy 2007/03/27 15:25:28 1.2 @@ -9,22 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - A property identifiying the entity providing the Resource. - The Provider's URL must be in the same domain as the Resource, - unless the Provider explicitly claims the Resource by including - a providesResource statement, pointing at the Resource, in the - Provider's description graph. - + A property identifiying the entity providing the Resource. The Provider's URL must be in the same domain as the Resource, unless the Provider explicitly claims the Resource by including a providesResource statement, pointing at the Resource, in the Provider's description graph. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/providesResource,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/providesResource 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/providesResource 2007/03/27 15:25:28 1.2 @@ -9,6 +9,9 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + @@ -16,15 +19,8 @@ - - - - - A property identifiying the provided Resource. The Resources's URL - must be in the same domain as the Provider, unless the Resource - explicitly claims the Provider by including a providedBy statement, - pointing at the Provider, in the Resources's description graph. - + A property identifiying the provided Resource. The Resources's URL must be in the same domain as the Provider, unless the Resource explicitly claims the Provider by including a providedBy statement, pointing at the Provider, in the Resources's description graph. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/sswap.owl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/sswap.owl 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/sswap.owl 2007/03/27 15:25:28 1.2 @@ -1,450 +1,320 @@ - + + - - - + + + + ]> - - - - December 2006 A - - This is the single file version of the SSWAP Protocol. + + + December 2006 A + This is the single file version of the SSWAP Protocol. It is appropriate for reading and viewing by editors such as Protege that do not handle distributed, modular ontologies (where each term is defined in a separate file). This file is for reference only; for actually using SSWAP, use the terms (each in its own file) at the URL indicated by the sswap: prefix. For an interactive "Clickable Protocol" visit http://sswap.info/protocol.jsp. - - http://ontologies.ncgr.org/moby - - http://ontologies.ncgr.org/moby - - - - - - A required class. This class designates the provider of one or more resources. Providers claim ownership of resources and are anticipated to be associated with actual organizations such as W3C, NCBI, etc. Providers may state that they provide multiple resources by using multiple providesResource properties. - - - - - - - - 1 - - - - - 1 - - - - - 1 - - - - - 1 - - - - - 1 - - - - - - - - - - - - - - - - - A required class. This class designates the semantically described resource. Resources that "do things," for example, transform input (sswap:Subject) to output (sswap:Object) are commonly called services. Resources may also be web pages, ontologies, etc. - - - - - - - - 1 - - - - - 1 - - - - - 1 - - - - - 1 - - - - - 1 - - - - - 1 - - - - - - - - - - 1 - - - - - 1 - - - - - - - - - - - - - - - - A required class. A sswap:Graph delineates a root or entry point for a suite of mappings. For services, a "mapping" embeds the concept of taking some input and returning some output. An individual of this class is the object of the sswap:hasMapping relationship from sswap:Resource. By differentially using sswap:operatesOn and sswap:hasMapping, one can, for example, differentiate between a pair of lists and a list of pairs. - - - - - - - - 1 - - - - - - - - - - 1 - - - - - - - - - - - - A required class. In the concept of a service mapping an input to an output, the sswap:Subject corresponds to the input. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from this input to its output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject. - - - - - - - - 1 - - - - - - - - - - 1 - - - - - - - - - - - - A required class. In the concept of a service mapping an input to an output, the sswap:Object corresponds to the output. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from an input to this output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject. - - - - - - - - - - - - - 1 - - - - - - - - - - - - Super property for all sswap object properties. This property is not used directly so it has no domain and range. - - - - - - - - - A property that connects a sswap:Graph to a sswap:Subject. The sswap:Subject's subgraph then contains the relevant mappings of an input (sswap:Subject) to its output (sswap:Object). - - - - - - - - - - - - A property that connects a sswap:Subject to a sswap:Object, or vice-versa. For services, this is usually used to establish the transformation from the input to the output. This property is directional (implies a mapping from the domain to the range), but can be used as its own inverse. So one may delineate a mapping from sswap:Subject to sswap:Object, and use another sswap:mapsTo to delineate a mapping from sswap:Object to sswap:Subject. - - - - - - - - - - - - - - - - - - - - - - - - - - - A property that connects a sswap:Resource to a sswap:Graph. The sswap:Graph's subgraph then contains the relevant mappings of an input (sswap:Subject) to its output (sswap:Object). - - - - - - - - - - - - A property identifying the entity providing the Resource. The Provider's URL must be in the same domain as the Resource, unless the Provider explicitly claims the Resource by including a providesResource statement, pointing at the Resource, in the Provider's description graph. - - - - - - - - - - - - - - A property identifying the provided Resource. The Resource's URL must be in the same domain as the Provider, unless the Resource explicitly claims the Provider by including a providedBy statement, pointing at the Provider, in the Resource's description graph. - - - - - - - - - - - - Super property for all sswap datatype properties. This property is not used directly so it has no domain and range. - + http://ontologies.ncgr.org/moby + http://ontologies.ncgr.org/moby + + + + + + + + + + + + + Points to a URI for additional information about its domain object. It is expected that the URI may be a human-readable web page (an HTML resource). Programs may dereference the URI to provide users with additional information describing a sswap:Resource or sswap:Provider. - - - - - - - Points to a URI for additional information about its domain object. It is expected that the URI may be a human-readable web page (an HTML resource). Programs may dereference the URI to provide users with additional information describing a sswap:Resource or sswap:Provider. - - - - - - - - - - - - - - - - - - - - Resources may require special user interfaces to gather input such as using web pages to solicit input from users. Programs that are preparing to invoke a resource may direct users to the URI pointed to by this property for the appropriate user interface. - - - - - - - - - - - - Points to a URI that may contain words, phrases, or other such text that programs may use to parse keywords associated with the property's object. - - - - - - - - - - - - - - - - - - - - - - - - A human-readable name of an sswap:Resource or sswap:Provider. This property may be used by programs to display a name to users. - - - - - - - - - - - - - - - - - - - A one line, human-readable description that programs may use to display brief information about a sswap:Resource or sswap:Provider. - - - - - - - - - - - - - - - - - - - - Resources may require special user interfaces to display output such as using web pages to display output to users. Programs that are handling a resource's response may direct users to the URI pointed to by this property to handle the result graph. - - - - - - + + Super property for all sswap datatype properties. This property is not used directly so it has no domain and range. + + + + + + + + 1 + + + + + + + + 1 + + + + + + A required class. A sswap:Graph delineates a root or entry point for a suite of mappings. For services, a "mapping" embeds the concept of taking some input and returning some output. An individual of this class is the object of the sswap:hasMapping relationship from sswap:Resource. By differentially using sswap:operatesOn and sswap:hasMapping, one can, for example, differentiate between a pair of lists and a list of pairs. + + + + + + A property that connects a sswap:Graph to a sswap:Subject. The sswap:Subject's subgraph then contains the relevant mappings of an input (sswap:Subject) to its output (sswap:Object). + + + + + + Resources may require special user interfaces to gather input such as using web pages to solicit input from users. Programs that are preparing to invoke a resource may direct users to the URI pointed to by this property for the appropriate user interface. + + + + + + + + + + + + + + + + + + + + A property that connects a sswap:Subject to a sswap:Object, or vice-versa. For services, this is usually used to establish the transformation from the input to the output. This property is directional (implies a mapping from the domain to the range), but can be used as its own inverse. So one may delineate a mapping from sswap:Subject to sswap:Object, and use another sswap:mapsTo to delineate a mapping from sswap:Object to sswap:Subject. + + + + + + + + + + + + + + + Points to a URI that may contain words, phrases, or other such text that programs may use to parse keywords associated with the property's object. + + + + + + + + + + + + + A human-readable name of an sswap:Resource or sswap:Provider. This property may be used by programs to display a name to users. + + + + + + + + + + + + 1 + + + + + + A required class. In the concept of a service mapping an input to an output, the sswap:Object corresponds to the output. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from an input to this output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject. + + + Super property for all sswap object properties. This property is not used directly so it has no domain and range. + + + + + + + + + + + + + A one line, human-readable description that programs may use to display brief information about a sswap:Resource or sswap:Provider. + + + + + + A property that connects a sswap:Resource to a sswap:Graph. The sswap:Graph's subgraph then contains the relevant mappings of an input (sswap:Subject) to its output (sswap:Object). + + + + + + Resources may require special user interfaces to display output such as using web pages to display output to users. Programs that are handling a resource's response may direct users to the URI pointed to by this property to handle the result graph. + + + + + + + A property identifying the entity providing the Resource. The Provider's URL must be in the same domain as the Resource, unless the Provider explicitly claims the Resource by including a providesResource statement, pointing at the Resource, in the Provider's description graph. + + + + + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + + + + + + + A required class. This class designates the provider of one or more resources. Providers claim ownership of resources and are anticipated to be associated with actual organizations such as W3C, NCBI, etc. Providers may state that they provide multiple resources by using multiple providesResource properties. + + + + + + + A property identifying the provided Resource. The Resource's URL must be in the same domain as the Provider, unless the Resource explicitly claims the Provider by including a providedBy statement, pointing at the Provider, in the Resource's description graph. + + + + + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + + + + + 1 + + + + 1 + + + + + + + + + + A required class. This class designates the semantically described resource. Resources that "do things," for example, transform input (sswap:Subject) to output (sswap:Object) are commonly called services. Resources may also be web pages, ontologies, etc. + + + Super class of all SSWAP classes. + + + + + + + + 1 + + + + + + + + 1 + + + + + + A required class. In the concept of a service mapping an input to an output, the sswap:Subject corresponds to the input. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from this input to its output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject. + + From dag at dev.open-bio.org Tue Mar 27 11:25:36 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 27 Mar 2007 15:25:36 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703271525.l2RFPSrT003576@dev.open-bio.org> dag Tue Mar 27 11:25:28 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/sswap/owldoc In directory dev.open-bio.org:/home/dag/s-moby/ontologies/sswap/owldoc Modified Files: IndexAllResources.html IndexClasses.html IndexnullAllResources.html IndexnullClasses.html graph.html object.html provider.html resource.html subject.html Log Message: Removed MGED.tar.gz and replaced ~35 files per Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies/sswap/owldoc IndexAllResources.html,1.1,1.2 IndexClasses.html,1.1,1.2 IndexnullAllResources.html,1.1,1.2 IndexnullClasses.html,1.1,1.2 graph.html,1.1,1.2 object.html,1.1,1.2 provider.html,1.1,1.2 resource.html,1.1,1.2 subject.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexAllResources.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexAllResources.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexAllResources.html 2007/03/27 15:25:28 1.2 @@ -7,5 +7,5 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

All Resources

Generated with OWLDoc
+

All Resources

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexClasses.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexClasses.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexClasses.html 2007/03/27 15:25:28 1.2 @@ -7,5 +7,5 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

All Classes

Generated with OWLDoc
+

All Classes

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexnullAllResources.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexnullAllResources.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexnullAllResources.html 2007/03/27 15:25:28 1.2 @@ -7,5 +7,5 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

[•] Resources

Generated with OWLDoc
+

[•] Resources

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexnullClasses.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexnullClasses.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexnullClasses.html 2007/03/27 15:25:28 1.2 @@ -7,5 +7,5 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

[•] Classes

Generated with OWLDoc
+

[•] Classes

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/graph.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/graph.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/graph.html 2007/03/27 15:25:28 1.2 @@ -7,11 +7,11 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

Class: Graph

A required class. A sswap:Graph delineates a root or entry point for a suite of mappings. For services, a "mapping" embeds the concept of taking some input and returning some output. An individual of this class is the object of the sswap:hasMapping relationship from sswap:Resource. By differentially using sswap:operatesOn and sswap:hasMapping, one can, for example, differentiate between a pair of lists and a list of pairs.

•owl:Thing
        •Graph

Super Classes

owl:Thing

Equivalent Classes (Necessary and Sufficient Conditions)

hasMapping MIN 1 owl:Thing
hasMapping ONLY Subject
metaData MAX 1 owl:Thing

Abstract Syntax

Class(Graph complete annotation(rdfs:comment "A required class. A sswap:Graph delineates a root or entry point for a suite of mappings.  For services, a "mapping" embeds the concept of taking some input and returning some output. An individual of this class is the object of the sswap:hasMapping relationship from sswap:Resource.  By differentially using sswap:operatesOn and sswap:hasMapping, one can, for example, differentiate between a pair of lists and a list of pairs."^^<http://www.w3.org/2001/XMLSchema#string>)
+

Class: Graph

A required class. A sswap:Graph delineates a root or entry point for a suite of mappings. For services, a "mapping" embeds the concept of taking some input and returning some output. An individual of this class is the object of the sswap:hasMapping relationship from sswap:Resource. By differentially using sswap:operatesOn and sswap:hasMapping, one can, for example, differentiate between a pair of lists and a list of pairs.

•owl:Thing
        •SSWAP
                •Graph

Super Classes

Equivalent Classe! s (Necessary and Sufficient Conditions)

hasMapping MIN 1 owl:Thing
hasMapping ONLY Subject
metaData MAX 1 owl:Thing

Abstract Syntax

Class(Graph complete annotation(rdfs:comment "A required class. A sswap:Graph delineates a root or entry point for a suite of mappings.  For services, a "mapping" embeds the concept of taking some input and returning some output. An individual of this class is the object of the sswap:hasMapping relationship from sswap:Resource.  By differentially using sswap:operatesOn and sswap:hasMapping, one can, for example,!
  differentiate between a pair of lists and a list of pairs."^^!
 <http
://www.w3.org/2001/XMLSchema#string>)
                     restriction(hasMapping minCardinality(1))
                     restriction(hasMapping allValuesFrom(Subject))
                     restriction(metaData maxCardinality(1)))
 
-SubClassOf(Graph owl:Thing)
+SubClassOf(Graph SSWAP)
 

Usage

Class Description/Definition (Necessary Conditions)

Domain of

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/object.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/object.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/object.html 2007/03/27 15:25:28 1.2 @@ -7,10 +7,10 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

Class: Object

A required class. In the concept of a service mapping an input to an output, the sswap:Object corresponds to the output. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from an input to this output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject.

•owl:Thing
        •Object

Super Classes

owl:Thing

Equivalent Classes (Necessary and Sufficient Conditions)

mapsTo ONLY Subject
metaData MAX 1 owl:Thing

Abstract Syntax

Class(Object complete annotation(rdfs:comment "A required class. In the concept of a service mapping an input to an output, the sswap:Object corresponds to the output. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from an input to this output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject."^^<http://www.w3.org/2001/XMLSchema#string>)
+

Class: Object

A required class. In the concept of a service mapping an input to an output, the sswap:Object corresponds to the output. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from an input to this output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject.

•owl:Thing
        •SSWAP
                •Object

Super Classes

Equivalent Classes (Necessary and Sufficient Conditions)

!
mapsTo ONLY Subject
metaData MAX 1 owl:Thing

Abstract Syntax

Class(Object complete annotation(rdfs:comment "A required class. In the concept of a service mapping an input to an output, the sswap:Object corresponds to the output. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from an input to this output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject."^^<http://www.w3.org/2001/XMLSchema#string>)
                      restriction(mapsTo allValuesFrom(Subject))
                      restriction(metaData maxCardinality(1)))
 
-SubClassOf(Object owl:Thing)
+SubClassOf(Object SSWAP)
 

Usage

Class Description/Definition (Necessary Conditions)

Domain of

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/provider.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/provider.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/provider.html 2007/03/27 15:25:28 1.2 @@ -7,7 +7,7 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

Class: Provider

A required class. This class designates the provider of one or more resources. Providers claim ownership of resources and are anticipated to be associated with actual organizations such as W3C, NCBI, etc. Providers may state that they provide multiple resources by using multiple providesResource properties.

•owl:Thing
        •Provider

Super Classes

owl:Thing

Equivalent Classes (Necessary and Sufficient Conditions)

aboutURI MAX 1 owl:Thing
metaData MAX 1 ! ;owl:Thing
name EQ 1 owl:Thing
oneLineDescription MAX 1 owl:Thing
providesResource MIN 1 owl:Thing
providesResource ONLY Resource

Abstract Syntax

Class(Provider complete annotation(rdfs:comment "A required class.  This class designates the provider of one or more resources. Providers claim ownership of resources and are anticipated to be associated with actual organizations such as W3C, NCBI, etc.  Providers may state that they provide multi!
 ple resources by using multiple providesResource properties."^!
 ^<htt
p://www.w3.org/2001/XMLSchema#string>)
+

Class: Provider

A required class. This class designates the provider of one or more resources. Providers claim ownership of resources and are anticipated to be associated with actual organizations such as W3C, NCBI, etc. Providers may state that they provide multiple resources by using multiple providesResource properties.

•owl:Thing
        •SSWAP
                •Provider

Super Classes

Equivalent Classes (Necessary and Sufficient Conditions)

aboutURI MAX 1 owl:Thing
metaData MAX 1 owl:Thing
name EQ 1 owl:Thing
oneLineDescription MAX 1 owl:Thing
providesResource MIN 1 owl:Thing
providesResource ONLY Resource

Abstract Syntax

Class(Provider complete annotation(rdfs:comment "A required class.  This class designates the !
 provider of one or more resources. Providers claim ownership o!
 f resour
ces and are anticipated to be associated with actual organizations such as W3C, NCBI, etc.  Providers may state that they provide multiple resources by using multiple providesResource properties."^^<http://www.w3.org/2001/XMLSchema#string>)
                        restriction(aboutURI maxCardinality(1))
                        restriction(metaData maxCardinality(1))
                        restriction(name cardinality(1))
@@ -15,6 +15,6 @@
                        restriction(providesResource minCardinality(1))
                        restriction(providesResource allValuesFrom(Resource)))
 
-SubClassOf(Provider owl:Thing)
+SubClassOf(Provider SSWAP)
 

Usage

Class Description/Definition (Necessary Conditions)

Domain of

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/resource.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/resource.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/resource.html 2007/03/27 15:25:28 1.2 @@ -7,7 +7,7 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

Class: Resource

A required class. This class designates the semantically described resource. Resources that "do things," for example, transform input (sswap:Subject) to output (sswap:Object) are commonly called services. Resources may also be web pages, ontologies, etc.

•owl:Thing
        •Resource

Super Classes

owl:Thing

Equivalent Classes (Necessary and Sufficient Conditions)

aboutURI MAX 1 owl:Thing
inputURI MAX 1 owl:Thing
metaData MAX 1 owl:Thing
name EQ 1 owl:Thing
oneLineDescription MAX 1 owl:Thing
operatesOn MIN 1 owl:Thing
operatesOn ONLY Graph
outputURI MAX 1 owl:Thing
providedBy EQ 1 owl:Thing
! providedBy ONLY Provider

Abstract Syntax

Class(Resource complete annotation(rdfs:comment "A required class. This class designates the semantically described resource. Resources that "do things," for example, transform input (sswap:Subject) to output (sswap:Object) are commonly called services. Resources may also be web pages, ontologies, etc."^^<http://www.w3.org/2001/XMLSchema#string>)
+

Class: Resource

A required class. This class designates the semantically described resource. Resources that "do things," for example, transform input (sswap:Subject) to output (sswap:Object) are commonly called services. Resources may also be web pages, ontologies, etc.

•owl:Thing
        •SSWAP
                •Resource

Super Classes

Equivalent Classes (Necessary and Sufficient Conditions)

aboutURI MAX 1 owl:Thing
inputURI MAX 1 owl:Thing
metaData MAX 1 owl:Thing
name EQ 1 owl:Thing
oneLineDescription MAX 1 owl:Thing
operatesOn MIN 1 owl:Thing
operatesOn ONLY Graph
outputURI MAX 1 ! ;owl:Thing
providedBy EQ 1 owl:Thing
providedBy ONLY Provider

Abstract Syntax

Class(Resource complete annotation(rdfs:comment "A required class. This class designates the semantically described resource. Resources that "do things," for example, transform input (sswap:Subject) to output (sswap:Object) are commonly called services. Resources may also be web pages, ontologies, etc."^^<http://www.w3.org/2001/XMLSchema#string>)
                        restriction(aboutURI maxCardinality(1))
                        restriction(inputURI maxCardinality(1))
                        restriction(metaData maxCardinality(1))
@@ -19,6 +19,6 @@
                        restriction(providedBy cardinality(1))
                        restriction(providedBy allValuesFrom(Provider)))
 
-SubClassOf(Resource owl:Thing)
+SubClassOf(Resource SSWAP)
 

Usage

Class Description/Definition (Necessary Conditions)

Domain of

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/subject.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/subject.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/subject.html 2007/03/27 15:25:28 1.2 @@ -7,11 +7,11 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

Class: Subject

A required class. In the concept of a service mapping an input to an output, the sswap:Subject corresponds to the input. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from this input to its output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject.

•owl:Thing
        •Subject

Super Classes

owl:Thing

Equivalent Classes (Necessary and Sufficient Conditions)

mapsTo MIN 1 owl:Thing
mapsTo ONLY Object
metaData MAX 1 owl:Thing

Abstract Syntax

Class(Subject complete annotation(rdfs:comment "A required class. In the concept of a service mapping an input to an output, the sswap:Subject corresponds to the input. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from this input to its output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject."^^<http://www.w3.org/2001/XMLSchema#string>)
+

Class: Subject

A required class. In the concept of a service mapping an input to an output, the sswap:Subject corresponds to the input. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from this input to its output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject.

•owl:Thing
        •SSWAP
                •Subject

Super Classes

Equivalent Classes (Necessary and Sufficient Conditions)

mapsTo MIN 1 owl:Thing
mapsTo ONLY Object
metaData MAX 1 owl:Thing

Abstract Syntax

Class(Subject complete annotation(rdfs:comment "A required class. In the concept of a service mapping an input to an output, the sswap:Subject corresponds to the input. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from this input to its output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject."^^<http://www.w3.org/2001/XMLSchema#string>)
                       restriction(mapsTo minCardinality(1))
                       restriction(mapsTo allValuesFrom(Object))
                       restriction(metaData maxCardinality(1)))
 
-SubClassOf(Subject owl:Thing)
+SubClassOf(Subject SSWAP)
 

Usage

Class Description/Definition (Necessary Conditions)

Domain of

Generated with OWLDoc
\ No newline at end of file From gordonp at dev.open-bio.org Fri Mar 9 17:13:07 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 12:13:07 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703091713.l29HD7vc023316@dev.open-bio.org> gordonp Fri Mar 9 12:13:07 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services In directory dev.open-bio.org:/tmp/cvs-serv23282/src/main/ca/ucalgary/services Log Message: Directory /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services added to the repository moby-live/Java/src/main/ca/ucalgary/services - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 9 17:13:57 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 12:13:57 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703091713.l29HDvi1023358@dev.open-bio.org> gordonp Fri Mar 9 12:13:57 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util In directory dev.open-bio.org:/tmp/cvs-serv23324/src/main/ca/ucalgary/services/util Log Message: Directory /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util added to the repository moby-live/Java/src/main/ca/ucalgary/services/util - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 9 17:14:11 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 12:14:11 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703091714.l29HEBP4023400@dev.open-bio.org> gordonp Fri Mar 9 12:14:11 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test In directory dev.open-bio.org:/tmp/cvs-serv23366/src/main/ca/ucalgary/services/util/test Log Message: Directory /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test added to the repository moby-live/Java/src/main/ca/ucalgary/services/util/test - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 9 17:16:55 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 12:16:55 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703091716.l29HGtpa023495@dev.open-bio.org> gordonp Fri Mar 9 12:16:55 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test In directory dev.open-bio.org:/tmp/cvs-serv23450/src/main/ca/ucalgary/services/util/test Added Files: ACDFileTestCase.java ACDFileTestCase.java~ transeq.acd Log Message: Start of commit for ACD service wrapping moby-live/Java/src/main/ca/ucalgary/services/util/test ACDFileTestCase.java,NONE,1.1 ACDFileTestCase.java~,NONE,1.1 transeq.acd,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 9 17:16:55 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 12:16:55 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703091716.l29HGtSJ023481@dev.open-bio.org> gordonp Fri Mar 9 12:16:55 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util In directory dev.open-bio.org:/tmp/cvs-serv23450/src/main/ca/ucalgary/services/util Added Files: ACDFile.java Log Message: Start of commit for ACD service wrapping moby-live/Java/src/main/ca/ucalgary/services/util ACDFile.java,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 9 17:18:01 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 12:18:01 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703091718.l29HI1MD023582@dev.open-bio.org> gordonp Fri Mar 9 12:18:01 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test In directory dev.open-bio.org:/tmp/cvs-serv23549/src/main/ca/ucalgary/services/util/test Removed Files: ACDFileTestCase.java~ Log Message: Mistaken import of editor backup file moby-live/Java/src/main/ca/ucalgary/services/util/test ACDFileTestCase.java~,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/RCS/ACDFileTestCase.java~,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 9 18:01:10 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 13:01:10 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703091801.l29I1A6h023649@dev.open-bio.org> gordonp Fri Mar 9 13:01:09 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util In directory dev.open-bio.org:/tmp/cvs-serv23614/src/main/ca/ucalgary/services/util Modified Files: ACDFile.java Log Message: Updated javadoc moby-live/Java/src/main/ca/ucalgary/services/util ACDFile.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/09 17:16:55 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/09 18:01:09 1.2 @@ -141,6 +141,13 @@ return application; } + /** + * Returns a list representing the blocks of the section. Each block + * is a map of key/value pairs corresponding to the tag-name/tag-value pairs + * of the ACD block. Two hardcoded keys are the block name (BLOCK_NAME_KEY) + * such as "sequence", "trim", "clean" + * and the block type (BLOCK_TYPE_KEY) such as "list", "boolean", "range", etc. + */ public List> getInputSection(){ return input; } From gordonp at dev.open-bio.org Sat Mar 10 00:33:16 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 19:33:16 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703100033.l2A0XGJX028345@dev.open-bio.org> gordonp Fri Mar 9 19:33:16 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util In directory dev.open-bio.org:/tmp/cvs-serv28310/src/main/ca/ucalgary/services/util Modified Files: ACDFile.java Log Message: Added handling for ACD file subsections (ignore by MOBY, as all secondary params are at the same level) moby-live/Java/src/main/ca/ucalgary/services/util ACDFile.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/09 18:01:09 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/10 00:33:16 1.3 @@ -12,6 +12,7 @@ public class ACDFile{ private List> application; private List> input; + private List> required; private List> additional; private List> advanced; private List> output; @@ -52,6 +53,7 @@ StringBuffer applicationSection = new StringBuffer(); StringBuffer inputSection = new StringBuffer(); + StringBuffer requiredSection = new StringBuffer(); StringBuffer additionalParamsSection = new StringBuffer(); StringBuffer advancedParamsSection = new StringBuffer(); StringBuffer outputSection = new StringBuffer(); @@ -84,6 +86,20 @@ inputSection.append(line+"\n"); } } + + else if(line.matches("^\\s*section\\s*:\\s*required\\s*\\[")){ + for(line = reader.readLine(); line != null; line = reader.readLine()){ + if(line.matches("^\\s*]")){ + break; + } + } + for(line = reader.readLine(); line != null; line = reader.readLine()){ + if(line.matches("^\\s*endsection\\s*:\\s*required")){ + break; + } + requiredSection.append(line+"\n"); + } + } else if(line.matches("^\\s*section:\\s*additional\\s*\\[")){ for(line = reader.readLine(); line != null; line = reader.readLine()){ @@ -131,6 +147,7 @@ // Populate the sections application = acdSectionToTagValuePairs(applicationSection.toString()); input = acdSectionToTagValuePairs(inputSection.toString()); + required = acdSectionToTagValuePairs(requiredSection.toString()); additional = acdSectionToTagValuePairs(additionalParamsSection.toString()); advanced = acdSectionToTagValuePairs(advancedParamsSection.toString()); output = acdSectionToTagValuePairs(outputSection.toString()); @@ -152,6 +169,10 @@ return input; } + public List> getRequiredParamsSection(){ + return required; + } + public List> getAdditionalParamsSection(){ return additional; } @@ -180,9 +201,14 @@ if(line.matches("^\\s*\\S+\\s*:\\s*\\S+\\s*\\[\\s*$")){ String blockType = line.replaceAll("^\\s*(\\S+)\\s*:\\s*\\S+\\s*\\[\\s*$", "$1"); String blockName = line.replaceAll("^\\s*\\S+\\s*:\\s*(\\S+)\\s*\\[\\s*$", "$1"); + boolean subsection = line.matches("^\\s*section\\s*:\\s*\\S*\\s*\\["); for(line = reader.readLine(); line != null; line = reader.readLine()){ if(line.matches("^\\s*]")){ + if(subsection){ + System.err.println("Ignoring subsection:\n" + blockText.toString()); + break; // ignore subsection specifications (MOBY 2ndary params don't hav'em) + } Map block = acdBlockToTagValuePairs(blockText.toString()); block.put(BLOCK_TYPE_KEY, blockType); block.put(BLOCK_NAME_KEY, blockName); @@ -192,6 +218,9 @@ blockText.append(line+"\n"); } } + else if(line.matches("^\\s*endsection:\\s*\\S+")){ + // ignore subsection info + } else{ throw new Exception("Unexpected content where blocks expected: "+line); } From gordonp at dev.open-bio.org Sat Mar 10 00:33:16 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 9 Mar 2007 19:33:16 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200703100033.l2A0XGe2028363@dev.open-bio.org> gordonp Fri Mar 9 19:33:16 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test In directory dev.open-bio.org:/tmp/cvs-serv28310/src/main/ca/ucalgary/services/util/test Modified Files: ACDFileTestCase.java Added Files: dan.acd Log Message: Added handling for ACD file subsections (ignore by MOBY, as all secondary params are at the same level) moby-live/Java/src/main/ca/ucalgary/services/util/test dan.acd,NONE,1.1 ACDFileTestCase.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/ACDFileTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/ACDFileTestCase.java 2007/03/09 17:16:55 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/ACDFileTestCase.java 2007/03/10 00:33:16 1.2 @@ -8,12 +8,13 @@ public class ACDFileTestCase extends TestCase{ private final static String ACDFILE_RESOURCE = "ca/ucalgary/services/util/test/transeq.acd"; + private final static String ACDFILE_SUBSECTION_RESOURCE = "ca/ucalgary/services/util/test/dan.acd"; public ACDFileTestCase(String name){ super(name); } - public void testParsing(){ + public void testParsingBasic(){ URL u = getClass().getClassLoader().getResource(ACDFILE_RESOURCE); assertNotNull("Could not find the test ACD file resource ("+ACDFILE_RESOURCE+")", u); @@ -35,6 +36,11 @@ assertTrue("The number of blocks (" + section.size() +") in the input section of " + u + " was not as expected (expected 1)", section.size() == 1); + section = file.getRequiredParamsSection(); + assertNotNull("The required parameters section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the required parameter section of " + + u + " was not as expected (expected 0)", section.size() == 0); + section = file.getAdditionalParamsSection(); assertNotNull("The additional parameters section for the test data file was unexpectedly null", section); assertTrue("The number of blocks (" + section.size() +") in the additional parameter section of " + @@ -51,13 +57,57 @@ u + " was not as expected (expected 1)", section.size() == 1); } + public void testParsingSubsections(){ + URL u = getClass().getClassLoader().getResource(ACDFILE_SUBSECTION_RESOURCE); + assertNotNull("Could not find the test ACD file resource ("+ACDFILE_SUBSECTION_RESOURCE+")", u); + + ACDFile file = null; + try{ + file = new ACDFile(u); + } catch(Exception e){ + e.printStackTrace(); + fail("Could not load and parse the test input resource ("+u+"): " + e); + } + + List> section = file.getApplicationSection(); + assertNotNull("The application section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the application section of " + + u + " was not as expected (expected 1)", section.size() == 1); + + section = file.getInputSection(); + assertNotNull("The input section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the input section of " + + u + " was not as expected (expected 1)", section.size() == 1); + + section = file.getRequiredParamsSection(); + assertNotNull("The required parameters section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the required parameter section of " + + u + " was not as expected (expected 0)", section.size() == 4); + + section = file.getAdditionalParamsSection(); + assertNotNull("The additional parameters section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the additional parameter section of " + + u + " was not as expected (expected 5)", section.size() == 6); + + section = file.getAdvancedParamsSection(); + assertNotNull("The advanced parameters section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the advanced parameter section of " + + u + " was not as expected (expected 1)", section.size() == 1); + + section = file.getOutputSection(); + assertNotNull("The output section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the output section of " + + u + " was not as expected (expected 1)", section.size() == 4); + } + /** * @return a test suite for all the test methods of this test case. */ public static Test suite() { TestSuite suite = new TestSuite(); - suite.addTest(new ACDFileTestCase("testParsing")); + suite.addTest(new ACDFileTestCase("testParsingBasic")); + suite.addTest(new ACDFileTestCase("testParsingSubsections")); return suite; } From gordonp at dev.open-bio.org Mon Mar 12 14:29:46 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:29:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121429.l2CETkV8002946@dev.open-bio.org> gordonp Mon Mar 12 10:29:45 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/resources In directory dev.open-bio.org:/tmp/cvs-serv2910/src/main/ca/ucalgary/services/resources Log Message: Directory /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/resources added to the repository moby-live/Java/src/main/ca/ucalgary/services/resources - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/resources/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/resources/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/resources/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Mon Mar 12 14:29:46 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:29:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121429.l2CETkoC002963@dev.open-bio.org> gordonp Mon Mar 12 10:29:46 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/test In directory dev.open-bio.org:/tmp/cvs-serv2910/src/main/ca/ucalgary/services/test Log Message: Directory /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/test added to the repository moby-live/Java/src/main/ca/ucalgary/services/test - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/test/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/test/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/test/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Mon Mar 12 14:30:56 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:30:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121430.l2CEUu19003006@dev.open-bio.org> gordonp Mon Mar 12 10:30:56 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv2975/src/main/ca/ucalgary/seahawk/services Added Files: TextClient.java Log Message: Initial commit of XSLT based MOBY to text transformer moby-live/Java/src/main/ca/ucalgary/seahawk/services TextClient.java,NONE,1.1 From gordonp at dev.open-bio.org Mon Mar 12 14:30:56 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:30:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121430.l2CEUuL5003020@dev.open-bio.org> gordonp Mon Mar 12 10:30:56 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/test In directory dev.open-bio.org:/tmp/cvs-serv2975/src/main/ca/ucalgary/seahawk/services/test Added Files: TextClientTestCase.java Log Message: Initial commit of XSLT based MOBY to text transformer moby-live/Java/src/main/ca/ucalgary/seahawk/services/test TextClientTestCase.java,NONE,1.1 From gordonp at dev.open-bio.org Mon Mar 12 14:32:02 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:32:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121432.l2CEW200003063@dev.open-bio.org> gordonp Mon Mar 12 10:32:02 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services In directory dev.open-bio.org:/tmp/cvs-serv3032/src/main/ca/ucalgary/services Added Files: ACDService.java Log Message: Initial commit of ACD service interface moby-live/Java/src/main/ca/ucalgary/services ACDService.java,NONE,1.1 From gordonp at dev.open-bio.org Mon Mar 12 14:32:02 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:32:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121432.l2CEW2Iv003079@dev.open-bio.org> gordonp Mon Mar 12 10:32:02 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util In directory dev.open-bio.org:/tmp/cvs-serv3032/src/main/ca/ucalgary/services/util Added Files: TempDir.java Log Message: Initial commit of ACD service interface moby-live/Java/src/main/ca/ucalgary/services/util TempDir.java,NONE,1.1 From gordonp at dev.open-bio.org Mon Mar 12 14:33:39 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:33:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121433.l2CEXc2B003204@dev.open-bio.org> gordonp Mon Mar 12 10:33:38 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/resources In directory dev.open-bio.org:/tmp/cvs-serv3173/src/main/ca/ucalgary/services/resources Added Files: acdRules.xml mobyRules.xsl Log Message: Initial commit of ACD service interface moby-live/Java/src/main/ca/ucalgary/services/resources acdRules.xml,NONE,1.1 mobyRules.xsl,NONE,1.1 From gordonp at dev.open-bio.org Mon Mar 12 14:33:39 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:33:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121433.l2CEXdF9003218@dev.open-bio.org> gordonp Mon Mar 12 10:33:39 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/test In directory dev.open-bio.org:/tmp/cvs-serv3173/src/main/ca/ucalgary/services/test Added Files: ACDServiceTestCase.java Log Message: Initial commit of ACD service interface moby-live/Java/src/main/ca/ucalgary/services/test ACDServiceTestCase.java,NONE,1.1 From gordonp at dev.open-bio.org Mon Mar 12 14:35:02 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:35:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121435.l2CEZ2A8003324@dev.open-bio.org> gordonp Mon Mar 12 10:35:01 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/test In directory dev.open-bio.org:/tmp/cvs-serv3293/src/main/ca/ucalgary/services/test Added Files: mobyTest1.png mobyTest2.png mobyDNASeq.xml Log Message: Support files for ACDService test cases moby-live/Java/src/main/ca/ucalgary/services/test mobyTest1.png,NONE,1.1 mobyTest2.png,NONE,1.1 mobyDNASeq.xml,NONE,1.1 From gordonp at dev.open-bio.org Mon Mar 12 14:37:24 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:37:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121437.l2CEbOPq003450@dev.open-bio.org> gordonp Mon Mar 12 10:37:24 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv3415/src/main/ca/ucalgary/seahawk/services Modified Files: MobyClient.java Log Message: Added several functions to parse multi-part data and binary data (because ACDService has these). Also added processing attriubutes to member fields for whitespace stripping and Base64 encoding. moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyClient.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2007/02/08 17:05:11 1.5 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2007/03/12 14:37:24 1.6 @@ -35,8 +35,7 @@ * described * here. Used in Seahawk to provide the service options popup items. */ -public class MobyClient -{ +public class MobyClient{ public static final String DATA_MAPPING_XML_RESOURCE = "ca/ucalgary/seahawk/resources/mobyBuilderRules.xml"; public static final String RESOURCE_SYSTEM_PROPERTY = "seahawk.rules"; public static final String RULE_SET_TAG = "object"; @@ -52,12 +51,20 @@ public static final String URL_REGEX_TAG = "url_regex"; public static final String REGEX_TAG = "regex"; public static final String XPATH_TAG = "xpath"; + public static final String WHITESPACE_ATTR = "whitespace"; + public static final String WHITESPACE_ATTR_STRIP_VAL = "strip"; + public static final String WHITESPACE_ATTR_NORMALIZE_VAL = "normalize"; + public static final String WHITESPACE_ATTR_KEEP_VAL = "keep"; + public static final String ENCODING_ATTR = "encoding"; + public static final String ENCODING_ATTR_BASE64_VAL = "Base64"; + public static final String ENCODING_ATTR_NONE_VAL = "none"; + public static final String SINGLE_RETURNED_VALUE_KEY = "_no_acd_param_should_have_this_name"; private NamespaceContextImpl nsContext; private CentralImpl c; private HashMap xpathMap; private HashMap urlRegexMap; - private HashMap regexMap; + private Map regexMap; private URL dataMappingXMLURL; private DocumentBuilder docBuilder; private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(MobyClient.class); @@ -68,7 +75,7 @@ c = new CentralCachedCallsImpl(); xpathMap = new HashMap(); urlRegexMap = new HashMap(); - regexMap = new HashMap(); + regexMap = new HashMap(); nsContext = new NamespaceContextImpl(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -88,7 +95,12 @@ if(rulesResource == null){ dataMappingXMLURL = cl.getResource(DATA_MAPPING_XML_RESOURCE); } - else{ + + // See if it's a URL + try{ + dataMappingXMLURL = new URL(rulesResource); + } + catch(Exception e){ dataMappingXMLURL = cl.getResource(rulesResource); } if(dataMappingXMLURL == null){ @@ -376,6 +388,30 @@ "have a non-blank " + DATATYPE_RULE_ATTR + " attribute as required"); } + String memberWhitespaceSetting = memTag.getAttribute(WHITESPACE_ATTR); + if(memberWhitespaceSetting == null || memberWhitespaceSetting.length() == 0){ + memberWhitespaceSetting = WHITESPACE_ATTR_KEEP_VAL; // default is to keep whitespace + } + else if(!memberWhitespaceSetting.equals(WHITESPACE_ATTR_KEEP_VAL) && + !memberWhitespaceSetting.equals(WHITESPACE_ATTR_NORMALIZE_VAL) && + !memberWhitespaceSetting.equals(WHITESPACE_ATTR_STRIP_VAL)){ + System.err.println("Object member " + memberNameKey + + " has an unrecognized value for the " + WHITESPACE_ATTR + + " attribute, overriding with default of " + WHITESPACE_ATTR_KEEP_VAL); + memberWhitespaceSetting = WHITESPACE_ATTR_KEEP_VAL; + } + String memberEncodingSetting = memTag.getAttribute(ENCODING_ATTR); + if(memberEncodingSetting == null || memberEncodingSetting.length() == 0){ + memberEncodingSetting = ENCODING_ATTR_NONE_VAL; // default is to not encode + } + else if(!memberEncodingSetting.equals(ENCODING_ATTR_NONE_VAL) && + !memberEncodingSetting.equals(ENCODING_ATTR_BASE64_VAL)){ + System.err.println("Object member " + memberNameKey + + " has an unrecognized value for the " + ENCODING_ATTR + + " attribute, overriding with default of " + ENCODING_ATTR_NONE_VAL); + memberWhitespaceSetting = ENCODING_ATTR_NONE_VAL; + } + if(membersMap.containsKey(memberNameKey)){ System.err.println("Object member " + memberNameKey + " already exists, ignoring new definition"); return; @@ -385,7 +421,9 @@ if(ruleValue == null || ruleValue.length() == 0){ System.err.println("Object member " + memberNameKey + " has a blank value rule"); } - membersMap.put(memberNameKey, ruleValue); + membersMap.put(memberNameKey, new String[]{ruleValue, + memberWhitespaceSetting, + memberEncodingSetting}); } protected void addNamespaceMapping(Element nsTag, Map namespaceStrings) throws Exception{ @@ -458,9 +496,206 @@ /** * Using the regular expression mappings that have been set up, + * maps a string using rules producing moby objects of the given type. + */ + public MobyDataObject[] getMobyObjects(String textData, MobyDataType targetDataType){ + Vector objectVector = new Vector(); + + for(Pattern pattern: regexMap.keySet()){ + MobyComplexBuilder rule = regexMap.get(pattern); + if(rule.getDataType().inheritsFrom(targetDataType)){ + Matcher matcher = pattern.matcher(textData); + + while(matcher.find()){ + try{ + MobyDataObject mobyObj = rule.apply(matcher); + if(mobyObj != null){ + objectVector.add(mobyObj); + } + } + catch(MobyException me){ + System.err.println("Could not build Moby object from match:" + me); + me.printStackTrace(); + } + } + } + } + + return (MobyDataObject[]) objectVector.toArray(new MobyDataObject[objectVector.size()]); + } + + /** + * Create a MOBY data instance from a map of name->bytes[] by applying the rules of the given MobyClient. + * The creation of a single object or collection is done according to the dataTemplate provided. + * + * @throws MobyServiceException NOTE: these are just warning level exceptions about collection-simple casting that you can add to the service response, or ignore if you like + */ + public MobyDataInstance getMobyObject(Map resultParts, MobyPrimaryData dataTemplate) + throws Exception, MobyServiceException{ + Vector results = new Vector(); + // The output parameter *potentially* has multiple parts + // (e.g. multiple .png file from EMBOSS's "banana" program) + // hence the nested for loops (part iteration, followed by created-object iteration) + for(String resultPartName: resultParts.keySet()){ + for(MobyDataObject resultPart: getMobyObjects(resultParts.get(resultPartName), dataTemplate.getDataType())){ + // Maintain the name for the object in the collection, as banana.1.png, banana.2.png, etc. + // is useful information for the end-user for making sense of them together! (left to right) + if(!resultPartName.equals(SINGLE_RETURNED_VALUE_KEY)){ // except for trivial single-byte-array case + resultPart.setName(resultPartName); + } + results.add(resultPart); + } + } + + if(results.size() == 0){ + if(dataTemplate instanceof MobyPrimaryDataSimple){ + if(resultParts != null && resultParts.size() > 0){ + // Is it a single-byte-array response? + if(resultParts.containsKey(SINGLE_RETURNED_VALUE_KEY)){ + if(resultParts.get(SINGLE_RETURNED_VALUE_KEY).length != 0){ + throw new MobyServiceException(MobyServiceException.WARNING, + MobyServiceException.INTERNAL_PROCESSING_ERROR, + null, + dataTemplate.getName(), + "The non-blank data provided " + + "did not match any MOBY Object rules, " + + "therefore a blank response is being returned. Contact " + + " the service provider to fix the MOBY Object rules."); + } + } + // Otherwise it's a multi-part result + else{ + for(String partName: resultParts.keySet()){ + if(resultParts.get(partName).length != 0){ + throw new MobyServiceException(MobyServiceException.WARNING, + MobyServiceException.INTERNAL_PROCESSING_ERROR, + null, + dataTemplate.getName(), + "The non-blank data provided (" + partName + + ") did not match any MOBY Object rules, " + + "therefore a blank response is being returned. Contact " + + " the service provider to fix the MOBY Object rules."); + } + } + } //end multi-part result + } //end if some results present + return null; //nothing to report + } + else{ // Empty set + return new MobyDataObjectSet(dataTemplate.getName()); + } + } + else if(results.size() > 1){ + if(dataTemplate instanceof MobyPrimaryDataSimple){ + System.err.println("The data map provided " + + "was a collection, but the request was to return a simple. " + + "Only the first value in the collection has been returned."); + // TODO: should we instead return the one deepest in the heirarchy (or with the most members)? + return results.elementAt(0); + } + else{ + MobyDataObjectSet resultSet = new MobyDataObjectSet(dataTemplate.getName()); + resultSet.addAll(results); + return resultSet; + } + } + // One result + else{ + if(dataTemplate instanceof MobyPrimaryDataSimple){ + return results.elementAt(0); + } + else{ // Collection of 1 + MobyDataObjectSet resultSet = new MobyDataObjectSet(dataTemplate.getName()); + resultSet.add(results.elementAt(0)); + return resultSet; + } + } + } + + /** + * Using the regular expression mappings that have been set up, + * maps a string using rules producing moby objects of the given type. + * Particularly, the regex is assumed to include only ASCII characters at first, + * and the byte-translation of it is checked against the raw data's bytes. + * If no rules match, the raw data is converted to a String, and the regex + * are tried as normal... + * + * The net effect is that you specify magic signatures for file types as regular expression rules, + * and calling this method will match up the file type by byte-wise comparing the data and pattern. + */ + public MobyDataObject[] getMobyObjects(byte[] rawData, MobyDataType targetDataType){ + // Only do the magic check if the target data type inherits from MOBY's base64 class (i.e. might encode binary data) + if(!targetDataType.inheritsFrom(MobyDataType.getDataType(MobyDataBytes.BASE64_DATATYPE))){ + return getMobyObjects(new String(rawData)); + } + + String rawDataAsString = null; + + Vector objectVector = new Vector(); + + for(Pattern pattern: regexMap.keySet()){ + MobyComplexBuilder rule = regexMap.get(pattern); + if(rule.getDataType().inheritsFrom(targetDataType)){ + // Only build the string representation of the byte array if we + // found a rule that applies (since it's a somewhat expensive operation + // to do the conversion) + if(rawDataAsString == null){ + rawDataAsString = bytesToString(rawData); + System.err.println("Start of data is " + rawDataAsString.substring(0, 4)); + } + Matcher matcher = pattern.matcher(rawDataAsString); + + while(matcher.find()){ + System.err.println("Found match for binary data"); + try{ + MobyDataObject mobyObj = rule.apply(matcher, rawData); + if(mobyObj != null){ + objectVector.add(mobyObj); + } + } + catch(MobyException me){ + System.err.println("Could not build Moby object from match:" + me); + me.printStackTrace(); + } + } + } + } + + if(objectVector.size() != 0){ + return (MobyDataObject[]) objectVector.toArray(new MobyDataObject[objectVector.size()]); + } + // Didn't find anything in the raw form, but there was a rule that applies to the data type, so try as a string... + //else if(rawDataAsString != null){ + // return getMobyObjects(new String(rawData)); + //} + else{ + return new MobyDataObject[0]; + } + } + + //Pad out the bytes (8-bit) into chars (16-bits), for regex checking of the data + private String bytesToString(byte[] bytes){ +// return new String(bytes); + StringBuffer stringBuffer = new StringBuffer(bytes.length); + + for(int i = 0; i < bytes.length; i++){ + // Casting byte to char pads it out with a byte e.g. 0x34 become 0x0034 (Unicode 16-bit) + // Do this because regex use unicode, not ASCII + stringBuffer.append((char) bytes[i]); + } + + return stringBuffer.toString(); + } + + /** + * Using the regular expression mappings that have been set up, * maps a string to moby objects. */ public MobyDataObject[] getMobyObjects(String textData){ + return getMobyObjects(textData, (byte[]) null); + } + + public MobyDataObject[] getMobyObjects(String textData, byte[] bytes){ if(regexMap.isEmpty()){ System.out.println("The MOBY Client has not been provided any regex->moby data mappings!"); return new MobyDataObject[0]; @@ -478,7 +713,7 @@ MobyComplexBuilder rule = (MobyComplexBuilder) regexMap.get(pattern); try{ - MobyDataObject mobyObj = rule.apply(matcher); + MobyDataObject mobyObj = rule.apply(matcher, bytes); if(mobyObj != null){ objectVector.add(mobyObj); } @@ -519,7 +754,7 @@ Matcher matcher = pattern.matcher(urlString); while(matcher.find()){ - MobyComplexBuilder rule = (MobyComplexBuilder) regexMap.get(pattern); + MobyComplexBuilder rule = (MobyComplexBuilder) urlRegexMap.get(pattern); try{ MobyDataObject mobyObj = rule.apply(matcher); @@ -771,9 +1006,10 @@ } public void addRegexMapping(String regexp, Map nsRules, String mobyDataType, Map membersMap){ //mobyObj<--mobyNamespaces - //System.out.println("regex addMapping: " + regexp); try{ - Pattern pattern = Pattern.compile(processRegExp(regexp)); + // Pattern.DOTALL to allow ".*" to span multiple lines, also allow comments (# to EOL) and whitespace + // for better readability in the rules file. + Pattern pattern = Pattern.compile(processRegExp(regexp), Pattern.DOTALL | Pattern.COMMENTS); // Base object if(mobyDataType == null || mobyDataType.length() == 0){ @@ -873,6 +1109,7 @@ public void clear(){ xpathMap.clear(); regexMap.clear(); + (new Exception()).printStackTrace(); } public void clearXPaths(){ @@ -881,6 +1118,7 @@ public void clearRegexs(){ regexMap.clear(); + (new Exception()).printStackTrace(); } public void clearURLRegexs(){ @@ -899,5 +1137,19 @@ } //System.out.println("the number of key-value mappings in this map: " + map.size()); } + + /** + * Indicates whether at least one production rule exists for the data type or one of its children. + */ + public boolean canProduceDataTypeFromString(MobyDataType targetDataType){ + //System.err.println("The rules database has " + regexMap.size() + " entries"); + for(MobyComplexBuilder rule: regexMap.values()){ + //System.err.println("Checking regex rule " + rule); + if(rule.getDataType().inheritsFrom(targetDataType)){ + return true; + } + } + return false; + } } From gordonp at dev.open-bio.org Mon Mar 12 14:38:38 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 10:38:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121438.l2CEccIN003516@dev.open-bio.org> gordonp Mon Mar 12 10:38:38 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv3481/src/main/ca/ucalgary/seahawk/services Modified Files: MobyComplexBuilder.java Log Message: Added XPath evaluation to regex rules, and added function to get the returned data type from the rule moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyComplexBuilder.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java 2007/02/08 16:59:58 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java 2007/03/12 14:38:38 1.3 @@ -1,13 +1,13 @@ package ca.ucalgary.seahawk.services; -import org.biomoby.shared.MobyDataType; -import org.biomoby.shared.MobyException; -import org.biomoby.shared.MobyNamespace; -import org.biomoby.shared.MobyRelationship; +import org.biomoby.shared.*; import org.biomoby.shared.data.MobyDataObject; import org.biomoby.shared.data.MobyDataComposite; +import org.w3c.dom.Document; + import javax.xml.xpath.*; +import javax.xml.parsers.*; import javax.xml.namespace.NamespaceContext; import java.util.Iterator; @@ -20,12 +20,26 @@ public class MobyComplexBuilder{ + private static XPathFactory xPathFactory; + private static DocumentBuilder docBuilder; + private Map namespaceRules; private Map memberRules; private MobyDataType mobyDataType; private MobyNamespace[] mobyNS; private MobyRelationship[] children; + static{ + xPathFactory = XPathFactory.newInstance(); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + try{ + docBuilder = dbf.newDocumentBuilder(); + } catch(Exception e){ + e.printStackTrace(); + } + } + public MobyComplexBuilder(String dataType, Map members, Map nameSpaces) throws Exception{ mobyDataType = MobyDataType.getDataType(dataType); // Not an existing Ontology data type @@ -87,6 +101,10 @@ } public MobyDataObject apply(Matcher matcher) throws MobyException{ + return apply(matcher, null); + } + + public MobyDataObject apply(Matcher matcher, byte[] data) throws MobyException{ MobyDataObject mobyObj = null; if(mobyDataType.getName().equals("Object")){ @@ -123,16 +141,87 @@ } } + Document doc = docBuilder.newDocument(); // Set members if available and required if(mobyObj instanceof MobyDataComposite){ if(children != null){ for(int i = 0; i < children.length; i++){ String memberName = children[i].getName(); - String result = (String) memberRules.get(memberName); + String[] resultSpec = (String[]) memberRules.get(memberName); + String result = resultSpec[0]; + byte[] resultBytes = result.getBytes(); + String whitespaceMode = resultSpec[1]; + String encodingMode = resultSpec[2]; + + boolean nonBasic = result.length() != 2 || result.indexOf("$") != 0; + MobyPrefixResolver.MobyNodeList nodeList = new MobyPrefixResolver.MobyNodeList(); // Replace any $0, $1, etc. in the replacement string with the values found in the matcher + // Note that this is not perfect: if you had "$1 $2", and $1 had value "$250", you'd get $250$2, + // then you'd substitute $2's value of "per metre", you'd get "per metre50 per metre" instead of + // "$250 per metre". Not sure of a good way around this yet (i.e. when varValue had $k in it where k > j)... for(int j = 0; j <= matcher.groupCount(); j++){ - result = result.replaceAll("\\$"+j, matcher.group(j)); + // A replaceAll() for binary data + if(data != null){ + (new Exception("Binary replaceAll()")).printStackTrace(); + int srcPos = 0; + for(int varIndex = result.indexOf("\\$"+j, srcPos); + varIndex != -1; + varIndex = result.indexOf("\\$"+j, srcPos)){ + int varValueLength = matcher.end(j)-matcher.start(j)+1; + + byte[] newResultBytes = new byte[resultBytes.length+varValueLength]; + if(varIndex > 0){ + System.arraycopy(resultBytes, 0, newResultBytes, 0, varIndex); + } + System.arraycopy(data, matcher.start(j), newResultBytes, varIndex, varValueLength); + int remaining = result.length()-varIndex-2; + if(remaining > 0){ + System.arraycopy(resultBytes, varIndex+2, newResultBytes, varIndex+varValueLength, + result.length()-varIndex-2); + } + srcPos += varIndex + varValueLength + 1; + resultBytes = newResultBytes; + } + } + // $# substitution in a string, considerably simpler! + else{ + String varValue = matcher.group(j); + if(whitespaceMode.equals(MobyClient.WHITESPACE_ATTR_NORMALIZE_VAL)){ + varValue = varValue.replaceAll("\\s+"," "); + } + else if(whitespaceMode.equals(MobyClient.WHITESPACE_ATTR_STRIP_VAL)){ + varValue = varValue.replaceAll("\\s+",""); + } + result = result.replaceAll("\\$"+j, varValue); + + // Binary data and XPath are incompatible, since many bytes are not allowed in XML + // so only create the node list if not Base64 encoding + nodeList.add(doc.createTextNode(result)); + } } + + if(encodingMode.equals(MobyClient.ENCODING_ATTR_BASE64_VAL)){ + (new Exception("Base 64 encoding")).printStackTrace(); + result = org.apache.axis.encoding.Base64.encode(data == null ? result.getBytes() : resultBytes); + } + else{ + System.err.println("NO BASE64 (" + MobyClient.ENCODING_ATTR_BASE64_VAL + + ") ENCODING for " +memberName+": " + encodingMode); + } + + // If the value contains anything other than $#, treat it as a XPath expression + // to be evaluated on a text node containing the result value + if(nonBasic && data == null){ + XPath xpath = xPathFactory.newXPath(); + try{ + result = xpath.evaluate(result, nodeList); + }catch(Exception e){ + e.printStackTrace(); + throw new MobyException("Could not evaluate result of XPath expression for object member " + + memberName + " (" + result + "): " + e); + } + } + ((MobyDataComposite) mobyObj).put(memberName, MobyDataObject.createInstanceFromString(children[i].getDataTypeName(), result)); } @@ -143,7 +232,7 @@ } public MobyDataObject applyXPath(Object result, NamespaceContext nsContext) throws MobyException, XPathExpressionException{ - XPath xpath = XPathFactory.newInstance().newXPath(); + XPath xpath = xPathFactory.newXPath(); xpath.setNamespaceContext(nsContext); MobyDataObject mobyObj = null; @@ -184,7 +273,7 @@ if(children != null){ for(int i = 0; i < children.length; i++){ String memberName = children[i].getName(); - String expr = (String) memberRules.get(memberName); + String expr = ((String[]) memberRules.get(memberName))[0]; String value = xpath.evaluate(expr, result); ((MobyDataComposite) mobyObj).put(memberName, @@ -195,4 +284,12 @@ return mobyObj; } + + /** + * Reports the data type of the objects returned by matched rules. + */ + public MobyDataType getDataType(){ + //System.err.println("Returning data type of " + mobyDataType.getName()); + return mobyDataType; + } } From gordonp at dev.open-bio.org Mon Mar 12 16:57:30 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 12:57:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121657.l2CGvUh2004230@dev.open-bio.org> gordonp Mon Mar 12 12:57:30 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service In directory dev.open-bio.org:/tmp/cvs-serv4195/src/main/org/biomoby/service Modified Files: MobyServlet.java Log Message: Updates to base service for better extensibility moby-live/Java/src/main/org/biomoby/service MobyServlet.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/MobyServlet.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/service/MobyServlet.java 2007/02/08 16:59:58 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/MobyServlet.java 2007/03/12 16:57:30 1.6 @@ -77,7 +77,7 @@ protected boolean isDebug = false; public void doGet(HttpServletRequest request, - HttpServletResponse response) + HttpServletResponse response) throws ServletException, java.io.IOException{ if(thisService == null){ try{ @@ -1142,9 +1142,10 @@ } MobyServlet servlet = new MobyServlet(); + ClassLoader classLoader = servlet.getClass().getClassLoader(); try{ // This line can throw many different exception if you didn't get the class right! - Class servletClass = servlet.getClass().getClassLoader().loadClass(args[0]); + Class servletClass = classLoader.loadClass(args[0]); if(servletClass == null){ System.err.println("The Class to test (" + args[0] + ") was not found"); System.err.println("Assuming you don't want to run a servlet test, executing main() method from subclass"); @@ -1189,7 +1190,14 @@ MobyContentInstance testResults = new MobyContentInstance(); // Configure the service, minimally, to check the input data - servlet.init(new TestServletConfig(args[0], new TestServletContext())); + java.net.URL webXMLURL = classLoader.getResource("WEB-INF/web.xml"); + if(webXMLURL == null){ + System.err.println("No WEB-INF/web.xml, assuming you don't need any of its settings for the servlet to work!"); + servlet.init(new TestServletConfig(args[0], new TestServletContext())); + } + else{ + servlet.init(new TestServletConfig(new TestServletContext(), webXMLURL)); + } servlet.thisService = servlet.createServiceFromConfig(null); // It should populate the testResults @@ -1210,7 +1218,7 @@ for(ServiceException se: testResults.getExceptions()){ se.printStackTrace(); } - throw new Exception("Executing service " + args[0] + " cause exceptions"); + throw new Exception("Executing service " + args[0] + " caused exceptions"); } else{ System.out.println(testResults.toString()); From gordonp at dev.open-bio.org Mon Mar 12 16:57:30 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 12:57:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121657.l2CGvUK2004256@dev.open-bio.org> gordonp Mon Mar 12 12:57:30 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test In directory dev.open-bio.org:/tmp/cvs-serv4195/src/main/org/biomoby/service/test Modified Files: MobyServletTestCase.java ServletTester.java TestServletConfig.java Log Message: Updates to base service for better extensibility moby-live/Java/src/main/org/biomoby/service/test MobyServletTestCase.java,1.2,1.3 ServletTester.java,1.1,1.2 TestServletConfig.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/MobyServletTestCase.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/service/test/MobyServletTestCase.java 2006/12/07 16:37:36 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/MobyServletTestCase.java 2007/03/12 16:57:30 1.3 @@ -22,6 +22,7 @@ public class MobyServletTestCase extends TestCase{ private final static String TEST_MOBY_XML = "org/biomoby/service/test/mobyAASeq.xml"; private final static String SERVLET_TEST_URL = "http://moby.ucalgary.ca:8089/MobyServlet"; + private final static String TEST_MAIN_CLASS_NAME = "org.biomoby.service.test.ConvertAAtoFASTA_AA"; /** * @param name Test case name. */ @@ -29,18 +30,6 @@ super(name); } - /** - * Sets up the test fixture. - * Called before every test case method. - */ - protected void setUp() throws Exception{ - super.setUp(); - } - - protected void tearDown() throws Exception{ - super.tearDown(); - } - protected URL getExampleURL(){ URL testDataURL = getClass().getClassLoader().getResource(TEST_MOBY_XML); if(testDataURL == null){ @@ -50,16 +39,54 @@ return testDataURL; } + /** + * Override this method to run the main method of more specific servlets + * you want to test (e.g. ACDServlet overrides this and specifies itself + * as the class to test). + */ + protected String getExampleClass(){ + return TEST_MAIN_CLASS_NAME; + } + + /** + * Override this method to run the main method of more specific servlets + * you want to test (e.g. ACDServlet overrides this and specifies itself + * as the class to test). + */ + protected String getExampleServlet(){ + return SERVLET_TEST_URL; + } + public void testMain() throws Exception{ // Should execute main URL testDataURL = getExampleURL(); + String className = getExampleClass(); + + // Use reflection to load the class whose main method should be called + // TODO: Maybe we should check that it inherits from MobyServlet first? + Class targetClass = null; + try { + targetClass = Class.forName(className); + } catch(Exception e){ + e.printStackTrace(); + fail("Could not find class load " + className + ": " + e); + } + + java.lang.reflect.Method mainMethod = null; + try{ + mainMethod = targetClass.getMethod("main", new Class[] {String[].class}); + } catch(Exception e){ + e.printStackTrace(); + fail("Could not find main method in class " + className + ": " + e); + } MobyServlet.setMainTerminationExit(false); + String[] args = new String[]{className, testDataURL.toString()}; try{ - ConvertAAtoFASTA_AA.main(new String[]{"org.biomoby.service.test.ConvertAAtoFASTA_AA",testDataURL.toString()}); + mainMethod.invoke(null, new Object[]{args}); } catch(Exception e){ e.printStackTrace(); - fail("Main method for org.biomoby.service.test.ConvertAAtoFASTA_AA had an exception"); + fail("Main method for " + className + " had an exception: " +e); } // Should execute subclass main @@ -210,7 +237,7 @@ public void testServletTester(){ try{ - ServletTester.main(new String[]{SERVLET_TEST_URL, "ignored"}); + ServletTester.main(new String[]{getExampleServlet(), getExampleURL().toString()}); } catch(Exception e){ e.printStackTrace(); fail("Could not run servlet tester successfully: " + e); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/ServletTester.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/service/test/ServletTester.java 2006/12/06 16:07:10 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/ServletTester.java 2007/03/12 16:57:30 1.2 @@ -1,7 +1,9 @@ /** + * This class is used by the MobyServlet framework + * to test a deployed service, and register it with MOBY Central. * This is the simplest Java MOBY client you can have. A fully documented version - * is available in the TestRequest class, with all the proper error checking. + * of a client is available in the TestRequest class, with all the proper error checking. */ package org.biomoby.service.test; @@ -14,8 +16,9 @@ import org.w3c.dom.*; import javax.xml.parsers.*; +import java.net.URL; import java.util.*; -import java.io.FileInputStream; +import java.io.*; public class ServletTester{ public static void main(String[] args) throws Exception{ @@ -46,49 +49,17 @@ String testServiceClassName = null; String inParams = null; String outParams = null; - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(false); - DocumentBuilder docBuilder = dbf.newDocumentBuilder(); - - Element docRoot = null; - try{ - docRoot = docBuilder.parse(webXmlURL.openStream()).getDocumentElement(); - if(docRoot == null || !docRoot.getNodeName().equals("web-app")){ - System.err.println("Could not find /web-app tag in " + - webXmlURL + ", aborting!"); - throw new Exception("Invalid web.xml, no web-app tag"); - } - } catch(Exception e){ - System.err.println("There appears to be a problem with the \"WEB-INF/web.xml\" file (XML syntax?)." + - "While parsing it I encountered the error: " + e); - e.printStackTrace(); - throw new Exception("Unparseable web.xml"); - } - Element servletNode = getChildElement(docRoot, "servlet"); - if(servletNode == null){ - System.err.println("Could not find /web-app/servlet/ tag in " + - webXmlURL + ", aborting!"); - throw new Exception("Invalid web.xml, no servlet tag"); - } - Element servletName = getChildElement(servletNode, "servlet-name"); - if(servletName == null){ - System.err.println("Could not find /web-app/servlet/servlet-name tag in " + - webXmlURL + ", aborting!"); - throw new Exception("Invalid web.xml, no servlet-name tag"); - } - Element servletClassName = getChildElement(servletNode, "servlet-class"); - if(servletClassName == null){ - System.err.println("Could not find /web-app/servlet/servlet-class tag in " + - webXmlURL + ", aborting!"); - throw new Exception("Invalid web.xml, no servlet-class tag"); - } + // Parse the web.xml config to set the servlet environment + TestServletConfig servletConfig = new TestServletConfig(new TestServletContext(), + webXmlURL); MobyServlet servlet = null; try{ // This line can throw many different exception if you didn't get the class right! - Class servletClass = MobyServlet.class.getClassLoader().loadClass(servletClassName.getTextContent()); + Class servletClass = MobyServlet.class.getClassLoader().loadClass(servletConfig.getServletClassName()); if(servletClass == null){ - throw new ClassNotFoundException("The servlet Class to run (" + servletClassName.getTextContent() + + throw new ClassNotFoundException("The servlet Class to run (" + + servletConfig.getServletClassName() + ") was not found, please ensure the web.xml is up-to-date."); } servlet = (MobyServlet) servletClass.newInstance(); @@ -98,16 +69,16 @@ throw new Exception("Invalid web.xml, the servlet-class tag was not useable"); } - // TODO: should properly parse the web.xml config - servlet.init(new TestServletConfig(servletName.getTextContent(), new TestServletContext())); + servlet.init(servletConfig); TestHttpServletRequest request = new TestHttpServletRequest(); request.setRequestURL(args[0]); MobyService testService = servlet.createServiceFromConfig(request); - // When we GET this URL, the RDF is returned + // When we GET this URL, the RDF is returned, populated with all the pertinent data for registration if(args.length != 3 || !("register_permanent".equals(args[2]))){ testService.setSignatureURL(null); //signature not set == MOBY agent, please delete this service if requested! } + // Otherwise we keep the signature URL that servlet.createServiceFromConfig() generated // Setup communication with MOBY Central Central worker = null; @@ -127,11 +98,18 @@ MobyContentInstance testData = null; MobyData[] inputTypes = testService.getPrimaryInputs(); if(inputTypes.length > 0){ - FileInputStream dataIn = null; + InputStream dataIn = null; try{ dataIn = new FileInputStream(args[1]); } catch(Exception e){ - e.printStackTrace(); + System.err.println("The specified resource " + args[1] + " is not a file, trying as a URL"); + } + if(dataIn == null){ + try{ + dataIn = (new URL(args[1])).openStream(); + } catch(Exception e){ + e.printStackTrace(); + } } if(dataIn == null){ System.err.println("Could not read example data file \"" + args[1] + "\", aborting!"); @@ -203,24 +181,4 @@ // TO DO: check RDF discrepancies? System.err.println("Service Successfully Unregistered!"); } - - public static Element getChildElement(Element parent, String elementName){ - if(elementName == null || parent == null){ - return null; - } - - NodeList children = parent.getChildNodes(); - for(int i = 0; children != null && i < children.getLength(); i++){ - // Make sure it's an element, not a processing instruction, text, etc. - if(!(children.item(i) instanceof Element)){ - continue; - } - Element child = (Element) children.item(i); - // Make sure it has the right name, or wildcard - if(elementName.equals(child.getTagName())){ - return child; - } - } - return null; - } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/TestServletConfig.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/service/test/TestServletConfig.java 2006/12/06 16:07:10 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/TestServletConfig.java 2007/03/12 16:57:30 1.2 @@ -8,6 +8,10 @@ package org.biomoby.service.test; +import org.biomoby.shared.MobyPrefixResolver; +import org.w3c.dom.*; + +import javax.xml.parsers.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.*; @@ -15,6 +19,7 @@ public class TestServletConfig implements ServletConfig{ private String name = null; + private String className = null; private Hashtable initParams = new Hashtable(); private ServletContext context = null; @@ -23,6 +28,66 @@ context = cont; } + public TestServletConfig(ServletContext cont, java.net.URL u) throws Exception{ + context = cont; + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + DocumentBuilder docBuilder = dbf.newDocumentBuilder(); + + Element docRoot = null; + try{ + docRoot = docBuilder.parse(u.openStream()).getDocumentElement(); + if(docRoot == null || !docRoot.getNodeName().equals("web-app")){ + throw new Exception("Invalid web.xml (" + u + "), no root web-app tag"); + } + } catch(Exception e){ + throw new Exception("There appears to be a problem with the \"WEB-INF/web.xml\" file (" + + u + ", XML syntax?).\n" + + "While parsing it I encountered the error: " + e); + } + + Element servletNode = MobyPrefixResolver.getChildElement(docRoot, "servlet"); + if(servletNode == null){ + System.err.println("Could not find /web-app/servlet/ tag in " + + u + ", aborting!"); + throw new Exception("Invalid web.xml (" + u +"), no servlet tag"); + } + Element servletName = MobyPrefixResolver.getChildElement(servletNode, "servlet-name"); + if(servletName == null){ + System.err.println("Could not find /web-app/servlet/servlet-name tag in " + + u + ", aborting!"); + throw new Exception("Invalid web.xml (" + u +"), no servlet-name tag"); + } + name = servletName.getTextContent(); + if(name.length() == 0){ + throw new Exception("Invalid web.xml (" + u +"), servlet-name tag is blank (cannot have nameless servlet)"); + } + + Element servletClassName = MobyPrefixResolver.getChildElement(servletNode, "servlet-class"); + if(servletClassName == null){ + System.err.println("Could not find /web-app/servlet/servlet-class tag in " + + u + ", aborting!"); + throw new Exception("Invalid web.xml (" + u + "), no servlet-class tag"); + } + className = servletClassName.getTextContent(); + if(className.length() == 0){ + throw new Exception("Invalid web.xml (" + u +"), servlet-class tag is blank (cannot have nameless class)"); + } + + NodeList paramNodes = docRoot.getElementsByTagName("context-param"); + for(int i = 0; i < paramNodes.getLength(); i++){ + Element paramNameTag = MobyPrefixResolver.getChildElement((Element) paramNodes.item(i), "param-name"); + Element paramValueTag = MobyPrefixResolver.getChildElement((Element) paramNodes.item(i), "param-value"); + if(paramNameTag == null || paramValueTag == null){ + System.err.println("Skipping context parameter #" + (i+1) + + " because of undefined param-name or param-value tag"); + continue; + } + addInitParameter(paramNameTag.getTextContent(), paramValueTag.getTextContent()); + } + } + public String getInitParameter(String name){ return (String) initParams.get(name); } @@ -42,4 +107,9 @@ public String getServletName(){ return name; } + + public String getServletClassName(){ + return className; + } + } From gordonp at dev.open-bio.org Mon Mar 12 16:58:48 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 12:58:48 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121658.l2CGwmIR004326@dev.open-bio.org> gordonp Mon Mar 12 12:58:48 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv4291/src/main/org/biomoby/shared Modified Files: MobyPrefixResolver.java Log Message: Doc updates, made node list class static for use externally moby-live/Java/src/main/org/biomoby/shared MobyPrefixResolver.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.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/shared/MobyPrefixResolver.java 2006/10/26 01:32:06 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.java 2007/03/12 16:58:48 1.8 @@ -18,6 +18,9 @@ * Using this class is the only way to compile XPaths that are independent * of the namespace declarations in the document (since those are the default ones * used by XPath evaluators). + * + * NOTE: the methods of this class rely on the DOM being parsed with a namespace-aware + * parser! */ public class MobyPrefixResolver implements PrefixResolver{ @@ -77,7 +80,7 @@ /** * Convenience method that matches child elements in the MOBY namespace or, for now * at least, with no declared namespace. "*" acts as a wildcard. - * @return the list of children, or null if either the elemtn or name is null does not exist + * @return the list of children, or null if either the element or name is null does not exist */ public static NodeList getChildElements(org.w3c.dom.Element e, String elementName){ if(elementName == null || e == null){ @@ -109,7 +112,7 @@ return matches; } - static class MobyNodeList implements NodeList{ + public static class MobyNodeList implements NodeList{ private Vector nodes; public MobyNodeList(){nodes = new Vector();} public int getLength(){return nodes.size();} From gordonp at dev.open-bio.org Mon Mar 12 17:00:33 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 13:00:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121700.l2CH0XWt004445@dev.open-bio.org> gordonp Mon Mar 12 13:00:33 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv4410/src/main/org/biomoby/shared Modified Files: MobyService.java Log Message: Added ability to delete inputs and outputs, also made get method for outputs downcasted moby-live/Java/src/main/org/biomoby/shared MobyService.java,1.15,1.16 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2006/11/11 23:04:34 1.15 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2007/03/12 17:00:33 1.16 @@ -297,6 +297,11 @@ rdf = (value == null ? "" : value); } + /** + * Adds an array of input parameter to the service. + * NOTE: the "set" is a bit of a misnomer: parameters will be added to the existing list. + * To clear the existing list of parameters, call this finction with 'null' first. + */ public void setInputs (MobyData[] value) { if (value == null) { primaryInputs.clear(); @@ -304,35 +309,83 @@ } else { for (int i = 0 ; i < value.length; i++) { if (value[i].isPrimary()) - primaryInputs.addElement (value[i]); + addOrReplaceData(primaryInputs, value[i]); else - secondaryInputs.addElement (value[i]); + addOrReplaceData(secondaryInputs, value[i]); } } } public void addInput (MobyData value) { if (value != null) { if (value.isPrimary()) - primaryInputs.addElement (value); + addOrReplaceData(primaryInputs, value); else - secondaryInputs.addElement (value); + addOrReplaceData(secondaryInputs, value); } } + public void removeInput(MobyData value) { + if (value != null) { + if (value.isPrimary()) + removeData(primaryInputs, value); + else + removeData(secondaryInputs, value); + } + } + + private void addOrReplaceData(Vector vector, MobyData value){ + for(int i = 0; i < vector.size(); i++){ + // Replace an existing parameter with the same name + if(vector.elementAt(i).getName().equals(value.getName())){ + vector.removeElementAt(i); + vector.insertElementAt(value, i); + return; + } + } + // Isn't a replacement, add to the end + vector.addElement(value); + } + + private void removeData(Vector vector, MobyData value){ + for(int i = 0; i < vector.size(); i++){ + // Remove an existing parameter with the same name + if(vector.elementAt(i).getName().equals(value.getName())){ + vector.removeElementAt(i--); + } + } + } + + /** + * Adds an array of output parameter to the service. + * NOTE: Unless the parameter is Primary, it will be ignored. + * ALSO NOTE: the "set" is a bit of a misnomer: parameters will be added to the existing list. + * To clear the existing list of parameters, call this finction with 'null' first. + */ public void setOutputs (MobyData[] value) { if (value == null) { primaryOutputs.clear(); } else { for (int i = 0 ; i < value.length; i++) { if (value[i].isPrimary()) - primaryOutputs.addElement (value[i]); + addOrReplaceData(primaryOutputs, value[i]); } } } + + /** + * Adds an output parameter to the service. NOTE: Unless the parameter is Primary, it will be ignored. + */ public void addOutput (MobyData value) { if (value != null) { if (value.isPrimary()) - primaryOutputs.addElement (value); + addOrReplaceData(primaryOutputs, value); + } + } + + public void removeOutput (MobyData value) { + if (value != null) { + if (value.isPrimary()) + removeData(primaryOutputs, value); } } @@ -352,9 +405,9 @@ } } - public MobyData[] getPrimaryOutputs() { + public MobyPrimaryData[] getPrimaryOutputs() { synchronized (primaryOutputs) { - MobyData[] results = new MobyData [primaryOutputs.size()]; + MobyPrimaryData[] results = new MobyPrimaryData [primaryOutputs.size()]; primaryOutputs.copyInto (results); return results; } From gordonp at dev.open-bio.org Mon Mar 12 17:01:29 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 13:01:29 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121701.l2CH1TEW004513@dev.open-bio.org> gordonp Mon Mar 12 13:01:29 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv4478/src/main/org/biomoby/shared/data Modified Files: MobyDataBytes.java Log Message: Chaged to a complex rather than string, as this is more correct moby-live/Java/src/main/org/biomoby/shared/data MobyDataBytes.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataBytes.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/shared/data/MobyDataBytes.java 2006/07/07 04:12:40 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataBytes.java 2007/03/12 17:01:29 1.5 @@ -2,6 +2,7 @@ package org.biomoby.shared.data; import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.MobyException; import java.io.*; /** @@ -9,17 +10,20 @@ * binary data that will be Base64 encoded to fit in the MOBY XML envelope. * It will also decode Base64 and UUEncoded strings. * - * Because getObject() returns a reference to the underlying byte array - * for the MOBY Object, the object content can be modified by changing - * members of this array. + * All members of the object can be accessed as they normally would be in + * a MobyDataComposite (including the Base64 representation of the bytes in the "contents" member), + * but the getBytes() and getObject() method, for + * convenience, return the bytes encoded by the "contents" member of the class. + * + * Note: changing the "contents" member's underlying StringBuffer changes the byte output! * * This class could be used to handle a JPEG's raw data for example. */ -public class MobyDataBytes extends MobyDataObject{ +public class MobyDataBytes extends MobyDataComposite{ - private byte[] bytes; - public static String BASE64_DATATYPE = "text-base64"; + public static final String BASE64_DATATYPE = "text-base64"; + public static final String ENCODED_MEMBER_NAME = "contents"; /** How much is read from a input stream (e.g. file) at once */ public static final int BYTE_READ_SIZE = 4096; @@ -27,21 +31,57 @@ /** * Construct the object using a DOM fragment. * - * @throws IllegalArgumentException if the element is not a text-base64 tag + * @throws IllegalArgumentException if the element is not a text-base64 tag, or doesn't inherit from it */ - public MobyDataBytes(org.w3c.dom.Element element) throws IllegalArgumentException{ - this(getName(element), getTextContents(element)); + public MobyDataBytes(org.w3c.dom.Element element) throws MobyException{ + super(MobyDataType.getDataType(BASE64_DATATYPE), getName(element)); setId(getId(element)); addNamespace(getNamespace(element)); + + MobyDataType inputDataType = MobyDataType.getDataType(element.getLocalName()); + if(!inputDataType.inheritsFrom(MobyDataType.getDataType(BASE64_DATATYPE))){ + throw new MobyException("The given tag ("+ element.getLocalName() + + ") does not inherit from " + BASE64_DATATYPE + + " in the MOBY Object Class Ontology, cannot " + + "consider its contents as binary data"); + } + setDataType(inputDataType); + + // Now, we know we have one field that represents the bytes, + // and there may be others which we will treat as regular composite members + populateMembersFromDOM(element); + + MobyDataObject contents = get(ENCODED_MEMBER_NAME); + if(!(contents instanceof MobyDataString)){ + throw new MobyException("The encoded binary member (" + ENCODED_MEMBER_NAME + + ") of the given element (" + + element.getLocalName()+ + ") was not a String primitive as expected"); + } } /** * C-tor to use when you have binary data to encode + * + * @throws MobyException if the data provided is null, or could not be encoded(?!) */ - public MobyDataBytes(String name, byte[] data){ - super(name); - setDataType(MobyDataType.getDataType(BASE64_DATATYPE)); - bytes = data; + public MobyDataBytes(String name, byte[] data) throws MobyException{ + super(MobyDataType.getDataType(BASE64_DATATYPE), name); + storeBytes(data); + } + + /** + * C-tor to use when you have binary data to encode + */ + public MobyDataBytes(String name, byte[] data, MobyDataType inputDataType) throws MobyException{ + this(name, data); + if(!inputDataType.inheritsFrom(MobyDataType.getDataType(BASE64_DATATYPE))){ + throw new MobyException("The given data type ("+ inputDataType.getName() + + ") does not inherit from " + BASE64_DATATYPE + + " in the MOBY Object Class Ontology, cannot " + + "consider the data given as binary data"); + } + setDataType(inputDataType); } /** @@ -50,11 +90,26 @@ * Currently Base64 encoding is acceptable, UU Decoding has yet to be implemented.. */ public MobyDataBytes(String name, CharSequence data){ - super(name); + super(MobyDataType.getDataType(BASE64_DATATYPE), name); setDataType(MobyDataType.getDataType(BASE64_DATATYPE)); - if(data != null){ - bytes = org.apache.axis.encoding.Base64.decode(data.toString()); + // TODO: add check that the data is valid Base64 format! + put(ENCODED_MEMBER_NAME, new MobyDataString(ENCODED_MEMBER_NAME, data)); + } + + /** + * C-tor to use when you have received text-encoded binary. + * + * Currently Base64 encoding is acceptable, UU Decoding has yet to be implemented.. + */ + public MobyDataBytes(String name, CharSequence data, MobyDataType inputDataType) throws MobyException{ + this(name, data); + if(!inputDataType.inheritsFrom(MobyDataType.getDataType(BASE64_DATATYPE))){ + throw new MobyException("The given data type ("+ inputDataType.getName() + + ") does not inherit from " + BASE64_DATATYPE + + " in the MOBY Object Class Ontology, cannot " + + "consider the data given as binary data"); } + setDataType(inputDataType); } /** @@ -62,14 +117,40 @@ * * @param resourceURL the URL of the resource to encode, such as "file:..." or "http:..." */ - public MobyDataBytes(String name, java.net.URL resourceURL) throws IOException{ - super(name); - setDataType(MobyDataType.getDataType(BASE64_DATATYPE)); + public MobyDataBytes(String name, java.net.URL resourceURL) throws MobyException, IOException{ + super(MobyDataType.getDataType(BASE64_DATATYPE), name); if(resourceURL == null){ return; } InputStream inputStream = resourceURL.openStream(); - bytes = readStream(inputStream); + storeBytes(readStream(inputStream)); + } + + protected void storeBytes(byte[] bytes) throws MobyException{ + if(bytes == null){ + throw new MobyException("The given byte data to Base64 encode was null"); + } + String contents = org.apache.axis.encoding.Base64.encode(bytes); + if(contents == null){ + throw new MobyException("The byte contents could not be encoded in Base64 format"); + } + put(ENCODED_MEMBER_NAME, new MobyDataString(ENCODED_MEMBER_NAME, contents)); + } + + /** + * C-tor to use when you want to encode a resource, such as an image file. + * + * @param resourceURL the URL of the resource to encode, such as "file:..." or "http:..." + */ + public MobyDataBytes(String name, java.net.URL resourceURL, MobyDataType inputDataType) throws IOException, MobyException{ + this(name, resourceURL); + if(!inputDataType.inheritsFrom(MobyDataType.getDataType(BASE64_DATATYPE))){ + throw new MobyException("The given data type ("+ inputDataType.getName() + + ") does not inherit from " + BASE64_DATATYPE + + " in the MOBY Object Class Ontology, cannot " + + "consider the data at the given URL as binary data"); + } + setDataType(inputDataType); } protected byte[] readStream(InputStream in) throws IOException { @@ -92,39 +173,20 @@ * file savers, etc. */ public java.io.InputStream getInputStream(){ - return new java.io.ByteArrayInputStream(bytes); + return new java.io.ByteArrayInputStream(getBytes()); } /** * @return byte[] representing the (mutable) underlying data in this object */ public Object getObject(){ - return bytes; + return getBytes(); } /** * The same as getObject, but doesn't require a cast of the result */ public byte[] getBytes(){ - return bytes; - } - - /** - * This method base64 encodes the binary data held in this MOBY Object - * if in service mode. - */ - public String toXML(){ - if(xmlMode == MobyDataInstance.SERVICE_XML_MODE){ - StringBuffer out = new StringBuffer(); - out.append(""); - if(bytes != null){ - out.append(org.apache.axis.encoding.Base64.encode(bytes)); - } - out.append(""); - return out.toString(); - } - else{ - return super.toXML(); - } - } + return org.apache.axis.encoding.Base64.decode(((MobyDataString) get(ENCODED_MEMBER_NAME)).getValue()); + } } From gordonp at dev.open-bio.org Mon Mar 12 17:02:30 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 13:02:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121702.l2CH2Uf1004577@dev.open-bio.org> gordonp Mon Mar 12 13:02:30 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv4542/src/main/org/biomoby/shared/data Modified Files: MobyDataComposite.java Log Message: Slightly refactoring of DOM parsing so child classes can use it too (e.g. MobyDataBytes) moby-live/Java/src/main/org/biomoby/shared/data MobyDataComposite.java,1.11,1.12 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.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/shared/data/MobyDataComposite.java 2007/01/23 19:36:25 1.11 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java 2007/03/12 17:02:30 1.12 @@ -34,6 +34,10 @@ public MobyDataComposite(org.w3c.dom.Element element) throws MobyException{ this(MobyDataType.getDataType(element.getLocalName()), getName(element), getNamespace(element), getId(element)); + populateMembersFromDOM(element); + } + + protected void populateMembersFromDOM(org.w3c.dom.Element element) throws MobyException{ // Decompose the children org.w3c.dom.NodeList substructures = MobyPrefixResolver.getChildElements(element, "*"); //wildcard int numSubstructures = substructures.getLength(); From gordonp at dev.open-bio.org Mon Mar 12 17:03:24 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 13:03:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121703.l2CH3ObW004662@dev.open-bio.org> gordonp Mon Mar 12 13:03:24 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv4627/src/main/org/biomoby/shared/data Modified Files: MobyDataObject.java Log Message: Added special case for Base64 encoded data to create MobyDataBytes objects moby-live/Java/src/main/org/biomoby/shared/data MobyDataObject.java,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java 2006/12/13 23:15:58 1.13 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java 2007/03/12 17:03:24 1.14 @@ -113,10 +113,11 @@ else if(MobyTags.MOBYDATETIME.equals(typeName)){ return new MobyDataDateTime("", value); } - else if("text-base64".equals(typeName)){ - return new MobyDataBytes("", value); - } else{ + MobyDataType type = MobyDataType.getDataType(typeName); + if(type != null && type.inheritsFrom(MobyDataBytes.BASE64_DATATYPE)){ + return new MobyDataBytes("", value, type); + } throw new MobyException("Attempted to construct a data instance from a string " + "value for a non-primitive data type (" + typeName + ")"); } @@ -172,9 +173,6 @@ else if(MobyTags.MOBYDATETIME.equals(objectClass)){ return new MobyDataDateTime(objectTag); } - else if("text-base64".equals(objectClass)){ - return new MobyDataBytes(objectTag); - } else if(MobyTags.COLLECTION.equals(objectClass)){ return new MobyDataObjectSet(objectTag); } @@ -182,8 +180,15 @@ return new MobyDataSecondaryInstance(objectTag); } // Must otherwise be a composite - else{ - return new MobyDataComposite(objectTag); + else{ + MobyDataType type = MobyDataType.getDataType(objectClass); + // Treat base64-encoded binary data as a special case, as we have a convenience class for it + if(type != null && type.inheritsFrom(MobyDataType.getDataType(MobyDataBytes.BASE64_DATATYPE))){ + return new MobyDataBytes(objectTag); + } + else{ + return new MobyDataComposite(objectTag); + } } } From gordonp at dev.open-bio.org Mon Mar 12 17:05:15 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 13:05:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121705.l2CH5FpJ004767@dev.open-bio.org> gordonp Mon Mar 12 13:05:14 EDT 2007 Update of /home/repository/moby/moby-live/Java/xmls/servlet In directory dev.open-bio.org:/tmp/cvs-serv4732/xmls/servlet Modified Files: build.xml Log Message: Added trailing slash to servlet URL, also fixed doc typo moby-live/Java/xmls/servlet build.xml,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/servlet/build.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/xmls/servlet/build.xml 2006/12/11 18:36:07 1.3 +++ /home/repository/moby/moby-live/Java/xmls/servlet/build.xml 2007/03/12 17:05:14 1.4 @@ -13,7 +13,7 @@ 3. ant test 4. ant war 5. Deploy the WAR file to your servlet container - 6. ant register + 6. ant registerService __________________________________________________________ @@ -223,7 +223,7 @@ - + @@ -234,7 +234,7 @@ - + @@ -245,7 +245,7 @@ - + From gordonp at dev.open-bio.org Mon Mar 12 17:57:51 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 13:57:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121757.l2CHvpVQ005028@dev.open-bio.org> gordonp Mon Mar 12 13:57:51 EDT 2007 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv4993/docs Modified Files: deployingServicesBasic.html Log Message: Added trailing slash to servlet URL moby-live/Java/docs deployingServicesBasic.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/deployingServicesBasic.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/deployingServicesBasic.html 2006/12/11 19:02:01 1.1 +++ /home/repository/moby/moby-live/Java/docs/deployingServicesBasic.html 2007/03/12 17:57:51 1.2 @@ -213,7 +213,7 @@ A testing client program is automagically included in your WAR, so type (with the fully qualified host name, and change 8080 appropriately if you had follow Step 0): -
java -jar ConvertAAtoFASTA_AA.war http://your.servlet.host:8080/ConvertAAtoFASTA_AA mobyAASeq.xml
+
java -jar ConvertAAtoFASTA_AA.war http://your.servlet.host:8080/ConvertAAtoFASTA_AA/ mobyAASeq.xml
If the service fails, a useful error message should be printed to help you diagnose the problem. This would usually be an incorrect web.xml, or the data type you return isn't what you declared (this is the first occasion your output is thoroughly checked). @@ -227,7 +227,7 @@ (no errors or faults, a real object is returned), you're ready to register your service with MobyCentral so anyone can use it. To do this, simply do the previous command, with an extra argument: -
java -jar ConvertAAtoFASTA_AA.war http://your.servlet.host:8080/ConvertAAtoFASTA_AA mobyAASeq.xml register
+
java -jar ConvertAAtoFASTA_AA.war http://your.servlet.host:8080/ConvertAAtoFASTA_AA/ mobyAASeq.xml register

This will run the service to make sure it works, then register it with MOBY Central. You'll see @@ -243,7 +243,7 @@

Since it isn't useful for everyone who uses this tutorial to host this service, please unregister it now with the following command: -

java -jar ConvertAAtoFASTA_AA.war http://your.servlet.host:8080/ConvertAAtoFASTA_AA unregister
+
java -jar ConvertAAtoFASTA_AA.war http://your.servlet.host:8080/ConvertAAtoFASTA_AA/ unregister

You should get "Service Successfully Unregistered!" if it worked.

@@ -320,7 +320,7 @@
Paul Gordon
-Last modified: Wed Dec 6 08:36:43 MST 2006 +Last modified: Thu Feb 22 09:20:25 MST 2007 From gordonp at dev.open-bio.org Mon Mar 12 18:51:35 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 14:51:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121851.l2CIpZL0005196@dev.open-bio.org> gordonp Mon Mar 12 14:51:35 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util In directory dev.open-bio.org:/tmp/cvs-serv5161/src/main/ca/ucalgary/services/util Modified Files: ACDFile.java Log Message: Added fix to parse variable blocks in ACD files (e.g. emma) moby-live/Java/src/main/ca/ucalgary/services/util ACDFile.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/10 00:33:16 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/12 18:51:35 1.4 @@ -206,7 +206,7 @@ for(line = reader.readLine(); line != null; line = reader.readLine()){ if(line.matches("^\\s*]")){ if(subsection){ - System.err.println("Ignoring subsection:\n" + blockText.toString()); + //System.err.println("Ignoring subsection:\n" + blockText.toString()); break; // ignore subsection specifications (MOBY 2ndary params don't hav'em) } Map block = acdBlockToTagValuePairs(blockText.toString()); @@ -218,6 +218,11 @@ blockText.append(line+"\n"); } } + else if(line.matches("^\\s*variable:\\s*\\S+\\s+\".*\"\\s*$")){ + // Ignore variable declarations (for the moment) + // since EMBOSS will figure out their values for itself, + // they are not passed in + } else if(line.matches("^\\s*endsection:\\s*\\S+")){ // ignore subsection info } From gordonp at dev.open-bio.org Mon Mar 12 18:51:35 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 12 Mar 2007 14:51:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703121851.l2CIpZrR005216@dev.open-bio.org> gordonp Mon Mar 12 14:51:35 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test In directory dev.open-bio.org:/tmp/cvs-serv5161/src/main/ca/ucalgary/services/util/test Modified Files: ACDFileTestCase.java Added Files: emma.acd Log Message: Added fix to parse variable blocks in ACD files (e.g. emma) moby-live/Java/src/main/ca/ucalgary/services/util/test emma.acd,NONE,1.1 ACDFileTestCase.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/ACDFileTestCase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/ACDFileTestCase.java 2007/03/10 00:33:16 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/ACDFileTestCase.java 2007/03/12 18:51:35 1.3 @@ -9,6 +9,7 @@ public class ACDFileTestCase extends TestCase{ private final static String ACDFILE_RESOURCE = "ca/ucalgary/services/util/test/transeq.acd"; private final static String ACDFILE_SUBSECTION_RESOURCE = "ca/ucalgary/services/util/test/dan.acd"; + private final static String ACDFILE_VARIABLE_RESOURCE = "ca/ucalgary/services/util/test/emma.acd"; public ACDFileTestCase(String name){ super(name); @@ -82,12 +83,12 @@ section = file.getRequiredParamsSection(); assertNotNull("The required parameters section for the test data file was unexpectedly null", section); assertTrue("The number of blocks (" + section.size() +") in the required parameter section of " + - u + " was not as expected (expected 0)", section.size() == 4); + u + " was not as expected (expected 4)", section.size() == 4); section = file.getAdditionalParamsSection(); assertNotNull("The additional parameters section for the test data file was unexpectedly null", section); assertTrue("The number of blocks (" + section.size() +") in the additional parameter section of " + - u + " was not as expected (expected 5)", section.size() == 6); + u + " was not as expected (expected 6)", section.size() == 6); section = file.getAdvancedParamsSection(); assertNotNull("The advanced parameters section for the test data file was unexpectedly null", section); @@ -97,7 +98,50 @@ section = file.getOutputSection(); assertNotNull("The output section for the test data file was unexpectedly null", section); assertTrue("The number of blocks (" + section.size() +") in the output section of " + - u + " was not as expected (expected 1)", section.size() == 4); + u + " was not as expected (expected 4)", section.size() == 4); + } + + public void testParsingVariable(){ + URL u = getClass().getClassLoader().getResource(ACDFILE_VARIABLE_RESOURCE); + assertNotNull("Could not find the test ACD file resource ("+ACDFILE_VARIABLE_RESOURCE+")", u); + + ACDFile file = null; + try{ + file = new ACDFile(u); + } catch(Exception e){ + e.printStackTrace(); + fail("Could not load and parse the test input resource ("+u+"): " + e); + } + + List> section = file.getApplicationSection(); + assertNotNull("The application section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the application section of " + + u + " was not as expected (expected 1)", section.size() == 1); + + section = file.getInputSection(); + assertNotNull("The input section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the input section of " + + u + " was not as expected (expected 10)", section.size() == 10); + + section = file.getRequiredParamsSection(); + assertNotNull("The required parameters section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the required parameter section of " + + u + " was not as expected (expected 0)", section.size() == 0); + + section = file.getAdditionalParamsSection(); + assertNotNull("The additional parameters section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the additional parameter section of " + + u + " was not as expected (expected 16)", section.size() == 16); + + section = file.getAdvancedParamsSection(); + assertNotNull("The advanced parameters section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the advanced parameter section of " + + u + " was not as expected (expected 0)", section.size() == 0); + + section = file.getOutputSection(); + assertNotNull("The output section for the test data file was unexpectedly null", section); + assertTrue("The number of blocks (" + section.size() +") in the output section of " + + u + " was not as expected (expected 2)", section.size() == 2); } /** @@ -108,6 +152,7 @@ TestSuite suite = new TestSuite(); suite.addTest(new ACDFileTestCase("testParsingBasic")); suite.addTest(new ACDFileTestCase("testParsingSubsections")); + suite.addTest(new ACDFileTestCase("testParsingVariable")); return suite; } From deandres at dev.open-bio.org Tue Mar 13 15:50:58 2007 From: deandres at dev.open-bio.org (Enrique de Andres Saiz) Date: Tue, 13 Mar 2007 11:50:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703131550.l2DFowxD007152@dev.open-bio.org> deandres Tue Mar 13 11:50:58 EDT 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Async In directory dev.open-bio.org:/tmp/cvs-serv7113 Modified Files: Service.pm SimpleServer.pm Log Message: Replaced calls to the deprecated getInputs and getInputID functions moby-live/Perl/MOBY/Async Service.pm,1.2,1.3 SimpleServer.pm,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Async/Service.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/MOBY/Async/Service.pm 2007/02/08 14:19:37 1.2 +++ /home/repository/moby/moby-live/Perl/MOBY/Async/Service.pm 2007/03/13 15:50:58 1.3 @@ -445,9 +445,9 @@ } # Get queries - my @query = getInputs($data); - foreach my $query (@query) { - push(@queries, $query->toString()); + my @mobyData = ($moby->getElementsByTagName('mobyData'), $moby->getElementsByTagName('moby:mobyData')); + foreach my $mobyData (@mobyData) { + push(@queries, $mobyData->toString()); } } =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Async/SimpleServer.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/Async/SimpleServer.pm 2006/12/04 08:27:52 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/Async/SimpleServer.pm 2007/03/13 15:50:58 1.2 @@ -92,28 +92,6 @@ @ISA = qw(WSRF::FileBasedMobyResourceLifetimes); #=============================================================================== -# authority -# -# This variable is a subroutine which gets the authority of a MOBY message -# and returns it. -# -my $authority = sub { - my ($data) = @_; - - # Get moby document - my $parser = XML::LibXML->new(); - my $doc = $parser->parse_string($data); - my $moby = $doc->getDocumentElement(); - - # Get authority - my @mobyContents = ($moby->getChildrenByTagName('mobyContent'), $moby->getChildrenByTagName('moby:mobyContent')); - my $mobyContent = shift(@mobyContents); - my $authority = $mobyContent->getAttribute('authority') || $mobyContent->getAttribute('moby:authority'); - - return $authority; -}; - -#=============================================================================== # async_create # # This variable is a subroutine which creates a WS-Resource and returns @@ -153,19 +131,25 @@ # Get input queryIDs and store them my $lock = WSRF::MobyFile->new($envelope); - my @queries = getInputs($data); - my @queryIDs; - foreach my $query (@queries) { - my $queryID = getInputID($query); - push(@queryIDs, $queryID); - } + my $inputs = serviceInputParser($data); + my @queryIDs = keys %$inputs; $WSRF::WSRP::Private{queryIDs} = \@queryIDs; $lock->toFile(); - # Iterate in order to run the service for each mobyData - my $auth = $authority->($data); - foreach my $query (@queries) { - my $queryID = getInputID($query); + # Get moby document + my $parser = XML::LibXML->new(); + my $doc = $parser->parse_string($data); + my $moby = $doc->getDocumentElement(); + + # Get authority + my @mobyContents = ($moby->getChildrenByTagName('mobyContent'), $moby->getChildrenByTagName('moby:mobyContent')); + my $mobyContent = shift(@mobyContents); + my $auth = $mobyContent->getAttribute('authority') || $mobyContent->getAttribute('moby:authority'); + + # Get mobyData and iterate over them in order to run the service for each one + my @mobyData = ($moby->getElementsByTagName('mobyData'), $moby->getElementsByTagName('moby:mobyData')); + foreach my $mobyData (@mobyData) { + my $queryID = $mobyData->getAttribute('queryID') || $mobyData->getAttribute('moby:queryID'); my $property_pid = "pid_$queryID"; my $property_input = "input_$queryID"; my $property_status = "status_$queryID"; @@ -179,7 +163,7 @@ # Input my $parser = XML::LibXML->new(); - my $doc = $parser->parse_string(responseHeader($auth).$query->toString.responseFooter()); + my $doc = $parser->parse_string(responseHeader($auth).$mobyData->toString().responseFooter()); my $input = $doc->getDocumentElement->toString; # Fork @@ -335,8 +319,7 @@ # Compose response using the status properties my $lock = WSRF::MobyFile->new($envelope); my $ans = ''; - foreach my $query (@queries) { - my $queryID = getInputID($query); + foreach my $queryID (@queryIDs) { my $property_status = "status_$queryID"; $ans .= "<".$WSRF::WSRP::PropertyNamespaceMap->{$property_status}{prefix}.":$property_status"; my $ns = defined($WSRF::WSRP::PropertyNamespaceMap->{$property_status}{namespace}) ? @@ -377,13 +360,12 @@ my $exception = ''; my $response = ''; - my @queries = getInputs($data); - foreach my $query (@queries) { - my $queryID = getInputID($query); + my $inputs = serviceInputParser($data); + foreach my $queryID (keys %$inputs) { $exception .= ""; $exception .= "701"; - $exception .= "Timeout exceeded. Try to invoke the service asynch-ronously."; + $exception .= "Timeout exceeded. Try to invoke the service asynchronously."; $exception .= ""; $response .= simpleResponse('', '', $queryID); @@ -412,9 +394,8 @@ my $exception = ''; my $response = ''; - my @queries = getInputs($data); - foreach my $query (@queries) { - my $queryID = getInputID($query); + my $inputs = serviceInputParser($data); + foreach my $queryID (keys %$inputs) { $exception .= ""; $exception .= "701"; From deandres at dev.open-bio.org Thu Mar 15 09:50:50 2007 From: deandres at dev.open-bio.org (Enrique de Andres Saiz) Date: Thu, 15 Mar 2007 05:50:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703150950.l2F9ooeH024953@dev.open-bio.org> deandres Thu Mar 15 05:50:50 EDT 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Async In directory dev.open-bio.org:/tmp/cvs-serv24918 Modified Files: Service.pm Log Message: Added enumerated_execute and enumerated_submit methods moby-live/Perl/MOBY/Async Service.pm,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Async/Service.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/MOBY/Async/Service.pm 2007/03/13 15:50:58 1.3 +++ /home/repository/moby/moby-live/Perl/MOBY/Async/Service.pm 2007/03/15 09:50:50 1.4 @@ -53,6 +53,23 @@ Comment : for more information about arguments look up execute method at MOBY::Client::Service. +=head2 enumerated_execute + + Name : enumerated_execute + Function : execute the asynchronous MOBY service using self-enumerated + inputs; this method invoke internally to the enumerated_submit, + poll and result methods. It calculates polling time according + to the status messages received from the provider. If from + that messages is not possible to infer the polling time, it + calculates a pseudo-random polling time, whoose value increases + until is up to around 1 hour. + Usage : $result = $Service->execute(%args) + Args : Input => \%data + Returns : a MOBY message containing whatever the service provides + as output. + Comment : for more information about arguments look up enumerated_execute + method at MOBY::Client::Service. + =head2 submit Name : submit @@ -63,6 +80,17 @@ Comment : for more information about arguments look up execute method at MOBY::Client::Service. +=head2 enumerated_submit + + Name : enumerated_submit + Function : submit the asynchronous MOBY service using self-enumerated + inputs. + Usage : ($EPR, @queryIDs) = $Service->submit(%args) + Args : XMLinputlist => \%data + Returns : WSRF::WS_Address object with an EPR and the input queryIDs. + Comment : for more information about arguments look up enumerated_execute + method at MOBY::Client::Service. + =head2 poll Name : poll @@ -245,6 +273,130 @@ return ($EPR, @queryIDs); } +sub enumerated_execute { + my ($self, %args) = @_; + + print "Creating WS-Resource...\n\n" unless ($self->{silent}); + + my $start = time; + my ($EPR, @queryIDs) = $self->enumerated_submit(%args); + + print XML::LibXML->new->parse_string($EPR->XML)->getDocumentElement()->toString."\n\n" unless ($self->{silent}); + + my $pollingTime; + my ($i, $j) = (0, 1); + my @status; + while ( $pollingTime = &_getPollingTime($i, $j, $start, @status) ) { + ($i, $j) = ($j, $i+$j); + + print "Next polling in $pollingTime seconds...\n\n" unless ($self->{silent}); + + sleep $pollingTime; + @status = $self->poll($EPR, @queryIDs); + + unless ($self->{silent}) { + foreach my $st (@status) { + print $st->XML."\n"; + } + print "\n"; + } + } + + print "Retrieving results and destroying WS-Resource...\n\n" unless ($self->{silent}); + + my @responses = $self->result($EPR, @queryIDs); + $self->destroy($EPR); + my $response = &_composeResponse(@responses); + + print "Finished.\n" unless ($self->{silent}); + + return $response; +} + +sub enumerated_submit { + my ($self, %args) = @_; + + # Compose the moby message (part of this block is copied from MOBY::Client::Service) + die "ERROR: expected Input to be a HASH ref" unless ( ref( $args{Input} ) eq 'HASH' ); + my %inputs = %{$args{Input}}; + my @queryIDs = keys %inputs; + my $data; + foreach my $qID ( @queryIDs ) { + + die "ERROR: expected hashref {articleName => XML} for each queryID" unless ( ref($inputs{$qID}) eq 'HASH' ); + my %articles = %{$inputs{$qID}}; + $data .= ""; + + foreach my $articleName(keys %articles){ + + my $XML = $articles{$articleName}; + if ( ref( $XML ) ne 'ARRAY' ) { + + $XML ||= ""; + if ( $XML =~ /\<(moby\:|)Value\>/ ){ + $data .= "$XML"; + } else { + $data .= "\n$XML\n\n"; + } + + } elsif ( ref( $XML ) eq 'ARRAY' ) { + + my @objs = @{$XML}; + $data .= "\n"; + foreach ( @objs ) { + $data .= "$_\n"; + } + $data .= "\n"; + } + } + $data .= "\n"; + } + my $version = $self->{smessageVersion}; + $data = " + + + $data + + "; + + # Create the resource and submit the batch-call + my $func = $self->{serviceName}.'_submit'; + my $ans = WSRF::Lite + -> proxy(&_getServiceEndpoint($self->{service})) + -> uri($WSRF::Constants::MOBY) + -> $func(SOAP::Data->value($data)->type('string')); + die "ERROR: ".$ans->faultstring if ($ans->fault); + + # Get address from the returned Endpoint Reference + my $address = $ans->match("//Body//{$WSRF::Constants::WSA}Address") ? + $ans->valueof("//Body//{$WSRF::Constants::WSA}Address") : + die "ERROR: no EndpointReference returned"; + die "ERROR: no address into returned EndpointReference" unless ($address); + + # Get resource identifier from the returned Endpoint Reference + my $identifier; + if ($ans->dataof('//Body//ReferenceParameters/*')) { + foreach my $a ($ans->dataof('//Body//ReferenceParameters/*')) { + my $name = $a->name(); + my $uri = $a->uri(); + my $value = $a->value(); + if ($name eq "ServiceInvocationId") { + $identifier = $value; + last; + } + } + } + die "ERROR: no identifier into returned EndpointReference" unless ($identifier); + + # Compose the Endpoint Reference + my $EPR = WSRF::WS_Address->new(); + $EPR->Address($address); + $EPR->ReferenceParameters(''.$identifier.''); + + # Return Endpoint Reference and the queryIDs + return ($EPR, @queryIDs); +} + sub poll { my ($self, $EPR, @queryIDs) = @_; From gordonp at dev.open-bio.org Thu Mar 15 17:55:59 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 15 Mar 2007 13:55:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703151755.l2FHtx6B025837@dev.open-bio.org> gordonp Thu Mar 15 13:55:59 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util In directory dev.open-bio.org:/tmp/cvs-serv25802/src/main/ca/ucalgary/services/util Modified Files: ACDFile.java Log Message: Fixed javadoc typo moby-live/Java/src/main/ca/ucalgary/services/util ACDFile.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/12 18:51:35 1.4 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java 2007/03/15 17:55:59 1.5 @@ -25,7 +25,7 @@ * Reads an EMBOSS ACD file and populates data structures representing the sections of the file * (see the getXXXSection() methods). * - * @throw Exception if the file cannot be read or parsed + * @throws Exception if the file cannot be read or parsed */ public ACDFile(File acdFile) throws Exception{ if(!acdFile.exists()){ From gordonp at dev.open-bio.org Wed Mar 21 16:22:56 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 21 Mar 2007 12:22:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703211622.l2LGMuFd015731@dev.open-bio.org> gordonp Wed Mar 21 12:22:56 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util In directory dev.open-bio.org:/tmp/cvs-serv15695/src/main/ca/ucalgary/seahawk/util Modified Files: Sequence.java Log Message: Made sequence finding more lenient w.r.t. whitespace moby-live/Java/src/main/ca/ucalgary/seahawk/util Sequence.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/Sequence.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/Sequence.java 2007/02/08 16:59:58 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/Sequence.java 2007/03/21 16:22:56 1.3 @@ -12,6 +12,7 @@ * @return true if ACGTUX comprise > 2/3 of the sequence, and all non-IUPAC letters comprise less than 5% */ public static boolean isNucleicAcid(String sequence){ + sequence = sequence.replaceAll("\\s", ""); String naChars = sequence.replaceAll("[^acgtunxACGTUNX]", ""); String nonNAChars = sequence.replaceAll("[acgtumrwsykvhdbnxACGTUMRWSYKVHDBNX \\-\t\r\n]", ""); double seqLen = (double) sequence.length(); // not int, because we don't want integer division @@ -20,6 +21,7 @@ } public static boolean isDNA(String sequence){ + sequence = sequence.replaceAll("\\s", ""); String dnaChars = sequence.replaceAll("[^acgtnxACGTNX]", ""); String nonDNAChars = sequence.replaceAll("[acgtmrwsykvhdbnxACGTMRWSYKVHDBNX \\-\t\r\n]", ""); double seqLen = (double) sequence.length(); // not int, because we don't want integer division @@ -27,6 +29,7 @@ } public static boolean isRNA(String sequence){ + sequence = sequence.replaceAll("\\s", ""); String rnaChars = sequence.replaceAll("[^acgunxACGUNX]", ""); String nonRNAChars = sequence.replaceAll("[acgumrwsykvhdbnxACGUMRWSYKVHDBNX \\-\t\r\n]", ""); double seqLen = (double) sequence.length(); // not int, because we don't want integer division @@ -34,6 +37,7 @@ } public static boolean isProtein(String sequence){ + sequence = sequence.replaceAll("\\s", ""); String protChars = sequence.replaceAll("[^ARNDCQEGHILKMFPSTWYVBZXarndcqeghilkmfpstwyvbz*]", ""); String nonProtChars = sequence.replaceAll("[ARNDCQEGHILKMFPSTWYVBZXarndcqeghilkmfpstwyvbz \\-\t\r\n]", ""); double seqLen = (double) sequence.length(); // not int, because we don't want integer division From gordonp at dev.open-bio.org Wed Mar 21 16:23:43 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 21 Mar 2007 12:23:43 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703211623.l2LGNhEB015775@dev.open-bio.org> gordonp Wed Mar 21 12:23:43 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv15739/src/main/ca/ucalgary/seahawk/services Modified Files: MobyClient.java Log Message: Fixed logic for loading rule file moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyClient.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2007/03/12 14:37:24 1.6 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2007/03/21 16:23:43 1.7 @@ -95,14 +95,15 @@ if(rulesResource == null){ dataMappingXMLURL = cl.getResource(DATA_MAPPING_XML_RESOURCE); } - - // See if it's a URL - try{ - dataMappingXMLURL = new URL(rulesResource); + else{ + // See if it's a URL + try{ + dataMappingXMLURL = new URL(rulesResource); + } + catch(Exception e){ + dataMappingXMLURL = cl.getResource(rulesResource); + } } - catch(Exception e){ - dataMappingXMLURL = cl.getResource(rulesResource); - } if(dataMappingXMLURL == null){ System.err.println("Could not find MOBY data mapping resource '"+ rulesResource+"'"); From gordonp at dev.open-bio.org Wed Mar 21 16:24:42 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 21 Mar 2007 12:24:42 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703211624.l2LGOgfa015819@dev.open-bio.org> gordonp Wed Mar 21 12:24:42 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv15783/src/main/ca/ucalgary/seahawk/gui Modified Files: MobyContentGUI.java Log Message: Changed default startup page to 3 simple instructions for beginners moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyContentGUI.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2007/02/08 16:59:57 1.4 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2007/03/21 16:24:42 1.5 @@ -47,6 +47,7 @@ public final static String DEFAULT_STATUS_MSG = "Click hyperlink to explore MOBY Web services"; public final static String RESOURCE_SYSTEM_PROPERTY = "seahawk.stylesheet"; + public final static String DEFAULT_STARTUP_PAGE_RESOURCE = "ca/ucalgary/seahawk/resources/startup.html"; public final static String DEFAULT_XSLT_CONVERTER_URL = "ca/ucalgary/seahawk/resources/moby2HTML.xsl"; public final static int MAX_TAB_NAME_LENGTH = 25; public final static String CLOSE_TAB_OPTION = "Close This Tab"; @@ -880,12 +881,19 @@ } } else{ - gui.showHelpTab(); + URL startURL = gui.getClass().getClassLoader().getResource(DEFAULT_STARTUP_PAGE_RESOURCE); + if(startURL == null){ + logger.error("Could not load "+DEFAULT_STARTUP_PAGE_RESOURCE+" - loading help file instead"); + gui.showHelpTab(); + } + else{ + gui.loadPaneFromURL(startURL, true); + } } } /** - * Method to be called when an applet is decommissioning. + * Method to be called when an applet is being decommissioned. */ public static void destroy(){ ca.ucalgary.seahawk.util.MobyUtils.destroyMobyGUI(); From gordonp at dev.open-bio.org Wed Mar 21 16:25:36 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 21 Mar 2007 12:25:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703211625.l2LGPalK015859@dev.open-bio.org> gordonp Wed Mar 21 12:25:36 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources In directory dev.open-bio.org:/tmp/cvs-serv15827/src/main/ca/ucalgary/seahawk/resources Added Files: startup.html Log Message: Changed default startup page to 3 simple instructions for beginners moby-live/Java/src/main/ca/ucalgary/seahawk/resources startup.html,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 23 20:22:53 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 23 Mar 2007 16:22:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703232022.l2NKMrfT020358@dev.open-bio.org> gordonp Fri Mar 23 16:22:53 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv20323/src/main/ca/ucalgary/seahawk/gui Modified Files: MobyContentPane.java Log Message: Added ability to paste data into Seahawk (as opposed to existing drag 'n' drop functionality), using ctrl-v, paste keyboard button and middle mouse button moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyContentPane.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java 2007/02/08 16:59:57 1.4 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java 2007/03/23 20:22:52 1.5 @@ -24,38 +24,24 @@ import ca.ucalgary.seahawk.util.MobyUtils; import javax.swing.*; -import javax.swing.event.CaretEvent; -import javax.swing.event.CaretListener; -import javax.swing.event.HyperlinkEvent; -import javax.swing.event.HyperlinkListener; +import javax.swing.event.*; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Point; -import java.awt.print.Printable; -import java.awt.print.PageFormat; -import java.awt.print.PrinterException; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.io.File; -import java.io.FileWriter; -import java.io.InputStream; -import java.io.IOException; -import java.io.StringWriter; +import java.awt.print.*; +import java.awt.event.*; +import java.io.*; import java.net.URL; import java.net.URLConnection; -import java.util.AbstractMap; -import java.util.HashMap; -import java.util.Iterator; -import java.util.StringTokenizer; -import java.util.Vector; +import java.util.*; /** * Text area contained in a Seahawk GUI tab. Displays HTML, RTF, text etc. using a JEditorPane. * Also provides link handling (including service options popup) and drag 'n' drop capabilities. */ -public class MobyContentPane extends JPanel implements Printable, CaretListener, HyperlinkListener, MouseListener, MobyRequestEventHandler{ +public class MobyContentPane extends JPanel implements Printable, CaretListener, HyperlinkListener, MouseListener, MobyRequestEventHandler, KeyListener{ public static final String MOBY_SERVICE_POPUP_NAME = "seahawkServicePopup"; public static final String WAITING_TAB_ICON_RESOURCE = "ca/ucalgary/seahawk/resources/images/hourglass.gif"; public static final String FAILED_TAB_ICON_RESOURCE = "ca/ucalgary/seahawk/resources/images/failed.gif"; @@ -93,10 +79,13 @@ contentGUI = cGUI; servicesGUI = sGUI; + // The next line is what provides the drag 'n' drop capability + addKeyListener(this); setTransferHandler(new FileAndTextTransferHandler(cGUI)); // The following is a non-user editable pane for showing HTML editorPane = new PrintableJEditorPane(); + editorPane.addKeyListener(this); editorPane.setTransferHandler(getTransferHandler()); //editorPane.setPreferredSize(parentComponent.getPreferredSize()); editorPane.setEditable(false); @@ -883,9 +872,23 @@ // MouseListener interface implementation public void mouseClicked(MouseEvent e){ + // Allow middle button paste + if(e.getButton() == MouseEvent.BUTTON3 || + e.getButton() == MouseEvent.BUTTON2 && e.isAltDown()){ + paste(); + } } - public void mouseEntered(MouseEvent e){} + /** + * Grabs the keyboard focus for the component if the mouse is over it, + * which eliminates the need for clicking before using keyboard shortcuts + * like Control-v to paste. + */ + public void mouseEntered(MouseEvent e){ + if(!requestFocusInWindow()){ + requestFocus(); + } + } public void mouseExited(MouseEvent e){} @@ -1067,4 +1070,25 @@ return scufl.toString(); } + + /** + * Implemented to provide paste functonality (control-v or the paste button on a Sun keyboard), + * since the editor panes are not editable and therefore by default do not respond to + * paste events. + */ + public void keyPressed(KeyEvent e){ + System.err.println("Key pressed " + e.getKeyChar()); + if(e.getKeyCode() == KeyEvent.VK_PASTE || + e.getKeyCode() == KeyEvent.VK_V && e.isControlDown()){ + System.err.println("Paste (pressed)!"); + paste(); + } + } + + public void keyReleased(KeyEvent e){} + public void keyTyped(KeyEvent e){} + + public void paste(){ + getTransferHandler().importData(editorPane, java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().getContents(this)); + } } From gordonp at dev.open-bio.org Fri Mar 23 20:23:52 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 23 Mar 2007 16:23:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703232023.l2NKNqMn020401@dev.open-bio.org> gordonp Fri Mar 23 16:23:52 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv20366/src/main/ca/ucalgary/seahawk/gui Modified Files: FileAndTextTransferHandler.java Log Message: Improved pasted data handling: RTF now interpreted as such, HTML somewhat cleaned up moby-live/Java/src/main/ca/ucalgary/seahawk/gui FileAndTextTransferHandler.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java 2007/02/08 16:59:57 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java 2007/03/23 20:23:52 1.4 @@ -174,17 +174,29 @@ } // Otherwise save the data to a temp file and load it as a URL - File savedFile = File.createTempFile("seahawkDataDrop", ""); + String suffix = ""; + if(text.indexOf("{\\rtf") == 0){ + suffix = ".rtf"; + } + else if(text.indexOf("<") != -1 && text.indexOf(">") > text.indexOf("<") && + text.indexOf("/") != -1){ + suffix = ".html"; + } + File savedFile = File.createTempFile("seahawkDataDrop", suffix); savedFile.deleteOnExit(); FileOutputStream out = new FileOutputStream(savedFile); - if(text.indexOf("") > text.indexOf("<") && - text.indexOf("/") != -1){ - // Add html tag around the contents if it's hypertext, so it's a full document and - // JEditorPane doesn't do funny stuff. - out.write("".getBytes()); - out.write(text.getBytes()); - out.write("".getBytes()); + if(suffix.equals(".html")){ + // Sometimes you get ?? at the start of pasted html, we'll clean it up + if(text.indexOf("??") == 0){ + text = text.substring(2); + } + if(text.indexOf("".getBytes()); + out.write(text.getBytes()); + out.write("".getBytes()); + } } else{ // Treat as plain text if there are no hyperlinks From mwilkinson at dev.open-bio.org Mon Mar 26 22:49:23 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Mon, 26 Mar 2007 18:49:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703262249.l2QMnNPC027500@dev.open-bio.org> mwilkinson Mon Mar 26 18:49:22 EDT 2007 Update of /home/repository/moby/moby-live/Docs In directory dev.open-bio.org:/tmp/cvs-serv27482 Added Files: BioMoby 1_0 version 6.pdf Log Message: first draft of the BioMoby manuscript moby-live/Docs BioMoby 1_0 version 6.pdf,NONE,1.1 rcsdiff: /home/repository/moby/moby-live/Docs/RCS/BioMoby,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/RCS/1_0,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/RCS/version,v: No such file or directory From gordonp at dev.open-bio.org Tue Mar 27 14:01:36 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 27 Mar 2007 10:01:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703271401.l2RE1aUM003022@dev.open-bio.org> gordonp Tue Mar 27 10:01:36 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources In directory dev.open-bio.org:/tmp/cvs-serv2986/src/main/ca/ucalgary/seahawk/resources Modified Files: startup.html Log Message: Minor doc updates moby-live/Java/src/main/ca/ucalgary/seahawk/resources startup.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/startup.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/startup.html 2007/03/21 16:25:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/startup.html 2007/03/27 14:01:36 1.2 @@ -7,12 +7,12 @@ Seahawk Quick Start:
    -
  1. Drag a desktop file (text, RTF or HTML), a Web link, a URL, or a part of an open Web page from your browser onto this window.
  2. +
  3. Drag a desktop file (text, RTF or HTML), a Web link, a URL, or a part of an open Web page from your browser onto this window. It will open in a new tab.
  4. Highlight the part of document you want to explore further (e.g. a DNA sequence or a database ID).
  5. Click the highlighted data and wait for analysis services options to pop up.
-For more help on using Seahawk to automatically discover and run Web-based analysis services, +For example data, and more help on using Seahawk to automatically discover and run Web-based analysis services, please click the help icon at the bottom of this window. From gordonp at dev.open-bio.org Tue Mar 27 14:01:36 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 27 Mar 2007 10:01:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703271401.l2RE1agE003044@dev.open-bio.org> gordonp Tue Mar 27 10:01:36 EDT 2007 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv2986/docs Modified Files: deployingServices.html Seahawk.html Log Message: Minor doc updates moby-live/Java/docs deployingServices.html,1.13,1.14 Seahawk.html,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/deployingServices.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/docs/deployingServices.html 2006/12/11 18:36:42 1.13 +++ /home/repository/moby/moby-live/Java/docs/deployingServices.html 2007/03/27 14:01:36 1.14 @@ -18,6 +18,10 @@ You do not need to checkout the jMOBY CVS, or install Apache Axis. Alternatively, you can do this tutorial without Apache Ant too.

+ +

For scientific publications using this methdology, please cite + this paper +

If, on the other hand, you are planning on directly hacking the jMOBY classes, the other approach to developing services (using a code generator and the full jMOBY CVS) @@ -316,7 +320,7 @@

Paul Gordon
-Last modified: Mon Dec 11 11:28:17 MST 2006 +Last modified: Sun Mar 25 08:19:42 MDT 2007 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/Seahawk.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/docs/Seahawk.html 2006/12/11 18:37:21 1.5 +++ /home/repository/moby/moby-live/Java/docs/Seahawk.html 2007/03/27 14:01:36 1.6 @@ -71,7 +71,7 @@ Axis, Jena, Xalan, Xerces, etc.) is available here, and is signed by the University of Calgary Bioinformatics Lab. You can also - build your own version of the jar with the jMOBY cvs Ant target "servlet-war". + build your own version of the jar with the jMOBY CVS Ant target "seahawk-jar". Either jar file can be used as an application with the command:
java -jar seahawk.jar
@@ -122,7 +122,7 @@
Paul Gordon
-Last modified: Mon Dec 11 08:49:26 MST 2006 +Last modified: Sun Mar 25 08:20:27 MDT 2007 From gordonp at dev.open-bio.org Tue Mar 27 14:02:53 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 27 Mar 2007 10:02:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703271402.l2RE2rfE003092@dev.open-bio.org> gordonp Tue Mar 27 10:02:53 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv3056/src/main/ca/ucalgary/seahawk/gui Modified Files: MobySecondaryInputGUI.java Log Message: Make sure the windows ends up on top when created, so the user sees it moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobySecondaryInputGUI.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobySecondaryInputGUI.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobySecondaryInputGUI.java 2006/12/07 16:37:36 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobySecondaryInputGUI.java 2007/03/27 14:02:53 1.3 @@ -164,6 +164,8 @@ // Make the window the preferred size of its widget contents if(showGUI){ pack(); + toFront(); + requestFocus(); confirmButton.requestFocusInWindow(); } } From mwilkinson at dev.open-bio.org Tue Mar 27 20:37:06 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Tue, 27 Mar 2007 16:37:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703272037.l2RKb6pj004121@dev.open-bio.org> mwilkinson Tue Mar 27 16:37:05 EDT 2007 Update of /home/repository/moby/moby-live/Docs In directory dev.open-bio.org:/tmp/cvs-serv4103 Added Files: BioMoby 1_0 version 7.pdf Log Message: next version of the manuscript with first set of suggested modifications from the community moby-live/Docs BioMoby 1_0 version 7.pdf,NONE,1.1 rcsdiff: /home/repository/moby/moby-live/Docs/RCS/BioMoby,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/RCS/1_0,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Docs/RCS/version,v: No such file or directory From gordonp at dev.open-bio.org Wed Mar 28 18:53:11 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 28 Mar 2007 14:53:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703281853.l2SIrBFS008008@dev.open-bio.org> gordonp Wed Mar 28 14:53:11 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv7972/src/main/org/biomoby/shared/data Modified Files: MobyDataUtils.java Log Message: Added more methods, providing greater I/O flexibility for serialization/deserialization moby-live/Java/src/main/org/biomoby/shared/data MobyDataUtils.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataUtils.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/shared/data/MobyDataUtils.java 2006/10/26 00:32:20 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataUtils.java 2007/03/28 18:53:11 1.5 @@ -2,6 +2,7 @@ import org.biomoby.shared.parser.MobyTags; import org.biomoby.shared.*; +import org.xml.sax.InputSource; import org.w3c.dom.*; import java.io.*; @@ -10,7 +11,21 @@ * such as serialization and deserialization. */ public class MobyDataUtils{ + + /** + * Writes the XML version of the contents, with an XML declaration. + */ public static boolean toXMLDocument(OutputStream os, MobyContentInstance mci) throws Exception{ + return toXMLDocument(os, mci, true); + } + + /** + * Output the XML representation of the data to an OutputStream + * (i.e. an output that takes byte data, not character-encoded strings). + * Note that the character decoding will depend on your runtime environment. + */ + public static boolean toXMLDocument(OutputStream os, MobyContentInstance mci, boolean includeXMLDeclaration) + throws Exception{ // May want to check character encoding before doing getBytes(), implement this later os.write("\n".getBytes()); os.write(("\n").getBytes()); @@ -18,9 +33,40 @@ os.write("\n".getBytes()); return true; } - - public static MobyContentInstance fromXMLDocument(InputStream is) throws Exception{ + + /** + * Writes the XML version of the contents, with an XML declaration. + */ + public static boolean toXMLDocument(Writer writer, MobyContentInstance mci) throws Exception{ + return toXMLDocument(writer, mci, true); + } + + /** + * Output the XML representation of the data to a Writer (i.e. an output that understands + * character-encoded strings). + */ + public static boolean toXMLDocument(Writer writer, MobyContentInstance mci, boolean includeXMLDeclaration) + throws Exception{ + writer.write("\n"); + writer.write(("\n")); + writer.write(mci.toXML()); + writer.write("\n"); + return true; + } + + /** + * Create a MOBY Java object representation from a MOBY XML payload stored in a String. + */ + public static MobyContentInstance fromXMLDocument(String xmlData) throws Exception{ + return fromXMLDocument(new StringReader(xmlData)); + } + + /** + * Create a MOBY Java object representation from a MOBY XML payload coming from an InputStream + * (a byte stream that will becoverted by the parser into character data). + */ + public static MobyContentInstance fromXMLDocument(InputStream is) throws Exception{ // Load an XML document javax.xml.parsers.DocumentBuilder docBuilder = null; try{ @@ -48,6 +94,72 @@ return fromXMLDocument(doc_root); } + /** + * Create a MOBY Java object representation from a MOBY XML payload at the given URL. + */ + public static MobyContentInstance fromXMLDocument(java.net.URL url) throws Exception{ + // Load an XML document + javax.xml.parsers.DocumentBuilder docBuilder = null; + try{ + javax.xml.parsers.DocumentBuilderFactory dbf = + javax.xml.parsers.DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + docBuilder = dbf.newDocumentBuilder(); + } + catch(javax.xml.parsers.ParserConfigurationException pce){ + throw new Exception("An XML parser could not be found or configured: " + pce); + } + + Document domDoc = null; + try{ + domDoc = docBuilder.parse(url.toURI().toString()); + } catch(org.xml.sax.SAXException saxe){ + throw new Exception("The XML data could not be parsed (not well-formed): " + saxe); + } catch(java.io.IOException ioe){ + throw new Exception("The XML data could not be loaded (I/O problem): " + ioe); + } + + // Select a node from the document and see if any of the mappings + // work out, in which case we can check what services we can run + Element doc_root = domDoc.getDocumentElement(); + return fromXMLDocument(doc_root); + } + + /** + * Create a MOBY Java object representation from a MOBY XML payload coming from a Reader (character data). + */ + public static MobyContentInstance fromXMLDocument(Reader reader) throws Exception{ + // Load an XML document + javax.xml.parsers.DocumentBuilder docBuilder = null; + try{ + javax.xml.parsers.DocumentBuilderFactory dbf = + javax.xml.parsers.DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + docBuilder = dbf.newDocumentBuilder(); + } + catch(javax.xml.parsers.ParserConfigurationException pce){ + throw new Exception("An XML parser could not be found or configured: " + pce); + } + + Document domDoc = null; + try{ + domDoc = docBuilder.parse(new InputSource(reader)); + } catch(org.xml.sax.SAXException saxe){ + throw new Exception("The XML data could not be parsed (not well-formed): " + saxe); + } catch(java.io.IOException ioe){ + throw new Exception("The XML data could not be loaded (I/O problem): " + ioe); + } + + // Select a node from the document and see if any of the mappings + // work out, in which case we can check what services we can run + Element doc_root = domDoc.getDocumentElement(); + return fromXMLDocument(doc_root); + } + + + /** + * Create a MOBY Java object representation from a MOBY XML payload represented in a DOM. + */ public static MobyContentInstance fromXMLDocument(Element doc_root) throws Exception{ if(doc_root == null){ throw new MobyException("The passed in element was null"); From gordonp at dev.open-bio.org Thu Mar 29 19:40:53 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 29 Mar 2007 15:40:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703291940.l2TJerOF012866@dev.open-bio.org> gordonp Thu Mar 29 15:40:52 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv12830/src/main/org/biomoby/shared/data Modified Files: MobyDataUtils.java Log Message: Javadoc clarification moby-live/Java/src/main/org/biomoby/shared/data MobyDataUtils.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataUtils.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/shared/data/MobyDataUtils.java 2007/03/28 18:53:11 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataUtils.java 2007/03/29 19:40:52 1.6 @@ -159,6 +159,8 @@ /** * Create a MOBY Java object representation from a MOBY XML payload represented in a DOM. + * + * @param doc_root the document's base MOBY tag */ public static MobyContentInstance fromXMLDocument(Element doc_root) throws Exception{ if(doc_root == null){ From gordonp at dev.open-bio.org Thu Mar 29 19:41:37 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 29 Mar 2007 15:41:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703291941.l2TJfbe7012932@dev.open-bio.org> gordonp Thu Mar 29 15:41:37 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv12896/src/main/org/biomoby/shared Modified Files: MobyService.java Log Message: Added isAsynchronous() method moby-live/Java/src/main/org/biomoby/shared MobyService.java,1.16,1.17 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2007/03/12 17:00:33 1.16 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2007/03/29 19:41:37 1.17 @@ -527,4 +527,8 @@ // Wasn't found if we got to here return null; } + + public boolean isAsynchronous(){ + return category.equals("moby-async"); + } } From gordonp at dev.open-bio.org Fri Mar 30 18:35:15 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 14:35:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301835.l2UIZFYF016544@dev.open-bio.org> gordonp Fri Mar 30 14:35:14 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/test In directory dev.open-bio.org:/tmp/cvs-serv16509/src/main/org/biomoby/client/test Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/test added to the repository moby-live/Java/src/main/org/biomoby/client/test - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/test/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/test/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/test/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 18:35:26 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 14:35:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301835.l2UIZQM8016587@dev.open-bio.org> gordonp Fri Mar 30 14:35:26 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c In directory dev.open-bio.org:/tmp/cvs-serv16552/src/main/org/biomoby/w3c Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c added to the repository moby-live/Java/src/main/org/biomoby/w3c - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 18:35:36 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 14:35:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301835.l2UIZavx016630@dev.open-bio.org> gordonp Fri Mar 30 14:35:35 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/addressing In directory dev.open-bio.org:/tmp/cvs-serv16595/src/main/org/biomoby/w3c/addressing Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/addressing added to the repository moby-live/Java/src/main/org/biomoby/w3c/addressing - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/addressing/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/addressing/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/addressing/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 18:55:31 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 14:55:31 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301855.l2UItVOc016697@dev.open-bio.org> gordonp Fri Mar 30 14:55:31 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/w3c In directory dev.open-bio.org:/tmp/cvs-serv16662/org/w3c Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/w3c added to the repository moby-live/Java/src/main/org/w3c - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 18:55:31 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 14:55:31 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301855.l2UItVXl016716@dev.open-bio.org> gordonp Fri Mar 30 14:55:31 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing In directory dev.open-bio.org:/tmp/cvs-serv16662/org/w3c/addressing Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing added to the repository moby-live/Java/src/main/org/w3c/addressing - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 18:55:31 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 14:55:31 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301855.l2UItVSD016733@dev.open-bio.org> gordonp Fri Mar 30 14:55:31 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/sax In directory dev.open-bio.org:/tmp/cvs-serv16662/org/w3c/addressing/sax Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/sax added to the repository moby-live/Java/src/main/org/w3c/addressing/sax - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/sax/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/sax/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/sax/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 19:04:14 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:04:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301904.l2UJ4EV8016784@dev.open-bio.org> gordonp Fri Mar 30 15:04:14 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap In directory dev.open-bio.org:/tmp/cvs-serv16749/org/soap Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/soap added to the repository moby-live/Java/src/main/org/soap - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 19:04:14 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:04:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301904.l2UJ4E5s016801@dev.open-bio.org> gordonp Fri Mar 30 15:04:14 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap/sax In directory dev.open-bio.org:/tmp/cvs-serv16749/org/soap/sax Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/soap/sax added to the repository moby-live/Java/src/main/org/soap/sax - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/sax/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/sax/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/sax/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 19:04:14 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:04:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301904.l2UJ4EC4016820@dev.open-bio.org> gordonp Fri Mar 30 15:04:14 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap/sax/test In directory dev.open-bio.org:/tmp/cvs-serv16749/org/soap/sax/test Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/soap/sax/test added to the repository moby-live/Java/src/main/org/soap/sax/test - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/sax/test/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/sax/test/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/soap/sax/test/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 19:16:49 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:16:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301916.l2UJGnYL016931@dev.open-bio.org> gordonp Fri Mar 30 15:16:49 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap In directory dev.open-bio.org:/tmp/cvs-serv16899/org/soap Added Files: SOAPFault.java WSRFFault.java Log Message: Support files written by Eddie for use in asynchronous service invocations moby-live/Java/src/main/org/soap SOAPFault.java,NONE,1.1 WSRFFault.java,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 30 19:16:49 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:16:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301916.l2UJGnEx016945@dev.open-bio.org> gordonp Fri Mar 30 15:16:49 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap/sax In directory dev.open-bio.org:/tmp/cvs-serv16899/org/soap/sax Added Files: FaultTags.java SOAPFaultParser.java Log Message: Support files written by Eddie for use in asynchronous service invocations moby-live/Java/src/main/org/soap/sax FaultTags.java,NONE,1.1 SOAPFaultParser.java,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 30 19:17:41 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:17:41 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301917.l2UJHfEh017033@dev.open-bio.org> gordonp Fri Mar 30 15:17:41 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/w3c/addressing/sax In directory dev.open-bio.org:/tmp/cvs-serv17001/org/w3c/addressing/sax Added Files: EndpointReferenceParser.java EprTags.java Log Message: Support files written by Eddie for use in asynchronous service invocations moby-live/Java/src/main/org/w3c/addressing/sax EndpointReferenceParser.java,NONE,1.1 EprTags.java,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 30 19:18:53 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:18:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301918.l2UJIr6C017120@dev.open-bio.org> gordonp Fri Mar 30 15:18:53 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg In directory dev.open-bio.org:/tmp/cvs-serv17085/org/omg Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/omg added to the repository moby-live/Java/src/main/org/omg - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 19:19:24 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:19:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301919.l2UJJOUn017163@dev.open-bio.org> gordonp Fri Mar 30 15:19:24 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg/lsae In directory dev.open-bio.org:/tmp/cvs-serv17128/org/omg/lsae Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/omg/lsae added to the repository moby-live/Java/src/main/org/omg/lsae - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 19:19:24 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:19:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301919.l2UJJOVn017199@dev.open-bio.org> gordonp Fri Mar 30 15:19:24 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax In directory dev.open-bio.org:/tmp/cvs-serv17128/org/omg/lsae/sax Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax added to the repository moby-live/Java/src/main/org/omg/lsae/sax - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 19:19:24 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:19:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301919.l2UJJOae017182@dev.open-bio.org> gordonp Fri Mar 30 15:19:24 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/notifications In directory dev.open-bio.org:/tmp/cvs-serv17128/org/omg/lsae/notifications Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/notifications added to the repository moby-live/Java/src/main/org/omg/lsae/notifications - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/notifications/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/notifications/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/notifications/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 19:19:50 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:19:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301919.l2UJJoiA017248@dev.open-bio.org> gordonp Fri Mar 30 15:19:49 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/test In directory dev.open-bio.org:/tmp/cvs-serv17213/org/omg/lsae/sax/test Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/test added to the repository moby-live/Java/src/main/org/omg/lsae/sax/test - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/test/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/test/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/test/RCS/directory,v: No such file or directory From gordonp at dev.open-bio.org Fri Mar 30 19:42:56 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:42:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301942.l2UJguvp017369@dev.open-bio.org> gordonp Fri Mar 30 15:42:56 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax In directory dev.open-bio.org:/tmp/cvs-serv17323/src/main/org/omg/lsae/sax Added Files: EventParser.java LsaeTags.java Log Message: Support code from Eddie for use in asynchronous service invocation moby-live/Java/src/main/org/omg/lsae/sax EventParser.java,NONE,1.1 LsaeTags.java,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 30 19:42:56 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:42:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301942.l2UJguKL017355@dev.open-bio.org> gordonp Fri Mar 30 15:42:56 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/notifications In directory dev.open-bio.org:/tmp/cvs-serv17323/src/main/org/omg/lsae/notifications Added Files: AnalysisEvent.java HeartBeatEvent.java PercentEvent.java StateEvent.java StepEvent.java TimeProgressEvent.java Log Message: Support code from Eddie for use in asynchronous service invocation moby-live/Java/src/main/org/omg/lsae/notifications AnalysisEvent.java,NONE,1.1 HeartBeatEvent.java,NONE,1.1 PercentEvent.java,NONE,1.1 StateEvent.java,NONE,1.1 StepEvent.java,NONE,1.1 TimeProgressEvent.java,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 30 19:48:12 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:48:12 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301948.l2UJmCGD017439@dev.open-bio.org> gordonp Fri Mar 30 15:48:12 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv17403/src/main/org/biomoby/shared Modified Files: MobyPrefixResolver.java Log Message: Added WSRF/P and WS-Addressing support moby-live/Java/src/main/org/biomoby/shared MobyPrefixResolver.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.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/shared/MobyPrefixResolver.java 2007/03/12 16:58:48 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.java 2007/03/30 19:48:12 1.9 @@ -36,6 +36,10 @@ public static final String XSI2001_PREFIX = "xsi2001"; public static final String SOAP_ENC_NAMESPACE ="http://schemas.xmlsoap.org/soap/encoding/"; public static final String SOAP_ENC_PREFIX ="soap-enc"; + public static final String WS_ADDRESSING_PREFIX = "wsa"; + public static final String WS_ADDRESSING_NAMESPACE = "http://schemas.xmlsoap.org/ws/2004/03/addressing"; + public static final String WSRP_PREFIX = "wsrp"; + public static final String WSRP_NAMESPACE = "http://docs.oasis-open.org/wsrf/rp-2"; /** * We don't really implement this as it can be extremely complicated. @@ -145,6 +149,12 @@ else if(SOAP_ENC_PREFIX.equals(prefix)){ return SOAP_ENC_NAMESPACE; } + else if(WS_ADDRESSING_PREFIX.equals(prefix)){ //used by async services + return WS_ADDRESSING_NAMESPACE; + } + else if(WSRP_PREFIX.equals(prefix)){ //used by async services + return WSRP_NAMESPACE; + } else{ return ""; // Indicates that we don't have a mapping for this prefix } From gordonp at dev.open-bio.org Fri Mar 30 19:48:37 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:48:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301948.l2UJmbJc017505@dev.open-bio.org> gordonp Fri Mar 30 15:48:37 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv17469/src/main/org/biomoby/shared/data Modified Files: MobyContentInstance.java Log Message: Javadoc update moby-live/Java/src/main/org/biomoby/shared/data MobyContentInstance.java,1.9,1.10 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyContentInstance.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/shared/data/MobyContentInstance.java 2006/12/14 22:17:28 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyContentInstance.java 2007/03/30 19:48:37 1.10 @@ -526,7 +526,8 @@ } /** - * Retrieves a list of the query names in this object + * Retrieves a list of the query names in this object. + * NOTE: IF YOU DELETE OBJECTS FROM THIS SET, THEY ARE REMOVED FROM THE MOBY PAYLOAD TOO! */ public Set keySet(){ return members.keySet(); From gordonp at dev.open-bio.org Fri Mar 30 19:49:33 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 15:49:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703301949.l2UJnX2r017567@dev.open-bio.org> gordonp Fri Mar 30 15:49:33 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/w3c/addressing In directory dev.open-bio.org:/tmp/cvs-serv17535/src/main/org/biomoby/w3c/addressing Added Files: EndpointReference.java Log Message: Support file for asynchronous moby service invocation moby-live/Java/src/main/org/biomoby/w3c/addressing EndpointReference.java,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 30 21:17:27 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 17:17:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703302117.l2ULHRHt017863@dev.open-bio.org> gordonp Fri Mar 30 17:17:27 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/test In directory dev.open-bio.org:/tmp/cvs-serv17813/src/main/org/biomoby/client/test Added Files: AsyncClientTestCase.java TestFASTACollection.xml Log Message: Initial commit of asynchronous client code, somewhat tested (single jobs) moby-live/Java/src/main/org/biomoby/client/test AsyncClientTestCase.java,NONE,1.1 TestFASTACollection.xml,NONE,1.1 From gordonp at dev.open-bio.org Fri Mar 30 21:17:27 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 30 Mar 2007 17:17:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703302117.l2ULHRg9017849@dev.open-bio.org> gordonp Fri Mar 30 17:17:27 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory dev.open-bio.org:/tmp/cvs-serv17813/src/main/org/biomoby/client Modified Files: MobyRequest.java Added Files: AsyncClient.java Log Message: Initial commit of asynchronous client code, somewhat tested (single jobs) moby-live/Java/src/main/org/biomoby/client AsyncClient.java,NONE,1.1 MobyRequest.java,1.22,1.23 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java 2007/02/08 16:59:58 1.22 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java 2007/03/30 21:17:27 1.23 @@ -1,9 +1,6 @@ package org.biomoby.client; -// Defines Web service input, output, access -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; +import java.io.*; import java.util.*; import javax.xml.namespace.QName; @@ -21,9 +18,13 @@ import org.apache.xpath.XPathContext; import org.apache.xpath.objects.XNodeSet; import org.apache.xpath.objects.XObject; + import org.biomoby.shared.*; import org.biomoby.shared.data.*; import org.biomoby.shared.parser.MobyTags; // defined the Moby XML element names +import org.biomoby.w3c.addressing.EndpointReference; +import org.omg.lsae.notifications.AnalysisEvent; + import org.w3c.dom.*; /** @@ -150,14 +151,14 @@ } /** - * @param service the MobyService that should be executed when invokeService is called + * @param mobyservice the MobyService that should be executed when invokeService is called */ - public void setService(MobyService service){ - if(service == null){ + public void setService(MobyService mobyservice){ + if(mobyservice == null){ mobyService = null; } - else if(mobyService == null || !service.equals(mobyService)){ - mobyService = service; + else if(mobyService == null || !mobyservice.equals(mobyService)){ + mobyService = mobyservice; } } @@ -263,19 +264,94 @@ // Used internally for asynchronous thread calls that all need the XML data // and can't rely on the answer from thread-insensitive getResponseXML() - private MobyContentInstance invokeService(StringBuffer contentsXML) throws Exception, MobyException, SOAPException, NoSuccessException{ + private MobyContentInstance invokeService(StringBuffer contentsXML) + throws Exception, MobyException, SOAPException, NoSuccessException{ + return invokeService(contentsXML, null, 0); + } + + private MobyContentInstance invokeService(StringBuffer contentsXML, MobyRequestEventHandler handler, int requestId) + throws Exception, MobyException, SOAPException, NoSuccessException{ if(mobyService == null){ throw new MobyException("Tried to invoke null service from MobyRequest (call setService first)"); } - Call call = getServiceFromWSDL(); - verifyInput(); - String mobyXML = convertMOBYDataToMOBYRequest(inputData); - Element mobyDOM = performSOAPRequest(call, mobyXML, contentsXML); - // The following parses the DOM and extracts all the appropriate jMOBY objects to represent the XML in Java - outputData = MobyDataUtils.fromXMLDocument(mobyDOM); - return outputData; + Element mobyDOM = null; + if(mobyService.isAsynchronous()){ + // Async is "simpler", because it had to merge DOMs together into a single MobyContentInstance anyway + return performAsyncSOAPRequest(mobyService, inputData, handler, requestId); + } + else{ + String mobyXML = convertMOBYDataToMOBYRequest(inputData); + Call call = getServiceFromWSDL(); + mobyDOM = performSOAPRequest(call, mobyXML, contentsXML); + // The following parses the DOM and extracts all the appropriate jMOBY objects to represent the XML in Java + return MobyDataUtils.fromXMLDocument(mobyDOM); + } + } + + protected MobyContentInstance performAsyncSOAPRequest(MobyService mservice, MobyContentInstance inData, + MobyRequestEventHandler handler, int requestId) + throws Exception{ + String mobyXML = convertMOBYDataToMOBYRequest(inData); + EndpointReference epr = AsyncClient.sendRequest(mservice, mobyXML); + + // Essentially cloning, so removing ids doesn't change the + // MobyContentInstance "data" (which we will use again later on) + MobyContentInstance finalContents = new MobyContentInstance(); + Set queryIDs = new HashSet(inData.keySet()); + try { + // Should add some timeout here... + while(!queryIDs.isEmpty()){ + // todo: make this setable + Thread.sleep(5000); + + AnalysisEvent[] events = + AsyncClient.poll(epr, queryIDs); + + Vector newDataAvailable = new Vector(); + for(AnalysisEvent event: events){ + if(event != null && event.isCompleted()){ + queryIDs.remove(event.getQueryId()); + newDataAvailable.add(event.getQueryId()); + } + } + + // Parse and merge the new data into the existing contents + InputStream resultStream = AsyncClient.getResultStream(epr, newDataAvailable); + Element mobyDOM = asyncSoapTextToMobyDOM(resultStream); + MobyContentInstance newResults = MobyDataUtils.fromXMLDocument(mobyDOM); + // The merge + for(String jobid: newResults.keySet()){ + finalContents.put(jobid, newResults.get(jobid)); + } + + // Inform the handler that some data has been added to the response (for incremental display?) + if(newDataAvailable.size() > 0 && handler != null){ + MobyRequestEvent mre = new MobyRequestEvent(finalContents, this, null, requestId); + StringWriter xmlWriter = new StringWriter(); + MobyDataUtils.toXMLDocument(xmlWriter, finalContents); + + mre.setContentsXML(xmlWriter.toString()); + handler.processEvent(mre); + } + } + } catch (Exception e) { + e.printStackTrace(); + AsyncClient.destroy(epr); + throw new Exception("Exception occured while polling the service invocation: " + e); + } + + return finalContents; + } + + private Element asyncSoapTextToMobyDOM(InputStream inStream) throws Exception{ + Element soapDOM = null; + synchronized(docBuilder){ + soapDOM = docBuilder.parse(inStream).getDocumentElement(); + } + final boolean IS_ASYNC_SERVICE_CALL = true; + return decodeSOAPMessage(soapDOM, null, null, IS_ASYNC_SERVICE_CALL); } /** @@ -296,19 +372,19 @@ // This is the class that asynchronously calls the service and does a callback to // the handler specified in the invocation. class InvocationThread extends Thread { - MobyService service; + MobyService mservice; MobyRequest mobyRequest; MobyRequestEventHandler handler; int requestId; InvocationThread(MobyRequest mr, MobyRequestEventHandler h, int id){ mobyRequest = mr; - service = mobyRequest.getService(); + mservice = mobyRequest.getService(); handler = h; requestId = id; // Name the thread after the service being run, mostly for ease of debugging - setName(service.getName()+requestId); + setName(mservice.getName()+requestId); } public void run() { @@ -317,7 +393,7 @@ handler.start(mobyRequest, requestId); StringBuffer contentsXML = new StringBuffer(); //to be filled in by the RPC call below try{ - content = mobyRequest.invokeService(contentsXML); //RPC call... + content = mobyRequest.invokeService(contentsXML, handler, requestId); //RPC call... } catch(Exception e){ responseEvent = new MobyRequestEvent(content, mobyRequest, e, requestId); @@ -348,33 +424,6 @@ } /** - * @throws MobyException if the number of input parameters was wrong, or the paramters were of the wrong type. - */ - protected void verifyInput() throws MobyException{ - /*MobyData[] requiredInputData = mobyService.getPrimaryInputs(); - - if(requiredInputData == null){ - if(inputData != null && inputData.size() != 0){ - throw new MobyException("Service invocation expects no input parameters, " + - "but setInput has not been called with a null or zero-length array argument"); - } - return; // otherwise there are no parameters to check - } - if(inputData == null || inputData.size() == 0){ - throw new MobyException("Service invocation expects " + requiredInputData.length + " input " + - "parameters, but setInput has not been called to provide any input"); - } - if (requiredInputData.length != inputData.length){ - throw new MobyException("Wrong number of input parameters to service invocation method: expected " + - requiredInputData.length + ", but setInput was provided " + inputData.length); - }*/ - - // BUG WORKAROUND: Since the Moby-generated WSDL doesn't define the input, we assume the - // data types are right, and we just have to check the number of them. - - } - - /** * This method retrieves from Moby Central a copy of the WSDL document for the service * (or uses an internally cached copy from a previous invocation), and sets the variables for the * SOAP call appropriately so you can consequently call performSOAPRequest. @@ -469,6 +518,11 @@ } + public Element decodeSOAPMessage(Element n, StringBuffer contentsXMLOutput, String inputXML) + throws SOAPException, MobyException{ + return decodeSOAPMessage(n, contentsXMLOutput, inputXML, false); + } + /** * Isolates the MOBY Data from the SOAP message returned by the remote service host. * @@ -477,22 +531,29 @@ * * @return The root element of the MOBY response DOM */ - public Element decodeSOAPMessage(Element n, StringBuffer contentsXMLOutput, String inputXML) throws SOAPException, MobyException{ + public Element decodeSOAPMessage(Element n, StringBuffer contentsXMLOutput, String inputXML, boolean async) + throws SOAPException, MobyException{ if(n == null){ throw new SOAPException("SOAP Message given to decode is null"); } NodeList node_list = null; - Node responseNode = null; XPath responseElementXPath = null; try{ - responseElementXPath = new XPath("//"+ MobyPrefixResolver.MOBY_TRANSPORT_PREFIX+ - ":"+mobyService.getName()+"Response | //" + - mobyService.getName()+"Response | " + - "//"+ MobyPrefixResolver.MOBY_TRANSPORT_PREFIX+ - ":"+mobyService.getName() + " | //" + - mobyService.getName(), - null, mobyPrefixResolver, XPath.SELECT); + if(async){ + responseElementXPath = new XPath("//"+MobyPrefixResolver.WSRP_PREFIX + + ":"+AsyncClient.WSRP_MULTI_PROPERTY_TAG_NAME+"Response", + null, mobyPrefixResolver, XPath.SELECT); + } + else{ + responseElementXPath = new XPath("//"+ MobyPrefixResolver.MOBY_TRANSPORT_PREFIX+ + ":"+mobyService.getName()+"Response | //" + + mobyService.getName()+"Response | " + + "//"+ MobyPrefixResolver.MOBY_TRANSPORT_PREFIX+ + ":"+mobyService.getName() + " | //" + + mobyService.getName(), + null, mobyPrefixResolver, XPath.SELECT); + } }catch(TransformerException te){ throw new SOAPException("Cannot select SOAP nodes due to exception "+ "while compiling XPath statement (code bug?):" +te); @@ -513,8 +574,29 @@ throw new SOAPException("Found more than one response element in SOAP payload, " + "unable to resolve ambiguity of the payload (service provider error?)"); } - responseNode = node_list.item(0); + Node[] responseNodes = null; + if(async){ + Vector nodes = new Vector(); + NodeList resultNodeList = node_list.item(0).getChildNodes(); + for(int i = 0; resultNodeList != null && i < resultNodeList.getLength(); i++){ + if(!(resultNodeList.item(i) instanceof Element)){ + continue; + } + Element resultElement = (Element) resultNodeList.item(i); + if(resultElement.getLocalName().startsWith(AsyncClient.MOBY_RESULT_PROPERTY_PREFIX)){ + nodes.add(resultElement); + } + } + responseNodes = nodes.toArray(new Node[nodes.size()]); + } + else{ + responseNodes = new Node[]{node_list.item(0)}; + } + + Element domRoot = null; // Where the result will be put + + for(Node responseNode: responseNodes){ // Find base64 encoded elements in the SOAP message using XPath and // replace them with the real decoded contents node_list = null; @@ -597,7 +679,8 @@ } } - String localResponseString = ""; + Element predefinedDOM = null; // Choice of ripping DOM Element for moby payload out of SOAP DOM + String localResponseString = ""; // or storing raw XML strings, to be converted to a DOM later for(int j = 0; j < children.getLength(); j++){ Node child = children.item(j); if(child instanceof CDATASection || child instanceof Text){ @@ -612,16 +695,27 @@ } localResponseString += child.getNodeValue();//.replaceAll("<", "<").replaceAll(">", ">").replaceAll("(&|F)", "&"); } + if(child instanceof Element && child.getLocalName().equals(MobyTags.MOBY)){ + debugPS.println("Warning: The MOBY contents was found as raw XML inside the SOAP response!\n" + + "This is illegal according to the MOBY-API, please inform the service\n " + + " provider, as parsing such text may not be supported in the future"); + localResponseString = null; + // Store the moby payload root element's DOM represntation, so we don't + // have to serialize it to the localResponseString and then parse it out + // again (that would be wasteful). + predefinedDOM = (Element) child; + break; + } } - if(localResponseString.length() == 0){ + if(localResponseString != null && localResponseString.length() == 0){ throw new MobyException("The MOBY payload has no text contents at all"); } // Check if the payload is an XML document. If not, try a last ditch effort // by base64 decoding the contents. This is technically not allowable in the // MOBY spec, but we are being lenient. - if(!localResponseString.startsWith("\n"+localResponseString; @@ -652,15 +746,58 @@ // later on because once the document is parsed, there is no way to get the // spaces back! I set the attribute explicitly at the top level of each data // element to compensate. Unless of course this was already done. - if(localResponseString.indexOf("xml:space=\"preserve\"") == -1){ + if(localResponseString != null && localResponseString.indexOf("xml:space=\"preserve\"") == -1){ localResponseString = localResponseString.replaceAll(" gordonp Sat Mar 31 11:44:04 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap/sax/test In directory dev.open-bio.org:/tmp/cvs-serv23625/src/main/org/soap/sax/test Added Files: SOAPFaultTestCase.java SOAPMessage.xml WSRFMessage.xml Log Message: JUnit test cases for the SOAP/WSRF fault parsing moby-live/Java/src/main/org/soap/sax/test SOAPFaultTestCase.java,NONE,1.1 SOAPMessage.xml,NONE,1.1 WSRFMessage.xml,NONE,1.1 From gordonp at dev.open-bio.org Sat Mar 31 15:44:44 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Sat, 31 Mar 2007 11:44:44 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703311544.l2VFiikD023720@dev.open-bio.org> gordonp Sat Mar 31 11:44:44 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap In directory dev.open-bio.org:/tmp/cvs-serv23685/src/main/org/soap Modified Files: SOAPFault.java Log Message: Javadoc update moby-live/Java/src/main/org/soap SOAPFault.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/soap/SOAPFault.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/soap/SOAPFault.java 2007/03/30 19:16:49 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/soap/SOAPFault.java 2007/03/31 15:44:44 1.2 @@ -98,8 +98,7 @@ /** * - * @param xmlData - * the xml to parse into a SOAPFault object + * @param xmlData the xml to parse into a SOAPFault object. One of byte[], File or String * @return a SOAPFault object obtained by parsing the XML * @throws MobyException * if there was a problem parsing the xml From gordonp at dev.open-bio.org Sat Mar 31 15:45:30 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Sat, 31 Mar 2007 11:45:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703311545.l2VFjUJd023763@dev.open-bio.org> gordonp Sat Mar 31 11:45:30 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/soap/sax In directory dev.open-bio.org:/tmp/cvs-serv23728/src/main/org/soap/sax Modified Files: SOAPFaultParser.java Log Message: Got rid of superfluous new line characters in date and fualt code fields moby-live/Java/src/main/org/soap/sax SOAPFaultParser.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/soap/sax/SOAPFaultParser.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/soap/sax/SOAPFaultParser.java 2007/03/30 19:16:49 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/soap/sax/SOAPFaultParser.java 2007/03/31 15:45:30 1.2 @@ -239,7 +239,7 @@ sb.append(ch, start, length); if (inSoapFault && readingFaultCode) { - faultCodeBuffer.append(sb.toString().trim()+"\n"); + faultCodeBuffer.append(sb.toString().trim()); return; } if (inSoapFault && readingFaultString) { @@ -251,7 +251,7 @@ return; } if (inSoapFault && inWsrfFault && readingWsrfTimestamp) { - wsrfTimeBuffer.append(sb.toString().trim()+"\n"); + wsrfTimeBuffer.append(sb.toString().trim()); return; } From gordonp at dev.open-bio.org Sat Mar 31 17:22:09 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Sat, 31 Mar 2007 13:22:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200703311722.l2VHM94K023967@dev.open-bio.org> gordonp Sat Mar 31 13:22:09 EDT 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/omg/lsae/sax/test In directory dev.open-bio.org:/tmp/cvs-serv23935/src/main/org/omg/lsae/sax/test Added Files: LSAEMessage.xml SOAPMessage.xml AnalysisEventTestCase.java Log Message: Basic JUnit test cases for the SOAP/LSAE event parsing moby-live/Java/src/main/org/omg/lsae/sax/test LSAEMessage.xml,NONE,1.1 SOAPMessage.xml,NONE,1.1 AnalysisEventTestCase.java,NONE,1.1 From dag at dev.open-bio.org Tue Mar 20 20:05:46 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 20 Mar 2007 20:05:46 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703202005.l2KK5jO4013111@dev.open-bio.org> dag Tue Mar 20 16:05:45 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/moby/owldoc In directory dev.open-bio.org:/home/dag/s-moby/ontologies/moby/owldoc Log Message: Directory /home/repository/moby/s-moby/ontologies/moby/owldoc added to the repository s-moby/ontologies/moby/owldoc - New directory rcsdiff: /home/repository/moby/s-moby/ontologies/moby/owldoc/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/s-moby/ontologies/moby/owldoc/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/s-moby/ontologies/moby/owldoc/RCS/directory,v: No such file or directory From dag at dev.open-bio.org Tue Mar 20 20:06:18 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 20 Mar 2007 20:06:18 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703202006.l2KK6Hsk013138@dev.open-bio.org> dag Tue Mar 20 16:06:17 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/sswap/owldoc In directory dev.open-bio.org:/home/dag/s-moby/ontologies/sswap/owldoc Log Message: Directory /home/repository/moby/s-moby/ontologies/sswap/owldoc added to the repository s-moby/ontologies/sswap/owldoc - New directory rcsdiff: /home/repository/moby/s-moby/ontologies/sswap/owldoc/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/s-moby/ontologies/sswap/owldoc/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/s-moby/ontologies/sswap/owldoc/RCS/directory,v: No such file or directory From dag at dev.open-bio.org Tue Mar 20 20:10:22 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 20 Mar 2007 20:10:22 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703202010.l2KKAL6C013200@dev.open-bio.org> dag Tue Mar 20 16:10:21 EDT 2007 Update of /home/repository/moby/s-moby/ontologies In directory dev.open-bio.org:/home/dag/s-moby/ontologies Added Files: MO.tar.gz Log Message: Added files from s-moby_ncgr_20070314.tar provided by Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies MO.tar.gz,NONE,1.1 From dag at dev.open-bio.org Tue Mar 20 20:10:28 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 20 Mar 2007 20:10:28 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703202010.l2KKAR2w013223@dev.open-bio.org> dag Tue Mar 20 16:10:27 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/moby In directory dev.open-bio.org:/home/dag/s-moby/ontologies/moby Added Files: moby.owl Log Message: Added files from s-moby_ncgr_20070314.tar provided by Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies/moby moby.owl,NONE,1.1 From dag at dev.open-bio.org Tue Mar 20 20:10:33 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 20 Mar 2007 20:10:33 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703202010.l2KKAR0g013239@dev.open-bio.org> dag Tue Mar 20 16:10:27 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/moby/owldoc In directory dev.open-bio.org:/home/dag/s-moby/ontologies/moby/owldoc Added Files: IndexAllResources.html IndexAnnotationProperties.html IndexClasses.html IndexDatatypeProperties.html IndexIndividuals.html IndexObjectProperties.html IndexnullAllResources.html IndexnullAnnotationProperties.html IndexnullClasses.html IndexnullDatatypeProperties.html IndexnullIndividuals.html IndexnullObjectProperties.html abouturi.html contents.html datatypeproperty.html graph.html hasmapping.html index.html inputuri.html mapsto.html metadata.html name.html object.html objectproperty.html onelinedescription.html ontology.html operateson.html outputuri.html providedby.html provider.html providesresource.html resource.html subject.html Log Message: Added files from s-moby_ncgr_20070314.tar provided by Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies/moby/owldoc IndexAllResources.html,NONE,1.1 IndexAnnotationProperties.html,NONE,1.1 IndexClasses.html,NONE,1.1 IndexDatatypeProperties.html,NONE,1.1 IndexIndividuals.html,NONE,1.1 IndexObjectProperties.html,NONE,1.1 IndexnullAllResources.html,NONE,1.1 IndexnullAnnotationProperties.html,NONE,1.1 IndexnullClasses.html,NONE,1.1 IndexnullDatatypeProperties.html,NONE,1.1 IndexnullIndividuals.html,NONE,1.1 IndexnullObjectProperties.html,NONE,1.1 abouturi.html,NONE,1.1 contents.html,NONE,1.1 datatypeproperty.html,NONE,1.1 graph.html,NONE,1.1 hasmapping.html,NONE,1.1 index.html,NONE,1.1 inputuri.html,NONE,1.1 mapsto.html,NONE,1.1 metadata.html,NONE,1.1 name.html,NONE,1.1 object.html,NONE,1.1 objectproperty.html,NONE,1.1 onelinedescription.html,NONE,1.1 ontology.html,NONE,1.1 operateson.html,NONE,1.1 outputuri.html,NONE,1.1 providedby.html,NONE,1.1 provider.html,NONE,1.1 providesresource.html,NONE,1.1 resource.html,NONE,1.1 subject.html,NONE,1.1 From dag at dev.open-bio.org Tue Mar 20 20:10:35 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 20 Mar 2007 20:10:35 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703202010.l2KKAROc013271@dev.open-bio.org> dag Tue Mar 20 16:10:27 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/sswap/owldoc In directory dev.open-bio.org:/home/dag/s-moby/ontologies/sswap/owldoc Added Files: IndexAllResources.html IndexAnnotationProperties.html IndexClasses.html IndexDatatypeProperties.html IndexIndividuals.html IndexObjectProperties.html IndexnullAllResources.html IndexnullAnnotationProperties.html IndexnullClasses.html IndexnullDatatypeProperties.html IndexnullIndividuals.html IndexnullObjectProperties.html abouturi.html contents.html datatypeproperty.html graph.html hasmapping.html index.html inputuri.html mapsto.html metadata.html name.html object.html objectproperty.html onelinedescription.html ontology.html operateson.html outputuri.html providedby.html provider.html providesresource.html resource.html subject.html Log Message: Added files from s-moby_ncgr_20070314.tar provided by Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies/sswap/owldoc IndexAllResources.html,NONE,1.1 IndexAnnotationProperties.html,NONE,1.1 IndexClasses.html,NONE,1.1 IndexDatatypeProperties.html,NONE,1.1 IndexIndividuals.html,NONE,1.1 IndexObjectProperties.html,NONE,1.1 IndexnullAllResources.html,NONE,1.1 IndexnullAnnotationProperties.html,NONE,1.1 IndexnullClasses.html,NONE,1.1 IndexnullDatatypeProperties.html,NONE,1.1 IndexnullIndividuals.html,NONE,1.1 IndexnullObjectProperties.html,NONE,1.1 abouturi.html,NONE,1.1 contents.html,NONE,1.1 datatypeproperty.html,NONE,1.1 graph.html,NONE,1.1 hasmapping.html,NONE,1.1 index.html,NONE,1.1 inputuri.html,NONE,1.1 mapsto.html,NONE,1.1 metadata.html,NONE,1.1 name.html,NONE,1.1 object.html,NONE,1.1 objectproperty.html,NONE,1.1 onelinedescription.html,NONE,1.1 ontology.html,NONE,1.1 operateson.html,NONE,1.1 outputuri.html,NONE,1.1 providedby.html,NONE,1.1 provider.html,NONE,1.1 providesresource.html,NONE,1.1 resource.html,NONE,1.1 subject.html,NONE,1.1 From dag at dev.open-bio.org Tue Mar 20 20:10:38 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 20 Mar 2007 20:10:38 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703202010.l2KKARVQ013253@dev.open-bio.org> dag Tue Mar 20 16:10:27 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/sswap In directory dev.open-bio.org:/home/dag/s-moby/ontologies/sswap Added Files: sswap.owl Log Message: Added files from s-moby_ncgr_20070314.tar provided by Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies/sswap sswap.owl,NONE,1.1 From dag at dev.open-bio.org Tue Mar 27 15:25:22 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 27 Mar 2007 15:25:22 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703271525.l2RFPLUo003395@dev.open-bio.org> dag Tue Mar 27 11:25:21 EDT 2007 Update of /home/repository/moby/s-moby/ontologies In directory dev.open-bio.org:/home/dag/s-moby/ontologies Removed Files: MGED.tar.gz Log Message: Removed MGED.tar.gz and replaced ~35 files per Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies MGED.tar.gz,1.1,NONE rcsdiff: /home/repository/moby/s-moby/ontologies/RCS/MGED.tar.gz,v: No such file or directory From dag at dev.open-bio.org Tue Mar 27 15:25:32 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 27 Mar 2007 15:25:32 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703271525.l2RFPSNK003430@dev.open-bio.org> dag Tue Mar 27 11:25:28 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util In directory dev.open-bio.org:/home/dag/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util Modified Files: OBOFileClassCreator.java OBOFileIndividualCreator.java OwlFileSplitter.java Log Message: Removed MGED.tar.gz and replaced ~35 files per Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies/src/java/org/semanticmoby/ontologies/util OBOFileClassCreator.java,1.1,1.2 OBOFileIndividualCreator.java,1.5,1.6 OwlFileSplitter.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util/OBOFileClassCreator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util/OBOFileClassCreator.java 2006/12/04 00:26:55 1.1 +++ /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util/OBOFileClassCreator.java 2007/03/27 15:25:28 1.2 @@ -199,19 +199,9 @@ // standard namespaces, plus namespaces for "obo" and this ontology // file's namespace RDFFormatter formatter = newRDFFormatter(); - if (date != null) { - formatter.addNamespace("dc", "http://purl.org/dc/elements/1.1/"); - } // Write the header out in a standard format formatter.writeHeader(out); - - // If dc:date and dc:creator are used in the ontology, they must first - // be declared to be annotation properties (see OWL reference manual) - out.println(); - if (date != null) { - out.println(" "); - } out.println(); // Write out the Ontology header, as well as version information, date, @@ -219,16 +209,6 @@ out.println(" "); out.println(); - if (version != null) { - out.println(" " + xmlSafeString(version) + ""); - if (date == null) { - out.println(); - } - } - if (date != null) { - out.println(" " + xmlSafeString(date) + ""); - out.println(); - } for (Iterator it = classURIs.iterator(); it.hasNext();) { String uri = it.next().toString(); out.println(" "); @@ -262,6 +242,10 @@ // Write the RDF header out in standard format formatter.writeRDFHeader(out); out.println(); + out.println(" "); + out.println(" "); + out.println(" "); + out.println(); // Write the term as an OWL class with associated annotation properties out.println(" "); @@ -275,13 +259,14 @@ formatter.writeWrapped(out, term.classDef, 12, null); out.println(); out.println(" "); - out.println(); + out.println(); } if (term.classComment != null) { out.println(" "); formatter.writeWrapped(out, term.classComment, 12, null); out.println(); out.println(" "); + out.println(); } if (term.classIsObsolete != null) { out.println(" " + term.classIsObsolete + ""); @@ -290,20 +275,19 @@ Iterator it = term.supers.iterator(); if (it.hasNext()) { while (it.hasNext()) { - String className = it.next().toString(); - out.println(" "); + String className = (it.next().toString()).replaceAll(":", "_"); + out.println(" "); + out.println(" "); + out.println(" "); } out.println(); } else { - out.println(" "); + out.println(" "); + out.println(" "); + out.println(" "); out.println(); } - out.println(" "); - out.println(" "); - out.println(" "); out.println(); out.println(" "); out.println(); =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util/OBOFileIndividualCreator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util/OwlFileSplitter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util/OwlFileSplitter.java 2007/01/15 23:13:23 1.3 +++ /home/repository/moby/s-moby/ontologies/src/java/org/semanticmoby/ontologies/util/OwlFileSplitter.java 2007/03/27 15:25:28 1.4 @@ -33,6 +33,11 @@ private Resource ontologyResource = null; /** + * A resource referring to the base URI + */ + private Resource baseURIResource = null; + + /** * The Jena model from which the components to be written are read */ private Model source = null; @@ -52,18 +57,15 @@ this.contentWriter = writer; this.contentFile = saveContents(in, inputName, writer); - File owldocDir = new File(contentWriter.getContentDirectory(), "owldoc"); - owldocDir.mkdir(); - - this.owldocWriter = new OwlDocWriter(contentFile, owldocDir); - try { // Read the OWL file as a Jena2 Model object and replace hashes // with slashes among the resources in the model FileInputStream fileIn = new FileInputStream(contentFile); this.source = ModelFactory.createDefaultModel(); source.read(fileIn, ""); - replaceHashesWithSlashes(); + this.source = replaceHashesWithSlashes(); + this.baseURIResource = ResourceFactory.createResource( + source.getNsPrefixURI("")); } catch (Throwable t) { IOException e = new IOException( "Specified OWL file could not be parsed:"); @@ -157,13 +159,18 @@ * @throws IOException if any of these files could not be written */ public void process() throws Exception { + +// File owldocDir = new File(contentWriter.getContentDirectory(), "owldoc"); +// owldocDir.mkdir(); +// this.owldocWriter = new OwlDocWriter(contentFile, owldocDir); + writeContentFile(); writeOntologyFile(); writeFilesFor(OWL.Class); writeFilesFor(OWL.DatatypeProperty); writeFilesFor(OWL.ObjectProperty); - owldocWriter.write(); - writeOwldocFiles(); +// owldocWriter.write(); +// writeOwldocFiles(); contentWriter.close(); } @@ -174,39 +181,37 @@ * base-uri/name), and updates statements whose subjects or objects point * at them to point at the replacement resources */ - private void replaceHashesWithSlashes() { + private Model replaceHashesWithSlashes() { + + // A new model to return + Model newModel = ModelFactory.createDefaultModel(); + newModel.setNsPrefixes(source.getNsPrefixMap()); // Collect all the non-blank resources that are declared to be of // rdf:type owl:Class, owl:DatatypeProperty, or owl:ObjectProperty List allResources = classesAndProperties(source); - // Look at all the resources, and for those that have hashes, - // create a replacement that has the hash changed to a slash + // Create a replacement for each resource, replacing a hash with a slash Map newResources = new HashMap(); for (Iterator it = allResources.iterator(); it.hasNext();) { Resource currentResource = (Resource) it.next(); String uri = currentResource.getURI(); - if (uri.indexOf('#') > -1) { - newResources.put( - currentResource, - ResourceFactory.createResource( - uri.replaceFirst("#", "/"))); - } + newResources.put( + currentResource, + ResourceFactory.createResource( + uri.indexOf('#') > -1 + ? uri.replaceFirst("#", "/") + : uri)); } - // Statements to remove (because their subjects need to be changed) - // or add (because they replace the ones that need removing). These - // are collected since it's unwise to modify the model while iterating - // over its statements - Model toRemove = ModelFactory.createDefaultModel(); - Model toAdd = ModelFactory.createDefaultModel(); - - // Check each statement in the model to see if its subject - // or object points to a resource that has a replacement + // Create a replacement statement for each one in the model, + // nd add the new statement to the new model for (StmtIterator it = source.listStatements(); it.hasNext();) { Statement stmt = it.nextStatement(); + Resource subj = stmt.getSubject(); + Property pred = stmt.getPredicate(); RDFNode obj = stmt.getObject(); // Check to see if there is a replacement resource for the @@ -214,30 +219,15 @@ Resource newSubj = (Resource) newResources.get(subj); Resource newObj = (Resource) newResources.get(obj); - if (newSubj != null) { - // The subject of a statement can't be changed, so a new - // statement must be created and the old one marked for - // removal. Note that the object of the statement could - // also be in need of replacement, hence the check for - // newObj - toRemove.add(stmt); - toAdd.add( - source.createStatement( - newSubj, - stmt.getPredicate(), - newObj == null ? obj : newObj)); - - } else if (newObj != null) { - // The object of a statement can be changed. Since we don't - // need to add or remove any statements, it's safe to do it - // right here in the loop - stmt.changeObject(newObj); - } + Statement newStmt = newModel.createStatement( + ((newSubj == null) ? subj : newSubj), + pred, + ((newObj == null) ? obj : newObj)); + + newModel.add(newStmt); } - - // Remove the statements marked for removal and add their replacements - source.remove(toRemove); - source.add(toAdd); + + return newModel; } /** @@ -256,12 +246,12 @@ */ private void writeOntologyFile() throws IOException { - // Find the statement, if any, that says that some URI - // is of rdf:type owl:Ontology. + // Find the statement, if any, that says that some URI + // is of rdf:type owl:Ontology. StmtIterator it = source.listStatements(null, RDF.type, OWL.Ontology); - if (! it.hasNext()) return; - - String uri = it.nextStatement().getSubject().getURI(); + if (! it.hasNext()) return; + + String uri = it.nextStatement().getSubject().getURI(); // The base URI of all elements will be the above URI with a // trailing forward slash (if it doesn't already have one) @@ -351,14 +341,12 @@ source, head, null, visited); reachable.setNsPrefixes(source.getNsPrefixMap()); - // Assert that the resource is itself an ontology - reachable.add(reachable.createStatement( - head, RDF.type, OWL.Ontology)); - // Import the owlOntology "master ontology" if (ontologyResource != null) { reachable.add(reachable.createStatement( - head, OWL.imports, ontologyResource)); + baseURIResource, RDF.type, OWL.Ontology)); + reachable.add(reachable.createStatement( + baseURIResource, OWL.imports, ontologyResource)); } reachable.write(contentWriter.outputStreamFor(elementName)); } From dag at dev.open-bio.org Tue Mar 27 15:25:34 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 27 Mar 2007 15:25:34 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703271525.l2RFPSsw003524@dev.open-bio.org> dag Tue Mar 27 11:25:28 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/sswap In directory dev.open-bio.org:/home/dag/s-moby/ontologies/sswap Modified Files: Graph Object Provider Resource Subject aboutURI datatypeProperty hasMapping inputURI mapsTo name objectProperty oneLineDescription operatesOn outputURI owlOntology providedBy providesResource sswap.owl Log Message: Removed MGED.tar.gz and replaced ~35 files per Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies/sswap Graph,1.1,1.2 Object,1.1,1.2 Provider,1.1,1.2 Resource,1.1,1.2 Subject,1.1,1.2 aboutURI,1.1,1.2 datatypeProperty,1.1,1.2 hasMapping,1.1,1.2 inputURI,1.1,1.2 mapsTo,1.1,1.2 name,1.1,1.2 objectProperty,1.1,1.2 oneLineDescription,1.1,1.2 operatesOn,1.1,1.2 outputURI,1.1,1.2 owlOntology,1.1,1.2 providedBy,1.1,1.2 providesResource,1.1,1.2 sswap.owl,1.1,1.2 =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/Graph,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/Graph 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/Graph 2007/03/27 15:25:28 1.2 @@ -9,21 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - + A required class. A sswap:Graph delineates a root or entry point for a suite of mappings. For services, a "mapping" embeds the concept of taking some input and returning some output. An individual of this class is the object of the sswap:hasMapping relationship from sswap:Resource. By differentially using sswap:operatesOn and sswap:hasMapping, one can, for example, differentiate between a pair of lists and a list of pairs. - - A required class. A sswap:Graph delineates a root or entry - point for a suite of mappings. For services, a "mapping" - embeds the concept of taking some input and returning some - output. An individual of this class is the object of the - sswap:hasMapping relationship from sswap:Resource. By - differentially using sswap:operatesOn and sswap:hasMapping, - one can, for example, differentiate between a pair of lists - and a list of pairs. - + + + =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/Object,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/Object 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/Object 2007/03/27 15:25:28 1.2 @@ -9,20 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + - - + A required class. In the concept of a service mapping an input to an output, the sswap:Object corresponds to the output. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from an input to this output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject. - - A required class. In the concept of a service mapping an input to - an output, the sswap:Object corresponds to the output. The property - sswap:mapsTo explicitly demarcates the mapping (or transformation) - from an input to this output. One can also use sswap:mapsTo to - describe inverse mappings where the stated relationship is *from* - sswap:Object to sswap:Subject. - + + + =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/Provider,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/Provider 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/Provider 2007/03/27 15:25:28 1.2 @@ -9,19 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + - - + A required class. This class designates the provider of one or more resources. Providers claim ownership of resources and are anticipated to be associated with actual organizations such as W3C, NCBI, etc. Providers may state that they provide multiple resources by using multiple providesResource properties. - - A required class. This class designates the provider of one or - more resources. Providers claim ownership of resources and are - anticipated to be associated with actual organizations such as - W3C, NCBI, etc. Providers may state that they provide multiple - resources by using multiple providesResource properties. - + + + =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/Resource,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/Resource 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/Resource 2007/03/27 15:25:28 1.2 @@ -9,18 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + - - + A required class. This class designates the semantically described resource. Resources that "do things," for example, transform input (sswap:Subject) to output (sswap:Object) are commonly called services. Resources may also be web pages, ontologies, etc. - - A required class. This class designates the semantically described - resource. Resources that "do things," for example, transform input - (sswap:Subject) to output (sswap:Object) are commonly called services. - Resources may also be web pages, ontologies, etc. - + + + =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/Subject,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/Subject 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/Subject 2007/03/27 15:25:28 1.2 @@ -9,20 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + - - + A required class. In the concept of a service mapping an input to an output, the sswap:Subject corresponds to the input. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from this input to its output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject. - - A required class. In the concept of a service mapping an input - to an output, the sswap:Subject corresponds to the input. The - property sswap:mapsTo explicitly demarcates the mapping (or - transformation) from this input to its output. One can also - use sswap:mapsTo to describe inverse mappings where the stated - relationship is *from* sswap:Object to sswap:Subject. - + + + =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/aboutURI,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/aboutURI 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/aboutURI 2007/03/27 15:25:28 1.2 @@ -9,22 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - Points to a URI for additional information about its domain - object. It is expected that the URI may be a human-readable - web page (an HTML resource). Programs may dereference the URI - to provide users with additional information describing a - sswap:Resource or sswap:Provider. - + Points to a URI for additional information about its domain object. It is expected that the URI may be a human-readable web page (an HTML resource). Programs may dereference the URI to provide users with additional information describing a sswap:Resource or sswap:Provider. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/datatypeProperty,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/datatypeProperty 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/datatypeProperty 2007/03/27 15:25:28 1.2 @@ -9,16 +9,14 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + - - - - - Super property for all sswap datatype properties. This property - is not used directly so it has no domain and range. - + Super property for all sswap datatype properties. This property is not used directly so it has no domain and range. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/hasMapping,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/hasMapping 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/hasMapping 2007/03/27 15:25:28 1.2 @@ -9,20 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - A property that connects a sswap:Graph to a sswap:Subject. The - sswap:Subject's subgraph then contains the relevant mappings of - an input (sswap:Subject) to its output (sswap:Object). - + A property that connects a sswap:Graph to a sswap:Subject. The sswap:Subject's subgraph then contains the relevant mappings of an input (sswap:Subject) to its output (sswap:Object). =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/inputURI,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/inputURI 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/inputURI 2007/03/27 15:25:28 1.2 @@ -9,21 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - Resources may require special user interfaces to gather input - such as using web pages to solicit input from users. Programs - that are preparing to invoke a resource may direct users to the - URI pointed to by this property for the appropriate user interface. - + Resources may require special user interfaces to gather input such as using web pages to solicit input from users. Programs that are preparing to invoke a resource may direct users to the URI pointed to by this property for the appropriate user interface. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/mapsTo,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/mapsTo 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/mapsTo 2007/03/27 15:25:28 1.2 @@ -9,24 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - A property that connects a sswap:Subject to a sswap:Object, or - vice-versa. For services, this is usually used to establish the - transformation from the input to the output. This property is - directional (imples a mapping from the domain to the range), but - can be used as its own inverse. So one may delineate a mapping - from sswap:Subject to sswap:Object, and use another sswap:mapsTo - to delineate a mapping from sswap:Object to sswap:Subject. - + A property that connects a sswap:Subject to a sswap:Object, or vice-versa. For services, this is usually used to establish the transformation from the input to the output. This property is directional (imples a mapping from the domain to the range), but can be used as its own inverse. So one may delineate a mapping from sswap:Subject to sswap:Object, and use another sswap:mapsTo to delineate a mapping from sswap:Object to sswap:Subject. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/name,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/name 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/name 2007/03/27 15:25:28 1.2 @@ -9,19 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - A human-readable name of an sswap:Resource or sswap:Provider. This - property may be used by programs to display a name to users. - + A human-readable name of an sswap:Resource or sswap:Provider. This property may be used by programs to display a name to users. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/objectProperty,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/objectProperty 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/objectProperty 2007/03/27 15:25:28 1.2 @@ -9,15 +9,14 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> - - - + + + + - - Super property for all sswap object properties. This property is - not used directly so it has no domain and range. - + Super property for all sswap object properties. This property is not used directly so it has no domain and range. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/oneLineDescription,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/oneLineDescription 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/oneLineDescription 2007/03/27 15:25:28 1.2 @@ -9,19 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - A one line, human-readable description that programs may use to - display brief information about a sswap:Resource or sswap:Provider. - + A one line, human-readable description that programs may use to display brief information about a sswap:Resource or sswap:Provider. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/operatesOn,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/operatesOn 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/operatesOn 2007/03/27 15:25:28 1.2 @@ -9,20 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - A property that connects a sswap:Resource to a sswap:Graph. The - sswap:Graph's subgraph then contains the relevant mappings of an - input (sswap:Subject) to its output (sswap:Object). - + A property that connects a sswap:Resource to a sswap:Graph. The sswap:Graph's subgraph then contains the relevant mappings of an input (sswap:Subject) to its output (sswap:Object). =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/outputURI,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/outputURI 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/outputURI 2007/03/27 15:25:28 1.2 @@ -9,6 +9,9 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + @@ -16,15 +19,8 @@ - - - - - Resources may require special user interfaces to display output - such as using web pages to dispay output to users. Programs that - are handling a resource's response may direct users to the URI - pointed to by this property to handle the result graph. - + Resources may require special user interfaces to display output such as using web pages to dispay output to users. Programs that are handling a resource's response may direct users to the URI pointed to by this property to handle the result graph. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owlOntology,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owlOntology 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owlOntology 2007/03/27 15:25:28 1.2 @@ -12,47 +12,18 @@ - - The SSWAP Protocol. Importing this one file causes a cascade - of imports to bring in all definitions of the entire ontology. - - - - - - - - - - - - - - - - - - - - - - - - - + Definitions of the classes and properties that make up the SSWAP Protocol. + + March 2007 A + http://ontologies.ncgr.org/moby + http://ontologies.ncgr.org/moby + + + =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/providedBy,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/providedBy 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/providedBy 2007/03/27 15:25:28 1.2 @@ -9,22 +9,18 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + + - - - - - A property identifiying the entity providing the Resource. - The Provider's URL must be in the same domain as the Resource, - unless the Provider explicitly claims the Resource by including - a providesResource statement, pointing at the Resource, in the - Provider's description graph. - + A property identifiying the entity providing the Resource. The Provider's URL must be in the same domain as the Resource, unless the Provider explicitly claims the Resource by including a providesResource statement, pointing at the Resource, in the Provider's description graph. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/providesResource,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/providesResource 2007/01/15 23:19:02 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/providesResource 2007/03/27 15:25:28 1.2 @@ -9,6 +9,9 @@ xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"> + + + @@ -16,15 +19,8 @@ - - - - - A property identifiying the provided Resource. The Resources's URL - must be in the same domain as the Provider, unless the Resource - explicitly claims the Provider by including a providedBy statement, - pointing at the Provider, in the Resources's description graph. - + A property identifiying the provided Resource. The Resources's URL must be in the same domain as the Provider, unless the Resource explicitly claims the Provider by including a providedBy statement, pointing at the Provider, in the Resources's description graph. =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/sswap.owl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/sswap.owl 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/sswap.owl 2007/03/27 15:25:28 1.2 @@ -1,450 +1,320 @@ - + + - - - + + + + ]> - - - - December 2006 A - - This is the single file version of the SSWAP Protocol. + + + December 2006 A + This is the single file version of the SSWAP Protocol. It is appropriate for reading and viewing by editors such as Protege that do not handle distributed, modular ontologies (where each term is defined in a separate file). This file is for reference only; for actually using SSWAP, use the terms (each in its own file) at the URL indicated by the sswap: prefix. For an interactive "Clickable Protocol" visit http://sswap.info/protocol.jsp. - - http://ontologies.ncgr.org/moby - - http://ontologies.ncgr.org/moby - - - - - - A required class. This class designates the provider of one or more resources. Providers claim ownership of resources and are anticipated to be associated with actual organizations such as W3C, NCBI, etc. Providers may state that they provide multiple resources by using multiple providesResource properties. - - - - - - - - 1 - - - - - 1 - - - - - 1 - - - - - 1 - - - - - 1 - - - - - - - - - - - - - - - - - A required class. This class designates the semantically described resource. Resources that "do things," for example, transform input (sswap:Subject) to output (sswap:Object) are commonly called services. Resources may also be web pages, ontologies, etc. - - - - - - - - 1 - - - - - 1 - - - - - 1 - - - - - 1 - - - - - 1 - - - - - 1 - - - - - - - - - - 1 - - - - - 1 - - - - - - - - - - - - - - - - A required class. A sswap:Graph delineates a root or entry point for a suite of mappings. For services, a "mapping" embeds the concept of taking some input and returning some output. An individual of this class is the object of the sswap:hasMapping relationship from sswap:Resource. By differentially using sswap:operatesOn and sswap:hasMapping, one can, for example, differentiate between a pair of lists and a list of pairs. - - - - - - - - 1 - - - - - - - - - - 1 - - - - - - - - - - - - A required class. In the concept of a service mapping an input to an output, the sswap:Subject corresponds to the input. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from this input to its output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject. - - - - - - - - 1 - - - - - - - - - - 1 - - - - - - - - - - - - A required class. In the concept of a service mapping an input to an output, the sswap:Object corresponds to the output. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from an input to this output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject. - - - - - - - - - - - - - 1 - - - - - - - - - - - - Super property for all sswap object properties. This property is not used directly so it has no domain and range. - - - - - - - - - A property that connects a sswap:Graph to a sswap:Subject. The sswap:Subject's subgraph then contains the relevant mappings of an input (sswap:Subject) to its output (sswap:Object). - - - - - - - - - - - - A property that connects a sswap:Subject to a sswap:Object, or vice-versa. For services, this is usually used to establish the transformation from the input to the output. This property is directional (implies a mapping from the domain to the range), but can be used as its own inverse. So one may delineate a mapping from sswap:Subject to sswap:Object, and use another sswap:mapsTo to delineate a mapping from sswap:Object to sswap:Subject. - - - - - - - - - - - - - - - - - - - - - - - - - - - A property that connects a sswap:Resource to a sswap:Graph. The sswap:Graph's subgraph then contains the relevant mappings of an input (sswap:Subject) to its output (sswap:Object). - - - - - - - - - - - - A property identifying the entity providing the Resource. The Provider's URL must be in the same domain as the Resource, unless the Provider explicitly claims the Resource by including a providesResource statement, pointing at the Resource, in the Provider's description graph. - - - - - - - - - - - - - - A property identifying the provided Resource. The Resource's URL must be in the same domain as the Provider, unless the Resource explicitly claims the Provider by including a providedBy statement, pointing at the Provider, in the Resource's description graph. - - - - - - - - - - - - Super property for all sswap datatype properties. This property is not used directly so it has no domain and range. - + http://ontologies.ncgr.org/moby + http://ontologies.ncgr.org/moby + + + + + + + + + + + + + Points to a URI for additional information about its domain object. It is expected that the URI may be a human-readable web page (an HTML resource). Programs may dereference the URI to provide users with additional information describing a sswap:Resource or sswap:Provider. - - - - - - - Points to a URI for additional information about its domain object. It is expected that the URI may be a human-readable web page (an HTML resource). Programs may dereference the URI to provide users with additional information describing a sswap:Resource or sswap:Provider. - - - - - - - - - - - - - - - - - - - - Resources may require special user interfaces to gather input such as using web pages to solicit input from users. Programs that are preparing to invoke a resource may direct users to the URI pointed to by this property for the appropriate user interface. - - - - - - - - - - - - Points to a URI that may contain words, phrases, or other such text that programs may use to parse keywords associated with the property's object. - - - - - - - - - - - - - - - - - - - - - - - - A human-readable name of an sswap:Resource or sswap:Provider. This property may be used by programs to display a name to users. - - - - - - - - - - - - - - - - - - - A one line, human-readable description that programs may use to display brief information about a sswap:Resource or sswap:Provider. - - - - - - - - - - - - - - - - - - - - Resources may require special user interfaces to display output such as using web pages to display output to users. Programs that are handling a resource's response may direct users to the URI pointed to by this property to handle the result graph. - - - - - - + + Super property for all sswap datatype properties. This property is not used directly so it has no domain and range. + + + + + + + + 1 + + + + + + + + 1 + + + + + + A required class. A sswap:Graph delineates a root or entry point for a suite of mappings. For services, a "mapping" embeds the concept of taking some input and returning some output. An individual of this class is the object of the sswap:hasMapping relationship from sswap:Resource. By differentially using sswap:operatesOn and sswap:hasMapping, one can, for example, differentiate between a pair of lists and a list of pairs. + + + + + + A property that connects a sswap:Graph to a sswap:Subject. The sswap:Subject's subgraph then contains the relevant mappings of an input (sswap:Subject) to its output (sswap:Object). + + + + + + Resources may require special user interfaces to gather input such as using web pages to solicit input from users. Programs that are preparing to invoke a resource may direct users to the URI pointed to by this property for the appropriate user interface. + + + + + + + + + + + + + + + + + + + + A property that connects a sswap:Subject to a sswap:Object, or vice-versa. For services, this is usually used to establish the transformation from the input to the output. This property is directional (implies a mapping from the domain to the range), but can be used as its own inverse. So one may delineate a mapping from sswap:Subject to sswap:Object, and use another sswap:mapsTo to delineate a mapping from sswap:Object to sswap:Subject. + + + + + + + + + + + + + + + Points to a URI that may contain words, phrases, or other such text that programs may use to parse keywords associated with the property's object. + + + + + + + + + + + + + A human-readable name of an sswap:Resource or sswap:Provider. This property may be used by programs to display a name to users. + + + + + + + + + + + + 1 + + + + + + A required class. In the concept of a service mapping an input to an output, the sswap:Object corresponds to the output. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from an input to this output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject. + + + Super property for all sswap object properties. This property is not used directly so it has no domain and range. + + + + + + + + + + + + + A one line, human-readable description that programs may use to display brief information about a sswap:Resource or sswap:Provider. + + + + + + A property that connects a sswap:Resource to a sswap:Graph. The sswap:Graph's subgraph then contains the relevant mappings of an input (sswap:Subject) to its output (sswap:Object). + + + + + + Resources may require special user interfaces to display output such as using web pages to display output to users. Programs that are handling a resource's response may direct users to the URI pointed to by this property to handle the result graph. + + + + + + + A property identifying the entity providing the Resource. The Provider's URL must be in the same domain as the Resource, unless the Provider explicitly claims the Resource by including a providesResource statement, pointing at the Resource, in the Provider's description graph. + + + + + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + + + + + + + A required class. This class designates the provider of one or more resources. Providers claim ownership of resources and are anticipated to be associated with actual organizations such as W3C, NCBI, etc. Providers may state that they provide multiple resources by using multiple providesResource properties. + + + + + + + A property identifying the provided Resource. The Resource's URL must be in the same domain as the Provider, unless the Resource explicitly claims the Provider by including a providedBy statement, pointing at the Provider, in the Resource's description graph. + + + + + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + + + + + 1 + + + + 1 + + + + + + + + + + A required class. This class designates the semantically described resource. Resources that "do things," for example, transform input (sswap:Subject) to output (sswap:Object) are commonly called services. Resources may also be web pages, ontologies, etc. + + + Super class of all SSWAP classes. + + + + + + + + 1 + + + + + + + + 1 + + + + + + A required class. In the concept of a service mapping an input to an output, the sswap:Subject corresponds to the input. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from this input to its output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject. + + From dag at dev.open-bio.org Tue Mar 27 15:25:36 2007 From: dag at dev.open-bio.org (Chris Dagdigian) Date: Tue, 27 Mar 2007 15:25:36 -0000 Subject: [MOBY-guts] biomoby commit Message-ID: <200703271525.l2RFPSrT003576@dev.open-bio.org> dag Tue Mar 27 11:25:28 EDT 2007 Update of /home/repository/moby/s-moby/ontologies/sswap/owldoc In directory dev.open-bio.org:/home/dag/s-moby/ontologies/sswap/owldoc Modified Files: IndexAllResources.html IndexClasses.html IndexnullAllResources.html IndexnullClasses.html graph.html object.html provider.html resource.html subject.html Log Message: Removed MGED.tar.gz and replaced ~35 files per Teri Gomez @ NCGR -- Chris Dagdigian s-moby/ontologies/sswap/owldoc IndexAllResources.html,1.1,1.2 IndexClasses.html,1.1,1.2 IndexnullAllResources.html,1.1,1.2 IndexnullClasses.html,1.1,1.2 graph.html,1.1,1.2 object.html,1.1,1.2 provider.html,1.1,1.2 resource.html,1.1,1.2 subject.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexAllResources.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexAllResources.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexAllResources.html 2007/03/27 15:25:28 1.2 @@ -7,5 +7,5 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

All Resources

Generated with OWLDoc
+

All Resources

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexClasses.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexClasses.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexClasses.html 2007/03/27 15:25:28 1.2 @@ -7,5 +7,5 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

All Classes

Generated with OWLDoc
+

All Classes

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexnullAllResources.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexnullAllResources.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexnullAllResources.html 2007/03/27 15:25:28 1.2 @@ -7,5 +7,5 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

[•] Resources

Generated with OWLDoc
+

[•] Resources

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexnullClasses.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexnullClasses.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/IndexnullClasses.html 2007/03/27 15:25:28 1.2 @@ -7,5 +7,5 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

[•] Classes

Generated with OWLDoc
+

[•] Classes

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/graph.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/graph.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/graph.html 2007/03/27 15:25:28 1.2 @@ -7,11 +7,11 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

Class: Graph

A required class. A sswap:Graph delineates a root or entry point for a suite of mappings. For services, a "mapping" embeds the concept of taking some input and returning some output. An individual of this class is the object of the sswap:hasMapping relationship from sswap:Resource. By differentially using sswap:operatesOn and sswap:hasMapping, one can, for example, differentiate between a pair of lists and a list of pairs.

•owl:Thing
        •Graph

Super Classes

owl:Thing

Equivalent Classes (Necessary and Sufficient Conditions)

hasMapping MIN 1 owl:Thing
hasMapping ONLY Subject
metaData MAX 1 owl:Thing

Abstract Syntax

Class(Graph complete annotation(rdfs:comment "A required class. A sswap:Graph delineates a root or entry point for a suite of mappings.  For services, a "mapping" embeds the concept of taking some input and returning some output. An individual of this class is the object of the sswap:hasMapping relationship from sswap:Resource.  By differentially using sswap:operatesOn and sswap:hasMapping, one can, for example, differentiate between a pair of lists and a list of pairs."^^<http://www.w3.org/2001/XMLSchema#string>)
+

Class: Graph

A required class. A sswap:Graph delineates a root or entry point for a suite of mappings. For services, a "mapping" embeds the concept of taking some input and returning some output. An individual of this class is the object of the sswap:hasMapping relationship from sswap:Resource. By differentially using sswap:operatesOn and sswap:hasMapping, one can, for example, differentiate between a pair of lists and a list of pairs.

•owl:Thing
        •SSWAP
                •Graph

Super Classes

Equivalent Classe! s (Necessary and Sufficient Conditions)

hasMapping MIN 1 owl:Thing
hasMapping ONLY Subject
metaData MAX 1 owl:Thing

Abstract Syntax

Class(Graph complete annotation(rdfs:comment "A required class. A sswap:Graph delineates a root or entry point for a suite of mappings.  For services, a "mapping" embeds the concept of taking some input and returning some output. An individual of this class is the object of the sswap:hasMapping relationship from sswap:Resource.  By differentially using sswap:operatesOn and sswap:hasMapping, one can, for example,!
  differentiate between a pair of lists and a list of pairs."^^!
 <http
://www.w3.org/2001/XMLSchema#string>)
                     restriction(hasMapping minCardinality(1))
                     restriction(hasMapping allValuesFrom(Subject))
                     restriction(metaData maxCardinality(1)))
 
-SubClassOf(Graph owl:Thing)
+SubClassOf(Graph SSWAP)
 

Usage

Class Description/Definition (Necessary Conditions)

Domain of

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/object.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/object.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/object.html 2007/03/27 15:25:28 1.2 @@ -7,10 +7,10 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

Class: Object

A required class. In the concept of a service mapping an input to an output, the sswap:Object corresponds to the output. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from an input to this output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject.

•owl:Thing
        •Object

Super Classes

owl:Thing

Equivalent Classes (Necessary and Sufficient Conditions)

mapsTo ONLY Subject
metaData MAX 1 owl:Thing

Abstract Syntax

Class(Object complete annotation(rdfs:comment "A required class. In the concept of a service mapping an input to an output, the sswap:Object corresponds to the output. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from an input to this output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject."^^<http://www.w3.org/2001/XMLSchema#string>)
+

Class: Object

A required class. In the concept of a service mapping an input to an output, the sswap:Object corresponds to the output. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from an input to this output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject.

•owl:Thing
        •SSWAP
                •Object

Super Classes

Equivalent Classes (Necessary and Sufficient Conditions)

!
mapsTo ONLY Subject
metaData MAX 1 owl:Thing

Abstract Syntax

Class(Object complete annotation(rdfs:comment "A required class. In the concept of a service mapping an input to an output, the sswap:Object corresponds to the output. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from an input to this output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject."^^<http://www.w3.org/2001/XMLSchema#string>)
                      restriction(mapsTo allValuesFrom(Subject))
                      restriction(metaData maxCardinality(1)))
 
-SubClassOf(Object owl:Thing)
+SubClassOf(Object SSWAP)
 

Usage

Class Description/Definition (Necessary Conditions)

Domain of

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/provider.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/provider.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/provider.html 2007/03/27 15:25:28 1.2 @@ -7,7 +7,7 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

Class: Provider

A required class. This class designates the provider of one or more resources. Providers claim ownership of resources and are anticipated to be associated with actual organizations such as W3C, NCBI, etc. Providers may state that they provide multiple resources by using multiple providesResource properties.

•owl:Thing
        •Provider

Super Classes

owl:Thing

Equivalent Classes (Necessary and Sufficient Conditions)

aboutURI MAX 1 owl:Thing
metaData MAX 1 ! ;owl:Thing
name EQ 1 owl:Thing
oneLineDescription MAX 1 owl:Thing
providesResource MIN 1 owl:Thing
providesResource ONLY Resource

Abstract Syntax

Class(Provider complete annotation(rdfs:comment "A required class.  This class designates the provider of one or more resources. Providers claim ownership of resources and are anticipated to be associated with actual organizations such as W3C, NCBI, etc.  Providers may state that they provide multi!
 ple resources by using multiple providesResource properties."^!
 ^<htt
p://www.w3.org/2001/XMLSchema#string>)
+

Class: Provider

A required class. This class designates the provider of one or more resources. Providers claim ownership of resources and are anticipated to be associated with actual organizations such as W3C, NCBI, etc. Providers may state that they provide multiple resources by using multiple providesResource properties.

•owl:Thing
        •SSWAP
                •Provider

Super Classes

Equivalent Classes (Necessary and Sufficient Conditions)

aboutURI MAX 1 owl:Thing
metaData MAX 1 owl:Thing
name EQ 1 owl:Thing
oneLineDescription MAX 1 owl:Thing
providesResource MIN 1 owl:Thing
providesResource ONLY Resource

Abstract Syntax

Class(Provider complete annotation(rdfs:comment "A required class.  This class designates the !
 provider of one or more resources. Providers claim ownership o!
 f resour
ces and are anticipated to be associated with actual organizations such as W3C, NCBI, etc.  Providers may state that they provide multiple resources by using multiple providesResource properties."^^<http://www.w3.org/2001/XMLSchema#string>)
                        restriction(aboutURI maxCardinality(1))
                        restriction(metaData maxCardinality(1))
                        restriction(name cardinality(1))
@@ -15,6 +15,6 @@
                        restriction(providesResource minCardinality(1))
                        restriction(providesResource allValuesFrom(Resource)))
 
-SubClassOf(Provider owl:Thing)
+SubClassOf(Provider SSWAP)
 

Usage

Class Description/Definition (Necessary Conditions)

Domain of

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/resource.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/resource.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/resource.html 2007/03/27 15:25:28 1.2 @@ -7,7 +7,7 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

Class: Resource

A required class. This class designates the semantically described resource. Resources that "do things," for example, transform input (sswap:Subject) to output (sswap:Object) are commonly called services. Resources may also be web pages, ontologies, etc.

•owl:Thing
        •Resource

Super Classes

owl:Thing

Equivalent Classes (Necessary and Sufficient Conditions)

aboutURI MAX 1 owl:Thing
inputURI MAX 1 owl:Thing
metaData MAX 1 owl:Thing
name EQ 1 owl:Thing
oneLineDescription MAX 1 owl:Thing
operatesOn MIN 1 owl:Thing
operatesOn ONLY Graph
outputURI MAX 1 owl:Thing
providedBy EQ 1 owl:Thing
! providedBy ONLY Provider

Abstract Syntax

Class(Resource complete annotation(rdfs:comment "A required class. This class designates the semantically described resource. Resources that "do things," for example, transform input (sswap:Subject) to output (sswap:Object) are commonly called services. Resources may also be web pages, ontologies, etc."^^<http://www.w3.org/2001/XMLSchema#string>)
+

Class: Resource

A required class. This class designates the semantically described resource. Resources that "do things," for example, transform input (sswap:Subject) to output (sswap:Object) are commonly called services. Resources may also be web pages, ontologies, etc.

•owl:Thing
        •SSWAP
                •Resource

Super Classes

Equivalent Classes (Necessary and Sufficient Conditions)

aboutURI MAX 1 owl:Thing
inputURI MAX 1 owl:Thing
metaData MAX 1 owl:Thing
name EQ 1 owl:Thing
oneLineDescription MAX 1 owl:Thing
operatesOn MIN 1 owl:Thing
operatesOn ONLY Graph
outputURI MAX 1 ! ;owl:Thing
providedBy EQ 1 owl:Thing
providedBy ONLY Provider

Abstract Syntax

Class(Resource complete annotation(rdfs:comment "A required class. This class designates the semantically described resource. Resources that "do things," for example, transform input (sswap:Subject) to output (sswap:Object) are commonly called services. Resources may also be web pages, ontologies, etc."^^<http://www.w3.org/2001/XMLSchema#string>)
                        restriction(aboutURI maxCardinality(1))
                        restriction(inputURI maxCardinality(1))
                        restriction(metaData maxCardinality(1))
@@ -19,6 +19,6 @@
                        restriction(providedBy cardinality(1))
                        restriction(providedBy allValuesFrom(Provider)))
 
-SubClassOf(Resource owl:Thing)
+SubClassOf(Resource SSWAP)
 

Usage

Class Description/Definition (Necessary Conditions)

Domain of

Generated with OWLDoc
\ No newline at end of file =================================================================== RCS file: /home/repository/moby/s-moby/ontologies/sswap/owldoc/subject.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ontologies/sswap/owldoc/subject.html 2007/03/20 20:10:27 1.1 +++ /home/repository/moby/s-moby/ontologies/sswap/owldoc/subject.html 2007/03/27 15:25:28 1.2 @@ -7,11 +7,11 @@ border: 1px solid #c7cfd5; background: #f1f5f9; margin: 10px; margin-bottom: 40px; padding: 8px; text-align: left; overflow: auto;}.spacer {margin: 10px; padding: 18px;}body {margin: 20px; padding: 0; background: #fff; font: 12px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;} table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;} -

Class: Subject

A required class. In the concept of a service mapping an input to an output, the sswap:Subject corresponds to the input. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from this input to its output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject.

•owl:Thing
        •Subject

Super Classes

owl:Thing

Equivalent Classes (Necessary and Sufficient Conditions)

mapsTo MIN 1 owl:Thing
mapsTo ONLY Object
metaData MAX 1 owl:Thing

Abstract Syntax

Class(Subject complete annotation(rdfs:comment "A required class. In the concept of a service mapping an input to an output, the sswap:Subject corresponds to the input. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from this input to its output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject."^^<http://www.w3.org/2001/XMLSchema#string>)
+

Class: Subject

A required class. In the concept of a service mapping an input to an output, the sswap:Subject corresponds to the input. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from this input to its output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject.

•owl:Thing
        •SSWAP
                •Subject

Super Classes

Equivalent Classes (Necessary and Sufficient Conditions)

mapsTo MIN 1 owl:Thing
mapsTo ONLY Object
metaData MAX 1 owl:Thing

Abstract Syntax

Class(Subject complete annotation(rdfs:comment "A required class. In the concept of a service mapping an input to an output, the sswap:Subject corresponds to the input. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from this input to its output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* sswap:Object to sswap:Subject."^^<http://www.w3.org/2001/XMLSchema#string>)
                       restriction(mapsTo minCardinality(1))
                       restriction(mapsTo allValuesFrom(Object))
                       restriction(metaData maxCardinality(1)))
 
-SubClassOf(Subject owl:Thing)
+SubClassOf(Subject SSWAP)
 

Usage

Class Description/Definition (Necessary Conditions)

Domain of

Generated with OWLDoc
\ No newline at end of file