Index: /unk/corelib/test/org/bridgedb/rdb/Test.java
===================================================================
--- /trunk/corelib/test/org/bridgedb/rdb/Test.java (revision 215)
+++  (revision )
@@ -1,87 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.rdb;
-
-import buildsystem.Measure;
-
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.bridgedb.AttributeMapper;
-import org.bridgedb.BridgeDb;
-import org.bridgedb.DataSource;
-import org.bridgedb.IDMapper;
-import org.bridgedb.IDMapperException;
-import org.bridgedb.Xref;
-
-/**
- * Test access to the derby client running on the webservice.
- */
-public class Test extends TestCase
-{
-	private Measure measure;
-	
-	@Override public void setUp()
-	{
-		measure = new Measure("bridgedb_timing.txt");
-	}
-
-	public void testDerbyClient() throws IDMapperException, ClassNotFoundException
-	{
-		long start, end, delta;
-		start = System.currentTimeMillis();
-		Class.forName ("org.bridgedb.rdb.IDMapperRdb");
-		DBConnectorDerbyServer.init ("wikipathways.org", 1527);
-		IDMapper mapper = BridgeDb.connect ("idmapper-derbyclient:Homo sapiens");
-		IDMapper mapper2 = BridgeDb.connect ("idmapper-derbyclient:metabolites");
-		end = System.currentTimeMillis();
-		delta = end - start;
-		measure.add ("timing::idmapper-derbyclient connect to two databases", "" + delta, "msec");
-		
-		System.out.println (mapper.getCapabilities().getSupportedTgtDataSources());
-		
-		Set <String> symbols = new HashSet<String>();
-		AttributeMapper attr = (AttributeMapper)mapper;
-		
-		// time the common case of doing a free search and then querying all for symbol
-		start = System.currentTimeMillis();
-		Map<Xref, String> symbolMap = attr.freeAttributeSearch("p53", "symbol", 100);
-		end = System.currentTimeMillis();
-		delta = end - start;
-		System.out.println (delta);
-		measure.add ("timing::idmapper-derbyclient free query for p53", "" + delta, "msec");
-		System.out.println (symbols);
-		
-		// time the case of getting all attributes for backpage info
-		start = System.currentTimeMillis();
-		Xref insr = new Xref ("ENSG00000171105", DataSource.getBySystemCode("EnHs"));
-		for (String x : new String[] {"Description", "Symbol", "Synonyms", "Chromosome"})
-		{
-			Set<String> result = attr.getAttributes(insr, x);
-			assertTrue ("No result for " + x, result.size() > 0);
-			System.out.println (result);
-		}
-		
-		end = System.currentTimeMillis();
-		delta = end - start;
-		measure.add ("timing::idmapper-derbyclient query for backpage attributes", "" + delta, "msec");
-		System.out.println (delta);
-	}
-}
Index: /unk/corelib/test/org/bridgedb/Test.java
===================================================================
--- /trunk/corelib/test/org/bridgedb/Test.java (revision 180)
+++  (revision )
@@ -1,126 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb;
-
-import buildsystem.Measure;
-
-import java.io.File;
-import java.util.HashSet;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.bridgedb.rdb.DataDerby;
-import org.bridgedb.rdb.SimpleGdb;
-import org.bridgedb.rdb.SimpleGdbFactory;
-
-public class Test extends TestCase 
-{
-	//TODO
-	private static final String GDB_HUMAN = 
-		System.getProperty ("user.home") + File.separator + 
-		"PathVisio-Data/gene databases/Hs_Derby_20081119.pgdb";
-	private static final String GDB_RAT = 
-		System.getProperty ("user.home") + File.separator + 
-		"PathVisio-Data/gene databases/Rn_Derby_20081119.pgdb";
-	private static final String GDB_CE_V3 = 
-		System.getProperty ("user.home") + File.separator + 
-		"/PathVisio-Data/gene databases/Ce_Derby_20090720.bridge";
-	
-	private Measure measure;
-	
-	@Override public void setUp() throws ClassNotFoundException
-	{
-		measure = new Measure("bridgedb_timing.txt");
-		Class.forName ("org.bridgedb.rdb.IDMapperRdb");
-	}
-	
-	public void testGdbConnect() throws IDMapperException
-	{
-		assertTrue (new File (GDB_HUMAN).exists()); // if gdb can't be found, rest of test doesn't make sense. 
-
-		long start, end, delta;
-		start = System.currentTimeMillis();		
-		IDMapper gdb = BridgeDb.connect ("idmapper-pgdb:" + GDB_HUMAN);		
-		end = System.currentTimeMillis();
-		delta = end - start;
-		measure.add ("timing::idmapper-pgdb connect to database", "" + delta, "msec");
-		
-		gdb.close();
-	}
-	
-	/**
-	 * From schema v2 to v3 there was a change in how the backpage was stored.
-	 * In schema v2 there was a backpage column in the datanode table
-	 * In schema v3 the backpage is split in several attributes.
-	 * For backwards compatibility, SimpleGdbImpl2 fakes these new attributes. 
-	 * This is tested here. 
-	 * @throws IDMapperException should be considered a failed test
-	 */
-	public void testGdbAttributes() throws IDMapperException
-	{
-		// test special attributes that are grabbed from backpage
-		// since this is a Schema v2 database
-		SimpleGdb gdb = SimpleGdbFactory.createInstance (GDB_HUMAN, new DataDerby(), 0);
-		Xref ref = new Xref ("26873", DataSource.getBySystemCode("L"));
-		assertTrue (gdb.getAttributes(ref, "Synonyms").contains ("5-Opase|DKFZP434H244|OPLA"));
-		assertTrue (gdb.getAttributes(ref, "Description").contains ("5-oxoprolinase (EC 3.5.2.9) (5-oxo-L-prolinase) (5-OPase) (Pyroglutamase) [Source:UniProtKB/Swiss-Prot.Acc:O14841]"));
-		assertTrue (gdb.getAttributes(ref, "Chromosome").contains ("8"));
-		assertTrue (gdb.getAttributes(ref, "Symbol").contains ("OPLAH"));
-		
-		Set<String> allExpectedAttributes = new HashSet<String>();
-		allExpectedAttributes.add ("26873");
-	}
-	
-	/**
-	 * Tests the capability properties of a Schema v3 database.
-	 * @throws IDMapperException should be considered a failed test
-	 */
-	public void testGdbProperties() throws IDMapperException 
-	{
-		IDMapper gdb = BridgeDb.connect ("idmapper-pgdb:" + GDB_CE_V3);		
-		for (String key : gdb.getCapabilities().getKeys())
-		{
-			System.out.println (key + " -> " + gdb.getCapabilities().getProperty(key));
-		}
-		assertEquals ("Caenorhabditis elegans", gdb.getCapabilities().getProperty("SPECIES"));
-		assertEquals ("3", gdb.getCapabilities().getProperty("SCHEMAVERSION"));
-		assertEquals ("Ensembl", gdb.getCapabilities().getProperty("DATASOURCENAME"));
-		assertEquals ("20090720", gdb.getCapabilities().getProperty("BUILDDATE"));
-		
-		IDMapper gdb2 = BridgeDb.connect ("idmapper-pgdb:" + GDB_HUMAN);
-		for (String key : gdb2.getCapabilities().getKeys())
-		{
-			System.out.println (key + " -> " + gdb2.getCapabilities().getProperty(key));
-		}
-		assertEquals ("2", gdb2.getCapabilities().getProperty("SCHEMAVERSION"));
-		assertEquals ("20081119", gdb2.getCapabilities().getProperty("BUILDDATE"));
-	}
-	
-	public void testRegisterDataSource()
-	{
-		DataSource.register("@@", "ZiZaZo");
-		
-		DataSource ds2 = DataSource.getBySystemCode ("@@");
-		DataSource ds3 = DataSource.getByFullName ("ZiZaZo");
-		assertEquals (ds2, ds3);
-		
-		// assert that you can refer to 
-		// undeclared systemcodes if necessary.
-		assertNotNull (DataSource.getBySystemCode ("##"));		
-	}
-}
Index: /unk/corelib/test/org/bridgedb/TestFile.java
===================================================================
--- /trunk/corelib/test/org/bridgedb/TestFile.java (revision 221)
+++  (revision )
@@ -1,127 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb;
-
-import buildsystem.Measure;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.bridgedb.file.IDMapperFile;
-import org.bridgedb.file.IDMapperText;
-
-/**
- * Test identifier mapping using a tab-delimited text file.
- */
-public class TestFile extends TestCase 
-{
-	private Measure measure;
-	
-	private static final File YEAST_IDS = new File ("test-data/yeast_id_mapping.txt");
-	private static final DataSource ENS_YEAST = DataSource.getByFullName("Ensembl Yeast");
-    private static final DataSource ENTREZ = DataSource.getByFullName("Entrez Gene");
-    private static final DataSource EMBL = DataSource.getByFullName("EMBL");
-    private static final Xref XREF1 = new Xref("YHR055C", ENS_YEAST);
-	
-	@Override public void setUp()
-	{
-		measure = new Measure("bridgedb_timing.txt");
-	}
-	
-	public void testFiles()
-	{
-		assertTrue (YEAST_IDS.exists());
-	}
-	
-	public void testRead() throws IDMapperException, IOException
-	{
-		IDMapperFile idMapper = new IDMapperText (YEAST_IDS.toURL());
-
-        Set<Xref> srcXrefs = new HashSet<Xref>();
-        srcXrefs.add(XREF1);
-
-        DataSource[] tgtDataSources = new DataSource[] { ENS_YEAST, ENTREZ, EMBL };
-
-		long start = System.currentTimeMillis();
-        // mapID for the first time will trigger reading
-		Map<Xref, Set<Xref>> mapXrefs = idMapper.mapID(srcXrefs, tgtDataSources);
-		long end = System.currentTimeMillis();
-		long delta = end - start;
-		System.out.println (delta);
-		measure.add ("timing::text file non-transitive", "" + delta, "msec");
-
-		Set<Xref> expected = new HashSet<Xref>();
-        expected.addAll (Arrays.asList(
-        		new Xref("YHR055C", ENS_YEAST),
-        		new Xref("U00061", EMBL),
-        		new Xref("K02204", EMBL),
-        		new Xref("AY558517", EMBL),
-        		new Xref("AY693077", EMBL),
-        		new Xref("856452", ENTREZ),
-        		new Xref("856450", ENTREZ)
-        		));
-        Set<Xref> xrefs = mapXrefs.get(XREF1);
-        assertEquals (expected, xrefs);
-
-        for (Xref xr : xrefs) {
-            System.out.println(xr.getDataSource().getFullName() + ": " + xr.getId());
-        }
-        
-        Xref nonsense = new Xref ("Humbug", DataSource.getByFullName("Ebenizer Scrooge"));
-        // non-existent id should just return empty list.
-        assertEquals (0, idMapper.mapID(nonsense).size());
-
-	}
-
-	// Test disabled, takes several minutes and produces too much output. 
-	public void _testTransitive() throws MalformedURLException, IDMapperException
-	{
-		IDMapperFile idMapper = new IDMapperText (YEAST_IDS.toURL(),
-				new char[] { '\t' },
-				new char[] { ',' },
-				true);
-
-        Set<Xref> srcXrefs = new HashSet<Xref>();
-        srcXrefs.add(XREF1);
-
-        DataSource[] tgtDataSources = new DataSource[] { ENS_YEAST, ENTREZ, EMBL };
-
-		long start = System.currentTimeMillis();
-        // mapID for the first time will trigger reading
-		Map<Xref, Set<Xref>> mapXrefs = idMapper.mapID(srcXrefs, tgtDataSources);
-		long end = System.currentTimeMillis();
-		long delta = end - start;
-		System.out.println (delta);
-		measure.add ("timing::text file transitive", "" + delta, "msec");
-
-		System.out.println (mapXrefs);
-        Set<Xref> xrefs = mapXrefs.get(XREF1);
-
-        for (Xref xr : xrefs) {
-            System.out.println(xr.getDataSource().getFullName() + ": " + xr.getId());
-        }
-	}
-	
-}
Index: /unk/corelib/test/org/bridgedb/TestBiomart.java
===================================================================
--- /trunk/corelib/test/org/bridgedb/TestBiomart.java (revision 287)
+++  (revision )
@@ -1,170 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb;
-
-import org.bridgedb.webservice.biomart.util.BiomartClient;
-import buildsystem.Measure;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.bridgedb.webservice.biomart.IDMapperBiomart;
-import org.bridgedb.webservice.biomart.*;
-
-/**
- * Test identifier mapping using Biomart web service.
- */
-public class TestBiomart extends TestCase
-{
-	// disabled test, because it takes several minutes to run
-    public void _testBiomartStub() throws IOException, IDMapperException {
-        BiomartStub biomartStub = BiomartStub.getInstance();
-
-        Set<String> marts = biomartStub.availableMarts();
-
-        for (String mart : marts) {
-            System.out.println (mart);
-            Set<String> datasets;
-            try {
-                datasets = biomartStub.availableDatasets(mart);
-            } catch (IDMapperException e) {
-                e.printStackTrace();
-                continue;
-            }
-
-            int nds = datasets.size();
-            for (String ds : datasets) {
-            	System.out.println ("\t" + ds);
-                IDMapperBiomart idMapper = new IDMapperBiomart(mart, ds);
-                //IDMapper idMapper = BridgeDb.connect("idmapper-biomart:dataset="+ds.getName());
-                IDMapperCapabilities cap = idMapper.getCapabilities();
-                if (cap.getSupportedSrcDataSources().isEmpty()
-                        || cap.getSupportedTgtDataSources().isEmpty()) {
-//                    System.out.println("\tds\t"+ds.getName());
-                    nds--;
-                }
-                for (DataSource dsx : cap.getSupportedSrcDataSources())
-                {
-               	 System.out.println ("\t\t" + dsx);
-                }
-                for (DataSource dsx : cap.getSupportedTgtDataSources())
-                {
-               	 System.out.println ("\t\t" + dsx);
-                }
-            }
-//            if (nds==0) {
-//                System.out.println("\tdb\t"+db.getName());
-//            }
-        }
-    }
-
-    public void testBioMartConnector() throws IOException, IDMapperException
-    {
-//        BiomartStub biomartStub = BiomartStub.getInstance();
-//        Map<String, Database> reg = null;
-//        try {
-//            reg = biomartStub.getRegistry();
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//        Set<Database> dbs = new HashSet(reg.size());
-//         for (Database db : reg.values()) {
-//             //if (db.visible()) {
-//                 dbs.add(db);
-//             //}
-//                System.out.println (db.getName());
-//         }
-        //BiomartStub biomartStub = BiomartStub.getInstance();
-
-        //Set<Dataset> datasets = new HashSet(biomartStub.getAvailableDatasets("ensembl"));
-
-        IDMapperBiomart mapper = new IDMapperBiomart("ensembl", "hsapiens_gene_ensembl");
- 		Set<DataSource> dest = mapper.getCapabilities().getSupportedTgtDataSources(); 
-		 
-		assertTrue (dest.size() > 0);
-		assertTrue (dest.contains (DataSource.getByFullName("entrezgene")));
-
-		Set<DataSource> src = mapper.getCapabilities().getSupportedSrcDataSources();
-		assertTrue (src.size() > 0);
-		assertTrue (dest.contains (DataSource.getByFullName("entrezgene")));
-    }
-
-    public void testBioMartConnector2() throws IOException, IDMapperException, ClassNotFoundException
-    {
-		Class.forName("org.bridgedb.webservice.biomart.IDMapperBiomart");
-		
-		 //IDMapperBiomart mapper = new IDMapperBiomart("hsapiens_gene_ensembl");
-		IDMapper mapper = BridgeDb.connect ("idmapper-biomart:http://www.biomart.org/biomart/martservice?mart=ensembl&dataset=hsapiens_gene_ensembl");
-		Set<DataSource> dest = mapper.getCapabilities().getSupportedTgtDataSources(); 
-		 
-		assertTrue (dest.size() > 0);
-		assertTrue (dest.contains (DataSource.getByFullName("entrezgene")));
-
-		Set<DataSource> src = mapper.getCapabilities().getSupportedSrcDataSources();
-		assertTrue (src.size() > 0);
-		assertTrue (dest.contains (DataSource.getByFullName("entrezgene")));
-	}
-
-    //TODO: put in Utility class
-    private String setRep(Set<Xref> refs)
-    {
-    	StringBuilder result = new StringBuilder("[");
-    	
-    	int remain = refs.size();
-    	int count = 0;
-    	
-    	for (Xref ref : refs)
-    	{
-    		result.append (ref);
-    		remain--;
-    		if (remain > 0) result.append (", ");
-    		count++;
-    		if (count > 3 && remain > 2) break;
-    	}
-    	if (remain > 0) result.append ("... " + remain + " more ...");
-    	
-    	result.append ("]");
-    	return result.toString();
-    }
-    
-    public void testBioMartMapping() throws IOException, IDMapperException, ClassNotFoundException
-    {
-        Class.forName("org.bridgedb.webservice.biomart.IDMapperBiomart");
-        
-        //IDMapperBiomart mapper = new IDMapperBiomart("hsapiens_gene_ensembl");
-       IDMapper mapper = BridgeDb.connect ("idmapper-biomart:http://www.biomart.org/biomart/martservice?mart=ensembl&dataset=hsapiens_gene_ensembl");
-       
-       Set<Xref> result = mapper.mapID(
-    		   new Xref("ENSG00000171105", DataSource.getByFullName("ensembl_gene_id")),
-    		   DataSource.getByFullName("entrezgene"));
-       for (Xref ref : result)
-       {
-    	   System.out.println (ref);
-       }
-       
-       assertTrue ("Expected entrezgene:3643. Got " + setRep (result), 
-    		   result.contains (new Xref ("3643", DataSource.getByFullName("entrezgene"))));
-   }
-}
Index: /unk/corelib/src/org/bridgedb/file/IDMapperFile.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/file/IDMapperFile.java (revision 245)
+++  (revision )
@@ -1,190 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.file;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.bridgedb.AbstractIDMapperCapabilities;
-import org.bridgedb.DataSource;
-import org.bridgedb.IDMapper;
-import org.bridgedb.IDMapperCapabilities;
-import org.bridgedb.IDMapperException;
-import org.bridgedb.Xref;
-import org.bridgedb.impl.InternalUtils;
-
-/**
- * Interface for ID mapping from files.
- * 
- */ 
-public abstract class IDMapperFile implements IDMapper {
-    protected final IDMapperFileCapabilities cap;
-    protected final IDMappingReader reader;
-
-    /**
-     * Constuctor from a {@link IDMappingReader}. transitivity is unsupported
-     * by default.
-     * @param reader ID mapping reader
-     * @throws IDMapperException when failed to read
-     */
-    public IDMapperFile(final IDMappingReader reader) throws IDMapperException
-    {
-        this(reader, false);
-    }
-
-    /**
-     * Constuctor from a {@link IDMappingReader} and user-defined free search
-     * capacity.
-     * @param reader ID mapping reader
-     * @param freeSearch if this IDMapper supports free search
-     * @throws IDMapperException when failed to read
-     * @throws IllegalArgumentException if reader is null
-     */
-    public IDMapperFile(final IDMappingReader reader,
-            final boolean freeSearch) throws IDMapperException
-    {
-        if (reader==null) {
-            throw new IllegalArgumentException("reader cannot be null.");
-        }
-
-        this.reader = reader;
-        cap = new IDMapperFileCapabilities(freeSearch);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public Map<Xref, Set<Xref>> mapID(final Collection<Xref> srcXrefs,
-                final DataSource... tgtDataSources) throws IDMapperException {
-        if (srcXrefs==null) {
-            throw new NullPointerException("argument srcXrefs cannot be null");
-        }
-
-        Map<Xref, Set<Xref>> result = new HashMap();
-
-        // remove unsupported target datasources
-        Set<DataSource> supportedTgtDatasources = cap.getSupportedTgtDataSources();
-        Set<DataSource> tgtDss;
-        if (tgtDataSources.length == 0) {
-            tgtDss = new HashSet<DataSource>(cap.getSupportedTgtDataSources());
-        } else {
-            tgtDss = new HashSet<DataSource>(Arrays.asList(tgtDataSources));
-            tgtDss.retainAll(supportedTgtDatasources);
-        }
-
-        if (tgtDss.isEmpty()) {
-            return result;
-        }
-
-        Map<Xref,Set<Xref>> mapXrefs = reader.getIDMappings();
-        if (mapXrefs==null) {
-            return result;
-        }
-
-        Set<DataSource> supportedSrcDatasources = cap.getSupportedSrcDataSources();
-        for (Xref srcXref : srcXrefs) {
-            if (!supportedSrcDatasources.contains(srcXref.getDataSource())) {
-                continue;
-            }
-
-            Set<Xref> refs = mapXrefs.get(srcXref);
-            if (refs==null) continue;
-            
-            for (Xref tgtXref : refs) 
-            {
-            	if (tgtDataSources.length == 0 || tgtDss.contains(tgtXref.getDataSource()))
-    			{
-            		InternalUtils.multiMapPut(result, srcXref, tgtXref);
-                }
-            }
-        }
-
-        return result;
-    }
-
-    /** {@inheritDoc} */
-    public Set<Xref> mapID(Xref srcXref, DataSource... tgtDataSources) throws IDMapperException {        Map<Xref,Set<Xref>> mapXrefs = reader.getIDMappings();
-        Set<Xref> result = new HashSet<Xref>();
-
-        if (mapXrefs==null) {
-            return result;
-        }
-
-        Set<DataSource> tgtDss = new HashSet<DataSource>(Arrays.asList(tgtDataSources));
-        Set<Xref> destRefs = mapXrefs.get(srcXref);
-        if (destRefs != null) for (Xref destRef : mapXrefs.get(srcXref))
-        {
-            if (tgtDataSources.length == 0 || tgtDss.contains(destRef.getDataSource()))
-            {
-                result.add (destRef);
-            }
-        }
-        
-        return result;
-    }
-	
-    /**
-     * {@inheritDoc}
-     */
-    public boolean xrefExists(final Xref xref) throws IDMapperException {
-        if (xref==null) {
-            throw new NullPointerException();
-        }
-
-        Map<Xref,Set<Xref>> mapXrefs = reader.getIDMappings();
-        if (mapXrefs==null) {
-            return false;
-        }
-
-        return mapXrefs.containsKey(xref);
-    }
-
-    private boolean isConnected = true;
-    // In the case of IDMapperFile, there is no need to discard associated resources.
-    
-    /** {@inheritDoc} */
-    public void close() throws IDMapperException { isConnected = false; }
-    /** {@inheritDoc} */
-    public boolean isConnected() { return isConnected; }
-    
-    /**
-     *
-     * @return capacities of the ID mapper
-     */
-    public IDMapperCapabilities getCapabilities() {        
-        return cap;
-    }
-
-    protected IDMappingReader getIDMappingReader() {
-        return reader;
-    }
-
-    private class IDMapperFileCapabilities extends AbstractIDMapperCapabilities {
-
-        public IDMapperFileCapabilities(final boolean freeSearch) throws IDMapperException
-        {
-            super (IDMapperFile.this.reader.getDataSources(), false, null);
-        }
-
-    }
-
-}
-
Index: /unk/corelib/src/org/bridgedb/file/IDMappingReaderFromDelimitedReader.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/file/IDMappingReaderFromDelimitedReader.java (revision 245)
+++  (revision )
@@ -1,256 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.file;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.Reader;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.bridgedb.DataSource;
-import org.bridgedb.IDMapperException;
-import org.bridgedb.Xref;
-import org.bridgedb.impl.InternalUtils;
-
-/**
- * Class for reading ID mapping data from delimited reader.
- * @author gjj
- */
-public class IDMappingReaderFromDelimitedReader implements IDMappingReader {
-    private boolean transitivity;
-    private List<DataSource> dataSources;
-    private Map<Xref,Set<Xref>> mapXrefs;
-    private List<String> data;
-
-    protected String regExDataSourceDelimiter;
-    protected String regExIDDelimiter;
-    protected boolean dsValid, idMappingValid;
-
-    /**
-     *
-     * @param reader a {@link Reader}
-     * @param regExDataSourceDelimiter regular expression of delimiter between
-     *        data sources
-     * @param regExIDDelimiter regular expression of delimiter between IDs
-     * @param transitivity transitivity support
-     * @throws IDMapperException if failed to read
-     */
-    public IDMappingReaderFromDelimitedReader(final Reader reader,
-            final String regExDataSourceDelimiter,
-            final String regExIDDelimiter,
-            final boolean transitivity) throws IDMapperException {
-        if (reader==null || regExDataSourceDelimiter==null) {
-            throw new java.lang.IllegalArgumentException("reader and regExDataSourceDelimiter cannot be null");
-        }
-
-        readData(reader);
-        this.regExDataSourceDelimiter = regExDataSourceDelimiter;
-        this.regExIDDelimiter = regExIDDelimiter;
-        this.transitivity = transitivity;
-
-        dsValid = false;
-        idMappingValid = false;
-    }
-
-    /**
-     * Read data.
-     * @param reader to read data from
-     * @throws IDMapperException when file can't be read
-     */
-    protected void readData(final Reader reader) throws IDMapperException {
-        data = new ArrayList<String>();
-        BufferedReader bfdrd = new BufferedReader(reader);
-        try {
-            String line = bfdrd.readLine();
-
-            while (line!=null) {
-                data.add(line);
-                line = bfdrd.readLine();
-            }
-            
-            bfdrd.close();
-            reader.close();
-        } catch(IOException e) {
-            throw new IDMapperException(e);
-        }
-    }
-
-    /**
-     * Set transitivity support.
-     * @param transitivity support transitivity if true.
-     */
-    public void setTransitivity(final boolean transitivity) {
-        this.transitivity = transitivity;
-    }
-
-    /**
-     * Get transitivity support.
-     * @return true if support transitivity; false otherwise.
-     */
-    public boolean getTransitivity() {
-        return transitivity;
-    }
-
-    /**
-     * Set {@link DataSource}s. This will override the data sources read from
-     * the delimited reader.
-     * @param dataSources {@link DataSource}s
-     */
-    public void setDataSources(List<DataSource> dataSources) {
-        this.dataSources = dataSources;
-        dsValid = dataSources==null;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public Set<DataSource> getDataSources() throws IDMapperException {
-        if (!dsValid) {
-            try {
-                readDataSources();
-            } catch(IOException ex) {
-                throw new IDMapperException(ex);
-            }
-        }
-
-        return new HashSet<DataSource>(dataSources);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public Map<Xref,Set<Xref>> getIDMappings() throws IDMapperException {
-        if (!idMappingValid) {
-            try {
-                readIDMappings();
-            } catch(IOException ex) {
-                throw new IDMapperException(ex);
-            }
-        }
-
-        return mapXrefs;
-    }
-
-    /**
-     * Read {@link DataSource}s from the reader.
-     * @throws IOException on failing to read file
-     */
-    protected void readDataSources() throws IOException {
-        dataSources = new ArrayList<DataSource>();
-
-        // add data sources
-        if (data.isEmpty()) {
-                System.err.println("Empty file");
-                return;
-        }
-
-        String[] types = data.get(0).split(regExDataSourceDelimiter);
-        int nds = types.length;
-        DataSource[] dss = new DataSource[nds];
-        for (int ids=0; ids<nds; ids++) {
-            String type = types[ids];
-            if (type.length()==0) {//TODO: how to deal with consecutive Delimiters
-                return;
-            }
-
-            dss[ids] = DataSource.getByFullName(type);
-            dataSources.add(dss[ids]);
-        }
-
-        dsValid = true;
-    }
-    
-    /**
-     * Read ID mappings from the reader.
-     * @throws IOException on file read error
-     */
-    protected void readIDMappings() throws IOException {
-        mapXrefs = new HashMap<Xref, Set<Xref>>();
-
-        int nline = data.size();
-        if (nline<2) {
-                System.err.println("No ID mapping data");
-                return;
-        }
-
-        // read each ID mapping (line)
-        for (int iline=1; iline<nline; iline++) {
-            String line = data.get(iline);
-            String[] strs = line.split(regExDataSourceDelimiter);
-            if (strs.length>dataSources.size()) {
-                    System.err.println("The number of ID is larger than the number of types at row "+iline);
-                    //continue;
-            }
-
-            int n = Math.min(strs.length, dataSources.size());
-
-            Set<Xref> xrefs = new HashSet<Xref>();
-
-            for (int i=0; i<n; i++) {
-                String str = strs[i];
-                if (regExIDDelimiter==null) {
-                    xrefs.add(new Xref(str, dataSources.get(i)));
-                } else {
-                    String[] ids = str.split(regExIDDelimiter);
-                    for (String id : ids) {
-                        xrefs.add(new Xref(id, dataSources.get(i)));
-                    }
-                }
-            }
-
-            addIDMapping(xrefs);
-        }
-
-        idMappingValid = true;
-    }
-    
-    /**
-     * Add matched references.
-     * @param xrefs matched references
-     */
-    protected void addIDMapping(final Set<Xref> xrefs) {
-        if (xrefs==null) {
-            throw new NullPointerException();
-        }
-
-        if (transitivity) {
-            Set<Xref> newXrefs = new HashSet<Xref>(xrefs);
-
-            for (Xref xref : xrefs) {
-                Set<Xref> oldXrefs = mapXrefs.get(xref);
-                if (oldXrefs!=null) {
-                    newXrefs.addAll(oldXrefs); // merge
-                }
-            }
-
-            for (Xref xref : newXrefs) {
-                mapXrefs.put(xref, newXrefs);
-            }
-        } else {
-            for (Xref ref : xrefs) 
-            {
-        		InternalUtils.multiMapPutAll(mapXrefs, ref, xrefs);
-            }
-        }
-    }
-}
Index: /unk/corelib/src/org/bridgedb/file/IDMappingReaderFromText.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/file/IDMappingReaderFromText.java (revision 241)
+++  (revision )
@@ -1,171 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.file;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-
-import java.net.URL;
-import java.net.URLConnection;
-
-import org.bridgedb.IDMapperException;
-import org.bridgedb.impl.InternalUtils;
-
-
-/**
- * Class for reading ID mapping data from delimited text file.
- * @author gjj
- */
-public class IDMappingReaderFromText extends IDMappingReaderFromDelimitedReader {
-    
-    protected final URL url;
-
-    /**
-     * Transitivity is unsupported. No delimiter between IDs.
-     * @param url url {@link URL} of the file
-     * @param dataSourceDelimiters delimiters between data sources
-     * @throws IDMapperException if failed to read file
-     */
-    public IDMappingReaderFromText(final URL url,
-            final char[] dataSourceDelimiters) throws IDMapperException {
-        this(url, dataSourceDelimiters, null);
-    }
-
-    /**
-     * Transitivity is unsupported.
-     * @param url url {@link URL} of the file
-     * @param dataSourceDelimiters delimiters between data sources
-     * @param regExIDDelimiter delimiters between IDs
-     * @throws IDMapperException if failed to read file
-     */
-    public IDMappingReaderFromText(final URL url,
-            final char[] dataSourceDelimiters,
-            final char[] regExIDDelimiter) throws IDMapperException {
-        this(url, dataSourceDelimiters, regExIDDelimiter, false);
-    }
-
-    /**
-     * Constructor from the {@link URL} of a tab-delimited text file,
-     * delimiters to separate between different data sources and IDs and
-     * transitivity support.
-     * @param url url {@link URL} of the file
-     * @param dataSourceDelimiters delimiters between data sources
-     * @param regExIDDelimiter delimiters between IDs
-     * @param transitivity support transitivity if true
-     * @throws IDMapperException if failed to read file
-     */
-    public IDMappingReaderFromText(final URL url,
-            final char[] dataSourceDelimiters,
-            final char[] regExIDDelimiter,
-            final boolean transitivity) throws IDMapperException {
-        this(url, strs2regex(dataSourceDelimiters), strs2regex(regExIDDelimiter), transitivity);
-    }
-
-    /**
-     * Transitivity is unsupported. No delimiters between IDs.
-     * @param url the {@link URL} of the delimited text file
-     * @param regExDataSourceDelimiter regular expression of delimiter between
-     *        data sources
-     * @throws IDMapperException if failed to read
-     */
-    public IDMappingReaderFromText(final URL url,
-            final String regExDataSourceDelimiter) throws IDMapperException {
-        this(url, regExDataSourceDelimiter, null);
-    }
-
-    /**
-     * Transitivity is unsupported.
-     * @param url the {@link URL} of the delimited text file
-     * @param regExDataSourceDelimiter regular expression of delimiter between
-     *        data sources
-     * @param regExIDDelimiter regular expression of delimiter between IDs
-     * @throws IDMapperException if failed to read
-     */
-    public IDMappingReaderFromText(final URL url,
-            final String regExDataSourceDelimiter,
-            final String regExIDDelimiter) throws IDMapperException {
-        this(url, regExDataSourceDelimiter, regExIDDelimiter, false);
-    }
-
-    /**
-     *
-     * @param url the {@link URL} of the delimited text file
-     * @param regExDataSourceDelimiter regular expression of delimiter between
-     *        data sources
-     * @param regExIDDelimiter regular expression of delimiter between IDs
-     * @param transitivity transitivity support
-     * @throws IDMapperException if failed to read
-     */
-    public IDMappingReaderFromText(final URL url,
-            final String regExDataSourceDelimiter,
-            final String regExIDDelimiter,
-            final boolean transitivity) throws IDMapperException {
-        super(getReader(url), regExDataSourceDelimiter,
-                regExIDDelimiter, transitivity); 
-        
-        this.url = url;
-    }
-
-    /**
-     * Set delimiters between data sources.
-     * @param dataSourceDelimiters delimiters between data sources
-     */
-    public void setDataSourceDelimiters(final char[] dataSourceDelimiters) {
-        dsValid = false;
-        idMappingValid = false;
-        regExDataSourceDelimiter = strs2regex(dataSourceDelimiters);
-    }
-
-    /**
-     * Set delimiters between data IDs.
-     * @param idDelimiters delimiters between data IDs
-     */
-    public void setIDDelimiters(final char[] idDelimiters) {
-        idMappingValid = false;
-        regExIDDelimiter = strs2regex(idDelimiters);
-    }
-
-    protected static String strs2regex(final char[] chs) {
-        if (chs==null || chs.length==0) {
-            return null;
-        }
-
-        StringBuilder regex = new StringBuilder();
-        int n = chs.length;
-        if (n>0) {
-            regex.append("[");
-            for (int i=0; i<n; i++) {
-                regex.append("\\0"+Integer.toOctalString(chs[i]));
-            }
-            regex.append("]");
-        }
-
-        return regex.toString();
-    }
-
-    private static Reader getReader(URL url) throws IDMapperException {
-        try {
-            InputStream inputStream = InternalUtils.getInputStream(url);
-            return new InputStreamReader(inputStream);
-        } catch(IOException e) {
-            throw new IDMapperException(e);
-        }
-    }
-
-}
Index: /unk/corelib/src/org/bridgedb/file/IDMapperText.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/file/IDMapperText.java (revision 164)
+++  (revision )
@@ -1,287 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.file;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.bridgedb.BridgeDb;
-import org.bridgedb.IDMapper;
-import org.bridgedb.IDMapperException;
-import org.bridgedb.Xref;
-
-/**
- * Class for mapping ID from delimited text file.
- * @author gjj
- */
-public class IDMapperText extends IDMapperFile 
-{
-	static
-	{
-		BridgeDb.register ("idmapper-text", new Driver());
-	}
-	
-	/** Knows how to instantiate IDMapperText. */
-	private static final class Driver implements org.bridgedb.Driver
-	{
-			/** prevent outside instantiation. */
-            private Driver() {}
-		
-            /** {@inheritDoc} */
-            public IDMapper connect(String location) throws IDMapperException
-            {
-                // parse arguments to determine idsep and dssep
-                // sample: dssep=\t,idsep=;,idsep=,,transitivity=false@file:/localfile.txt
-                // \t represents tab, \@ represents @
-                String  path = null;
-                char[] dssep = null;
-                char[] idsep = null;
-                boolean transitivity = false;
-
-                int idx = location.indexOf("@");
-                if (idx<=0) {
-                    path = location;
-                    // defaults if no options are provided:
-                    idsep = new char[] { ',' };
-                    dssep = new char[] { '\t' };
-                } else {
-                    // Is an url always contains :/ ?
-                    if (idx > location.indexOf(":/")) { //@ is part of the path
-                        path = location;
-                    } else {
-                        while (idx>0 && location.charAt(idx-1)=='\\') { //escape \@
-                            idx = location.indexOf(idx+1);
-                        }
-
-                        if (idx==-1) {
-                            throw new IDMapperException("Wrong link format!");
-                        }
-
-                        if (idx==location.length()-1) {
-                            throw new IDMapperException("Empty address!");
-                        }
-
-                        path = location.substring(idx+1);
-
-                        String config = location.substring(0, idx)+",";
-                        String prefixTran = "transitivity=";
-                        idx = config.indexOf(prefixTran);
-                        String tran = config.substring(idx+prefixTran.length());
-                        if (tran.toLowerCase().startsWith("true")) {
-                            transitivity = true;
-                        } else if (tran.toLowerCase().startsWith("false")) {
-                            transitivity = false;
-                        } else {
-                            throw new IDMapperException(
-                                    "transivity can only be true or false");
-                        }
-
-                        dssep = parseConfig(config, "dssep");
-                        idsep = parseConfig(config, "idsep");
-                    }
-                }
-
-                try
-                {
-                        return new IDMapperText(new URL(path), dssep, idsep,
-                                transitivity);
-                }
-                catch (MalformedURLException ex)
-                {
-                        throw new IDMapperException(ex);
-                }
-            }
-
-            /** 
-             * parse the separator list part of the connection string.
-             * \@ or \t will be unescaped.
-             * @param config the connection string to parse
-             * @param head the section to look for, either dssep or idsep
-             * @return separators
-             */
-            private char[] parseConfig(String config, String head) {
-                Set<Character> delimiters = new HashSet<Character>();
-                Pattern p = Pattern.compile(head+"=(.|\\t|\\@),",
-                        Pattern.CASE_INSENSITIVE);
-                Matcher m = p.matcher(config);
-                while (m.find()) {
-                    String sep = m.group(1);
-                    if (sep.equalsIgnoreCase("\\t")) {
-                        sep = "\t";
-                    } else if (sep.equalsIgnoreCase("\\@")) {
-                        sep = "@";
-                    }
-
-                    delimiters.add(sep.charAt(0));
-                }
-
-                int nsep = delimiters.size();
-                if (nsep==0) {
-                    return null;
-                }
-
-                char[] ret = new char[nsep];
-                int isep = 0;
-                for (char c : delimiters) {
-                    ret[isep++] = c;
-                }
-
-                return ret;
-            }
-        
-	}
-
-    private final URL url;
-    private char[] dataSourceDelimiters;
-    private char[] idDelimiters;
-    private boolean transitivity;
-
-    /**
-     * Constructor from the {@link URL} of a tab-delimited text file.
-     * @param url {@link URL} of the file
-     * @throws IDMapperException if failed to read file
-     */
-    public IDMapperText(final URL url) throws IDMapperException {
-        this(url,  new char[] {'\t'}); // default is tab delimited
-    }
-
-    /**
-     * Transitivity is unsupported. No delimiter between data sources.
-     * @param url url {@link URL} of the file
-     * @param dataSourceDelimiters delimiters between data sources
-     * @throws IDMapperException if failed to read file
-     */
-    public IDMapperText(final URL url,
-            final char[] dataSourceDelimiters) throws IDMapperException {
-        this(url, dataSourceDelimiters, null);
-    }
-
-    /**
-     * Transitivity is unsupported.
-     * @param url url {@link URL} of the file
-     * @param dataSourceDelimiters delimiters between data sources
-     * @param idDelimiters delimiters between IDs
-     * @throws IDMapperException if failed to read file
-     */
-    public IDMapperText(final URL url,
-            final char[] dataSourceDelimiters,
-            final char[] idDelimiters) throws IDMapperException {
-        this(url, dataSourceDelimiters, idDelimiters, false);
-    }
-
-    /**
-     * Constructor from the {@link URL} of a tab-delimited text file,
-     * delimiters to separate between different data sources and IDs and
-     * transitivity support.
-     * @param url url {@link URL} of the file
-     * @param dataSourceDelimiters delimiters between data sources
-     * @param idDelimiters delimiters between IDs
-     * @param transitivity support transitivity if true
-     * @throws IDMapperException if failed to read file
-     */
-    public IDMapperText(final URL url,
-            final char[] dataSourceDelimiters,
-            final char[] idDelimiters,
-            final boolean transitivity) throws IDMapperException {
-        super(new IDMappingReaderFromText(url,
-                dataSourceDelimiters,
-                idDelimiters));
-        this.url = url;
-        this.dataSourceDelimiters = dataSourceDelimiters;
-        this.idDelimiters = idDelimiters;
-        setTransitivity(transitivity);
-    }
-
-    /**
-     * Free search is not supported for delimiter-text file.
-     * This will throw UnsupportedOperationException
-     * @param text ignored
-     * @param limit ignored
-     * @return does not return
-     * @throws IDMapperException will not be thrown
-     */
-    public Set<Xref> freeSearch (String text, int limit) throws IDMapperException {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * Set transitivity support.
-     * @param transitivity support transitivity if true.
-     */
-    public void setTransitivity(final boolean transitivity) {
-        this.transitivity = transitivity;
-        ((IDMappingReaderFromText) reader).setTransitivity(transitivity);
-    }
-
-    /**
-     * Get transitivity support.
-     * @return true if support transitivity; false otherwise.
-     */
-    public boolean getTransitivity() {
-        return transitivity;
-    }
-
-    /**
-     * Get {@link URL} of the file.
-     * @return {@link URL} of the file
-     */
-    public URL getURL() {
-        return url;
-    }
-
-    /**
-     *
-     * @return delimiters between data sources
-     */
-    public char[] getDataSourceDelimiters() {
-        return dataSourceDelimiters;
-    }
-
-    /**
-     *
-     * @return delimiters between data IDs
-     */
-    public char[] getIDDelimiters() {
-        return idDelimiters;
-    }
-
-    /**
-     * Set delimiters between data sources.
-     * @param dataSourceDelimiters delimiters between data sources
-     */
-    public void setDataSourceDelimiters(final char[] dataSourceDelimiters) {
-        ((IDMappingReaderFromText)this.getIDMappingReader()).
-                setDataSourceDelimiters(dataSourceDelimiters);
-        this.dataSourceDelimiters = dataSourceDelimiters;
-    }
-
-    /**
-     * Set delimiters between data IDs.
-     * @param idDelimiters delimiters between data IDs
-     */
-    public void setIDDelimiters(final char[] idDelimiters) {
-        ((IDMappingReaderFromText)this.getIDMappingReader())
-                .setIDDelimiters(idDelimiters);
-        this.idDelimiters = idDelimiters;
-    }
-}
Index: /unk/corelib/src/org/bridgedb/file/IDMappingReader.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/file/IDMappingReader.java (revision 134)
+++  (revision )
@@ -1,48 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.file;
-
-import java.util.Map;
-import java.util.Set;
-
-import org.bridgedb.DataSource;
-import org.bridgedb.IDMapperException;
-import org.bridgedb.Xref;
-
-
-/**
- * Interface for reading ID mapping data.
- * 
- */
-public interface IDMappingReader {
-
-    /**
-     * Get {@link DataSource}s from the file.
-     * @return {@link DataSource}s from the file
-     * @throws IDMapperException if failed to read the file
-     */
-    public Set<DataSource> getDataSources() throws IDMapperException;
-
-    /**
-     * Get {@link Xref}s from the file.
-     * @return Map from a {@link Xref} to the {@link Set} of all its matched
-     * Xref.
-     * @throws IDMapperException if failed to read the file
-     */
-    public Map<Xref,Set<Xref>> getIDMappings() throws IDMapperException;
-
-}
Index: /unk/corelib/src/org/bridgedb/file/package.html
===================================================================
--- /trunk/corelib/src/org/bridgedb/file/package.html (revision 61)
+++  (revision )
@@ -1,11 +1,0 @@
-<html>
-<body>
-Driver and helper classes for using simple files as an identifier mapping service.
-<p>
-For example, to use a tab-delimited text file as a mapping resource, you can use the following piece of code:  
-<pre>
-	class.forName("org.bridgedb.file.IDMapperText");
-	mapper = BridgeDb.connect ("idmapper-text:file://path/to/file");
-</pre>
-</body>
-</html>
Index: /unk/corelib/src/org/bridgedb/impl/InternalUtils.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/impl/InternalUtils.java (revision 243)
+++  (revision )
@@ -1,228 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.impl;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.bridgedb.DataSource;
-import org.bridgedb.IDMapper;
-import org.bridgedb.IDMapperException;
-import org.bridgedb.Xref;
-
-/**
- * To prevent duplication and redundancy, functions that are common to 
- * multiple IDMapper implementations
- * can be placed here.
- * <p>
- * <b>Warning!</b> This class is not part of the public API of BridgeDb. Methods in this class
- * may disappear or change in backwards-incompatible ways. <b>This class should not be used by applications!</b>
- */
-public final class InternalUtils 
-{
-	/** private constructor to prevent instantiation. */
-	private InternalUtils() {}
-	
-	/**
-	 * call the "single" mapID (Xref, ...) multiple times
-	 * to perform mapping of a Set.
-	 * <p> 
-	 * This is intended for IDMappers that don't gain any advantage of mapping
-	 * multiple ID's at a time. They can implement mapID(Xref, ...), and
-	 * use mapMultiFromSingle to simulate mapID(Set, ...)
-	 * @param mapper used for performing a single mapping
-	 * @param srcXrefs xrefs to translate
-	 * @param tgt DataSource(s) to map to, optional.
-	 * @return mappings with the translated result for each input Xref. Never returns null, but
-	 *    not each input is a key in the output map.
-	 * @throws IDMapperException when mapper.mapID throws IDMapperException
-	 */
-	public static Map<Xref, Set<Xref>> mapMultiFromSingle(IDMapper mapper, Collection<Xref> srcXrefs, DataSource... tgt)
-		throws IDMapperException
-	{
-		final Map<Xref, Set<Xref>> result = new HashMap<Xref, Set<Xref>>();
-		for (Xref src : srcXrefs)
-		{
-			final Set<Xref> refs = mapper.mapID(src, tgt);
-			if (refs.size() > 0)
-				result.put (src, refs);
-		}
-		return result;
-	}
-
-	/**
-	 * call the "multi" mapID (Set, ...) using a Set with one item
-	 * to perform mapping of a single ID.
-	 * <p> 
-	 * This is intended for IDMappers that have a performance advantage of mapping
-	 * multiple ID's at a time. They can implement mapID(Set, ...), and
-	 * use mapSingleFromMulti to simulate mapID(Xref, ...)
-	 * @param mapper used for performing a multi-mapping
-	 * @param src xref to translate
-	 * @param tgt DataSource(s) to map to, optional.
-	 * @return Set of translated Xrefs, or an empty set if none were found.
-	 * @throws IDMapperException when mapper.mapID throws IDMapperException
-	 */
-	public static Set<Xref> mapSingleFromMulti(IDMapper mapper, Xref src, DataSource... tgt)
-		throws IDMapperException
-	{
-		Set<Xref> srcXrefs = new HashSet<Xref>();
-		srcXrefs.add(src);
-		Map<Xref, Set<Xref>> mapXrefs = mapper.mapID(srcXrefs, tgt);
-		if (mapXrefs.containsKey(src))
-			return mapXrefs.get(src);
-		else
-			return Collections.emptySet();
-	}
-	
-	/**
-	 * parse configuration params of the connection string. Connection strings are
-	 * expected to have a formatting like @code{base?arg1=val&arg2=val}.
-	 * @param location configuration string to parse.
-	 * @param allowedParams allowed argument names to appear before =
-	 * @return key / value Map of configuration arguments. The base (the part before the ?)
-	 * 	is returned in the special key "BASE". If the part before ? is empty, 
-	 *  the "BASE" key is not created.
-	 * @throws IllegalArgumentException if arguments do not follow the key=val structure, or 
-	 * 	if the key is not in allowedParams
-	 */
-	public static Map<String, String> parseLocation (String location, String... allowedParams)
-	{
-		Map<String, String> result = new HashMap<String, String>();
-		Set<String> allowedSet = new HashSet<String>(Arrays.asList(allowedParams));
-		
-		String param = location;
-		
-		int idx = location.indexOf('?');
-		if (idx > -1) 
-		{
-			// do not add empty string.
-			if (idx > 0) 
-				result.put ("BASE", location.substring(0,idx));
-
-			param = location.substring(idx+1);
-		}
-		
-		if ("".equals(param)) return result;
-		
-		String[] args = param.split ("&");
-		for (String arg : args)
-		{
-			idx = arg.indexOf("=");
-			if (idx > -1)
-			{
-				String key = arg.substring (0, idx);
-				if (!allowedSet.contains(key))
-				{
-					throw new IllegalArgumentException("Unexpected property '" + key + "'");
-				}
-				String val = arg.substring (idx + 1);
-				result.put (key, val);
-			}
-			else
-			{
-				throw new IllegalArgumentException("Could not parse argument " + arg + 
-						". Expected key=val format");
-			}
-		}
-		
-		return result;
-	}
-
-    public static InputStream getInputStream(String source) throws IOException {
-        URL url = new URL(source);
-        return getInputStream(url);
-    }
-    
-    private static final int MS_CONNECTION_TIMEOUT = 2000;
-    //TODO: test when IOException is thrown
-    
-    /**
-     * Start downloading a file from the web and open an InputStream to it.
-     * @param source location of file to download.
-     * @return InputStream
-     * @throws IOException after a number of attempts to connect to the remote server have failed.
-     */
-    public static InputStream getInputStream(URL source) throws IOException {
-        InputStream stream = null;
-        int expCount = 0;
-        int timeOut = MS_CONNECTION_TIMEOUT;
-        while (true) { // multiple chances
-            try {
-                URLConnection uc = source.openConnection();
-                uc.setUseCaches(false); // don't use a cached page
-                uc.setConnectTimeout(timeOut); // set timeout for connection
-                stream = uc.getInputStream();
-                break;
-            } catch (IOException e) {
-                if (expCount++==4) {
-                    throw(e);
-                } else {
-                    timeOut *= 2;
-                }
-            }
-        }
-
-        return stream;
-    }
-
-    /**
-     * Generic method for multimaps, a map that can contain multiple values per key.
-     */
-    public static <T, U> void multiMapPut(Map<T, Set<U>> map, T key, U val)
-    {
-    	Set<U> set;
-    	if (map.containsKey (key))
-    	{
-    		set = map.get(key);
-    	}
-    	else
-    	{
-    		set = new HashSet<U>();
-    		map.put(key, set);
-    	}
-    	set.add (val);
-    }
-
-    /**
-     * Generic method for multimaps, a map that can contain multiple values per key.
-     */
-    public static <T, U> void multiMapPutAll(Map<T, Set<U>> map, T key, Collection<U> vals)
-    {
-    	Set<U> set;
-    	if (map.containsKey (key))
-    	{
-    		set = map.get(key);
-    	}
-    	else
-    	{
-    		set = new HashSet<U>();
-    		map.put(key, set);
-    	}
-    	set.addAll (vals);
-    }
-
-}
Index: /unk/corelib/src/org/bridgedb/rdb/DataDerby.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/rdb/DataDerby.java (revision 175)
+++  (revision )
@@ -1,399 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.rdb;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.sql.CallableStatement;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.util.Properties;
-import java.util.zip.CRC32;
-import java.util.zip.CheckedInputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-import org.bridgedb.IDMapperException;
-
-
-//import org.pathvisio.debug.Logger;
-//import org.pathvisio.debug.StopWatch;
-
-/**
-   DBConnector implementation using the Derby driver, with the database in a
-   single, uncompressed zip archive.
-   While creating, the data is stored in a temporary directory. 
-   This directory will be cleaned up when the database is finalized.
-*/
-//TODO: make sure the temp directory is cleaned up also when this is not finalized
-public class DataDerby extends DBConnector
-{
-	public static final String DB_FILE_EXT_GDB = "bridge";
-	public static final String DB_FILE_EXT_GEX = "pgex";
-
-	String getDbExt() {
-		switch(getDbType()) {
-		case TYPE_GDB: return DB_FILE_EXT_GDB;
-		case TYPE_GEX: return DB_FILE_EXT_GEX;
-		default: return "";
-		}
-	}
-	
-	private static final String DB_NAME_IN_ZIP = "database";
-	
-	// name of db, what it will be when the db is finalized.
-	private String finalDbName;
-	
-	// while making a database, it is created in a temporary directory,
-	private File tempDbSubdir = null;
-	private File tempDbParentdir = null;
-	
-	private boolean finalized;
-	
-	/**
-	 * Generates a correct JDBC connection string.
-	 * @return the JDBC connection string. 
-	 */
-	private String getDbUrl()
-	{
-		String url = "jdbc:derby:";
-		if (finalized)
-		{
-			url += "jar:(" + finalDbName + ")" + DB_NAME_IN_ZIP;
-		} 
-		else 
-		{
-			url += tempDbSubdir;
-		}
-		return url;
-	}
-	
-	/**
-	 * @param props one of PROP_NONE or PROP_RECREATE. PROP_NONE will
-	 *   lead to a normal connection, PROP_RECREATE will lead to destroying
-	 *   the old database and creating a clean new one.
-	 * @param dbName is the file that will be produced finally.
-	 * If dbName doesn't end with the right extension, the right extension will be added.
-	 * @return the JDBC database Connection.
-	 * @throws IDMapperException if the database connection could not be made,
-	 * 	or if the Derby driver could not be loaded.
-	 */
-	public Connection createConnection(String dbName, int props) throws IDMapperException 
-	{
-		boolean recreate = (props & PROP_RECREATE) != 0;
-
-		// make sure the final Db name ends with the right extension.
-		finalDbName = dbName;
-		finalized = !recreate;
-		
-		if(recreate) 
-		{
-			finalDbName = dbName.endsWith(getDbExt()) ? dbName : dbName + "." + getDbExt();
-			try
-			{
-				tempDbParentdir = FileUtilsGdb.createTempDir("derby", ".tmp");
-				tempDbSubdir = new File (tempDbParentdir, "database");
-			}
-			catch (IOException e)
-			{
-				throw new IDMapperException (e);
-			}
-		}
-		
-		Properties sysprop = System.getProperties();
-		
-		try
-		{
-			sysprop.setProperty("derby.storage.tempDirectory", System.getProperty("java.io.tmpdir"));
-			sysprop.setProperty("derby.stream.error.file", File.createTempFile("derby",".log").toString());
-			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
-		}
-		catch (ClassNotFoundException e)
-		{
-			throw new IDMapperException (e);
-		}
-		catch (IOException f)
-		{
-			throw new IDMapperException (f);
-		}
-		Properties prop = new Properties();
-		prop.setProperty("create", Boolean.toString(recreate));
-		
-//		StopWatch timer = new StopWatch();
-//		timer.start();
-		
-		String url = getDbUrl();
-
-		Connection con;
-		try
-		{
-			con = DriverManager.getConnection(url, prop);
-		}
-		catch (SQLException e)
-		{
-			throw new IDMapperException (e);
-		}
-		
-//		Logger.log.info("Connecting with derby to " + url + ":\t" + timer.stop());		
-		return con;
-	}
-	
-	public Connection createNewDatabaseConnection(String dbName) throws IDMapperException 
-	{
-		return createConnection(FileUtilsGdb.removeExtension(dbName), PROP_RECREATE);
-	}
-	
-	public String finalizeNewDatabase(String dbName) throws IDMapperException 
-	{
-		if (finalized) return finalDbName; // already finalized.
-		
-		//Transfer db to zip and clear old dbfiles
-		toZip (new File (finalDbName), tempDbSubdir);
-		
-		FileUtilsGdb.deleteRecursive(tempDbParentdir);
-		
-		//Return new database file
-		return finalDbName;
-	}
-	
-	public void closeConnection(Connection con) throws IDMapperException 
-	{
-		closeConnection(con, PROP_NONE);
-	}
-	
-	/**
-	 * Close the connection to this database.
-	 * @param con JDBC Connection object
-	 * @param props Passing PROP_FINALIZE for props will cause a full shutdown, which is necessary
-	 * after creating a fresh database.
-	 * @throws IDMapperException if the database could not be closed.
-	 */
-	public void closeConnection(Connection con, int props) throws IDMapperException 
-	{
-		if(con != null) 
-		{
-			if (props == PROP_FINALIZE)
-			{
-				//shutdown only necessary after modifying database!!!
-				//Otherwise causes problems when loading same database twice.
-				try
-				{
-					DriverManager.getConnection(getDbUrl() + ";shutdown=true");
-				}
-				catch (SQLException se)  
-				{	
-					/*
-					 In this case a thrown exception signals success. See:
-				      http://db.apache.org/derby/docs/10.3/getstart/rwwdactivity3.html
-				      if (e.getSQLState().equals("XJ015")) shutdownSuccess= true; //Derby engine
-					 */
-					if ( se.getSQLState().equals("08006") ) // single file
-					{		
-//						Logger.log.info ("Database " + getDbUrl() + " shutdown cleanly");
-					}
-					else throw new IDMapperException (se);
-				}
-			}
-			try
-			{
-				con.close();
-				con = null;
-			}
-			catch (SQLException se)
-			{
-				throw new IDMapperException (se);
-			}
-		}
-	}
-	
-	//TODO: I wonder if this is possible for zipped databases...
-	// if not, this can be done together with finalizing.
-	public void compact(Connection con) throws IDMapperException 
-	{
-		try
-		{
-			con.commit();
-			con.setAutoCommit(true);
-	
-			if (getDbType() == DBConnector.TYPE_GDB)
-			{
-				CallableStatement cs = con.prepareCall
-				("CALL SYSCS_UTIL.SYSCS_COMPRESS_TABLE(?, ?, ?)");
-				//Gene table
-				cs.setString(1, "APP");
-				cs.setString(2, "DATANODE");
-				cs.setShort(3, (short) 1);
-				cs.execute();
-				
-				//Link table
-				cs.setString(1, "APP");
-				cs.setString(2, "LINK");
-				cs.setShort(3, (short) 1);
-				cs.execute();
-
-				cs.setString(1, "APP");
-				cs.setString(2, "ATTRIBUTE");
-				cs.setShort(3, (short) 1);
-				cs.execute();
-
-			}
-			else if (getDbType() == DBConnector.TYPE_GEX)
-			{
-				CallableStatement cs = con.prepareCall
-				("CALL SYSCS_UTIL.SYSCS_COMPRESS_TABLE(?, ?, ?)");
-				//Expression table
-				cs.setString(1, "APP");
-				cs.setString(2, "EXPRESSION");
-				cs.setShort(3, (short) 1);
-				cs.execute();
-			}
-			con.commit(); //Just to be sure...
-		}
-		catch (SQLException e)
-		{
-			throw new IDMapperException (e); 
-		}
-	}
-		
-	/**
-	 * create a zip file from a directory.
-	 * @param zipFile output file
-	 * @param dbDir input dir
-	 */
-	private void toZip(File zipFile, File dbDir) 
-	{
-		try {			
-			if(zipFile.exists()) zipFile.delete();
-			
-			ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile));
-			out.setMethod(ZipOutputStream.STORED);
-			for(File f : dbDir.listFiles()) addFiles(f, DB_NAME_IN_ZIP + '/', out);
-			out.closeEntry();
-			out.close();
-			
-			String zipPath = zipFile.getAbsolutePath().replace(File.separatorChar, '/');
-			String url = "jdbc:derby:jar:(" + zipPath + ")" + DB_NAME_IN_ZIP;
-
-			DriverManager.getConnection(url);
-		
-		} catch(IOException e) {
-			e.printStackTrace();
-		}
-		catch(SQLException e) {
-			e.printStackTrace();
-		}
-	}
-	
-	private byte[] buf = new byte[1024];
-	
-	/**
-	 * recursively add files or directory to ZipOutputStream. Skips directories
-	 * named "tmp" or files ending with "lck".
-	 * 
-	 * @param file file or directory to add.
-	 * @param dir base directory inside zip
-	 * @param out target zip output stream.
-	 * @throws IOException on IO error
-	 */
-	private void addFiles(File file, String dir, ZipOutputStream out) throws IOException 
-	{
-		if(file.isDirectory()) 
-		{
-			if(file.getName().equals("tmp")) return; //Skip 'tmp' directory
-			
-			String newDir = dir + file.getName() + '/';
-			ZipEntry add = new ZipEntry(newDir);
-			setZipEntryAttributes(file, add);
-			out.putNextEntry(add);
-			
-			for(File f : file.listFiles()) addFiles(f, newDir,out);
-		} 
-		else 
-		{
-			if(file.getName().endsWith(".lck")) return; //Skip '*.lck' files
-			ZipEntry add = new ZipEntry(dir + file.getName());
-			
-			setZipEntryAttributes(file, add);
-			
-			// real clever: putNextEntry has to be called before writing to out,
-			// and CRC has to be calculated before putNextEntry
-			// so we end up reading all files twice.
-			out.putNextEntry(add);
-				        
-			FileInputStream in = new FileInputStream(file);
-			int len;
-			while ((len = in.read(buf)) > 0) 
-			{
-				out.write(buf, 0, len);
-			}
-			in.close();
-		}
-	}
-	
-	/**
-	 * Calculates required attributes for ZipEntry.
-	 * <ul>
-	 * <li>method: ZipEntry.STORED (meaning uncompressed)
-	 * <li>crc: calculated
-	 * <li>size: file size
-	 * <li>compressedSize: also file size, since uncompressed
-	 * </ul>
-	 * @param z the ZipEntry to set attributes on
-	 * @param f the file to calculate the attributes for
-	 * @throws IOException when the file couldn't be read  
-	 */
-	private void setZipEntryAttributes(File f, ZipEntry z) throws IOException 
-	{
-		z.setTime(f.lastModified());
-		z.setMethod(ZipEntry.STORED);
-				
-		if(f.isDirectory()) 
-		{
-			z.setCrc(0);
-			z.setSize(0);
-			z.setCompressedSize(0);
-		} 
-		else 
-		{			
-			z.setSize(f.length());
-			z.setCompressedSize(f.length());
-			z.setCrc(computeCheckSum(f));
-		}
-	}
-	
-	/**
-	 * Calculate the 32-bit CRC code for a file,
-	 * Suitable for ZipEntry.setCrc.
-	 * @param f file to check
-	 * @throws IOException on file read error
-	 * @return CRC code
-	 */
-	private long computeCheckSum(File f) throws IOException 
-	{
-		CheckedInputStream cis = new CheckedInputStream(
-				new FileInputStream(f), new CRC32());
-		byte[] tempBuf = new byte[128];
-		while (cis.read(tempBuf) >= 0) { }
-		long result = cis.getChecksum().getValue();
-		cis.close();
-		return result;
-	}
-	
-}
Index: /unk/corelib/src/org/bridgedb/rdb/DBConnector.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/rdb/DBConnector.java (revision 106)
+++  (revision )
@@ -1,121 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.rdb;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import org.bridgedb.IDMapperException;
-
-
-/**
- * DBConnector is used by SimpleGex and SimpleGdb
- * to perform operations
- * such as creating a new database
- * or establishing a connection
- * that are different for Derby, Hsqldb, etc.
- * 
- * This class implements only non-GUI functionality.
- * There is a derived DBConnSwt class that also 
- * includes dialogs to set the parameters
- * for opening / creating.
- */
-public abstract class DBConnector 
-{
-	public static final int PROP_NONE = 0;
-	public static final int PROP_RECREATE = 4;
-	public static final int PROP_FINALIZE = 8;
-	
-	/**
-	 * Type for gene database.
-	 */
-	public static final int TYPE_GDB = 0;
-	/**
-	 * Type for expression database.
-	 */
-	public static final int TYPE_GEX = 1;
-
-	public abstract Connection createConnection(String dbName, int props) throws IDMapperException;	
-	
-	/**
-	 * Close the given connection.
-	 * @param con The connection to be closed
-	 * @throws IDMapperException when there was a database error
-	 */
-	public void closeConnection(Connection con) throws IDMapperException 
-	{
-		closeConnection(con, PROP_NONE);
-	}
-	
-	/**
-	 * Close the given connection, and optionally finalize it after creation (using {@link #PROP_FINALIZE}).
-	 * @param con The connection to be closed
-	 * @param props Close properties (one of {@link #PROP_NONE}, {@link #PROP_FINALIZE} or {@link #PROP_RECREATE})
-	 * @throws IDMapperException when there was a database error
-	 */
-	public void closeConnection(Connection con, int props) throws IDMapperException 
-	{
-		try
-		{
-			con.close();
-		}
-		catch (SQLException e)
-		{
-			throw new IDMapperException (e);
-		}
-	}
-	
-	private int dbType;
-
-	/**
-	 * Set the database type (one of {@link #TYPE_GDB} or {@link #TYPE_GEX}).
-	 * @param type The type of the database that will be used for this class
-	 */
-	public void setDbType(int type) { dbType = type; }
-	
-	/**
-	 * Get the database type (one of {@link #TYPE_GDB} or {@link #TYPE_GEX}).
-	 * @return The type of the database that is used for this class
-	 */
-	public int getDbType() { return dbType; }
-	
-	/**
-	 * This method is called to finalize the given database after creation
-	 * (e.g. set read-only, archive files). The database name needs to returned, this
-	 * may change when finalizing the database modifies the storage type (e.g. from directory
-	 * to single file).
-	 * The database connection needs to be closed before running this method.
-	 * @param dbName The name of the database to finalize	
-	 * @return The name of the finalized database
-	 * @throws IDMapperException when there was a database error
-	 */
-	public abstract String finalizeNewDatabase(String dbName) throws IDMapperException;
-		
-	/**
-	 * This method may be implemented when the database files need to be
-	 * compacted or defragmented after creation of a new database. It will be called
-	 * after all data is added to the database.
-	 * @param con A connection to the database
-	 * @throws IDMapperException when there was a database error
-	 */
-	public void compact(Connection con) throws IDMapperException
-	{
-		//May be implemented by subclasses
-	}
-	
-
-}
Index: /unk/corelib/src/org/bridgedb/rdb/GdbConstruct.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/rdb/GdbConstruct.java (revision 105)
+++  (revision )
@@ -1,60 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.rdb;
-
-import org.bridgedb.IDMapperException;
-import org.bridgedb.Xref;
-
-/**
- * Interface for constructing a gene database.
- */
-public interface GdbConstruct 
-{
-
-	/**
-	 * Add a biological entity to the database.
-	 * @param ref entity to add
-	 * @param bpText html-formatted description
-	 * @return 1 if addition was successful, 0 otherwise. 
-	 */
-	public int addGene(Xref ref, String bpText); 
-
-	/**
-	 * Add an attribute for a biological entity to the database.
-	 * @param ref entity to add
-	 * @param attr key
-	 * @param val value
-	 * @return 1 if addition was successful, 0 otherwise. 
-	 */
-    public int addAttribute(Xref ref, String attr, String val);
-
-	/**
-	 * Add a link between two refs to the database.
-	 * @param left left part of relationship
-	 * @param right right part of relationship
-	 * @return 1 if addition was successful, 0 otherwise. 
-	 */
-    public int addLink(Xref left, Xref right);
-    
-	/**
-	   Create indices on the database
-	   You can call this at any time after creating the tables,
-	   but it is good to do it only after inserting all data.
-	   @throws IDMapperException on failure
-	 */
-	public void createGdbIndices() throws IDMapperException;   
-}
Index: /unk/corelib/src/org/bridgedb/rdb/DataDerbyDirectory.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/rdb/DataDerbyDirectory.java (revision 105)
+++  (revision )
@@ -1,53 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.rdb;
-
-import java.sql.DriverManager;
-import java.sql.SQLException;
-
-import org.bridgedb.IDMapperException;
-
-
-//import org.pathvisio.debug.Logger;
-
-/**
-   Implementation of DBConnector using the Derby Driver,
-   with the database stored as multiple files in a directory
-*/
-public class DataDerbyDirectory extends DataDerby
-{	
-	String lastDbName;
-		
-	public String finalizeNewDatabase(String dbName) throws IDMapperException
-	{
-		try
-		{
-			DriverManager.getConnection("jdbc:derby:" + FileUtilsGdb.removeExtension(dbName) + ";shutdown=true");
-		}
-		catch(SQLException e)
-		{
-			if (e.getSQLState().equals ("08006"))
-			{
-				// this exception is acutally expected, see
-			    // http://db.apache.org/derby/docs/10.3/getstart/rwwdactivity3.html
-//				Logger.log.info ("Database shudown cleanly");
-			}
-			else throw new IDMapperException (e);
-		}
-		return dbName;
-	}	
-}
Index: /unk/corelib/src/org/bridgedb/rdb/SimpleGdb.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/rdb/SimpleGdb.java (revision 288)
+++  (revision )
@@ -1,231 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.rdb;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-import org.bridgedb.DataSource;
-import org.bridgedb.IDMapperException;
-
-/**
- * SimpleGdb is the main implementation of the Gdb interface,
- * for dealing with single SQL-based pgdb's.
- * It's responsible for creating and querying a single 
- * pgdb relational database through the JDBC interface.
- * <p>
- * It wraps SQL statements in methods, 
- * so the rest of the apps don't need to know the
- * details of the Database schema.
- * <p>
- * It delegates dealing with the differences between 
- * various RDBMS's (Derby, Hsqldb etc.)
- * to a DBConnector instance.
- * A correct DBConnector instance needs to be 
- * passed to the constructor of SimpleGdb. 
- * <p>
- * In the PathVisio GUI environment, use GdbManager
- * to create and connect one or two centralized Gdb's. 
- * This will also automatically
- * find the right DBConnector from the preferences.
- * <p>
- * In a head-less or test environment, you can bypass GdbManager
- * and use SimpleGdb directly 
- * to create or connect to one or more pgdb's of any type.
- */
-public abstract class SimpleGdb extends IDMapperRdb implements GdbConstruct
-{
-	/**
-	 * Create IDMapper based on an existing SQL connection.
-	 * @param con Existing SQL Connection.
-	 */
-	SimpleGdb(Connection con)
-	{
-		this.con = con;
-	}
-	
-	/**
-	 * helper class that handles lazy initialization of all prepared statements used by SimpleGdb
-	 * Non-static, because it needs the con database connection field.
-	 */
-	protected final class LazyPst
-	{
-		/**
-		 * Initialize with given SQL string, but don't create PreparedStatement yet.
-		 * Valid to call before database connection is created.
-		 * @param aSql SQL query
-		 */
-		public LazyPst(String aSql)
-		{
-			sql = aSql;
-		}
-		
-		private PreparedStatement pst = null;
-		private final String sql;
-		
-		/**
-		 * Get a PreparedStatement using lazy initialization.
-		 * <p>
-		 * Assumes SimpleGdbImpl2.con is already valid
-		 * @return a prepared statement for the given query.
-		 * @throws SQLException when a PreparedStatement could not be created
-		 */
-		public PreparedStatement getPreparedStatement() throws SQLException
-		{
-			if (pst == null)
-			{
-				pst = con.prepareStatement(sql);
-			}
-			return pst;
-		}
-	}
-
-	/**
-	 * The {@link Connection} to the Gene Database.
-	 */
-	protected Connection con = null;
-	// dbConnector, helper class for dealing with RDBMS specifcs.
-	private DBConnector dbConnector;
-
-	/** {@inheritDoc} */
-	final public boolean isConnected() { return con != null; }
-
-	protected String dbName;
-	
-	/** {@inheritDoc} */
-	@Override final public String getDbName() { return dbName; }
-	
-	/** {@inheritDoc} */
-	final public void close() throws IDMapperException 
-	{
-		if (con == null) throw new IDMapperException("Database connection already closed");
-		if (dbConnector != null) dbConnector.closeConnection(con);
-		try
-		{
-			con.close();
-		}
-		catch (SQLException ex)
-		{
-			throw new IDMapperException (ex);
-		}
-		con = null;
-	}
-
-	/**
-	 * Excecutes several SQL statements to create the tables and indexes in the database the given
-	 * connection is connected to
-	 * Note: Official GDB's are created by Alex Pico's script, not with this code.
-	 * This is just here for testing purposes.
-	 */
-	abstract public void createGdbTables();
-	
-	public static final int NO_LIMIT = 0;
-	public static final int NO_TIMEOUT = 0;
-	public static final int QUERY_TIMEOUT = 5; //seconds
-
-	/**
-	   prepare for inserting genes and/or links.
-	   @throws IDMapperException on failure
-	 */
-	abstract public void preInsert() throws IDMapperException;
-
-	/**
-	   commit inserted data.
-	   @throws IDMapperException on failure
-	 */
-	final public void commit() throws IDMapperException
-	{
-		try
-		{
-			con.commit();
-		}
-		catch (SQLException e)
-		{
-			throw new IDMapperException (e);
-		}
-	}
-
-	/**
-	   @return number of rows in gene table.
-	   @throws IDMapperException on failure
-	 */
-	final public int getGeneCount() throws IDMapperException
-	{
-		int result = 0;
-		try
-		{
-			ResultSet r = con.createStatement().executeQuery("SELECT COUNT(*) FROM " + "datanode");
-			r.next();
-			result = r.getInt (1);
-			r.close();
-		}
-		catch (SQLException e)
-		{
-			throw new IDMapperException (e);
-		}
-		return result;
-	}
-
-	/**
-	 * @param ds DataSource to count identifiers for.
-	   @return number of identifiers table for the given datasource
-	   @throws IDMapperException on failure
-	 */
-	final public int getGeneCount(DataSource ds) throws IDMapperException
-	{
-		int result = 0;
-		try
-		{
-			ResultSet r = con.createStatement().executeQuery(
-					"SELECT COUNT(*) FROM datanode WHERE code = '" + ds.getSystemCode() + "'");
-			r.next();
-			result = r.getInt (1);
-			r.close();
-		}
-		catch (SQLException e)
-		{
-			throw new IDMapperException (e);
-		}
-		return result;
-	}
-	
-	/**
-	   compact the database.
-	   @throws IDMapperException on failure
-	 */
-	final public void compact() throws IDMapperException
-	{
-		dbConnector.compact(con);
-	}
-	
-	/**
-	   finalize the database.
-	   @throws IDMapperException on failure
-	 */
-	final public void finalize() throws IDMapperException
-	{
-		dbConnector.compact(con);
-		createGdbIndices();
-		dbConnector.closeConnection(con, DBConnector.PROP_FINALIZE);
-		String newDb = dbConnector.finalizeNewDatabase(dbName);
-		dbName = newDb;
-	}
-
-	
-}
Index: /unk/corelib/src/org/bridgedb/rdb/DataHsqldb.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/rdb/DataHsqldb.java (revision 105)
+++  (revision )
@@ -1,143 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.rdb;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Properties;
-
-import org.bridgedb.IDMapperException;
-
-
-//import org.pathvisio.debug.Logger;
-//import org.pathvisio.debug.StopWatch;
-
-/**
-   DBConnector implementation using the hsqldb driver
-*/
-public class DataHsqldb extends DBConnector
-{
-	static final String DB_FILE_EXT = "properties";
-	static final String[] DB_EXT = new String[] { "*." + DB_FILE_EXT };
-	static final String[] DB_EXT_NAMES = new String[] { "Hsqldb Database" };
-		
-	public Connection createConnection(String dbName, int props) throws IDMapperException 
-	{
-		Connection con;
-		try
-		{
-			boolean recreate = (props & PROP_RECREATE) != 0;
-			if(recreate) {
-				File dbFile = dbName2File(dbName);
-				if(dbFile.exists()) dbFile.delete();
-			}
-			
-			dbName = file2DbName(dbName);
-			
-			Class.forName("org.hsqldb.jdbcDriver");
-			Properties prop = new Properties();
-			prop.setProperty("user","sa");
-			prop.setProperty("password","");
-			prop.setProperty("hsqldb.default_table_type", "cached");
-			prop.setProperty("ifexists", Boolean.toString(!recreate));
-			
-//			StopWatch timer = new StopWatch();
-//			timer.start();
-			con = DriverManager.getConnection("jdbc:hsqldb:file:" + dbName, prop);
-//			Logger.log.info("Connecting with hsqldb to " + dbName + ":\t" + timer.stop());
-		}
-		catch (SQLException e)
-		{
-			throw new IDMapperException (e);
-		}
-		catch (ClassNotFoundException f)
-		{
-			throw new IDMapperException (f);
-		}
-	
-		return con;
-	}
-
-	public void closeConnection(Connection con) throws IDMapperException 
-	{	
-		closeConnection(con, PROP_NONE);
-	}
-	
-	public void closeConnection(Connection con, int props) throws IDMapperException 
-	{
-		try
-		{
-			boolean compact = (props & PROP_FINALIZE) != 0;
-			if(con != null) {
-				Statement sh = con.createStatement();
-				sh.executeQuery("SHUTDOWN" + (compact ? " COMPACT" : ""));
-				sh.close();
-				con.close();
-			}
-		}
-		catch (SQLException e)
-		{
-			throw new IDMapperException (e);
-		}
-	}
-	
-	File dbName2File(String dbName) {
-		return new File(dbName + '.' + DB_FILE_EXT);
-	}
-	
-	String file2DbName(String fileName) {
-		String end = '.' + DB_FILE_EXT;
-		return fileName.endsWith(end) ? 
-				fileName.substring(0, fileName.length() -  end.length()) : fileName;
-	}
-	
-	public void setDatabaseReadonly(String dbName, boolean readonly) {
-		 setPropertyReadOnly(dbName, readonly);
-	}
-	
-	void setPropertyReadOnly(String dbName, boolean readonly) {
-    	Properties prop = new Properties();
-		try {
-			File propertyFile = dbName2File(dbName);
-			prop.load(new FileInputStream(propertyFile));
-			prop.setProperty("hsqldb.files_readonly", Boolean.toString(readonly));
-			prop.store(new FileOutputStream(propertyFile), "HSQL Database Engine");
-			} catch (Exception e) {
-//				Logger.log.error("Unable to set database properties to readonly", e);
-				//TODO: Better handle execption
-			}
-	}
-
-	Connection newDbCon;
-	public Connection createNewDatabaseConnection(String dbName) throws IDMapperException 
-	{
-		newDbCon = createConnection(dbName, PROP_RECREATE);
-		return newDbCon;
-	}
-
-	public String finalizeNewDatabase(String dbName) throws IDMapperException 
-	{
-		if(newDbCon != null) closeConnection(newDbCon, PROP_FINALIZE);
-		setPropertyReadOnly(dbName, true);
-		return dbName;
-	}
-}
Index: /unk/corelib/src/org/bridgedb/rdb/IDMapperRdb.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/rdb/IDMapperRdb.java (revision 288)
+++  (revision )
@@ -1,108 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.rdb;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-
-import org.bridgedb.AttributeMapper;
-import org.bridgedb.BridgeDb;
-import org.bridgedb.DataSource;
-import org.bridgedb.IDMapper;
-import org.bridgedb.IDMapperException;
-import org.bridgedb.Xref;
-import org.bridgedb.impl.InternalUtils;
-
-/**
- * Interface for all classes that provide Gdb-like functionality,
- * such as looking up cross-references and backpage text.
- */
-public abstract class IDMapperRdb implements IDMapper, AttributeMapper
-{
-	static
-	{
-		BridgeDb.register ("idmapper-pgdb", new DriverPgdb());
-		BridgeDb.register ("idmapper-derbyclient", new DriverClient());
-		BridgeDb.register ("idmapper-jdbc", new DriverJdbc());
-	}
-	
-	private static final class DriverPgdb implements org.bridgedb.Driver
-	{
-		/** private constructor to prevent instantiation. */
-		private DriverPgdb() { } 
-		
-		/** {@inheritDoc} */
-		public IDMapper connect(String location) throws IDMapperException 
-		{
-			return SimpleGdbFactory.createInstance(location, new DataDerby(), 0);
-		}
-	}
-
-	private static final class DriverJdbc implements org.bridgedb.Driver
-	{
-		/** private constructor to prevent instantiation. */
-		private DriverJdbc() { } 
-		
-		/** {@inheritDoc} */
-		public IDMapper connect(String location) throws IDMapperException 
-		{
-			try
-			{
-				Connection con = DriverManager.getConnection("jdbc:" + location);
-			
-				return SimpleGdbFactory.createInstance(location, con, 0);
-			}
-			catch (SQLException ex)
-			{
-				throw new IDMapperException(ex);
-			}
-		}
-	}
-
-	private static final class DriverClient implements org.bridgedb.Driver
-	{
-		/** private constructor to prevent instantiation. */
-		private DriverClient() { } 
-		
-		/** {@inheritDoc} */
-		public IDMapper connect(String location) throws IDMapperException 
-		{
-			//TODO: make port and host configurable
-			DBConnectorDerbyServer.init ("wikipathways.org", 1527);
-			return SimpleGdbFactory.createInstance(location, new DBConnectorDerbyServer(), 0);
-		}
-	}
-	
-	/**
-	 * Gets the name of te currently used gene database.
-	 * @return the database name as specified in the connection string
-	 */
-	public abstract String getDbName();
-
-	/** @return the database name, i.e. the full path to the pgdb. */
-	@Override public String toString() { return getDbName(); } 
-	
-	/** {@inheritDoc} */
-	public Map<Xref, Set<Xref>> mapID(Collection<Xref> srcXrefs, DataSource... tgtDataSources) throws IDMapperException 
-	{
-		return InternalUtils.mapMultiFromSingle(this, srcXrefs, tgtDataSources);
-	}	
-}
Index: /unk/corelib/src/org/bridgedb/rdb/SimpleGdbImpl2.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/rdb/SimpleGdbImpl2.java (revision 307)
+++  (revision )
@@ -1,722 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.rdb;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.bridgedb.AbstractIDMapperCapabilities;
-import org.bridgedb.DataSource;
-import org.bridgedb.IDMapperCapabilities;
-import org.bridgedb.IDMapperException;
-import org.bridgedb.Xref;
-
-/** {@inheritDoc} */
-class SimpleGdbImpl2 extends SimpleGdb
-{		
-	private static final int GDB_COMPAT_VERSION = 2; //Preferred schema version
-	
-	private final SimpleGdb.LazyPst pstDatasources = new SimpleGdb.LazyPst(
-			"SELECT codeRight FROM link GROUP BY codeRight"
-		);
-	private final SimpleGdb.LazyPst pstInfo = new SimpleGdb.LazyPst(
-			"SELECT * FROM info"
-		);
-	private final SimpleGdb.LazyPst pstXrefExists = new SimpleGdb.LazyPst(
-			"SELECT id FROM " + "datanode" + " WHERE " +
-			"id = ? AND code = ?"
-		);
-	private final SimpleGdb.LazyPst pstBackpage = new SimpleGdb.LazyPst(
-			"SELECT backpageText FROM datanode " +
-			" WHERE id = ? AND code = ?"
-		);
-	private final SimpleGdb.LazyPst pstAttribute = new SimpleGdb.LazyPst(
-			"SELECT attrvalue FROM attribute " +
-			" WHERE id = ? AND code = ? AND attrname = ?"
-		);
-	private final SimpleGdb.LazyPst pstAllAttributes = new SimpleGdb.LazyPst(
-			"SELECT attrname, attrvalue FROM attribute " +
-			" WHERE id = ? AND code = ?"
-		);
-	private final SimpleGdb.LazyPst pstAttributesSet = new SimpleGdb.LazyPst(
-			"SELECT attrname FROM attribute GROUP BY attrname"
-		);
-	private final SimpleGdb.LazyPst pstCrossRefs = new SimpleGdb.LazyPst (
-			"SELECT dest.idRight, dest.codeRight FROM link AS src JOIN link AS dest " +
-			"ON src.idLeft = dest.idLeft and src.codeLeft = dest.codeLeft " +
-			"WHERE src.idRight = ? AND src.codeRight = ?"
-		);
-	private final SimpleGdb.LazyPst pstCrossRefsWithCode = new SimpleGdb.LazyPst (
-			"SELECT dest.idRight, dest.codeRight FROM link AS src JOIN link AS dest " +
-			"ON src.idLeft = dest.idLeft and src.codeLeft = dest.codeLeft " +
-			"WHERE src.idRight = ? AND src.codeRight = ? AND dest.codeRight = ?"
-		);
-	private final SimpleGdb.LazyPst pstRefsByAttribute = new SimpleGdb.LazyPst (
-			"SELECT datanode.id, datanode.code FROM datanode " +
-			" LEFT JOIN attribute ON attribute.code = datanode.code AND attribute.id = datanode.id " +
-			"WHERE attrName = ? AND attrValue = ?"
-		);
-	private final SimpleGdb.LazyPst pstFreeSearch = new SimpleGdb.LazyPst (
-			"SELECT id, code FROM datanode WHERE " +
-			"LOWER(ID) LIKE ?"
-		);
-	private final SimpleGdb.LazyPst pstAttributeSearch = new SimpleGdb.LazyPst (
-			"SELECT id, code, attrvalue FROM attribute WHERE " +
-			"attrname = 'Symbol' AND LOWER(attrvalue) LIKE ?"
-		);
-	private final SimpleGdb.LazyPst pstIdSearchWithAttributes = new SimpleGdb.LazyPst (
-			"SELECT id, code, attrvalue FROM attribute WHERE " +
-			"attrname = 'Symbol' AND LOWER(ID) LIKE ?"
-		);
-	
-	/** {@inheritDoc} */
-	public boolean xrefExists(Xref xref) throws IDMapperException 
-	{
-		try 
-		{
-			PreparedStatement pst = pstXrefExists.getPreparedStatement();
-			pst.setString(1, xref.getId());
-			pst.setString(2, xref.getDataSource().getSystemCode());
-			ResultSet r = pst.executeQuery();
-
-			while(r.next()) 
-			{
-				return true;
-			}
-		} 
-		catch (SQLException e) 
-		{
-			throw new IDMapperException (e);
-		}
-		return false;
-	}
-
-	/**
-	 * Read the info table and return as properties.
-	 * @return a map where keys are column names and values are the fields in the first row.
-	 * @throws IDMapperException when the database became unavailable
-	 */
-	private Map<String, String> getInfo() throws IDMapperException
-	{
-		Map<String, String> result = new HashMap<String, String>();
-		try
-		{
-			PreparedStatement pst = pstInfo.getPreparedStatement();
-			ResultSet rs = pst.executeQuery();
-			
-			if (rs.next())
-			{
-				ResultSetMetaData rsmd = rs.getMetaData();
-				for (int i = 1; i <= rsmd.getColumnCount(); ++i)
-				{
-					String key = rsmd.getColumnName(i);
-					String val = rs.getString(i);
-					result.put (key, val);
-				}
-			}
-		}
-		catch (SQLException ex)
-		{
-			throw new IDMapperException (ex);
-		}
-		
-		return result;
-	}
-	
-
-	/** 
-	 * get Backpage info. In Schema v2, this was not stored in 
-	 * the attribute table but as a separate column, so this is treated
-	 * as a special case. This method is called by <pre>getAttribute (ref, "Backpage")</pre>
-	 * @param ref the entity to get backpage info for.
-	 * @return Backpage info as string
-	 * @throws IDMapperException when database is unavailable
-	 */
-	private String getBpInfo(Xref ref) throws IDMapperException 
-	{
-		try {
-			PreparedStatement pst = pstBackpage.getPreparedStatement();
-			pst.setString (1, ref.getId());
-			pst.setString (2, ref.getDataSource().getSystemCode());
-			ResultSet r = pst.executeQuery();
-			String result = null;
-			if (r.next())
-			{
-				result = r.getString(1);
-			}
-			return result;
-		} catch	(SQLException e) { throw new IDMapperException (e); } //Gene not found
-	}
-
-	/** {@inheritDoc} */
-	public Set<Xref> mapID (Xref idc, DataSource... resultDs) throws IDMapperException
-	{
-		Set<Xref> refs = new HashSet<Xref>();
-		
-		if (idc.getDataSource() == null) return refs;
-		try
-		{
-			PreparedStatement pst;
-			if (resultDs.length != 1)
-			{
-				pst = pstCrossRefs.getPreparedStatement();
-			}
-			else
-			{
-				pst = pstCrossRefsWithCode.getPreparedStatement();
-				pst.setString(3, resultDs[0].getSystemCode());
-			}
-			
-			pst.setString(1, idc.getId());
-			pst.setString(2, idc.getDataSource().getSystemCode());
-			
-			Set<DataSource> dsFilter = new HashSet<DataSource>(Arrays.asList(resultDs));
-
-			ResultSet rs = pst.executeQuery();
-			while (rs.next())
-			{
-				DataSource ds = DataSource.getBySystemCode(rs.getString(2));
-				if (resultDs.length == 0 || dsFilter.contains(ds))
-				{
-					refs.add (new Xref (rs.getString(1), ds));
-				}
-			}
-		}
-		catch (SQLException e)
-		{
-			throw new IDMapperException (e);
-		}
-		
-		return refs;
-	}
-
-	/** {@inheritDoc} */
-	public List<Xref> getCrossRefsByAttribute(String attrName, String attrValue) throws IDMapperException {
-//		Logger.log.trace("Fetching cross references by attribute: " + attrName + " = " + attrValue);
-		List<Xref> refs = new ArrayList<Xref>();
-
-		try {
-			PreparedStatement pst = pstRefsByAttribute.getPreparedStatement();
-			pst.setString(1, attrName);
-			pst.setString(2, attrValue);
-			ResultSet r = pst.executeQuery();
-			while(r.next()) {
-				Xref ref = new Xref(r.getString(1), DataSource.getBySystemCode(r.getString(2)));
-				refs.add(ref);
-			}
-		} catch(SQLException e) {
-			throw new IDMapperException (e);
-		}
-//		Logger.log.trace("End fetching cross references by attribute");
-		return refs;
-	}
-
-	/**
-	 * Opens a connection to the Gene Database located in the given file.
-	 * A new instance of this class is created automatically.
-	 * @param dbName The file containing the Gene Database. 
-	 * @param con An existing SQL Connector.
-	 * @param props PROP_RECREATE if you want to create a new database (possibly overwriting an existing one) 
-	 * 	or PROP_NONE if you want to connect read-only
-	 * @throws IDMapperException when the database could not be created or connected to
-	 */
-	public SimpleGdbImpl2(String dbName, Connection con, int props) throws IDMapperException
-	{
-		super (con);
-		
-		if(dbName == null) throw new NullPointerException();
-		this.dbName = dbName;
-		
-		if ((props & DBConnector.PROP_RECREATE) == 0)
-		{
-			try
-			{
-				con.setReadOnly(true);
-			}
-			catch (SQLException e)
-			{
-				throw new IDMapperException (e);
-			}
-			checkSchemaVersion();
-		}
-		
-		 caps = new SimpleGdbCapabilities();
-	}
-	
-	/**
-	 * look at the info table of the current database to determine the schema version.
-	 * @throws IDMapperException when looking up the schema version failed
-	 */
-	private void checkSchemaVersion() throws IDMapperException 
-	{
-		int version = 0;
-		try 
-		{
-			ResultSet r = con.createStatement().executeQuery("SELECT schemaversion FROM info");
-			if(r.next()) version = r.getInt(1);
-		} 
-		catch (SQLException e) 
-		{
-			//Ignore, older db's don't even have schema version
-		}
-		if(version != GDB_COMPAT_VERSION) 
-		{
-			throw new IDMapperException ("Implementation and schema version mismatch");
-		}
-	}
-
-	/**
-	 * Excecutes several SQL statements to create the tables and indexes in the database the given
-	 * connection is connected to
-	 * Note: Official GDB's are created by AP, not with this code.
-	 * This is just here for testing purposes.
-	 */
-	public void createGdbTables() 
-	{
-//		Logger.log.info("Info:  Creating tables");
-		try 
-		{
-			Statement sh = con.createStatement();
-			sh.execute("DROP TABLE info");
-			sh.execute("DROP TABLE link");
-			sh.execute("DROP TABLE datanode");
-			sh.execute("DROP TABLE attribute");
-		} 
-		catch(SQLException e) 
-		{
-//			Logger.log.error("Unable to drop gdb tables (ignoring): " + e.getMessage());
-		}
-
-		try
-		{
-			Statement sh = con.createStatement();
-			sh.execute(
-					"CREATE TABLE					" +
-					"		info							" +
-					"(	  schemaversion INTEGER PRIMARY KEY		" +
-			")");
-//			Logger.log.info("Info table created");
-			sh.execute( //Add compatibility version of GDB
-					"INSERT INTO info VALUES ( " + GDB_COMPAT_VERSION + ")");
-//			Logger.log.info("Version stored in info");
-			sh.execute(
-					"CREATE TABLE					" +
-					"		link							" +
-					" (   idLeft VARCHAR(50) NOT NULL,		" +
-					"     codeLeft VARCHAR(50) NOT NULL,	" +
-					"     idRight VARCHAR(50) NOT NULL,		" +
-					"     codeRight VARCHAR(50) NOT NULL,	" +
-					"     bridge VARCHAR(50),				" +
-					"     PRIMARY KEY (idLeft, codeLeft,    " +
-					"		idRight, codeRight) 			" +
-					" )										");
-//			Logger.log.info("Link table created");
-			sh.execute(
-					"CREATE TABLE					" +
-					"		datanode						" +
-					" (   id VARCHAR(50),					" +
-					"     code VARCHAR(50),					" +
-					"     backpageText VARCHAR(800),		" +
-					"     PRIMARY KEY (id, code)    		" +
-					" )										");
-//			Logger.log.info("DataNode table created");
-			sh.execute(
-					"CREATE TABLE							" +
-					"		attribute 						" +
-					" (   id VARCHAR(50),					" +
-					"     code VARCHAR(50),					" +
-					"     attrname VARCHAR(50),				" +
-					"	  attrvalue VARCHAR(255)			" +
-					" )										");
-//			Logger.log.info("Attribute table created");
-		} 
-		catch (SQLException e)
-		{
-//			Logger.log.error("while creating gdb tables: " + e.getMessage(), e);
-		}
-	}
-
-	
-	public static final int NO_LIMIT = 0;
-	public static final int NO_TIMEOUT = 0;
-	public static final int QUERY_TIMEOUT = 20; //seconds
-
-	/** {@inheritDoc} */
-	public Set<Xref> freeSearch (String text, int limit) throws IDMapperException 
-	{		
-		Set<Xref> result = new HashSet<Xref>();
-		try {
-			PreparedStatement ps1 = pstFreeSearch.getPreparedStatement();
-			ps1.setQueryTimeout(QUERY_TIMEOUT);
-			if(limit > NO_LIMIT) 
-			{
-				ps1.setMaxRows(limit);
-			}
-
-			ps1.setString(1, "%" + text.toLowerCase() + "%");
-			ResultSet r = ps1.executeQuery();
-			while(r.next()) {
-				String id = r.getString(1);
-				DataSource ds = DataSource.getBySystemCode(r.getString(2));
-				Xref ref = new Xref (id, ds);
-				result.add (ref);
-			}			
-		} 
-		catch (SQLException e) 
-		{
-			throw new IDMapperException(e);
-		}
-		return result;
-	}
-	
-    private PreparedStatement pstGene = null;
-    private PreparedStatement pstLink = null;
-    private PreparedStatement pstAttr = null;
-
-	/** {@inheritDoc} */
-	public int addGene(Xref ref, String bpText) 
-	{
-    	if (pstGene == null) throw new NullPointerException();
-		try 
-		{
-			pstGene.setString(1, ref.getId());
-			pstGene.setString(2, ref.getDataSource().getSystemCode());
-			pstGene.setString(3, bpText);
-			pstGene.executeUpdate();
-		} 
-		catch (SQLException e) 
-		{ 
-//			Logger.log.error("" + ref, e);
-			return 1;
-		}
-		return 0;
-    }
-    
-	/** {@inheritDoc} */
-    public int addAttribute(Xref ref, String attr, String val)
-    {
-    	try {
-    		pstAttr.setString(1, attr);
-			pstAttr.setString(2, val);
-			pstAttr.setString(3, ref.getId());
-			pstAttr.setString(4, ref.getDataSource().getSystemCode());
-			pstAttr.executeUpdate();
-		} catch (SQLException e) {
-//			Logger.log.error(attr + "\t" + val + "\t" + ref, e);
-			return 1;
-		}
-		return 0;
-    }
-
-	/** {@inheritDoc} */
-    public int addLink(Xref left, Xref right) 
-    {
-    	if (pstLink == null) throw new NullPointerException();
-    	try 
-    	{
-			pstLink.setString(1, left.getId());
-			pstLink.setString(2, left.getDataSource().getSystemCode());
-			pstLink.setString(3, right.getId());
-			pstLink.setString(4, right.getDataSource().getSystemCode());
-			pstLink.executeUpdate();
-		} 
-		catch (SQLException e)
-		{
-//			Logger.log.error(left + "\t" + right , e);
-			return 1;
-		}
-		return 0;
-	}
-
-	/**
-	   Create indices on the database
-	   You can call this at any time after creating the tables,
-	   but it is good to do it only after inserting all data.
-	   @throws IDMapperException on failure
-	 */
-	public void createGdbIndices() throws IDMapperException 
-	{
-		try
-		{
-			Statement sh = con.createStatement();
-			sh.execute(
-					"CREATE INDEX i_codeLeft" +
-					" ON link(codeLeft)"
-			);
-			sh.execute(
-					"CREATE INDEX i_idRight" +
-					" ON link(idRight)"
-			);
-			sh.execute(
-					"CREATE INDEX i_codeRight" +
-					" ON link(codeRight)"
-			);
-			sh.execute(
-					"CREATE INDEX i_code" +
-					" ON " + "datanode" + "(code)"
-			);
-		}
-		catch (SQLException e)
-		{
-			throw new IDMapperException (e);
-		}
-	}
-
-	/**
-	   prepare for inserting genes and/or links.
-	   @throws IDMapperException on failure
-	 */
-	public void preInsert() throws IDMapperException
-	{
-		try
-		{
-			con.setAutoCommit(false);
-			pstGene = con.prepareStatement(
-				"INSERT INTO datanode " +
-				"	(id, code," +
-				"	 backpageText)" +
-				"VALUES (?, ?, ?)"
-	 		);
-			pstLink = con.prepareStatement(
-				"INSERT INTO link " +
-				"	(idLeft, codeLeft," +
-				"	 idRight, codeRight)" +
-				"VALUES (?, ?, ?, ?)"
-	 		);
-			pstAttr = con.prepareStatement(
-					"INSERT INTO attribute " +
-					"	(attrname, attrvalue, id, code)" +
-					"VALUES (?, ?, ?, ?)"
-					);
-		}
-		catch (SQLException e)
-		{
-			throw new IDMapperException (e);
-		}
-	}
-
-	/**
-	 * @return a list of data sources present in this database. 
-	   @throws IDMapperException when the database is unavailable
-	 */
-	private Set<DataSource> getDataSources() throws IDMapperException
-	{
-		Set<DataSource> result = new HashSet<DataSource>();
-    	try
-    	{
-    	 	PreparedStatement pst = pstDatasources.getPreparedStatement();
-    	 	ResultSet rs = pst.executeQuery();
-    	 	while (rs.next())
-    	 	{
-    	 		DataSource ds = DataSource.getBySystemCode(rs.getString(1)); 
-    	 		result.add (ds);
-    	 	}
-    	}
-    	catch (SQLException ignore)
-    	{
-    		throw new IDMapperException(ignore);
-    	}
-    	return result;
-	}
-	
-	private final IDMapperCapabilities caps;
-
-	private class SimpleGdbCapabilities extends AbstractIDMapperCapabilities
-	{
-		/** default constructor.
-		 * @throws IDMapperException when database is not available */
-		public SimpleGdbCapabilities() throws IDMapperException 
-		{
-			super (SimpleGdbImpl2.this.getDataSources(), true, 
-					SimpleGdbImpl2.this.getInfo());
-		}
-	}
-	
-	/**
-	 * @return the capabilities of this gene database
-	 */
-	public IDMapperCapabilities getCapabilities() 
-	{
-		return caps;
-	}
-	
-	private static final Map<String, String> ATTRIBUTES_FROM_BACKPAGE;
-	
-	static
-	{
-		ATTRIBUTES_FROM_BACKPAGE = new HashMap<String, String>();
-		ATTRIBUTES_FROM_BACKPAGE.put ("Chromosome", "<TH>Chr:<TH>([^<]*)<");
-		ATTRIBUTES_FROM_BACKPAGE.put ("Description", "<TH>Description:<TH>([^<]*)<");
-		ATTRIBUTES_FROM_BACKPAGE.put ("Synonyms", "<TH>Synonyms:<TH>([^<]*)<");
-		ATTRIBUTES_FROM_BACKPAGE.put ("Symbol", "<TH>(?:Gene Symbol|Metabolite):<TH>([^<]*)<");
-		ATTRIBUTES_FROM_BACKPAGE.put ("BrutoFormula", "<TH>Bruto Formula:<TH>([^<]*)<");
-	}
-
-	/** {@inheritDoc} */
-	public Set<String> getAttributes(Xref ref, String attrname)
-			throws IDMapperException 
-	{
-		Set<String> result = new HashSet<String>();
-		
-		if (ATTRIBUTES_FROM_BACKPAGE.containsKey(attrname))
-		{
-			String bpInfo = getBpInfo(ref);
-			if (bpInfo != null)
-			{
-				Pattern pat = Pattern.compile(ATTRIBUTES_FROM_BACKPAGE.get (attrname));
-				Matcher matcher = pat.matcher(bpInfo);
-				if (matcher.find())
-				{
-					result.add (matcher.group(1));
-				}
-			}
-		}
-		
-		try {
-			PreparedStatement pst = pstAttribute.getPreparedStatement();
-			pst.setString (1, ref.getId());
-			pst.setString (2, ref.getDataSource().getSystemCode());
-			pst.setString (3, attrname);
-			ResultSet r = pst.executeQuery();
-			if (r.next())
-			{
-				result.add (r.getString(1));
-			}
-			return result;
-		} catch	(SQLException e) { throw new IDMapperException ("Xref:" + ref + ", Attribute: " + attrname, e); } // Database unavailable
-	}
-
-	/** {@inheritDoc} */
-	public Map<String, Set<String>> getAttributes(Xref ref)
-			throws IDMapperException 
-	{
-		Map<String, Set<String>> result = new HashMap<String, Set<String>>();
-				
-		String bpInfo = getBpInfo(ref);
-		if (bpInfo != null)
-		{
-			for (String attrname : ATTRIBUTES_FROM_BACKPAGE.keySet())
-			{
-				Pattern pat = Pattern.compile(ATTRIBUTES_FROM_BACKPAGE.get (attrname));
-				Matcher matcher = pat.matcher(bpInfo);
-				if (matcher.find())
-				{
-					Set<String> attrSet = new HashSet<String>();
-					attrSet.add (matcher.group(1));
-					result.put (attrname, attrSet);
-				}
-			}
-		}
-		
-		try {
-			PreparedStatement pst = pstAllAttributes.getPreparedStatement();
-			pst.setString (1, ref.getId());
-			pst.setString (2, ref.getDataSource().getSystemCode());
-			ResultSet r = pst.executeQuery();
-			if (r.next())
-			{
-				String key = r.getString(1);
-				String value = r.getString(2);
-				if (result.containsKey (key))
-				{
-					result.get(key).add (value);
-				}
-				else
-				{
-					Set<String> valueSet = new HashSet<String>();
-					valueSet.add (value);
-					result.put (key, valueSet);
-				}
-			}
-			return result;
-		} catch	(SQLException e) { throw new IDMapperException ("Xref:" + ref, e); } // Database unavailable
-	}
-
-	/**
-	 *
-	 * @return true
-	 */
-	public boolean isFreeAttributeSearchSupported()
-	{
-		return true;
-	}
-
-	/**
-	 * free text search for matching symbols.
-	 * @return references that match the query
-	 * @param query The text to search for
-	 * @param attrType the attribute to look for, e.g. 'Symbol' or 'Description'.
-	 * @param limit The number of results to limit the search to
-	 * @throws IDMapperException if the mapping service is (temporarily) unavailable 
-	 */
-	public Map<Xref, String> freeAttributeSearch (String query, String attrType, int limit) throws IDMapperException
-	{
-		Map<Xref, String> result = new HashMap<Xref, String>();
-		try {
-			PreparedStatement pst = (MATCH_ID.equals (attrType)) ? 
-					pstIdSearchWithAttributes.getPreparedStatement() : pstAttributeSearch.getPreparedStatement();
-			pst.setQueryTimeout(QUERY_TIMEOUT);
-			if(limit > NO_LIMIT) pst.setMaxRows(limit);
-			pst.setString(1, "%" + query.toLowerCase() + "%");
-			ResultSet r = pst.executeQuery();
-
-			while(r.next()) 
-			{
-				String id = r.getString("id");
-				String code = r.getString("code");
-				String symbol = r.getString("attrValue");
-				result.put(new Xref (id, DataSource.getBySystemCode(code)), symbol);
-			}
-		} catch (SQLException e) {
-			throw new IDMapperException (e);
-		}
-		return result;		
-	}
-
-	/** {@inheritDoc} */
-	public Set<String> getAttributeSet() throws IDMapperException 
-	{
-		Set<String> result = new HashSet<String>();
-    	try
-    	{
-    	 	PreparedStatement pst = pstAttributesSet.getPreparedStatement();
-    	 	ResultSet rs = pst.executeQuery();
-    	 	while (rs.next())
-    	 	{
-    	 		result.add (rs.getString(1));
-    	 	}
-    	}
-    	catch (SQLException ignore)
-    	{
-    		throw new IDMapperException(ignore);
-    	}
-    	return result;
-	}
-}
Index: /unk/corelib/src/org/bridgedb/rdb/SimpleGdbImpl3.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/rdb/SimpleGdbImpl3.java (revision 307)
+++  (revision )
@@ -1,645 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.rdb;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.bridgedb.AbstractIDMapperCapabilities;
-import org.bridgedb.DataSource;
-import org.bridgedb.IDMapperCapabilities;
-import org.bridgedb.IDMapperException;
-import org.bridgedb.Xref;
-
-/** {@inheritDoc} */
-class SimpleGdbImpl3 extends SimpleGdb
-{		
-	private static final int GDB_COMPAT_VERSION = 3; //Preferred schema version
-	
-	private final SimpleGdb.LazyPst pstDatasources = new SimpleGdb.LazyPst(
-			"SELECT codeRight FROM link GROUP BY codeRight"
-		);
-	private final SimpleGdb.LazyPst pstInfo = new SimpleGdb.LazyPst(
-			"SELECT * FROM info"
-		);
-	private final SimpleGdb.LazyPst pstXrefExists = new SimpleGdb.LazyPst(
-			"SELECT id FROM " + "datanode" + " WHERE " +
-			"id = ? AND code = ?"
-		);	
-	private final SimpleGdb.LazyPst pstAttribute = new SimpleGdb.LazyPst(
-			"SELECT attrvalue FROM attribute " +
-			" WHERE id = ? AND code = ? AND attrname = ?"
-		);
-	private final SimpleGdb.LazyPst pstAllAttributes = new SimpleGdb.LazyPst(
-			"SELECT attrname, attrvalue FROM attribute " +
-			" WHERE id = ? AND code = ?"
-		);
-	private final SimpleGdb.LazyPst pstAttributesSet = new SimpleGdb.LazyPst(
-			"SELECT attrname FROM attribute GROUP BY attrname"
-		);
-	private final SimpleGdb.LazyPst pstCrossRefs = new SimpleGdb.LazyPst (
-			"SELECT dest.idRight, dest.codeRight FROM link AS src JOIN link AS dest " +
-			"ON src.idLeft = dest.idLeft and src.codeLeft = dest.codeLeft " +
-			"WHERE src.idRight = ? AND src.codeRight = ?"
-		);
-	private final SimpleGdb.LazyPst pstCrossRefsWithCode = new SimpleGdb.LazyPst (
-			"SELECT dest.idRight, dest.codeRight FROM link AS src JOIN link AS dest " +
-			"ON src.idLeft = dest.idLeft and src.codeLeft = dest.codeLeft " +
-			"WHERE src.idRight = ? AND src.codeRight = ? AND dest.codeRight = ?"
-		);
-	private final SimpleGdb.LazyPst pstRefsByAttribute = new SimpleGdb.LazyPst (
-			"SELECT datanode.id, datanode.code FROM datanode " +
-			" LEFT JOIN attribute ON attribute.code = datanode.code AND attribute.id = datanode.id " +
-			"WHERE attrName = ? AND attrValue = ?"
-		);
-	private final SimpleGdb.LazyPst pstFreeSearch = new SimpleGdb.LazyPst (
-			"SELECT id, code FROM datanode WHERE " +
-			"LOWER(ID) LIKE ?"
-		);
-	private final SimpleGdb.LazyPst pstAttributeSearch = new SimpleGdb.LazyPst (
-			"SELECT id, code, attrvalue FROM attribute WHERE " +
-			"attrname = 'Symbol' AND LOWER(attrvalue) LIKE ?"
-		);
-	private final SimpleGdb.LazyPst pstIdSearchWithAttributes = new SimpleGdb.LazyPst (
-			"SELECT id, code, attrvalue FROM attribute WHERE " +
-			"attrname = 'Symbol' AND LOWER(ID) LIKE ?"
-		);
-	
-	/** {@inheritDoc} */
-	public boolean xrefExists(Xref xref) throws IDMapperException 
-	{
-		try 
-		{
-			PreparedStatement pst = pstXrefExists.getPreparedStatement();
-			pst.setString(1, xref.getId());
-			pst.setString(2, xref.getDataSource().getSystemCode());
-			ResultSet r = pst.executeQuery();
-
-			while(r.next()) 
-			{
-				return true;
-			}
-		} 
-		catch (SQLException e) 
-		{
-			throw new IDMapperException (e);
-		}
-		return false;
-	}
-
-	/** {@inheritDoc} */
-	public Set<Xref> mapID (Xref idc, DataSource... resultDs) throws IDMapperException
-	{
-		Set<Xref> refs = new HashSet<Xref>();
-		
-		try
-		{
-			PreparedStatement pst;
-			if (resultDs.length != 1)
-			{
-				pst = pstCrossRefs.getPreparedStatement();
-			}
-			else
-			{
-				pst = pstCrossRefsWithCode.getPreparedStatement();
-				pst.setString(3, resultDs[0].getSystemCode());
-			}
-			
-			pst.setString(1, idc.getId());
-			pst.setString(2, idc.getDataSource().getSystemCode());
-
-			Set<DataSource> dsFilter = new HashSet<DataSource>(Arrays.asList(resultDs));
-
-			ResultSet rs = pst.executeQuery();
-			while (rs.next())
-			{
-				DataSource ds = DataSource.getBySystemCode(rs.getString(2));
-				if (resultDs.length == 0 || dsFilter.contains(ds))
-				{
-					refs.add (new Xref (rs.getString(1), ds));
-				}
-			}
-		}
-		catch (SQLException e)
-		{
-			throw new IDMapperException (e);
-		}
-		
-		return refs;
-	}
-
-	/** {@inheritDoc} */
-	public List<Xref> getCrossRefsByAttribute(String attrName, String attrValue) throws IDMapperException {
-//		Logger.log.trace("Fetching cross references by attribute: " + attrName + " = " + attrValue);
-		List<Xref> refs = new ArrayList<Xref>();
-
-		try {
-			PreparedStatement pst = pstRefsByAttribute.getPreparedStatement();
-			pst.setString(1, attrName);
-			pst.setString(2, attrValue);
-			ResultSet r = pst.executeQuery();
-			while(r.next()) {
-				Xref ref = new Xref(r.getString(1), DataSource.getBySystemCode(r.getString(2)));
-				refs.add(ref);
-			}
-		} catch(SQLException e) {
-			throw new IDMapperException (e);
-		}
-//		Logger.log.trace("End fetching cross references by attribute");
-		return refs;
-	}
-
-	/**
-	 * Opens a connection to the Gene Database located in the given file.
-	 * A new instance of this class is created automatically.
-	 * @param dbName The file containing the Gene Database. 
-	 * @param con An existing java SQL connection
-	 * @param props PROP_RECREATE if you want to create a new database (possibly overwriting an existing one) 
-	 * 	or PROP_NONE if you want to connect read-only
-	 * @throws IDMapperException when the database could not be created or connected to
-	 */
-	public SimpleGdbImpl3(String dbName, Connection con, int props) throws IDMapperException
-	{
-		super(con);
-		if(dbName == null) throw new NullPointerException();
-
-		this.dbName = dbName;
-
-		if ((props & DBConnector.PROP_RECREATE) == 0)
-		{
-			try
-			{
-				con.setReadOnly(true);
-			}
-			catch (SQLException e)
-			{
-				throw new IDMapperException (e);
-			}
-			checkSchemaVersion();
-		}
-		
-		caps = new SimpleGdbCapabilities();
-	}
-	
-	/**
-	 * look at the info table of the current database to determine the schema version.
-	 * @throws IDMapperException when looking up the schema version failed
-	 */
-	private void checkSchemaVersion() throws IDMapperException 
-	{
-		int version = 0;
-		try 
-		{
-			ResultSet r = con.createStatement().executeQuery("SELECT schemaversion FROM info");
-			if(r.next()) version = r.getInt(1);
-		} 
-		catch (SQLException e) 
-		{
-			//Ignore, older db's don't even have schema version
-		}
-		if(version != GDB_COMPAT_VERSION) 
-		{
-			throw new IDMapperException ("Implementation and schema version mismatch");
-		}
-	}
-
-	/**
-	 * Excecutes several SQL statements to create the tables and indexes in the database the given
-	 * connection is connected to
-	 * Note: Official GDB's are created by AP, not with this code.
-	 * This is just here for testing purposes.
-	 */
-	public void createGdbTables() 
-	{
-//		Logger.log.info("Info:  Creating tables");
-		try 
-		{
-			Statement sh = con.createStatement();
-			sh.execute("DROP TABLE info");
-			sh.execute("DROP TABLE link");
-			sh.execute("DROP TABLE datanode");
-			sh.execute("DROP TABLE attribute");
-		} 
-		catch(SQLException e) 
-		{
-//			Logger.log.error("Unable to drop gdb tables (ignoring): " + e.getMessage());
-		}
-
-		try
-		{
-			Statement sh = con.createStatement();
-			sh.execute(
-					"CREATE TABLE					" +
-					"		info							" +
-					"(	  schemaversion INTEGER PRIMARY KEY		" +
-			")");
-//			Logger.log.info("Info table created");
-			sh.execute( //Add compatibility version of GDB
-					"INSERT INTO info VALUES ( " + GDB_COMPAT_VERSION + ")");
-//			Logger.log.info("Version stored in info");
-			sh.execute(
-					"CREATE TABLE					" +
-					"		link							" +
-					" (   idLeft VARCHAR(50) NOT NULL,		" +
-					"     codeLeft VARCHAR(50) NOT NULL,	" +
-					"     idRight VARCHAR(50) NOT NULL,		" +
-					"     codeRight VARCHAR(50) NOT NULL,	" +
-					"     bridge VARCHAR(50),				" +
-					"     PRIMARY KEY (idLeft, codeLeft,    " +
-					"		idRight, codeRight) 			" +
-					" )										");
-//			Logger.log.info("Link table created");
-			sh.execute(
-					"CREATE TABLE					" +
-					"		datanode						" +
-					" (   id VARCHAR(50),					" +
-					"     code VARCHAR(50)					" +
-					"     PRIMARY KEY (id, code)    		" +
-					" )										");
-//			Logger.log.info("DataNode table created");
-			sh.execute(
-					"CREATE TABLE							" +
-					"		attribute 						" +
-					" (   id VARCHAR(50),					" +
-					"     code VARCHAR(50),					" +
-					"     attrname VARCHAR(50),				" +
-					"	  attrvalue VARCHAR(255)			" +
-					" )										");
-//			Logger.log.info("Attribute table created");
-		} 
-		catch (SQLException e)
-		{
-//			Logger.log.error("while creating gdb tables: " + e.getMessage(), e);
-		}
-	}
-
-	
-	public static final int NO_LIMIT = 0;
-	public static final int NO_TIMEOUT = 0;
-	public static final int QUERY_TIMEOUT = 20; //seconds
-
-	/** {@inheritDoc} */
-	public Set<Xref> freeSearch (String text, int limit) throws IDMapperException 
-	{		
-		Set<Xref> result = new HashSet<Xref>();
-		try {
-			PreparedStatement ps1 = pstFreeSearch.getPreparedStatement();
-			ps1.setQueryTimeout(QUERY_TIMEOUT);
-			if(limit > NO_LIMIT) 
-			{
-				ps1.setMaxRows(limit);
-			}
-
-			ps1.setString(1, "%" + text.toLowerCase() + "%");
-			ResultSet r = ps1.executeQuery();
-			while(r.next()) {
-				String id = r.getString(1);
-				DataSource ds = DataSource.getBySystemCode(r.getString(2));
-				Xref ref = new Xref (id, ds);
-				result.add (ref);
-			}			
-		} 
-		catch (SQLException e) 
-		{
-			throw new IDMapperException(e);
-		}
-		return result;
-	}
-	
-    private PreparedStatement pstGene = null;
-    private PreparedStatement pstLink = null;
-    private PreparedStatement pstAttr = null;
-
-	/** {@inheritDoc} */
-	public int addGene(Xref ref, String bpText) 
-	{
-		//TODO: bpText is unused
-    	if (pstGene == null) throw new NullPointerException();
-		try 
-		{
-			pstGene.setString(1, ref.getId());
-			pstGene.setString(2, ref.getDataSource().getSystemCode());
-			pstGene.executeUpdate();
-		} 
-		catch (SQLException e) 
-		{ 
-//			Logger.log.error("" + ref, e);
-			return 1;
-		}
-		return 0;
-    }
-    
-	/** {@inheritDoc} */
-    public int addAttribute(Xref ref, String attr, String val)
-    {
-    	try {
-    		pstAttr.setString(1, attr);
-			pstAttr.setString(2, val);
-			pstAttr.setString(3, ref.getId());
-			pstAttr.setString(4, ref.getDataSource().getSystemCode());
-			pstAttr.executeUpdate();
-		} catch (SQLException e) {
-//			Logger.log.error(attr + "\t" + val + "\t" + ref, e);
-			return 1;
-		}
-		return 0;
-    }
-
-	/** {@inheritDoc} */
-    public int addLink(Xref left, Xref right) 
-    {
-    	if (pstLink == null) throw new NullPointerException();
-    	try 
-    	{
-			pstLink.setString(1, left.getId());
-			pstLink.setString(2, left.getDataSource().getSystemCode());
-			pstLink.setString(3, right.getId());
-			pstLink.setString(4, right.getDataSource().getSystemCode());
-			pstLink.executeUpdate();
-		} 
-		catch (SQLException e)
-		{
-//			Logger.log.error(left + "\t" + right , e);
-			return 1;
-		}
-		return 0;
-	}
-
-	/**
-	   Create indices on the database
-	   You can call this at any time after creating the tables,
-	   but it is good to do it only after inserting all data.
-	   @throws IDMapperException on failure
-	 */
-	public void createGdbIndices() throws IDMapperException 
-	{
-		try
-		{
-			Statement sh = con.createStatement();
-			sh.execute(
-					"CREATE INDEX i_codeLeft" +
-					" ON link(codeLeft)"
-			);
-			sh.execute(
-					"CREATE INDEX i_idRight" +
-					" ON link(idRight)"
-			);
-			sh.execute(
-					"CREATE INDEX i_codeRight" +
-					" ON link(codeRight)"
-			);
-			sh.execute(
-					"CREATE INDEX i_code" +
-					" ON " + "datanode" + "(code)"
-			);
-		}
-		catch (SQLException e)
-		{
-			throw new IDMapperException (e);
-		}
-	}
-
-	/**
-	   prepare for inserting genes and/or links.
-	   @throws IDMapperException on failure
-	 */
-	public void preInsert() throws IDMapperException
-	{
-		try
-		{
-			con.setAutoCommit(false);
-			pstGene = con.prepareStatement(
-				"INSERT INTO datanode " +
-				"	(id, code)" +
-				"VALUES (?, ?)"
-	 		);
-			pstLink = con.prepareStatement(
-				"INSERT INTO link " +
-				"	(idLeft, codeLeft," +
-				"	 idRight, codeRight)" +
-				"VALUES (?, ?, ?, ?)"
-	 		);
-			pstAttr = con.prepareStatement(
-					"INSERT INTO attribute " +
-					"	(attrname, attrvalue, id, code)" +
-					"VALUES (?, ?, ?, ?)"
-					);
-		}
-		catch (SQLException e)
-		{
-			throw new IDMapperException (e);
-		}
-	}
-
-	/**
-	 * Read the info table and return as properties.
-	 * @return a map where keys are column names and values are the fields in the first row.
-	 * @throws IDMapperException when the database became unavailable
-	 */
-	private Map<String, String> getInfo() throws IDMapperException
-	{
-		Map<String, String> result = new HashMap<String, String>();
-		try
-		{
-			PreparedStatement pst = pstInfo.getPreparedStatement();
-			ResultSet rs = pst.executeQuery();
-			
-			if (rs.next())
-			{
-				ResultSetMetaData rsmd = rs.getMetaData();
-				for (int i = 1; i <= rsmd.getColumnCount(); ++i)
-				{
-					String key = rsmd.getColumnName(i);
-					String val = rs.getString(i);
-					result.put (key, val);
-				}
-			}
-		}
-		catch (SQLException ex)
-		{
-			throw new IDMapperException (ex);
-		}
-		
-		return result;
-	}
-	
-	/**
-	 * @return a list of data sources present in this database. 
-	   @throws IDMapperException when the database is unavailable
-	 */
-	private Set<DataSource> getDataSources() throws IDMapperException
-	{
-		Set<DataSource> result = new HashSet<DataSource>();
-    	try
-    	{
-    	 	PreparedStatement pst = pstDatasources.getPreparedStatement();
-    	 	ResultSet rs = pst.executeQuery();
-    	 	while (rs.next())
-    	 	{
-    	 		DataSource ds = DataSource.getBySystemCode(rs.getString(1)); 
-    	 		result.add (ds);
-    	 	}
-    	}
-    	catch (SQLException ignore)
-    	{
-    		throw new IDMapperException(ignore);
-    	}
-    	return result;
-	}
-	
-	private final IDMapperCapabilities caps;
-
-	private class SimpleGdbCapabilities extends AbstractIDMapperCapabilities
-	{
-		/** default constructor.
-		 * @throws IDMapperException when database is not available */
-		public SimpleGdbCapabilities() throws IDMapperException 
-		{
-			super (SimpleGdbImpl3.this.getDataSources(), true, 
-				SimpleGdbImpl3.this.getInfo());
-		}
-	}
-
-	/**
-	 * @return the capabilities of this gene database
-	 */
-	public IDMapperCapabilities getCapabilities() 
-	{
-		return caps;
-	}
-
-	/** {@inheritDoc} */
-	public Set<String> getAttributes(Xref ref, String attrname)
-			throws IDMapperException 
-	{
-		Set<String> result = new HashSet<String>();
-		try {
-			PreparedStatement pst = pstAttribute.getPreparedStatement();
-			pst.setString (1, ref.getId());
-			pst.setString (2, ref.getDataSource().getSystemCode());
-			pst.setString (3, attrname);
-			ResultSet r = pst.executeQuery();
-			if (r.next())
-			{
-				result.add (r.getString(1));
-			}
-			return result;
-		} catch	(SQLException e) { throw new IDMapperException (e); } // Database unavailable
-	}
-
-	/** {@inheritDoc} */
-	public Map<String, Set<String>> getAttributes(Xref ref)
-			throws IDMapperException 
-	{
-		Map<String, Set<String>> result = new HashMap<String, Set<String>>();				
-		try {
-			PreparedStatement pst = pstAllAttributes.getPreparedStatement();
-			pst.setString (1, ref.getId());
-			pst.setString (2, ref.getDataSource().getSystemCode());
-			ResultSet r = pst.executeQuery();
-			if (r.next())
-			{
-				String key = r.getString(1);
-				String value = r.getString(2);
-				if (result.containsKey (key))
-				{
-					result.get(key).add (value);
-				}
-				else
-				{
-					Set<String> valueSet = new HashSet<String>();
-					valueSet.add (value);
-					result.put (key, valueSet);
-				}
-			}
-			return result;
-		} catch	(SQLException e) { throw new IDMapperException ("Xref:" + ref, e); } // Database unavailable
-	}
-
-	/**
-	 *
-	 * @return true
-	 */
-	public boolean isFreeAttributeSearchSupported()
-	{
-		return true;
-	}
-	
-	/**
-	 * free text search for matching symbols.
-	 * @return references that match the query
-	 * @param query The text to search for
-	 * @param attrType the attribute to look for, e.g. 'Symbol' or 'Description'.
-	 * @param limit The number of results to limit the search to
-	 * @throws IDMapperException if the mapping service is (temporarily) unavailable 
-	 */
-	public Map<Xref, String> freeAttributeSearch (String query, String attrType, int limit) throws IDMapperException
-	{
-		Map<Xref, String> result = new HashMap<Xref, String>();
-		try {
-			PreparedStatement pst = (MATCH_ID.equals (attrType)) ? 
-					pstIdSearchWithAttributes.getPreparedStatement() : pstAttributeSearch.getPreparedStatement();
-			pst.setQueryTimeout(QUERY_TIMEOUT);
-			if(limit > NO_LIMIT) pst.setMaxRows(limit);
-			pst.setString(1, "%" + query.toLowerCase() + "%");
-			ResultSet r = pst.executeQuery();
-
-			while(r.next()) 
-			{
-				String id = r.getString("id");
-				String code = r.getString("code");
-				String symbol = r.getString("attrValue");
-				result.put(new Xref (id, DataSource.getBySystemCode(code)), symbol);
-			}
-		} catch (SQLException e) {
-			throw new IDMapperException (e);
-		}
-		return result;		
-	}
-
-	/** {@inheritDoc} */
-	public Set<String> getAttributeSet() throws IDMapperException 
-	{
-		Set<String> result = new HashSet<String>();
-    	try
-    	{
-    	 	PreparedStatement pst = pstAttributesSet.getPreparedStatement();
-    	 	ResultSet rs = pst.executeQuery();
-    	 	while (rs.next())
-    	 	{
-    	 		result.add (rs.getString(1));
-    	 	}
-    	}
-    	catch (SQLException ignore)
-    	{
-    		throw new IDMapperException(ignore);
-    	}
-    	return result;
-	}
-
-}
Index: /unk/corelib/src/org/bridgedb/rdb/DBConnectorDerbyServer.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/rdb/DBConnectorDerbyServer.java (revision 164)
+++  (revision )
@@ -1,102 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.rdb;
-
-import java.io.File;
-import java.io.IOException;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.util.Properties;
-
-import javax.naming.OperationNotSupportedException;
-
-import org.bridgedb.IDMapperException;
-
-/**
- * Database connector that connects to a Derby database server.
- */
-public class DBConnectorDerbyServer extends DBConnector {
-	
-	static private String host;
-	static private int port;
-	static private boolean inited = false;
-	
-	/**
-	 * Initialize global settings that will be shared by all instances of DBConnectorDerbyServer.
-	 * @param aHost	The host on which the database resides
-	 * @param aPort	The port to create the connection on
-	 */
-	static public void init (String aHost, int aPort)
-	{
-		host = aHost;
-		port = aPort;
-		inited = true;
-	}
-	
-	/**
-	 * Create a new database connector for the hostname and port set at initialization time.
-	 * Will raise an exception if you forgot to call init() before.
-	 */
-	public DBConnectorDerbyServer() 
-	{
-		if (!inited) throw new IllegalArgumentException("Not yet initialized!");
-	}
-	
-	public Connection createConnection(String dbName) throws IDMapperException 
-	{
-		Properties sysprop = System.getProperties();
-		sysprop.setProperty("derby.storage.tempDirectory", System.getProperty("java.io.tmpdir"));
-		
-		try
-		{
-			sysprop.setProperty("derby.stream.error.file", File.createTempFile("derby",".log").toString());
-			Class.forName("org.apache.derby.jdbc.ClientDriver");
-		}
-		catch (ClassNotFoundException e)
-		{
-			throw new IDMapperException (e);
-		}
-		catch (IOException f)
-		{
-			throw new IDMapperException (f);
-		}
-		String url = "jdbc:derby://" + host + ":" + port + "/" + dbName;
-		Connection con;
-		try
-		{
-			con = DriverManager.getConnection(url);
-		}
-		catch (SQLException f)
-		{
-			throw new IDMapperException (f);
-		}
-		return con;
-	}
-
-	public Connection createConnection(String dbName, int props) throws IDMapperException 
-	{
-		return createConnection(dbName);
-	}
-
-	public String finalizeNewDatabase(String dbName) throws IDMapperException 
-	{
-		//Creating database not supported
-		throw new IDMapperException (new OperationNotSupportedException("Can't create new database on server"));
-	}
-
-}
Index: /unk/corelib/src/org/bridgedb/rdb/FileUtilsGdb.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/rdb/FileUtilsGdb.java (revision 105)
+++  (revision )
@@ -1,88 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.rdb;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Random;
-
-//import org.pathvisio.debug.Logger;
-
-/**
- * Collection of static utility methods dealing with files.
- * <p>
- * Package private class
- */
-final class FileUtilsGdb {	
-	
-	/** prevent instantiation of utility class. */
-	private FileUtilsGdb() {}
-	
-	/**
-	 * Think "deltree" or "rm -r".
-	 * @param file directory to remove recursively
-	 * TODO: duplicate with org.pathvisio.util.FileUtils
-	 */
-	public static void deleteRecursive(File file) {
-		if(file.isDirectory()) {
-			for(File f : file.listFiles()) deleteRecursive(f);
-		}
-		file.delete();
-	}
-	
-	/**
-	 * Removes the file extension (everything from the last occurence of '.').
-	 * @param fname file name
-	 * @return file name without extension
-	 * TODO: duplicate with org.pathvisio.util.FileUtils
-	 */
-	public static String removeExtension(String fname) {
-		int dot = fname.lastIndexOf('.');
-		String result = fname;
-		if(dot > 0) result = fname.substring(0, dot);
-		return result;
-	}
-	
-	/**
-	 * Attempts to create a directory in the right temporary directory,
-	 * with a random name that starts with prefix.
-	 * @return a temporary directory
-	 * @param prefix prefix of temp directory name
-	 * @param postfix postfix of temp directory name
-	 * @throws IOException when dir could not be made
-	 */
-	public static File createTempDir(String prefix, String postfix) throws IOException
-	{
-		File result;
-		Random rng = new Random();
-		int i = rng.nextInt(100000);
-		// check for a filename that is free
-		do
-		{
-			result = new File (System.getProperty("java.io.tmpdir"), prefix + i + postfix);
-			i++;
-		}
-		while (result.exists());
-		result.mkdir();
-		
-		if (!result.exists()) throw new IOException();
-		if (!result.isDirectory()) throw new IOException();
-		
-//		Logger.log.info ("Created temporary directory " + result.getAbsolutePath());
-		return result;
-	}
-}
Index: /unk/corelib/src/org/bridgedb/rdb/SimpleGdbFactory.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/rdb/SimpleGdbFactory.java (revision 269)
+++  (revision )
@@ -1,120 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.rdb;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-import org.bridgedb.IDMapperException;
-
-/**
- * Factory class that instantiates the correct SimpleGdb implementation
- * for a new / existing gdb,
- * based on the schema version.
- * Use this class for creating / connecting to any SimpleGdb database.
- */
-public final class SimpleGdbFactory 
-{
-	/** private constructor prevents instantiation. */
-	private SimpleGdbFactory() {};
-	
-	static final int LATEST_SCHEMA_VERSION = 3;
-
-	/**
-	 * Older method to open a connection to a Gene database
-	 * using a DBConnector to handle differences
-	 * between different RDBMS-es. The other createInstance() is preferred.
-	 * <p>
-	 * Use this instead of constructor to create an instance of SimpleGdb that matches the schema version.
-	 * @param dbName The file containing the Gene Database. 
-	 * @param newDbConnector handles the differences between types of RDBMS.
-	 * A new instance of DbConnector class is instantiated automatically.
-	 * @param props PROP_RECREATE if you want to create a new database, overwriting any existing ones. Otherwise, PROP_NONE.
-	 * @return a new Gdb
-	 * @throws IDMapperException on failure
-	*/
-	public static SimpleGdb createInstance(String dbName, DBConnector newDbConnector, int props) throws IDMapperException
-	{
-		DBConnector dbConnector;
-		Connection con;
-
-		try
-		{
-			// create a fresh db connector of the correct type.
-			dbConnector = newDbConnector.getClass().newInstance();
-		}
-		catch (InstantiationException e)
-		{
-			throw new IDMapperException (e);
-		} 
-		catch (IllegalAccessException e) 
-		{
-			throw new IDMapperException (e);
-		}
-		con = dbConnector.createConnection(dbName, props);
-		
-		return createInstance(dbName, con, props);
-	}
-
-	/**
-	 * Opens a connection to the Gene Database located in the given file.
-	 * <p>
-	 * Use this instead of constructor to create an instance of SimpleGdb that matches the schema version.
-	 * @param dbName The file containing the Gene Database. 
-	 * @param con An SQL Connection to the database
-	 * @param props PROP_RECREATE if you want to create a new database, overwriting any existing ones. Otherwise, PROP_NONE.
-	 * @return a new Gdb
-	 * @throws IDMapperException on failure
-	*/
-	public static SimpleGdb createInstance(String dbName, Connection con, int props) throws IDMapperException
-	{
-		if(dbName == null) throw new NullPointerException();	
-
-		int version = 0;
-		if ((props & DBConnector.PROP_RECREATE) == 0)
-		{
-			// read database and try to determine version
-			
-			try 
-			{
-				ResultSet r = con.createStatement().executeQuery("SELECT schemaversion FROM info");
-				if(r.next()) version = r.getInt(1);
-			} 
-			catch (SQLException e) 
-			{
-				//Ignore, older db's don't even have schema version
-			}			
-		}
-		else
-		{
-			version = LATEST_SCHEMA_VERSION;
-		}
-		
-		switch (version)
-		{
-		case 2:
-			return new SimpleGdbImpl2(dbName, con, props);
-		case 3:
-			return new SimpleGdbImpl3(dbName, con, props);
-		//NB add future schema versions here
-		default:
-			throw new IDMapperException ("Unrecognized schema version '" + version + "', please make sure you have the latest " +
-					"version of this software and databases");
-		}		
-	}
-}
Index: /unk/corelib/src/org/bridgedb/rdb/package.html
===================================================================
--- /trunk/corelib/src/org/bridgedb/rdb/package.html (revision 61)
+++  (revision )
@@ -1,12 +1,0 @@
-<html>
-<body>
-Driver and helper classes for using relational databases as identifier mapping services.
-<p>
-For example, to use a downloadable derby database (pgdb file) as a mapping resource, 
-you can use the following piece of code:  
-<pre>
-	class.forName("org.bridgedb.file.IDMapperRdb");
-	mapper = BridgeDb.connect ("idmapper-pgdb:path/to/file.pgdb");
-</pre>
-</body>
-</html>
Index: /unk/corelib/src/org/bridgedb/webservice/bridgerest/BridgeRest.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/webservice/bridgerest/BridgeRest.java (revision 307)
+++  (revision )
@@ -1,512 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.webservice.bridgerest;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.net.URLEncoder;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.bridgedb.AttributeMapper;
-import org.bridgedb.BridgeDb;
-import org.bridgedb.DataSource;
-import org.bridgedb.IDMapper;
-import org.bridgedb.IDMapperCapabilities;
-import org.bridgedb.IDMapperException;
-import org.bridgedb.Xref;
-import org.bridgedb.impl.InternalUtils;
-import org.bridgedb.webservice.IDMapperWebservice;
-
-/**
- * IDMapper implementation for BridgeRest, the REST interface of BridgeDb itself.
- */
-public class BridgeRest extends IDMapperWebservice implements AttributeMapper
-{
-	static {
-		BridgeDb.register ("idmapper-bridgerest", new Driver());
-	}
-
-	private final static class Driver implements org.bridgedb.Driver {
-		/** private constructor to prevent outside instantiation. */
-		private Driver() { } 
-
-		/** {@inheritDoc} */
-		public IDMapper connect(String location) throws IDMapperException  {
-                	// replace all spaces by "%20" to access organisms such as "Arabidopsis theliana"
-			return new BridgeRest(location.replaceAll(" ", "%20"));
-		}
-	}
-
-	private final class RestCapabilities implements IDMapperCapabilities {
-		private Map<String, String> properties = new HashMap<String, String>();
-		private boolean freeSearchSupported;
-
-		/** 
-		 * Capabilities for the BridgeRest IDMapper. 
-		 * @throws IDMapperException when the webservice was not available.
-		 */
-		public RestCapabilities() throws IDMapperException {
-			try {
-				loadProperties();
-				loadFreeSearchSupported();
-			} catch(IOException e) {
-				throw new IDMapperException(e);
-			}
-		}
-
-		/** 
-		 * Helper method, reads a list of supported datasources from the webservice.
-		 * @param cmd can be sourceDataSources or targetDataSources
-		 * @return Set of DataSources
-		 * @throws IDMapperException when service is unavailable.
-		 */
-		private Set<DataSource> loadDataSources(String cmd) throws IDMapperException
-		{
-			try
-			{
-				Set<DataSource> results = new HashSet<DataSource>();
-	
-				BufferedReader in = new UrlBuilder (cmd).openReader();
-				String line = null;
-				while((line = in.readLine()) != null) {
-					results.add(DataSource.getByFullName(line));
-				}
-				in.close();
-				return results;
-			}
-			catch (IOException ex)
-			{
-				throw new IDMapperException (ex);
-			}
-		}
-
-		/** 
-		 * Helper method, checks if free search is supported by the webservice.
-		 * @throws IOException when service is unavailable.
-		 */
-		private void loadFreeSearchSupported() throws IOException {
-			BufferedReader in = new UrlBuilder ("isFreeSearchSupported").openReader();
-			String line = null;
-			while((line = in.readLine()) != null) {
-				freeSearchSupported = Boolean.parseBoolean(line);
-			}
-			in.close();
-		}
-
-		/** 
-		 * Helper method, reads properties from the webservice.
-		 * @throws IOException when service is unavailable.
-		 */
-		private void loadProperties() throws IOException {
-			BufferedReader in = new UrlBuilder ("properties").openReader();
-			String line = null;
-			while((line = in.readLine()) != null) {
-				String[] cols = line.split("\t");
-				properties.put(cols[0], cols[1]);
-			}
-			in.close();
-		}
-
-		/** {@inheritDoc} */
-		public Set<String> getKeys() {
-			return properties.keySet();
-		}
-
-		/** {@inheritDoc} */
-		public String getProperty(String key) {
-			return properties.get(key);
-		}
-
-		/** {@inheritDoc} */
-		public Set<DataSource> getSupportedSrcDataSources()
-			throws IDMapperException 
-		{
-			if (supportedSrcDataSources==null) {
-				supportedSrcDataSources = loadDataSources("sourceDataSources");
-			}
-			return supportedSrcDataSources;
-		}
-
-		/** {@inheritDoc} */
-		public Set<DataSource> getSupportedTgtDataSources()
-			throws IDMapperException 
-		{
-			if (supportedTgtDataSources==null) {
-				supportedTgtDataSources = loadDataSources("targetDataSources");
-			}
-			return supportedTgtDataSources;
-		}
-
-		/** {@inheritDoc} */
-		public boolean isFreeSearchSupported() {
-			return freeSearchSupported;
-		}
-
-		/** {@inheritDoc} */
-		public boolean isMappingSupported(DataSource src, DataSource tgt)
-		throws IDMapperException {
-			try {
-				boolean supported = false;				
-				BufferedReader in = new UrlBuilder("isMappingSupported")
-					.ordered(src.getSystemCode(), tgt.getSystemCode()).openReader();
-				String line = null;
-				while((line = in.readLine()) != null) {
-					supported = Boolean.parseBoolean(line);
-				}
-				in.close();
-				return supported;
-			} catch(IOException e) {
-				throw new IDMapperException(e);
-			}
-		}
-	}
-
-	private final String baseUrl;
-
-	private final IDMapperCapabilities capabilities;
-
-	private Set<DataSource> supportedSrcDataSources = null;
-	private Set<DataSource> supportedTgtDataSources = null;
-	private Set<String> attributeSet = null;
-
-	/**
-	 * Helper class for constructing URL of a BridgeRest webservice command.
-	 */
-	private final class UrlBuilder
-	{
-		private StringBuilder builder = new StringBuilder(baseUrl);
-		
-		/**
-		 * Start building a new Url for the BridgeRest webservice.
-		 * @param cmd the command, or the first parameter after the base Url. For example "properties".
-		 * 	This param will be added after the baseUrl, separated by a "/"
-		 */
-		private UrlBuilder(String cmd)
-		{
-			builder.append ("/");
-			builder.append (cmd);
-		}
-		
-		/**
-		 * Ordered, unnamed arguments.
-		 * @param args Optional arguments, these will be URLencoded and separated by "/"
-		 * @return this, for chaining purposes
-		 * @throws IOException in case there is an encoding problem (really unlikely) 
-		 */
-		UrlBuilder ordered (String... args) throws IOException
-		{
-			for (String arg : args)
-			{
-				builder.append ("/");
-				builder.append (URLEncoder.encode (arg, "UTF-8"));
-			}
-			return this;
-		}
-
-		private boolean hasQMark = false;
-		
-		/**
-		 * Named parameters, these will be appended after ? and formatted as key=val pairs,
-		 * separated by &
-		 * @param key name of parameter
-		 * @param val value of parameter
-		 * @throws IOException in case there is an encoding problem (really unlikely) 
-		 * @return this, for chaining purposes
-		 */
-		UrlBuilder named (String key, String val) throws IOException
-		{
-			if (!hasQMark)
-			{
-				builder.append ("?");
-				hasQMark = true;
-			}
-			else
-			{
-				builder.append ("&");
-			}
-			builder.append (URLEncoder.encode (key, "UTF-8"));
-			builder.append ("=");
-			builder.append (URLEncoder.encode (val, "UTF-8"));
-			return this;
-		}
-
-		/**
-		 * Open an InputStream to a given URL. For certain requests, when there are 0 results, the
-		 * BridgeWebservice helpfully redirects to an error page instead of simply returning
-		 * an empty list. Here we detect that situation and throw IOException.
-		 * @return inputstream to given url.
-		 * @throws IOException when there is a timeout, or when the http response code is not 200 - OK 
-		 */
-		private BufferedReader openReader() throws IOException
-		{
-			URL url = new URL (builder.toString()); 
-			HttpURLConnection con = (HttpURLConnection) url.openConnection();
-			con.setInstanceFollowRedirects(false);
-			int response = con.getResponseCode();
-			if (response < HttpURLConnection.HTTP_OK || response >= HttpURLConnection.HTTP_MULT_CHOICE ) 
-				throw new IOException("HTTP response: " + con.getResponseCode() + " - " + con.getResponseMessage());
-			return new BufferedReader(new InputStreamReader(con.getInputStream()));
-		}
-	}
-	
-	/**
-	 * @param baseUrl base Url, e.g. http://webservice.bridgedb.org/Human or
-	 * 	http://localhost:8182
-	 * @throws IDMapperException when service is unavailable 
-	 */
-	BridgeRest (String baseUrl) throws IDMapperException
-	{
-		this.baseUrl = baseUrl;
-
-		//Get the capabilities
-		capabilities = new RestCapabilities();
-	}
-
-	private boolean isConnected = true;
-
-	/** {@inheritDoc} */
-	public void close() throws IDMapperException { isConnected = false; }
-
-	/** {@inheritDoc} */
-	public Set<Xref> freeSearch(String text, int limit)
-	throws IDMapperException 
-	{
-		try
-		{
-			BufferedReader r = new UrlBuilder ("search").ordered(text).openReader();
-			Set<Xref> result = new HashSet<Xref>();
-
-			{
-				Xref dest;
-				while ((dest = parseLine(r)) != null) result.add (dest);
-			}
-			
-			return result;
-		}
-		catch (IOException ex) {
-			throw new IDMapperException (ex);
-		} 
-	}
-
-	/** {@inheritDoc} */
-	public IDMapperCapabilities getCapabilities() {
-		return capabilities;
-	}
-
-	/** {@inheritDoc} */
-	public boolean isConnected() {
-		return isConnected;
-	}
-
-	/** {@inheritDoc} */
-	public Map<Xref, Set<Xref>> mapID(Collection<Xref> srcXrefs,
-			DataSource... tgtDataSources) throws IDMapperException 
-	{
-		return InternalUtils.mapMultiFromSingle(this, srcXrefs, tgtDataSources);
-	}
-
-	/** {@inheritDoc} */
-	public Set<Xref> mapID(Xref src,
-			DataSource... tgtDataSources) throws IDMapperException 
-			{
-		Set<DataSource> dsFilter = new HashSet<DataSource>();
-		if(tgtDataSources != null) dsFilter.addAll(Arrays.asList(tgtDataSources));
-
-		try
-		{
-			UrlBuilder builder = new UrlBuilder ("xrefs")
-				.ordered(src.getDataSource().getSystemCode(), src.getId());
-			if (tgtDataSources.length == 1) 
-				builder = builder.named("dataSource", tgtDataSources[0].getSystemCode());
-			BufferedReader r = builder.openReader();
-			Set<Xref> result = new HashSet<Xref>();
-			{
-				Xref dest;
-				while ((dest = parseLine(r)) != null)
-				{
-					if (dsFilter.size() == 0 || dsFilter.contains(dest.getDataSource()))
-					{
-						result.add (dest);
-					}
-				}		
-			}
-			return result;
-		}
-		catch (IOException ex)
-		{
-			throw new IDMapperException(ex);
-		}
-	}
-
-	/** 
-	 * parse a single line of input.
-	 * @param reader reader to read line from
-	 * @return Xref or null if end of stream was reached
-	 * @throws IOException if there was an error while reading (not EOF!) */
-	private Xref parseLine(BufferedReader reader) throws IOException
-	{
-		StringBuilder builder = new StringBuilder();
-		String id = null;
-		int c;
-		while (true)
-		{
-			// read char by char and use switch statement
-			// for efficiency
-			c = reader.read();
-			switch (c)
-			{
-			case -1:
-				return null; // end of the stream
-			case '\n': 
-				DataSource ds = DataSource.getByFullName(builder.toString());
-				return new Xref(id, ds);
-			case '\t':
-				id = builder.toString();
-				builder = new StringBuilder();
-				break;
-			default:
-				builder.append((char)c);
-			}
-		}
-	}
-
-	/** {@inheritDoc} */
-	public boolean xrefExists(Xref xref) throws IDMapperException {
-		try {
-			boolean exists = false;
-			BufferedReader in = new UrlBuilder ("xrefExists")
-				.ordered(xref.getDataSource().getSystemCode(), xref.getId())
-				.openReader();
-			String line = in.readLine();
-			exists = Boolean.parseBoolean(line);
-			in.close();
-			return exists;
-		} catch(IOException e) {
-			throw new IDMapperException(e);
-		}
-	}
-
-	/**
-	 *
-	 * @return true
-	 */
-	public boolean isFreeAttributeSearchSupported()
-	{
-		return true;
-	}
-
-	/** {@inheritDoc} */
-	public Map<Xref, String> freeAttributeSearch(String query, String attrType,
-			int limit) throws IDMapperException {
-		try {
-			Map<Xref, String> result = new HashMap<Xref, String>();
-			
-			BufferedReader in = new UrlBuilder("attributeSearch")
-				.ordered (query).named("limit", "" + limit)
-				.named ("attrName", attrType)
-				.openReader();
-			String line;
-			while ((line = in.readLine()) != null) {
-				String[] cols = line.split("\t", -1);
-				Xref x = new Xref (cols[0], DataSource.getByFullName(cols[1]));
-				String value = cols[2];
-				result.put(x, value);
-			}
-			in.close();
-			return result;
-		} catch (IOException ex) {
-			throw new IDMapperException (ex);
-		} 
-	}
-
-	/** {@inheritDoc} */
-	public Set<String> getAttributes(Xref ref, String attrType)
-	throws IDMapperException {
-		try {
-			Set<String> results = new HashSet<String>();
-
-			BufferedReader in = new UrlBuilder ("attributes")
-				.ordered(ref.getDataSource().getSystemCode(), ref.getId())
-				.named ("attrName", attrType)
-				.openReader();
-
-			String line;
-			while ((line = in.readLine()) != null) {
-				results.add(line);
-			}
-			in.close();
-			return results;
-		} catch (IOException ex) {
-			throw new IDMapperException (ex);
-		} 
-	}
-
-	/** {@inheritDoc} */
-	public Set<String> getAttributeSet() throws IDMapperException {
-		if (attributeSet==null) {
-			try {
-				Set<String> results = new HashSet<String>();
-
-				BufferedReader in = new UrlBuilder ("attributeSet")
-					.openReader();
-				String line;
-				while ((line = in.readLine()) != null) {
-					results.add(line);
-				}
-				in.close();
-				attributeSet = results;
-			} catch (IOException ex) {
-				throw new IDMapperException (ex);
-			}
-                }
-
-                return attributeSet;
-	}
-
-	/** {@inheritDoc} */
-	public Map<String, Set<String>> getAttributes(Xref ref)
-	throws IDMapperException {
-		try {
-			Map<String, Set<String>> results = new HashMap<String, Set<String>>();
-
-			BufferedReader in = new UrlBuilder ("attributes")
-				.ordered(ref.getDataSource().getSystemCode(), ref.getId())
-				.openReader();
-			
-			String line;
-			while ((line = in.readLine()) != null) {
-				String[] cols = line.split("\t", -1);
-				Set<String> rs = results.get(cols[0]);
-				if(rs == null) results.put(cols[0], rs = new HashSet<String>());
-				rs.add(cols[1]);
-			}
-			in.close();
-			return results;
-		} catch (IOException ex) {
-			throw new IDMapperException (ex);
-		} 
-	}
-	
-}
Index: /unk/corelib/src/org/bridgedb/webservice/biomart/util/Attribute.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/webservice/biomart/util/Attribute.java (revision 247)
+++  (revision )
@@ -1,60 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package org.bridgedb.webservice.biomart.util;
-
-/**
- * Attribute, corresponding to attribute in BioMart.
- * @author gjj
- */
-public class Attribute 
-{
-    private final String name;
-    private final String displayName;
-    private final String description;
-    private final String page;
-
-    /**
-     *
-     * @param name attribute name
-     * @param displayName attribute display name
-     */
-    public Attribute(String name, String displayName, String description, String page) 
-    {
-    	this.name = name;
-    	this.displayName = displayName;
-    	this.description = description;
-    	this.page = page;
-    }
-
-    /**
-     *
-     * @return attribute name
-     */
-    public String getName() {
-            return name;
-    }
-
-    /**
-     * 
-     * @return attribute display name
-     */
-    public String getDisplayName() {
-        return displayName;
-    }
-
-}
Index: /unk/corelib/src/org/bridgedb/webservice/biomart/util/Database.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/webservice/biomart/util/Database.java (revision 288)
+++  (revision )
@@ -1,154 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package org.bridgedb.webservice.biomart.util;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.bridgedb.impl.InternalUtils;
-
-/**
- * Database, corresponding to database/mart in BioMart.
- * @author gjj
- */
-public class Database {
-    private String dbname;
-    private Map<String, String> param;
-
-    // cache for getAvailableDatasets()
-    private Map<String,Dataset> datasets = null;
-
-    /**
-     * Get available datasets of a mart/database.
-     * @return {@link Vector} of available datasets
-     * @throws IOException if failed to read
-     */
-    public Map<String, Dataset> getAvailableDatasets()
-            throws IOException 
-    {
-    	if (datasets != null) return datasets;
-
-    	//TODO: not sure why this is needed
-//        try {
-//            getRegistry();
-//        } catch (ParserConfigurationException e) {
-//            e.printStackTrace();
-//        } catch (SAXException e) {
-//            e.printStackTrace();
-//        }
-
-        datasets = new HashMap<String, Dataset>();
-
-        Map<String, String> detail = getParam();
-
-        String urlStr = "http://" + detail.get("host") + ":" + detail.get("port")
-                        + detail.get("path") + "?type=datasets&mart=" + detail.get("name");
-        //System.out.println("DB name = " + martName + ", Target URL = " + urlStr + "\n");
-
-        URL url = new URL(urlStr);
-        InputStream is = InternalUtils.getInputStream(url);
-
-        BufferedReader reader = new BufferedReader(new InputStreamReader(is));
-        String s;
-
-        String[] parts;
-
-        while ((s = reader.readLine()) != null) {
-            parts = s.split("\\t");
-
-            if ((parts.length > 4) && parts[3].equals("1")) {
-                Dataset dataset = new Dataset(parts[1], parts[2], this);
-                datasets.put(dataset.getName(),dataset);
-                //datasourceMap.put(parts[1], martName);
-                datasets.put(parts[1], dataset);
-            }
-        }
-
-        is.close();
-        reader.close();
-        reader = null;
-        is = null;
-
-        return datasets;
-    }
-
-    /**
-     * look up a dataset by name.
-     * @param id the name of the dataset to look up
-     * @return the specified Dataset
-     * @throws IOException if the mart could not be accessed.
-     */
-    public Dataset getDataset (String id) throws IOException
-    {
-    	return getAvailableDatasets().get(id);
-    }
-    
-    /**
-     *
-     * @param dbname database name
-     * @param param database parameters
-     */
-    public Database(String dbname, Map<String, String> param) {
-        this.dbname = dbname;
-        this.param = param;
-    }
-
-    /**
-     *
-     * @return database name
-     */
-    public String getName() {
-        return dbname;
-    }
-
-    /**
-     *
-     * @return database parameters
-     */
-    public Map<String, String> getParam() {
-        return param;
-    }
-
-    /**
-     *
-     * @return true if visible; false otherwise
-     */
-    public boolean visible() {
-        return param.get("visible").equals("1");
-    }
-
-    /**
-     *
-     * @return database display name
-     */
-    public String displayName() {
-        return param.get("displayName");
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String toString() {
-        return displayName();
-    }
-}
Index: /unk/corelib/src/org/bridgedb/webservice/biomart/util/Dataset.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/webservice/biomart/util/Dataset.java (revision 299)
+++  (revision )
@@ -1,234 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package org.bridgedb.webservice.biomart.util;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.bridgedb.impl.InternalUtils;
-
-/**
- * Dataset, corresponding to dataset in BioMart.
- * @author gjj
- */
-public class Dataset 
-{
-    private String name;
-    private String displayName;
-    private Database database;
-
-    // cache for getFilters()
-    private Map<String, Filter> filters = null;
-
-    // cache for getAttributes()
-    private Map<String, Attribute> attributes = null;
-
-    /**
-     * Parse a line of Biomart output and construct a Filter based on that.
-     * @param line line to parse
-     * @return a Filter, or null if the line is not correctly formatted, or it 
-     *  	does not meet the criteria for a valid Filter (e.g. second column has to contain "ID(s)")
-     */
-    private static Filter parseFilter(String line)
-    {
-    	String[] parts;
-        parts = line.split("\\t");
-
-        if ((parts.length > 1)) {
-            if ((parts[1].contains("ID(s)")
-                        || parts[1].contains("Accession(s)")
-                        || parts[1].contains("IDs"))
-                     && (parts[0].startsWith("with_") == false)
-                     && (parts[0].endsWith("-2") == false)
-                     || parts.length>6
-                     && parts[5].equals("id_list")) {
-                return new Filter(parts[0], parts[1]);
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Get filters for a dataset. Result will be cached.
-     * @return filters
-     * @throws IOException if failed to read
-     */
-    public Map<String, Filter> getFilters()
-        throws IOException 
-    {
-    	filters = new HashMap<String, Filter>();
-        Database database = getDatabase();
-
-        Map<String, String> detail = database.getParam();
-        String urlStr = "http://" 
-                        + detail.get("host") + ":"
-                        + detail.get("port")
-                        + detail.get("path")
-                        + "?virtualschema="
-                        + detail.get("serverVirtualSchema")
-                        + "&type=filters&dataset="
-                        + name;
-
-        URL url = new URL(urlStr);
-        InputStream is = InternalUtils.getInputStream(url);
-
-        BufferedReader reader = new BufferedReader(new InputStreamReader(is));
-        String s;
-        while ((s = reader.readLine()) != null) 
-        {
-        	Filter f = parseFilter (s);
-        	if (f != null) filters.put (f.getName(), f);
-        }
-
-        is.close();
-        reader.close();
-        reader = null;
-        is = null;
-
-        return filters;
-    }
-    
-    /**
-     * Get attributes. Result will be cached.
-     * @return Map of attribute name to attributes
-     * @throws IOException if failed to read
-     */
-    public Map<String, Attribute> getAttributes() throws IOException 
-    {
-    	if (attributes != null) return attributes;
-        attributes = new HashMap<String, Attribute>();
-
-        Database database = getDatabase();
-
-        Map<String, String> detail = database.getParam();
-
-        String urlStr = "http://" + detail.get("host") + ":" + detail.get("port")
-                        + detail.get("path") + "?virtualschema="
-                        + detail.get("serverVirtualSchema") + "&type=attributes&dataset="
-                        + name;
-        
-        URL url = new URL(urlStr);
-        InputStream is = InternalUtils.getInputStream(url);
-
-        BufferedReader reader = new BufferedReader(new InputStreamReader(is));
-        String s;
-
-        String displayName;
-
-        String[] parts;
-
-        while ((s = reader.readLine()) != null) {
-
-            String page = "unknown";
-            String description;
-            parts = s.split("\\t");
-
-            if (parts.length == 0)
-                continue;
-
-            if (parts.length == 4) {
-                displayName = parts[3] + ": " + parts[1];
-                description = displayName;
-            } else if (parts.length > 1) {
-                displayName = parts[1];
-                description = parts[2];
-                page = parts[3];
-            } else {
-                displayName = "";
-                description = "";
-            }
-            
-            // only add attributes listed as "feature_page"
-            if ("feature_page".equals(page))
-            	attributes.put(parts[0], new Attribute(
-            		parts[0], displayName, description, page));
-        }
-
-        is.close();
-        reader.close();
-        reader = null;
-        is = null;
-
-        return attributes;
-    }    
-
-    /**
-     * look up an attribute by name.
-     * @param id the name of the attribute to look up
-     * @return the specified Attribute
-     * @throws IOException if the mart could not be accessed.
-     */
-    public Attribute getAttribute(String id) throws IOException
-    {
-    	return getAttributes().get(id);
-    }
-  
-    /**
-     *
-     * @param name dataset name
-     * @param displayName dataset display name
-     * @param database database/mart of the dataset
-     */
-    public Dataset(String name, String displayName, Database database) 
-    {
-        if (name == null)
-            throw new NullPointerException("name may not be null.");
-        if (database==null)
-            throw new NullPointerException("database may not be null.");
-    	this.name = name;
-        this.displayName = displayName;
-        this.database = database;
-    }
-
-    /**
-     *
-     * @return dataset name
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     *
-     * @return dataset display name
-     */
-    public String displayName() {
-        return displayName;
-    }
-
-    /**
-     *
-     * @return database/mart which this dataset belongs to
-     */
-    public Database getDatabase() {
-        return database;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String toString() {
-        return displayName();
-    }
-
-}
Index: /unk/corelib/src/org/bridgedb/webservice/biomart/util/Filter.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/webservice/biomart/util/Filter.java (revision 161)
+++  (revision )
@@ -1,53 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package org.bridgedb.webservice.biomart.util;
-
-/**
- * Class Filter, storing information on filters in BioMart.
- * @author gjj
- */
-public class Filter {
-    private String name;
-    private String displayName;
-
-    /**
-     *
-     * @param name filter name
-     * @param displayName filter display name
-     */
-    public Filter(String name, String displayName) {
-            this.name = name;
-            this.displayName = displayName;
-    }
-
-    /**
-     *
-     * @return filter name
-     */
-    public String getName() {
-            return name;
-    }
-
-    /**
-     * 
-     * @return filter diaplay name
-     */
-    public String getDisplayName() {
-            return displayName;
-    }
-}
Index: /unk/corelib/src/org/bridgedb/webservice/biomart/util/filterconversion.txt
===================================================================
--- /trunk/corelib/src/org/bridgedb/webservice/biomart/util/filterconversion.txt (revision 296)
+++  (revision )
@@ -1,19 +1,0 @@
-REACTOME	referencemolecule_chebi_id_list	referencedatabase_chebi
-REACTOME	referencednasequence_kegg_id_list	referencedatabase_kegg_gene
-REACTOME	referencednasequence_entrez_id_list	referencedatabase_entrez_gene
-REACTOME	referencepeptidesequence_uniprot_id_list	referencedatabase_uniprot
-REACTOME	referencepeptidesequence_tigr_id_list	referencedatabase_tigr
-REACTOME	referencepeptidesequence_wormbase_id_list	referencedatabase_wormbase
-REACTOME	referencednasequence_ensembl_id_list	referencedatabase_ensembl
-REACTOME	pathway_id_list	stableidentifier_identifier
-REACTOME	pathway_db_id_list	pathway_db_id
-REACTOME	reaction_id_list	reaction__dm_stableidentifier_identifier
-REACTOME	reaction_db_id_list	Reaction	reaction__dm_db_id
-REACTOME	complex_id_list	complex__dm_stableidentifier_identifier
-REACTOME	complex_db_id_list	db_id
-UNIPROT	pidn_id	pidn
-UNIPROT	hssp_id	hssp_id
-UNIPROT	interpro_id	ipro_id
-UNIPROT	pdb_id	pdb_id
-UNIPROT	ec_id	ec_id
-UNIPROT	gene_name	gene_name
Index: /unk/corelib/src/org/bridgedb/webservice/biomart/util/BiomartClient.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/webservice/biomart/util/BiomartClient.java (revision 295)
+++  (revision )
@@ -1,225 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package org.bridgedb.webservice.biomart.util;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.PrintStream;
-
-import java.net.URL;
-import java.net.URLConnection;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.bridgedb.impl.InternalUtils;
-import org.bridgedb.webservice.biomart.IDMapperBiomart;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.NodeList;
-
-import org.xml.sax.SAXException;
-
-/**
- * BioMart service class, adapted from BioMart client in Cytoscape.
- */
-public final class BiomartClient {
-    public static final String DEFAULT_BASE_URL = "http://www.biomart.org/biomart/martservice";
-    
-    private final String baseURL;
-    private static final String RESOURCE = "/org/bridgedb/webservice/biomart/util/filterconversion.txt";
-
-    // caches the result of getRegistry()
-    private Map<String, Database> marts = null;
-
-    private Map<String, Map<String, String>> filterConversionMap;
-
-    private static final int BUFFER_SIZE = 81920;
-
-    /**
-     * Creates a new BiomartStub object from given URL.
-     *
-     * @param baseURL base url of martservice, for example "http://www.biomart.org/biomart/martservice" (default)
-     * @throws IOException if failed to read local resource
-     */
-    public BiomartClient(String baseURL) throws IOException {
-        this.baseURL = baseURL + "?";
-        loadConversionFile();
-    }
-
-    /**
-     * Conversion map from filter to attribute.
-     * @throws IOException if failed to read local resource
-     */
-    private void loadConversionFile() throws IOException {
-        filterConversionMap = new HashMap<String, Map<String, String>>();
-
-        InputStreamReader inFile = new InputStreamReader(IDMapperBiomart.class.getResource(RESOURCE).openStream());
-
-        BufferedReader inBuffer = new BufferedReader(inFile);
-
-        String line;
-        String trimed;
-        String oldName = null;
-        Map<String, String> oneEntry = new HashMap<String, String>();
-
-        String[] dbparts;
-
-        while ((line = inBuffer.readLine()) != null) {
-            trimed = line.trim();
-            dbparts = trimed.split("\\t");
-
-            if (dbparts[0].equals(oldName) == false) {
-                oneEntry = new HashMap<String, String>();
-                oldName = dbparts[0];
-                filterConversionMap.put(oldName, oneEntry);
-            }
-
-            oneEntry.put(dbparts[1], dbparts[2]);
-        }
-
-        inFile.close();
-        inBuffer.close();
-    }
-
-    /**
-     * @param mart mart name
-     * @param dataset dataset name
-     * @param filter filter to convert
-     * @return Attribute converted from filter
-     * @throws IOException if failed to read from webservice
-     */
-    public Attribute filterToAttribute(String mart, String dataset, String filter) throws IOException 
-    {
-    	String attrName;
-        if (dataset.contains("REACTOME")) {
-            attrName = filterConversionMap.get("REACTOME").get(filter);
-        } else if (dataset.contains("UNIPROT")) {
-        	attrName = filterConversionMap.get("UNIPROT").get(filter);
-        } else if (dataset.contains("VARIATION")) {
-            attrName = filter + "_stable_id";
-        } else {
-            attrName = filter;
-        }
-        return getMart(mart).getDataset(dataset).getAttribute(attrName);
-    }
-
-    /**
-     *  Get the registry information from the base URL.
-     *
-     * @return  Map of registry information.  Key value is "name" field.
-     * @throws ParserConfigurationException if failed new document builder
-     * @throws SAXException if failed to parse registry
-     * @throws IOException if failed to read from URL
-     */
-    public Map<String, Database> getRegistry()
-            throws IOException, ParserConfigurationException, SAXException {
-        // If already loaded, just return it.
-        if (marts != null)
-            return marts;
-
-        // Initialize database map.
-        marts = new HashMap<String, Database>();
-
-        // Prepare URL for the registry status
-        final String reg = "type=registry";
-        final URL targetURL = new URL(baseURL + reg);
-
-        // Get the result as XML document.
-        final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-        final DocumentBuilder builder = factory.newDocumentBuilder();
-
-        InputStream is = InternalUtils.getInputStream(targetURL);
-
-        final Document registry = builder.parse(is);
-
-        // Extract each datasource
-        NodeList locations = registry.getElementsByTagName("MartURLLocation");
-        int locSize = locations.getLength();
-        NamedNodeMap attrList;
-        int attrLen;
-        String dbID;
-
-        for (int i = 0; i < locSize; i++) {
-            attrList = locations.item(i).getAttributes();
-            attrLen = attrList.getLength();
-
-            // First, get the key value
-            dbID = attrList.getNamedItem("name").getNodeValue();
-
-            Map<String, String> entry = new HashMap<String, String>();
-
-            for (int j = 0; j < attrLen; j++) {
-                entry.put(attrList.item(j).getNodeName(), attrList.item(j).getNodeValue());
-            }
-
-            marts.put(dbID, new Database(dbID,entry));
-        }
-
-        is.close();
-        is = null;
-
-        return marts;
-    }
-
-    /**
-     * Send the XML query to Biomart, and get the result as table.
-     * @param xmlQuery query xml
-     * @return result {@link BufferedReader}
-     * @throws IOException if failed to read webservice
-     */
-    public BufferedReader sendQuery(String xmlQuery) throws IOException {
-
-        //System.out.println("=======Query = " + xmlQuery);
-
-        URL url = new URL(baseURL);
-        URLConnection uc = url.openConnection();
-        uc.setDoOutput(true);
-        uc.setRequestProperty("User-Agent", "Java URLConnection");
-
-        OutputStream os = uc.getOutputStream();
-
-        final String postStr = "query=" + xmlQuery;
-        PrintStream ps = new PrintStream(os);
-
-        // Post the data
-        ps.print(postStr);
-        os.close();
-        ps.close();
-        ps = null;
-        os = null;
-
-        return new BufferedReader(new InputStreamReader(uc.getInputStream()), BUFFER_SIZE);
-    }
-
-    /**
-     * get Database/mart.
-     * @param dbname database name
-     * @return database
-     */
-    public Database getMart(final String dbname) {
-        return marts.get(dbname);
-    }
-}
Index: /unk/corelib/src/org/bridgedb/webservice/biomart/util/XMLQueryBuilder.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/webservice/biomart/util/XMLQueryBuilder.java (revision 161)
+++  (revision )
@@ -1,125 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package org.bridgedb.webservice.biomart.util;
-
-import java.io.StringWriter;
-import java.util.Map;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- *
- */
-public final class XMLQueryBuilder {
-	private static DocumentBuilderFactory factory;
-	private static DocumentBuilder builder;
-
-	static {
-		factory = DocumentBuilderFactory.newInstance();
-
-		try {
-			builder = factory.newDocumentBuilder();
-		} catch (ParserConfigurationException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-	}
-
-        /**
-         * Prevent from instantializing.
-         */
-        private XMLQueryBuilder() {}
-
-	/**
-         *
-         * @param dataset dataset
-         * @param attrs attributes
-         * @param queryFilters filters
-         * @return quering strings
-         */
-	public static String getQueryString(String dataset, Attribute[] attrs, 
-                    Map<String, String> queryFilters) {
-            final Document doc = builder.newDocument();
-            Element query = doc.createElement("Query");
-            query.setAttribute("virtualSchemaName", "default");
-            query.setAttribute("header", "1");
-            query.setAttribute("uniqueRows", "1");
-            query.setAttribute("count", "");
-            query.setAttribute("datasetConfigVersion", "0.6");
-            query.setAttribute("formatter", "TSV");
-
-            doc.appendChild(query);
-
-            Element ds = doc.createElement("Dataset");
-            ds.setAttribute("name", dataset);
-            query.appendChild(ds);
-
-            for (Attribute attr : attrs) {
-                Element at = doc.createElement("Attribute");
-                at.setAttribute("name", attr.getName());
-                ds.appendChild(at);
-            }
-
-            if ((queryFilters != null) && (!queryFilters.isEmpty())) {
-                for (Map.Entry<String, String> filter : queryFilters.entrySet()) {
-                    Element ft = doc.createElement("Filter");
-                    ft.setAttribute("name", filter.getKey());
-                    if(filter.getValue() == null) {
-                        ft.setAttribute("excluded", "0");
-                    } else {
-                        ft.setAttribute("value", filter.getValue());
-                    }
-                    ds.appendChild(ft);
-                }
-            }
-
-            TransformerFactory tff = TransformerFactory.newInstance();
-            Transformer tf;
-            String result = null;
-
-            try {
-                tf = tff.newTransformer();
-                tf.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
-
-                StringWriter strWtr = new StringWriter();
-                StreamResult strResult = new StreamResult(strWtr);
-
-                tf.transform(new DOMSource(doc.getDocumentElement()), strResult);
-
-                result = strResult.getWriter().toString();
-            } catch (TransformerConfigurationException e) {
-                e.printStackTrace();
-            } catch (TransformerException e) {
-                e.printStackTrace();
-            }
-
-            return result;
-	}
-}
Index: /unk/corelib/src/org/bridgedb/webservice/biomart/IDMapperBiomart.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/webservice/biomart/IDMapperBiomart.java (revision 307)
+++  (revision )
@@ -1,407 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package org.bridgedb.webservice.biomart;
-
-import java.io.IOException;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.bridgedb.AbstractIDMapperCapabilities;
-import org.bridgedb.AttributeMapper;
-import org.bridgedb.BridgeDb;
-import org.bridgedb.DataSource;
-import org.bridgedb.IDMapper;
-import org.bridgedb.IDMapperCapabilities;
-import org.bridgedb.IDMapperException;
-import org.bridgedb.Xref;
-import org.bridgedb.impl.InternalUtils;
-import org.bridgedb.webservice.IDMapperWebservice;
-import org.bridgedb.webservice.biomart.util.BiomartClient;
-
-/**
- *
- * @author gjj
- */
-public class IDMapperBiomart extends IDMapperWebservice implements AttributeMapper {
-
-    static {
-		BridgeDb.register ("idmapper-biomart", new Driver());
-	}
-
-	private final static class Driver implements org.bridgedb.Driver {
-        /** private constructor to prevent outside instantiation. */
-		private Driver() { } 
-
-        /** {@inheritDoc} */
-        public IDMapper connect(String location) throws IDMapperException  {
-            // e.g.: dataset=oanatinus_gene_ensembl
-            // e.g.: http://www.biomart.org/biomart/martservice?mart=ensembl&dataset=hsapiens_gene_ensembl
-            String baseURL = BiomartClient.DEFAULT_BASE_URL;
-
-            Map<String, String> args = 
-            	InternalUtils.parseLocation(location, "mart", "dataset");
-            
-            if (args.containsKey("BASE"))
-            {
-            	baseURL = args.get("BASE");
-            }
-            
-            // may be null if unspecified.
-            String mart = args.get("mart");
-            
-            // may be null if unspecified.
-            String dataset = args.get("dataset");
-
-            return new IDMapperBiomart(mart, dataset, baseURL);
-        }
-    }
-
-    private String mart;
-    private String dataset;
-    private BiomartStub stub;
-
-    private String baseURL;
-
-    private Set<DataSource> supportedSrcDs;
-    private Set<DataSource> supportedTgtDs;
-
-    /**
-     * Use default url of BiMart.
-     * @param mart name of mart
-     * @param dataset name of dataset
-     * @throws IDMapperException if failed to link to the dataset
-     */
-    public IDMapperBiomart(String mart, String dataset)
-            throws IDMapperException {
-        this(mart, dataset, null);
-    }
-
-    /**
-     * Construct from a dataset, a database, id-only option and transitivity
-     * option.
-     * @param mart name of mart
-     * @param dataset name of dataset
-     * @param baseURL base url of BioMart
-     * @throws IDMapperException if failed to link to the dataset
-     */
-    public IDMapperBiomart(String mart, String dataset, String baseURL)
-            throws IDMapperException {
-        this.mart = mart;
-        this.dataset = dataset;
-        if (baseURL!=null) {
-            this.baseURL = baseURL;
-        } else {
-            this.baseURL = BiomartClient.DEFAULT_BASE_URL;
-        }
-
-        try {
-            stub = BiomartStub.getInstance(this.baseURL);
-        } catch (IOException e) {
-            throw new IDMapperException(e);
-        }
-
-        if (!stub.availableMarts().contains(mart)) {
-            throw new IDMapperException("Mart " + mart + " doesn't exist.");
-        }
-
-        if (!stub.availableDatasets(mart).contains(dataset)) {
-            throw new IDMapperException("dataset not exist.");
-        }
-
-        supportedSrcDs = this.getSupportedSrcDataSources();
-        supportedTgtDs = this.getSupportedTgtDataSources();
-        
-        cap = new BiomartCapabilities();
-    }
-
-    /**
-     *
-     * @return base URL of BioMart.
-     */
-    public String getBaseURL() {
-        return baseURL;
-    }
-
-    /**
-     *
-     * @return mart name
-     */
-    public String getMart() {
-        return mart;
-    }
-
-    /**
-     * Get dataset.
-     * @return dataset from BioMart
-     */
-    public String getDataset() {
-        return dataset;
-    }
-
-    /**
-     *
-     * @return URL of the dataset
-     */
-    public String toString() {
-        return getBaseURL()+"?dataset="+getDataset();
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public Map<Xref, Set<Xref>> mapID(Collection<Xref> srcXrefs,
-                DataSource... tgtDataSources) throws IDMapperException 
-    {
-        if (srcXrefs==null)
-            throw new NullPointerException("srcXrefs cannot be null.");
-
-        Map<Xref, Set<Xref>> result = new HashMap<Xref, Set<Xref>>();
-
-        // source datasources
-        // first key: full name of src Datasource
-        // second key: id of xref
-        // third key: xref itself
-        Map<String, Map<String, Xref>> mapSrcTypeIDXrefs = 
-        	new HashMap<String, Map<String, Xref>>();
-        
-        
-        for (Xref xref : srcXrefs) {
-            DataSource ds = xref.getDataSource();
-            if (!supportedSrcDs.contains(ds)) continue;
-
-            String src = ds.getFullName();
-            Map<String, Xref> ids = mapSrcTypeIDXrefs.get(src);
-            if (ids==null) {
-                ids = new HashMap<String, Xref>();
-                mapSrcTypeIDXrefs.put(src, ids);
-            }
-            ids.put(xref.getId(), xref);
-        }
-
-        // supported tgt datasources
-        Set<String> tgtTypes = new HashSet<String>();
-        if (tgtDataSources.length > 0)
-        	for (DataSource ds : tgtDataSources) 
-        	{
-        		if (supportedTgtDs.contains(ds)) {
-        			tgtTypes.add(ds.getFullName());
-        		}
-        	}
-        else
-        	throw new UnsupportedOperationException("For idmapper-biomart, you have to specify at least one target DataSource");
-        String[] tgts = tgtTypes.toArray(new String[0]);
-
-        for (Map.Entry<String, Map<String, Xref>> entry :
-                mapSrcTypeIDXrefs.entrySet()) {
-            String src = entry.getKey();
-            Set<String> ids = entry.getValue().keySet();
-            Map<String,Set<String>[]> res =
-                        stub.translate(mart, dataset , src, tgts, ids);
-
-
-            for (Map.Entry<String,Set<String>[]> entryRes : res.entrySet()) {
-                String srcId = entryRes.getKey();
-                Set<String>[] tgtIds = entryRes.getValue();
-                if (tgtIds==null) { // source xref not exist
-                    continue;
-                }
-
-                Xref srcXref = mapSrcTypeIDXrefs.get(src).get(srcId);
-                
-                Set<Xref> tgtXrefs = new HashSet<Xref>();
-                for (int itgt=0; itgt<tgts.length; itgt++) {
-                    for (String tgtId : tgtIds[itgt]) {
-                        Xref tgtXref = new Xref(tgtId,
-                                DataSource.getByFullName(tgts[itgt]));
-                        tgtXrefs.add(tgtXref);
-                    }
-                }
-                
-                result.put(srcXref, tgtXrefs);
-            }
-        }        
-
-        return result;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public boolean xrefExists(Xref xref) throws IDMapperException 
-    {
-    	// We query specifically for ensembl_gene_id etc.
-    	// Biomart doesn't like querying for everything
-        Set<Xref> set = mapID(xref, 
-        		DataSource.getByFullName("ensembl_gene_id"),
-        		DataSource.getByFullName("ensembl_transcript_id"));
-        return !set.isEmpty();
-    }
-
-    /**
-     * free text search is not supported for BioMart-based IDMapper.
-     * {@inheritDoc}
-     */
-    public Set<Xref> freeSearch (String text, int limit)
-            throws IDMapperException {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * Get supported source data sources.
-     * @return supported source data sources
-     * @throws IDMapperException if failed to read the filters
-     */
-    protected Set<DataSource> getSupportedSrcDataSources()
-            throws IDMapperException {
-        Set<DataSource> dss = new HashSet<DataSource>();
-        Set<String> filters = stub.availableSrcIDTypes(mart, dataset);
-        for (String filter : filters) {
-            DataSource ds = DataSource.getByFullName(filter);
-            if (ds!=null) {
-                dss.add(ds);
-            }
-        }
-        return dss;
-    }
-
-    /**
-     * Get supported target data sources.
-     * @return supported target data sources
-     * @throws IDMapperException if failed to read the filters
-     */
-    protected Set<DataSource> getSupportedTgtDataSources() 
-            throws IDMapperException {
-        Set<DataSource> dss = new HashSet<DataSource>();
-        Set<String> types = stub.availableTgtIDTypes(mart, dataset);
-
-        for (String type : types) {
-            DataSource ds = DataSource.getByFullName(type);
-            if (ds!=null) {
-                dss.add(ds);
-            }
-        }
-        return dss;
-    }
-
-    private final IDMapperCapabilities cap;
-
-    private class BiomartCapabilities extends AbstractIDMapperCapabilities
-    {
-            /** default constructor.
-             * @throws IDMapperException when database is not available */
-            public BiomartCapabilities() throws IDMapperException
-            {
-                    super (null, false, null);
-            }
-
-        /** {@inheritDoc} */
-        public Set<DataSource> getSupportedSrcDataSources() throws IDMapperException {
-            return IDMapperBiomart.this.supportedSrcDs;
-        }
-
-        /** {@inheritDoc} */
-        public Set<DataSource> getSupportedTgtDataSources() throws IDMapperException {
-            return IDMapperBiomart.this.supportedTgtDs;
-        }
-
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public IDMapperCapabilities getCapabilities() {
-        return cap;
-    }
-
-    private boolean isConnected = true;
- 
-    // In the case of IDMapperBioMart, there is no need to discard associated resources.
-    /**
-     * {@inheritDoc}
-     */
-    public void close() throws IDMapperException { isConnected = false; }
-    /**
-     * {@inheritDoc}
-     */
-    public boolean isConnected() { return isConnected; }
-
-    /**
-     * {@inheritDoc}
-     */
-    public Set<String> getAttributes(Xref ref, String attrType) throws IDMapperException {
-        if (ref==null || attrType==null) {
-            return Collections.emptySet();
-        }
-
-        String srcType = ref.getDataSource().getFullName();
-        if (srcType == null) return Collections.emptySet();
-        
-        String[] tgtTypes = new String[]{attrType};
-        Set<String> srcIds = new HashSet<String>(1);
-        srcIds.add(ref.getId());
-
-        Map<String,Set<String>[]> map = stub.translate(mart, dataset, srcType, tgtTypes, srcIds);
-        Set<String>[] sets = map.get(ref.getId());
-        if (sets==null || sets.length==0)
-            return null;
-
-        return sets[0];
-    }
-
-    /**
-     *
-     * @return false
-     */
-    public boolean isFreeAttributeSearchSupported()
-    {
-        return false;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public Map<Xref, String> freeAttributeSearch (String query, String attrType, int limit) throws IDMapperException {
-        throw new UnsupportedOperationException("Free attribute search not supported.");
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public Set<String> getAttributeSet() throws IDMapperException {
-        return stub.availableTgtAttributes(mart, dataset);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public Map<String, Set<String>> getAttributes(Xref ref) throws IDMapperException {
-        Map<String, Set<String>> map = new HashMap<String, Set<String>>();
-        for (String attr : getAttributeSet()) {
-            Set<String> attrs = getAttributes(ref, attr);
-            if (attrs!=null) {
-                map.put(attr, attrs);
-            }
-        }
-        return map;
-    }
-}
Index: /unk/corelib/src/org/bridgedb/webservice/biomart/BiomartStub.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/webservice/biomart/BiomartStub.java (revision 288)
+++  (revision )
@@ -1,370 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package org.bridgedb.webservice.biomart;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.bridgedb.IDMapperException;
-import org.bridgedb.webservice.biomart.util.Attribute;
-import org.bridgedb.webservice.biomart.util.BiomartClient;
-import org.bridgedb.webservice.biomart.util.Database;
-import org.bridgedb.webservice.biomart.util.Dataset;
-import org.bridgedb.webservice.biomart.util.Filter;
-import org.bridgedb.webservice.biomart.util.XMLQueryBuilder;
-
-import org.xml.sax.SAXException;
-
-/**
- * Wrapp-up for BiomartClient.
- * @author gjj
- */
-public final class BiomartStub 
-{
-    public static final String defaultBaseURL
-            = BiomartClient.DEFAULT_BASE_URL;
-
-    // one instance per url
-    private static Map<String, BiomartStub> instances = new HashMap<String, BiomartStub>();
-
-    /**
-     *
-     * @return BiomartStub with the default server url
-     * @throws IOException if failed to connect
-     */
-    public static BiomartStub getInstance() throws IOException {
-        return getInstance(defaultBaseURL);
-    }
-
-    /**
-     *
-     * @param baseUrl server url
-     * @return BiomartStub from the server
-     * @throws IOException if failed to connect
-     */
-    public static BiomartStub getInstance(String baseUrl) throws IOException {
-        if (baseUrl==null) {
-            throw new IllegalArgumentException("base url cannot be null");
-        }
-
-        BiomartStub instance = instances.get(baseUrl);
-        if (instance==null) {
-            instance = new BiomartStub(baseUrl);
-            instances.put(baseUrl, instance);
-        }
-
-        return instance;
-    }
-
-    private BiomartClient client;
-
-    /**
-     *
-     * @param baseUrl server url.
-     * @throws IOException if failed to connect.
-     */
-    private BiomartStub(String baseUrl) throws IOException {
-        client = new BiomartClient(baseUrl);
-    }
-
-    /**
-     *
-     * @return available marts
-     * @throws IDMapperException if failed
-     */
-    public Set<String> availableMarts() throws IDMapperException {
-        Map<String, Database> marts;
-        try {
-            marts = client.getRegistry();
-        } catch (IOException e) {
-            throw new IDMapperException(e);
-        } catch (ParserConfigurationException e) {
-            throw new IDMapperException(e);
-        } catch (SAXException e) {
-            throw new IDMapperException(e);
-        }
-
-        Set<String> visibleMarts = new HashSet<String>();
-        for (Database db : marts.values()) {
-            if (db.visible()) {
-                visibleMarts.add(db.getName());
-            }
-        }
-
-        return visibleMarts;
-    }
-
-    /**
-     *
-     * @param mart mart name
-     * @return mart display name or null if not exist
-     */
-    public String martDisplayName(String mart) {
-        if (mart==null) {
-            return null;
-        }
-
-        Database db = client.getMart(mart);
-        return db==null?null:db.displayName();
-    }
-
-    /**
-     *
-     * @param mart mart name
-     * @return available datasets from this mart
-     * @throws IDMapperException when mapping service is unavailable
-     */
-    public Set<String> availableDatasets(String mart)
-            throws IDMapperException {
-        if (mart==null) {
-            return Collections.emptySet();
-        }
-
-        if (!availableMarts().contains(mart)) {
-            return Collections.emptySet();
-        }
-
-        Map<String,Dataset> datasets;
-        try {
-        	datasets = client.getMart(mart).getAvailableDatasets();
-        } catch (IOException e) {
-            throw new IDMapperException(e);
-        }
-
-        return datasets.keySet();
-    }
-
-     /**
-     *
-     * @param mart mart name
-     * @param dataset dataset name
-     * @return dataset display name or null if not exist
-     * @throws IOException if the data could not be read
-     */
-    public String datasetDisplayName(String mart, String dataset) throws IOException 
-    {
-        if (dataset==null) {
-            return null;
-        }
-
-        Dataset ds = client.getMart(mart).getDataset(dataset);
-        return ds==null?null:ds.displayName();
-    }
-
-    /**
-     *
-     * @param mart mart name
-     * @param dataset dataset name
-     * @return available filters / source id types of the dataset from this
-     *         mart
-     * @throws IDMapperException if failed
-     */
-    public Set<String> availableSrcIDTypes(final String mart,
-            final String dataset) throws IDMapperException {
-        if (mart==null || dataset==null) {
-            return Collections.emptySet();
-        }
-
-        if (!availableDatasets(mart).contains(dataset)) {
-            return Collections.emptySet();
-        }
-
-        Map<String,Filter> filters;
-        try {
-            filters = client.getMart(mart).getDataset(dataset).getFilters();
-        } catch (IOException e) {
-            throw new IDMapperException(e);
-        }
-
-        return filters.keySet();
-    }
-
-    /**
-     *
-     * @param mart mart name
-     * @param dataset dataset name
-     * @return available tgt id types
-     * @throws IDMapperException if failed.
-     */
-    public Set<String> availableTgtIDTypes(final String mart,
-            final String dataset) throws IDMapperException {
-        return availableAttributes(mart, dataset, true);
-    }
-
-    /**
-     *
-     * @param mart mart name
-     * @param dataset dataset name
-     * @return availab e tgt attributes (exclude id types)
-     * @throws IDMapperException if failed.
-     */
-    public Set<String> availableTgtAttributes(final String mart,
-            final String dataset) throws IDMapperException {
-        return availableAttributes(mart, dataset, false);
-    }
-
-    /**
-     *
-     * @param mart mart name.
-     * @param dataset dataset name.
-     * @param idOnly filter the attributes ending with "ID" or "Accession"
-     *        if true; no filter otherwise.
-     * @return attribute names / target id types of the dataset from this
-     *         mart.
-     * @throws IDMapperException if failed.
-     */
-    private Set<String> availableAttributes(final String mart,
-            final String dataset, boolean idOnly) throws IDMapperException {
-
-        if (mart==null || dataset==null) {
-            return Collections.emptySet();
-        }
-
-        if (!availableDatasets(mart).contains(dataset)) {
-            return Collections.emptySet();
-        }
-
-        try {
-            Dataset data = client.getMart(mart).getDataset(dataset);
-            Map<String,Attribute> attributes = data.getAttributes();
-
-            Set<String> result = new HashSet<String>();
-            for (String name : attributes.keySet()) {
-            	if (name.trim().length()==0)
-            		continue;
-            	String displayName = attributes.get(name).getDisplayName();
-            	if (idOnly == (displayName.endsWith("ID")
-            			|| displayName.endsWith("Accession")
-            			|| name.endsWith("id")
-            			|| name.endsWith("accession"))) {
-            		result.add(name);
-            	}
-            }
-
-            return result;
-        } catch (IOException e) {
-            throw new IDMapperException(e);
-        }
-    }
-
-    /**
-     * @param mart mart name
-     * @param dataset dataset name
-     * @param srcType filter name / source id type
-     * @param tgtTypes attribute names / target id types
-     * @param srcIds source ids to be translated
-     * @return map from source id to target ids
-     *         key: source id
-     *         value: corresponding target ids
-     * @throws IDMapperException if failed to connect
-     */
-    public Map<String,Set<String>[]> translate(final String mart,
-            final String dataset, final String srcType,
-            final String[] tgtTypes, final Set<String> srcIds)
-            throws IDMapperException {
-    	if (mart==null||dataset==null||srcType==null||tgtTypes==null||srcIds==null) {
-    		throw new NullPointerException("Null argument.");
-    	}
-
-    	Attribute tgtAttr;
-    	try {
-    		tgtAttr = client.filterToAttribute(mart, dataset, srcType);
-    		if (tgtAttr==null) {
-    			return new HashMap<String, Set<String>[]>();
-    		}
-
-    		int nAttr = tgtTypes.length;
-    		Attribute[] attrs = new Attribute[nAttr+1];
-
-    		// prepare attributes
-    		int iattr = 0;
-    		for (String attr : tgtTypes) {
-    			attrs[iattr++] = client.getMart(mart).getDataset(dataset).getAttribute(attr);
-    		}
-    		attrs[nAttr] = tgtAttr;
-
-    		// prepare filters
-    		StringBuilder sb = new StringBuilder();
-    		for (String str : srcIds) {
-    			sb.append(str);
-    			sb.append(",");
-    		}
-
-    		// remove last comma
-    		int len = sb.length();
-    		if (len>0) {
-    			sb.deleteCharAt(len-1);
-    		}
-
-    		Map<String, String> queryFilter = new HashMap<String, String>(1);
-    		queryFilter.put(srcType, sb.toString());
-
-    		// build query string
-    		String query = XMLQueryBuilder.getQueryString(dataset, attrs, queryFilter);
-
-    		// query
-    		BufferedReader bfr = null;
-    		bfr = client.sendQuery(query);
-    		if (!bfr.ready())
-    			throw new IDMapperException("Query failed");
-
-    		if (bfr==null) {
-    			return new HashMap<String, Set<String>[]>(0);
-    		}
-
-    		// read id mapping
-    		Map<String,Set<String>[]> result = new HashMap<String,Set<String>[]>();
-    		String header = bfr.readLine();
-    		if (header.indexOf("ERROR") >= 0) throw new IDMapperException(header);
-    		String line;
-    		while ((line = bfr.readLine())!=null) {
-    			String[] strs = line.split("\t");
-    			if (strs.length!=nAttr+1)
-    				continue; // because the last one is the src id
-    			String src = strs[nAttr];
-    			Set<String>[] tgt = result.get(src);
-    			if (tgt==null) {
-    				tgt = new Set[nAttr];
-    				for (int i=0; i<nAttr; i++) {
-    					tgt[i] = new HashSet<String>();
-    				}
-    				result.put(src, tgt);
-    			}
-
-    			for (int i=0; i<nAttr; i++) {
-    				String str = strs[i];
-    				if (str.length()>0) {
-    					tgt[i].add(str);
-    				}
-    			}
-
-    		}
-            return result;
-    	} catch (IOException e) {
-    		throw new IDMapperException(e);
-    	}
-    }
-}
Index: /unk/corelib/src/org/bridgedb/webservice/biomart/package.html
===================================================================
--- /trunk/corelib/src/org/bridgedb/webservice/biomart/package.html (revision 161)
+++  (revision )
@@ -1,12 +1,0 @@
-<html>
-<body>
-Driver and helper classes for using web services as identifier mapping services.
-<p>
-For example, to use BioMart as a mapping resource,
-you can use the following piece of code:  
-<pre>
-	class.forName("org.bridgedb.webservice.biomart.IDMapperBiomart");
-	mapper = BridgeDb.connect ("idmapper-biomart:path/to/biomart?dataset=datasetname");
-</pre>
-</body>
-</html>
Index: /unk/corelib/src/org/bridgedb/webservice/IDMapperWebservice.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/webservice/IDMapperWebservice.java (revision 134)
+++  (revision )
@@ -1,28 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package org.bridgedb.webservice;
-
-import org.bridgedb.AbstractIDMapper;
-
-/**
- *
- * @author gjj
- */
-public abstract class IDMapperWebservice extends AbstractIDMapper {
-
-}
Index: /unk/corelib/src/org/bridgedb/AbstractIDMapperCapabilities.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/AbstractIDMapperCapabilities.java (revision 157)
+++  (revision )
@@ -1,94 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Simple implementation of IDMapperCapabilities,
- * which assumes that the supported datasources are the
- * same for target and source, and that the supported
- * data sources and properties are static and known at creation
- * time.
- */
-public abstract class AbstractIDMapperCapabilities implements
-		IDMapperCapabilities {
-
-	/** {@inheritDoc} */
-	public Set<String> getKeys() 
-	{
-		return properties.keySet();
-	}
-
-	/** {@inheritDoc} */
-	public String getProperty(String key) 
-	{
-		return properties.get(key);
-	}
-
-	private final Set<DataSource> supportedDataSources;
-	private final Map<String, String> properties;
-	private final boolean freeSearchSupported;
-	
-	/**
-	 * @param supportedDataSources Supported DataSources. IDMappers
-	 * are usually symmetrical, so in the default implementation
-	 * supportedDataSources is both target and source DataSources.
-	 * @param props properties, may be null.
-	 * @param freeSearchSupported if free search is supported or not
-	 */
-	public AbstractIDMapperCapabilities(Set<DataSource> supportedDataSources, boolean freeSearchSupported, Map<String, String> props) 
-	{
-		this.supportedDataSources = supportedDataSources;
-		this.freeSearchSupported = freeSearchSupported;
-		if (props == null)
-		{
-			properties = Collections.emptyMap();
-		}
-		else
-		{
-			properties = props;
-		}
-	}
-	
-	/** {@inheritDoc} */
-	public Set<DataSource> getSupportedSrcDataSources()
-			throws IDMapperException {
-		return supportedDataSources;
-	}
-
-	/** {@inheritDoc} */
-	public Set<DataSource> getSupportedTgtDataSources()
-			throws IDMapperException {
-		return supportedDataSources;
-	}
-
-        /** {@inheritDoc} */
-        public boolean isMappingSupported(DataSource src, DataSource tgt)
-			throws IDMapperException  {
-            return getSupportedSrcDataSources().contains(src)
-                    && getSupportedTgtDataSources().contains(tgt);
-        }
-
-	/** {@inheritDoc} */
-	public boolean isFreeSearchSupported() 
-	{
-		return freeSearchSupported;
-	}
-}
Index: /unk/corelib/src/org/bridgedb/IDMapper.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/IDMapper.java (revision 229)
+++  (revision )
@@ -1,90 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Base interface for all id mapping methods.
- * Has methods for basic functionality such as looking up cross-references and backpage text.
- */
-public interface IDMapper {
-
-	/**
-	 * Get all cross-references for a set of entities, restricting the
-	 * result to contain only references from the given set of data sources.
-     * Supports one-to-one mapping and one-to-many mapping.
-     * @param srcXrefs source Xref, containing ID and ID type/data source
-     * @param tgtDataSources target ID types/data sources. Set this to null
-     *   if you want to retrieve all results.
-     * @return a map from source Xref to target Xref's. The map is not guaranteed
-     *    to contain a result for each srcXrefs you pass in. This method will never
-     *    return null however.
-	 * @throws IDMapperException if the mapping service is (temporarily) unavailable 
-     */
-    public Map<Xref, Set<Xref>> mapID(Collection<Xref> srcXrefs, DataSource... tgtDataSources) throws IDMapperException;
-
-	/**
-	 * Get all cross-references for the given entity, restricting the
-	 * result to contain only references from the given set of data sources.
-	 * @param ref the entity to get cross-references for. 
-     * @param tgtDataSources target ID types/data sources. Set this to null if you 
-     *   want to retrieve all results.
-	 * @return A Set containing the cross references, or an empty
-	 * Set when no cross references could be found. This method does not return null.
-	 * @throws IDMapperException if the mapping service is (temporarily) unavailable 
-	 */
-	public Set<Xref> mapID (Xref ref, DataSource... tgtDataSources) throws IDMapperException;
-	
-    /**
-     * Check whether an Xref exists.
-     * @param xref reference to check
-     * @return if the reference exists, false if not
-     * @throws IDMapperException if failed
-     */
-    public boolean xrefExists(Xref xref) throws IDMapperException;
-
-    /**
-     * free text search for matching symbols or identifiers.
-     * @param text text to search
-     * @param limit up limit of number of hits
-     * @return a set of hit references
-     * @throws IDMapperException if failed
-     */
-    public Set<Xref> freeSearch (String text, int limit) throws IDMapperException;
-
-    /**
-     *
-     * @return capacities of the ID mapper
-     */
-    public IDMapperCapabilities getCapabilities();
-    
-    /**
-     * dispose any resources (such as open database connections) associated
-     * with this IDMapper.
-     * @throws IDMapperException if the associated resources could not be freed.
-     */
-    public void close() throws IDMapperException;
-    
-    /**
-     * Use this method to check if the IDMapper is still valid.
-     * @return false after the close() method is called on this object, true otherwise 
-     */
-    public boolean isConnected();
-}
Index: /unk/corelib/src/org/bridgedb/BridgeDb.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/BridgeDb.java (revision 290)
+++  (revision )
@@ -1,72 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Central access point for connecting to IDMappers.
- */
-public final class BridgeDb
-{
-	private static Map<String, Driver> drivers = new HashMap<String, Driver>();
-	
-	/** Private, to prevent instantiation of Utility class. */
-	private BridgeDb() {}
-	
-	/**
-	 * Finds the correct implementation of the {@link IDMapper} interface and instantiates it.
-	 * @param connectionString used to configure a mapping resource. The connectionString
-	 *   has the form "protocol:location", where protocol can be e.g. "idmapper-text" or
-	 *   "idmapper-pgdb", and location is for example an url or a file, depending
-	 *   on the protocol.<BR>
-	 *   Note that you need to load the driver that implements the protocol first by loading its
-	 *   class with Class.forName(). E.g. for idmapper-pgdb, the class "org.bridgedb.rdb.IDMapperRdb" needs
-	 *   to be loaded.
-	 * @return the newly instantiated IDMapper
-	 * @throws IDMapperException when the right IDMapper implementation could not
-	 *   be instantiated, or when the connection string is not formatted correctly
-	 */
-	public static IDMapper connect(String connectionString) throws IDMapperException
-	{
-		int pos = connectionString.indexOf(":");
-		if (pos < 0) throw new IDMapperException("connection String must be of the form 'protocol:location'");
-		String protocol = connectionString.substring(0, pos);
-		String location = connectionString.substring(pos + 1);
-		
-		if (drivers.containsKey(protocol))
-		{
-			return drivers.get(protocol).connect(location);
-		}
-		else
-		{
-			throw new IDMapperException ("Unknown protocol: " + protocol);
-		}
-	}
-	
-	/**
-	 * Used by {@link Driver} implementations to register themselves and make
-	 * themselves available to the world.
-	 * @param protocol The protocol (part before ":" in connection string) that this Driver is for.
-	 * @param driver An instance of the Driver.
-	 */
-	public static void register(String protocol, Driver driver)
-	{
-		drivers.put(protocol, driver);
-	}
-}
Index: /unk/corelib/src/org/bridgedb/Xref.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/Xref.java (revision 255)
+++  (revision )
@@ -1,112 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb;
-
-/**
- * Stores an id + {@link DataSource} combination, which represents
- * an unique gene product.
- * <p>
- * Immutable class, thread safe
- */
-public class Xref implements Comparable<Xref> 
-{	
-	final private String id;
-	final private DataSource ds;
-	
-	// String representation of this xref
-	final private String rep;
-	
-	/**
-	 * @param id the Id part of this Xref
-	 * @param ds the DataSource part of this Xref.
-	 */
-	public Xref(String id, DataSource ds) {
-		this.id = id;
-		this.ds = ds;
-		rep = (ds == null ? "" : (ds.getSystemCode() == null ? ds.getFullName() : ds.getSystemCode())) + ":" + id; 
-	}
-	
-	/**
-	 * @return the DataSource part of this Xref
-	 */
-	public DataSource getDataSource() { return ds; }
-	
-	/**
-	 * @return the id part of this Xref
-	 */
-	public String getId() { return id; }
-	
-	/**
-	 * @return short string representation for this Xref, for example En:ENSG000001 or X:1004_at
-	 *   This string representation is not meant to be stored or parsed, it is there mostly for
-	 *   debugging purposes.
-	 */
-	public String toString() { return rep;  }
-	
-	/**
-	 * hashCode calculated from id and datasource combined.
-	 * @return the hashCode
-	 */
-	public int hashCode() 
-	{
-		return rep.hashCode();
-	}
-	
-	/**
-	 * @return true if both the id and the datasource are equal.
-	 * @param o Object to compare to
-	 */
-	public boolean equals(Object o) 
-	{
-		if (o == null) return false;
-		if(!(o instanceof Xref)) return false;
-		Xref ref = (Xref)o;
-		return 
-			(id == null ? ref.id == null : id.equals(ref.id)) && 
-			(ds == null ? ref.ds == null : ds.equals(ref.ds));
-	}
-	
-	/**
-	 * Compares two Xrefs, asciibetically using string representation.
-	 * @param idc Xref to compare to
-	 * @return 0 if equal, positive number if higher, negative number if lower. 
-	 */
-	public int compareTo (Xref idc) 
-	{
-		return rep.compareTo(idc.rep);
-	}
-	
-	/**
-	 * Uses DataSource.getUrl() to create a valid URL for an online webpage describing this entity.
-	 * @return url as a String.
-	 */
-	public String getUrl()
-	{
-		return ds.getUrl (id);
-	}
-	
-	/**
-	 * Uses DataSource.getURN() to create a global identifier, such as
-	 * urn:miriam:uniprot:P12345. 
-	 * @return the URN as string 
-	 */
-	public String getURN()
-	{
-		return ds.getURN (id);
-	}
-
-}
Index: /unk/corelib/src/org/bridgedb/AttributeMapper.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/AttributeMapper.java (revision 307)
+++  (revision )
@@ -1,74 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb;
-
-import java.util.Map;
-import java.util.Set;
-
-/**
- * AttributeMapper knows about attributes for Xrefs.
- */
-public interface AttributeMapper
-{
-	/**
-	 * Get attributes for an entity, such as gene Symbol.
-	 * @param ref the entity to get the attribute for
-	 * @param attrType the attribute to look for, e.g. 'Symbol' or 'Description'.
-	 * @return the attribute, or null if nothing was found
-	 * @throws IDMapperException if the mapping service is (temporarily) unavailable 
-	 */
-	public Set<String> getAttributes(Xref ref, String attrType) throws IDMapperException;
-	
-	
-	/**
-	 * Get all attributes for an entity. 
-	 * Usually this method is more efficient if you want to query several attributes in a sequence.
-	 * @param ref the entity to get the attributes for
-	 * @return a Map where attribute names are the keys and attribute values are the values. 
-	 * @throws IDMapperException if the mapping service is (temporarily) unavailable 
-	 */
-	public Map<String, Set<String>> getAttributes(Xref ref) throws IDMapperException;
-
-        /**
-         *
-         * @return true if free attribute search is supported, false otherwise.
-         */
-        public boolean isFreeAttributeSearchSupported();
-
-	/**
-	 * free text search for matching symbols.
-	 * @return map references and attribute values that match the query
-	 * @param query The text to search for
-	 * @param attrType the attribute to look for, e.g. 'Symbol' or 'Description'. 
-	 * 	If you use the special MATCH_ID constant, it will query the identifier instead.
-	 * @param limit The number of results to limit the search to
-	 * @throws IDMapperException if the mapping service is (temporarily) unavailable 
-	 */
-	public Map<Xref, String> freeAttributeSearch (String query, String attrType, int limit) throws IDMapperException;
-
-	/** use this magic constant as the attrType parameter to also search for identifiers. */
-	public static final String MATCH_ID = "org.bridgedb.MATCH_ID";
-
-	/**
-	 * Set of attributes provided by this AttributeMapper.
-	 * There is no guarantee that a specific Xref has these attributes.
-	 * @return set of available attributes in this AttributeMapper. 
-	 *    If there are none available, returns an empty set.
-	 * @throws IDMapperException if the mapping service is (temporarily) unavailable 
-	 */
-	public Set<String> getAttributeSet() throws IDMapperException;
-}
Index: /unk/corelib/src/org/bridgedb/IDMapperCapabilities.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/IDMapperCapabilities.java (revision 164)
+++  (revision )
@@ -1,78 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb;
-
-import java.util.Set;
-
-/**
- * Describes capabilities of an IDMapper.
- * Free form key-value properties are used for version info etc.
- */
-public interface IDMapperCapabilities {
-
-    /**
-     *
-     * @return true if free text search is supported, false otherwise.
-     */
-    public boolean isFreeSearchSupported();
-
-    /**
-     *
-     * @return supported source ID types
-     * @throws IDMapperException if supported DataSources 
-     * 	could not be determined because of service unavailability.
-     */
-    public Set<DataSource>  getSupportedSrcDataSources() throws IDMapperException;
-
-    /**
-     *
-     * @return supported target ID types
-     * @throws IDMapperException if supported DataSources 
-     * 	could not be determined because of service unavailability.
-     */
-    public Set<DataSource> getSupportedTgtDataSources() throws IDMapperException;
-
-    /**
-     *
-     * @param src source data source
-     * @param tgt target data source
-     * @return true if mapping is supported from src to des
-     * @throws IDMapperException if service is unavailable
-     */
-    public boolean isMappingSupported(DataSource src, DataSource tgt) throws IDMapperException;
-    
-    /**
-     * Return a value for a property, or null if this property is not defined.
-     * Implementations are free to choose a set of properties. Suggested properties:
-     * <ul>
-     * <li>Version
-     * <li>DateCreated
-     * <li>SourceDatabase
-     * <li>SourceDatabaseVersion
-     * <li>Species
-     * </ul>
-     * @param key key
-     * @return property string
-     */
-    public String getProperty(String key);
-    
-    /**
-     * @return the keys of all properties. 
-     * Implementations may return an empty set but never null.
-     */
-    public Set<String> getKeys();
-}
Index: /unk/corelib/src/org/bridgedb/DataSourcePatterns.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/DataSourcePatterns.java (revision 105)
+++  (revision )
@@ -1,79 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Contains regular expression patterns for identifiers
- * Can be used to guess the BioDataSource of an identifier
- * of unknown origin.
- */
-public final class DataSourcePatterns 
-{
-	/** private constructor, to prevent instantiation of utility class. */
-	private DataSourcePatterns() {}
-	
-	private static Map<DataSource, Pattern> patterns = new HashMap<DataSource, Pattern>();
-	
-	/**
-	 * Register a regex Pattern for recognizing a DataSource.
-	 * @param key the DataSource that may be recognized.
-	 * @param value the Pattern to look for.
-	 */
-	public static void registerPattern (DataSource key, Pattern value)
-	{
-		patterns.put (key, value);
-	}
-	
-	/**
-	 * Look for all DataSource patterns that match a given input. 
-	 * @param id to compare with registered patterns
-	 * @return set of patterns which matches the given id.
-	 */
-	public static Set<DataSource> getDataSourceMatches (String id)
-	{
-		Set<DataSource> result = new HashSet<DataSource>();
-		for (DataSource ds : patterns.keySet())
-		{
-			Matcher m = patterns.get(ds).matcher(id);					
-			if (m.matches()) result.add (ds);			
-		}
-		return result;
-	}
-	
-	/**
-	 * @return all known data patterns, mapped to
-	 * their BioDataSource.
-	 * For example, this map will contain:
-	 * <pre>
-	 *    BioDataSource.ENSEMBL_HUMAN -> Pattern.compile("ENSG\d+")
-	 * </pre>
-	 * <p>
-	 * There is not guaranteed to be a Pattern for every
-	 * BioDataSource constant.
-	 */
-	public static Map<DataSource, Pattern> getPatterns()
-	{
-		return patterns;
-	}
-}
Index: /unk/corelib/src/org/bridgedb/package.html
===================================================================
--- /trunk/corelib/src/org/bridgedb/package.html (revision 164)
+++  (revision )
@@ -1,21 +1,0 @@
-<html>
-<body>
-<b>BridgeDb</b> is a java library intended for dealing with identifiers for
-biological entities such as genes, proteins, metabolites.
-<p>
-In BridgeDb, a {@link org.bridgedb.DataSource} defines an online resource such as Ensembl or Entrez.
-<p>
-An {@link org.bridgedb.Xref} is the combination of an identifier and a particular resource, 
-and thus uniquely defines a single biological entity. It is often possible
-to generate a URL to an online description of this biological entity.
-<p>
-Identifiers are preferably not descriptive. A descriptive name such as INSR (Insulin Receptor) 
-instead of Entrez Gene 3643 can be useful. In BridgeDb we refer to this as a Symbol. Because
-of the ambiguous nature, Symbols are not the primary means for identifying 
-<p>
-Usually, different DataSources describe the same biological entities. Cross references are
-stored in so called Synonym databases. {@link org.bridgedb.IDMapper} has facilities for mapping cross-references
-and mapping between different DataSources.
-<p>
-</body>
-</html>
Index: /unk/corelib/src/org/bridgedb/IDMapperException.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/IDMapperException.java (revision 105)
+++  (revision )
@@ -1,67 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb;
-
-/**
- * for all exceptions thrown by IDMapper interface. 
-<p>	
-	Simple wrapper so using classes don't need to deal with implementation details
-	of specific IDMapper implementations. 
-<p>
-	Usually wraps SQLException, ClassNotFoundException, for IDMapperRdb,
-	XmlRpcException for IDMapperWebservice and IOException for IDMapperText
-<p>
-	Simply use the inherited constructor IDMapperException(Throwable cause)
-	to wrap an exception.
-*/
-public class IDMapperException extends Exception
-{
-
-	/** 
-	 * See Exception(Throwable). 
-	 * @param t cause
-	 */
-	public IDMapperException (Throwable t)
-	{
-		super (t);
-	}
-	
-	/** 
-	 * See Exception(String, Throwable). 
-	 * @param msg a message
-	 * @param t cause
-	 */
-	public IDMapperException (String msg, Throwable t)
-	{
-		super (msg, t);
-	}
-	
-	/** 
-	 * See Exception (String). 
-	 * @param msg a message
-	 */
-	public IDMapperException (String msg)
-	{
-		super (msg);
-	}
-	
-	/** See Exception (). */
-	public IDMapperException ()
-	{
-		super();
-	}
-}
Index: /unk/corelib/src/org/bridgedb/AbstractIDMapper.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/AbstractIDMapper.java (revision 233)
+++  (revision )
@@ -1,39 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb;
-
-import java.util.Set;
-
-import org.bridgedb.impl.InternalUtils;
-
-/**
- * Contains default implementation of some IDMapper methods.
- */
-public abstract class AbstractIDMapper implements IDMapper
-{
-
-	/**
-	 * Default implementation of mapID.
-	 * This just calls <pre>mapID (Set&lt;Xref&gt;, Set&lt;DataSource&gt;)</pre> for mapping
-	 * multiple id's with a set containing only a single Xref.
-	 * {@inheritDoc}
-	 */
-	public Set<Xref> mapID (Xref srcRef, DataSource... tgtDataSources) throws IDMapperException
-	{
-		return InternalUtils.mapSingleFromMulti(this, srcRef, tgtDataSources);
-	}
-}
Index: /unk/corelib/src/org/bridgedb/IDMapperStack.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/IDMapperStack.java (revision 307)
+++  (revision )
@@ -1,526 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * combines multiple {@link IDMapper}'s in a stack.
- * <p>
- * The behavior of the {@link IDMapper} interface implementations
- * differs per method:
- * if the method returns a single result, usually it is 
- * from the first child database that has a sensible result.
- * This also means that the child databases have a definitive
- * ordering: the first one shadows the second one for some results.
- * <p>
- * If the method returns a list, IDMapperStack joins
- * the result from all connected child databases together.
- */
-public class IDMapperStack implements IDMapper, AttributeMapper
-{
-	private List<IDMapper> gdbs = new ArrayList<IDMapper>();
-
-	/**
-	 * Create a fresh IDMapper from a connectionString and add it to the stack.
-	 * @param connectionString connectionString for configuring the new IDMapper
-	 * @return the newly created IDMapper
-	 * @throws IDMapperException when the connection failed.
-	 */
-	public IDMapper addIDMapper(String connectionString) throws IDMapperException
-	{
-		IDMapper idMapper = BridgeDb.connect(connectionString);
-		addIDMapper(idMapper);
-		return idMapper;
-	}
-
-	/**
-	 * Add an existing IDMapper to the stack.
-	 * @param idMapper IDMapper to be added.
-	 */
-    public void addIDMapper(IDMapper idMapper)
-    {
-        if (idMapper!=null) {
-            gdbs.add(idMapper);
-        }
-    }
-    
-    private boolean isTransitive = false;
-    
-    /**
-     * Set Transitivity mode, where all mappings are combined to infer
-     * second degree mappings.
-     * @param value true or false
-     */
-    public void setTransitive(boolean value)
-    {
-    	isTransitive = value;
-    }
-    
-    /**
-     * @return true if the stack is in transitive mode
-     */
-    public boolean getTransitive()
-    {
-    	return isTransitive;
-    }
-    
-	/**
-	 * Remove an idMapper from the stack.
-	 * @param idMapper IDMapper to be removed.
-	 */
-    public void removeIDMapper(IDMapper idMapper)
-    {
-    	gdbs.remove(idMapper);
-    }
-
-	/**
-	 * closes all child databases. 
-	 * @throws IDMapperException when closing failed for one of the databases. It will still try to 
-	 * 	close all child databases even if one throws an exception. However, only the last exception will be thrown.
-	 */
-	public void close() throws IDMapperException 
-	{
-		IDMapperException postponed = null;
-		for (IDMapper child : gdbs)
-		{
-			if (child != null)
-			{
-				try
-				{
-					child.close();
-					child = null; // garbage collect
-				}
-				catch (IDMapperException ex)
-				{
-					postponed = ex;
-				}
-			}
-		}
-		if (postponed != null)
-		{
-			throw postponed;
-		}
-	}
-
-	/** {@inheritDoc} */
-	public boolean xrefExists(Xref xref) throws IDMapperException 
-	{
-		for (IDMapper child : gdbs)
-		{
-			if (child != null && child.isConnected())
-			{
-				if(child.xrefExists(xref)) {
-					return true;
-				}
-			}
-		}
-		return false;
-	}
-	
-	/**
-	 * @return true if at least one of the child services
-	 * are connected.
-	 */
-	public boolean isConnected() 
-	{
-		for (IDMapper child : gdbs)
-		{
-			if (child != null && child.isConnected())
-			{
-				return true;
-			}
-		}
-		return false;
-	}
-
-	private final IDMapperCapabilities caps = new IDMapperStackCapabilities();
-	
-	private class IDMapperStackCapabilities implements IDMapperCapabilities
-	{
-		/**
-		 * @return union of DataSources supported by child services
-		 * @throws IDMapperException when one of the services was unavailable
-		 */
-		public Set<DataSource> getSupportedSrcDataSources() throws IDMapperException
-		{
-			final Set<DataSource> result = new HashSet<DataSource>();
-			for (IDMapper idm : IDMapperStack.this.gdbs)
-			{
-                Set<DataSource> dss = null;
-                dss = idm.getCapabilities().getSupportedSrcDataSources();
-                if (dss!=null) {
-                    result.addAll (dss);
-                }
-			}
-			return result;
-		}
-
-		/**
-		 * @return union of DataSources supported by child services
-		 * @throws IDMapperException when one of the services was unavailable
-		 */
-		public Set<DataSource> getSupportedTgtDataSources() throws IDMapperException
-		{
-			final Set<DataSource> result = new HashSet<DataSource>();
-			for (IDMapper idm : IDMapperStack.this.gdbs)
-			{
-				Set<DataSource> dss = null;
-                dss = idm.getCapabilities().getSupportedTgtDataSources();
-
-                if (dss!=null) {
-                    result.addAll (dss);
-                }
-			}
-			return result;
-		}
-
-                /** {@inheritDoc} */
-                public boolean isMappingSupported(DataSource src, DataSource tgt)
-                                throws IDMapperException {
-                    for (IDMapper idm : IDMapperStack.this.gdbs)
-                    {
-                        if (idm.getCapabilities().isMappingSupported(src, tgt)) {
-                            return true;
-                        }
-                    }
-                    return false;
-                }
-
-		/**
-		 * @return true if free search is supported by one of the children
-		 */
-		public boolean isFreeSearchSupported() 
-		{
-			// returns true if any returns true
-			// TODO: not sure if this is the right logic?
-			for (IDMapper idm : IDMapperStack.this.gdbs)
-			{
-				if (idm.getCapabilities().isFreeSearchSupported())
-					return true;
-			}
-			return false;
-		}
-
-		/** {@inheritDoc} */
-		public Set<String> getKeys() 
-		{
-			return Collections.emptySet();
-		}
-
-		/** {@inheritDoc} */
-		public String getProperty(String key) 
-		{
-			return null;
-		}
-	};
-	
-	/**
-	 * @return an object describing the capabilities of the combined stack of services.
-	 */
-	public IDMapperCapabilities getCapabilities() 
-	{
-		return caps;
-	}
-
-	/** {@inheritDoc} */
-	public Set<Xref> freeSearch(String text, int limit)
-			throws IDMapperException 
-	{
-		Set<Xref> result = new HashSet<Xref>();
-		
-		for (IDMapper child : gdbs)
-		{
-			if (child != null && child.isConnected())
-			{
-				result.addAll (child.freeSearch(text, limit));
-			}
-		}
-		return result;
-	}
-
-	/** {@inheritDoc} */
-	public Map<Xref, Set<Xref>> mapID(Collection<Xref> srcXrefs,
-			DataSource... tgtDataSources) throws IDMapperException 
-	{
-		if (isTransitive)
-		{
-			return mapIDtransitive(srcXrefs, tgtDataSources);
-		}
-		else
-		{
-			return mapIDnormal(srcXrefs, tgtDataSources);
-		}
-	}
-
-	/**
-	 * helper method to map Id's in non-transitive mode.
-	 * @param srcXrefs mapping source
-	 * @param tgtDataSources target data sources
-	 * @return mapping result
-	 * @throws IDMapperException if one of the children fail
-	 */
-	private Map<Xref, Set<Xref>> mapIDnormal(Collection<Xref> srcXrefs,
-			DataSource... tgtDataSources) throws IDMapperException 
-	{
-		Map<Xref, Set<Xref>> result = new HashMap<Xref, Set<Xref>>();
-		
-		for (IDMapper child : gdbs)
-		{
-			if (child != null && child.isConnected())
-			{
-				for (Map.Entry<Xref, Set<Xref>> entry : child.mapID(srcXrefs, tgtDataSources).entrySet())
-				{
-					Set<Xref> resultSet = result.get (entry.getKey());
-					if (resultSet == null) 
-					{
-						resultSet = new HashSet<Xref>();
-						result.put (entry.getKey(), resultSet);
-					}
-					resultSet.addAll (entry.getValue());
-				}
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * helper method to map Id's in transitive mode.
-	 * @param srcXrefs mapping source
-	 * @param tgtDataSources target data sources
-	 * @return mapping result
-	 * @throws IDMapperException if one of the children fail
-	 */
-	private Map<Xref, Set<Xref>> mapIDtransitive(Collection<Xref> srcXrefs,
-			DataSource... tgtDataSources) throws IDMapperException 
-	{
-		// Current implementation just repeatedly calls mapIDTransitive (Xref, Set<Ds>) 
-		// It may be possible to rearrange loops to optimize for fewer database calls.
-		Map <Xref, Set<Xref>> result = new HashMap<Xref, Set<Xref>>();
-		for (Xref ref: srcXrefs)
-		{
-			result.put (ref, mapIDtransitive(ref, tgtDataSources));
-		}
-		return result;
-	}
-
-	/** {@inheritDoc} */
-	public Set<String> getAttributes(Xref ref, String attrname)
-			throws IDMapperException 
-	{
-		Set<String> result = new HashSet<String>();
-		for (IDMapper child : gdbs)
-		{
-			if (child != null && child instanceof AttributeMapper && child.isConnected())
-			{
-				result.addAll (((AttributeMapper)child).getAttributes(ref, attrname));
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * @return true if free attribute search is supported by one of the children
-	 */
-	public boolean isFreeAttributeSearchSupported()
-	{
-		// returns true if any returns true
-		// TODO: not sure if this is the right logic?
-		for (IDMapper child : IDMapperStack.this.gdbs)
-		{
-		        if (child != null && child instanceof AttributeMapper)
-		        {
-		        	if (((AttributeMapper)child).isFreeAttributeSearchSupported())
-					return true;
-		        }
-		}
-		return false;
-	}
-
-	/** {@inheritDoc} */
-	public Map<Xref, String> freeAttributeSearch (String query, String attrType, int limit) throws IDMapperException
-	{
-		Map<Xref, String> result = null;
-		for (IDMapper child : gdbs)
-		{
-			if (child != null && child instanceof AttributeMapper && child.isConnected()
-				&& ((AttributeMapper)child).isFreeAttributeSearchSupported())
-			{
-				Map<Xref, String> childResult = 
-					((AttributeMapper)child).freeAttributeSearch(query, attrType, limit);
-				if (result == null) 
-					result = childResult;
-				else
-				{
-					for (Xref ref : childResult.keySet())
-					{
-						if (!result.containsKey(ref))
-							result.put (ref, childResult.get(ref));
-					}
-				}
-			}
-		}
-		return result;
-	}
-	
-	/** @return concatenation of toString of each child */
-	@Override public String toString()
-	{
-		String result = "";
-		boolean first = true;
-		for (IDMapper child : gdbs)
-		{
-			if (!first) result += ", "; 
-			first = false;
-			result += child.toString();
-		}
-		return result;
-	}
-	
-	/** @return number of child databases */
-	public int getSize()
-	{
-		return gdbs.size();
-	}
-	
-	/**
-	 * @param index in the range 0 <= index < getSize() 
-	 * @return the IDMapper at the given position */
-	public IDMapper getIDMapperAt(int index)
-	{
-		return gdbs.get(index);
-	}
-
-	/** {@inheritDoc} */
-	public Set<Xref> mapID(Xref ref, DataSource... resultDs) throws IDMapperException 
-	{
-		if (isTransitive)
-		{
-			return mapIDtransitive (ref, resultDs);
-		}
-		else
-		{
-			return mapIDnormal (ref, resultDs);
-		}
-	}
-	
-	
-	/**
-	 * helper method to map Id's in transitive mode.
-	 * @param ref Xref to map
-	 * @param resultDs target data sources
-	 * @return mapping result
-	 * @throws IDMapperException if one of the children fail
-	 */
-	private Set<Xref> mapIDtransitive(Xref ref, DataSource... resultDs) throws IDMapperException 
-	{
-		// first round
-		Set<Xref> result = new HashSet<Xref>();
-		for (IDMapper i : gdbs)
-		{
-			if (i == null || !i.isConnected()) continue;
-			
-			// map ref in IDMapper i
-			Set<Xref> round1 = i.mapID(ref);
-			
-			// then map the result of that in all IDMappers j (j != i)
-			for (IDMapper j : gdbs)
-			{
-				if (j == null || !j.isConnected()) continue;
-				if (i == j) continue;
-				
-				Map<Xref, Set<Xref>> round2 = j.mapID(round1, resultDs); 
-				for (Xref key : round2.keySet())
-				{
-					result.addAll (round2.get (key));
-				}
-			}			
-		}
-		return result;
-	}
-	
-	/**
-	 * helper method to map Id's in transitive mode.
-	 * @param ref Xref to map
-	 * @param resultDs target data sources
-	 * @return mapping result
-	 * @throws IDMapperException if one of the children fail
-	 */
-	private Set<Xref> mapIDnormal(Xref ref, DataSource... resultDs) throws IDMapperException 
-	{
-		Set<Xref> result = new HashSet<Xref>();
-		for (IDMapper child : gdbs)
-		{
-			if (child != null && child.isConnected())
-			{
-				result.addAll (child.mapID(ref, resultDs));
-			}
-		}
-		return result;
-	}
-
-	/** {@inheritDoc} */
-	public Set<String> getAttributeSet() throws IDMapperException 
-	{
-		Set<String> result = new HashSet<String>();
-		for (IDMapper child : gdbs)
-		{
-			if (child != null && child instanceof AttributeMapper && child.isConnected())
-			{
-				result.addAll (((AttributeMapper)child).getAttributeSet());
-			}
-		}
-		return result;
-	}
-
-	/** {@inheritDoc} */
-	public Map<String, Set<String>> getAttributes(Xref ref)
-			throws IDMapperException 
-	{
-		Map<String, Set<String>> result = new HashMap<String, Set<String>>();
-		for (IDMapper child : gdbs)
-		{
-			if (child != null && child instanceof AttributeMapper && child.isConnected())
-			{
-				for (Map.Entry<String, Set<String>> entry :
-					((AttributeMapper)child).getAttributes(ref).entrySet())
-				{
-					Set<String> thisSet;
-					if (!result.containsKey(entry.getKey()))	
-					{
-						thisSet = new HashSet<String>();
-						result.put (entry.getKey(), thisSet); 
-					}
-					else
-					{
-						thisSet = result.get(entry.getKey());
-					}
-					thisSet.addAll(entry.getValue());
-				}
-			}
-		}
-		return result;
-	}
-	
-}
Index: /unk/corelib/src/org/bridgedb/DataSource.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/DataSource.java (revision 162)
+++  (revision )
@@ -1,457 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
-contains information about a certain DataSource, such as
-<ul>
-<li>It's full name ("Ensembl")
-<li>It's system code ("En")
-<li>It's main url ("http://www.ensembl.org")
-<li>Id-specific url's ("http://www.ensembl.org/Homo_sapiens/Gene/Summary?g=" + id)
-</ul>
-The DataSource class uses the extensible enum pattern.
-You can't instantiate DataSources directly, instead you have to use one of
-the constants from the org.bridgedb.bio module such as BioDataSource.ENSEMBL, 
-or the "getBySystemcode" or "getByFullname" methods.
-These methods return a predefined DataSource object if it exists.
-If a predefined DataSource for a requested SystemCode doesn't exists,
-a new one springs to life automatically. This can be used 
-when the user requests new, unknown data sources. If you call
-getBySystemCode twice with the same argument, it is guaranteed
-that you get the same return object. However, there is no way
-to combine a new DataSource with a new FullName unless you use 
-the "register" method.
-<p>
-This way any number of pre-defined DataSources can be used, 
-but plugins can define new ones and you can
-handle unknown data sources in the same 
-way as predefined ones.
-<p>
-Definitions for common DataSources can be found in {@link org.bridgedb.bio.BioDataSource}.
-*/
-public final class DataSource
-{
-	private static Map<String, DataSource> bySysCode = new HashMap<String, DataSource>();
-	private static Map<String, DataSource> byFullName = new HashMap<String, DataSource>();
-	private static Set<DataSource> registry = new HashSet<DataSource>();
-	
-	private String sysCode = null;
-	private String fullName = null;
-	private String mainUrl = null;
-	private String prefix = "";
-	private String postfix = "";
-	private Object organism = null;
-	private String idExample = null;
-	private boolean isPrimary = true;
-	private String type;
-	private String urnBase;
-	
-	/**
-	 * Constructor is private, so that we don't
-	 * get any standalone DataSources. 
-	 * DataSources should be obtained from 
-	 * {@link getByFullName} or {@link getBySystemCode}. Information about
-	 * DataSources can be added with {@link register}
-	 */
-	private DataSource () {}
-	
-	/** 
-	 * Turn id into url pointing to info page on the web, e.g. "http://www.ensembl.org/get?id=ENSG..."
-	 * @param id identifier to use in url
-	 * @return Url
-	 */
-	public String getUrl(String id)
-	{
-		return prefix + id + postfix;
-	}
-				
-	/** 
-	 * returns full name of DataSource e.g. "Ensembl". 
-	 * May return null if only the system code is known. 
-	 * Also used as identifier in GPML
-	 * @return full name of DataSource 
-	 */
-	public String getFullName()
-	{
-		return fullName;
-	}
-	
-	/** 
-	 * returns GenMAPP SystemCode, e.g. "En". May return null,
-	 * if only the full name is known.
-	 * Also used as identifier in
-	 * <ol> 
-	 * <li>Gdb databases, 
-	 * <li>Gex databases.
-	 * <li>Imported data
-	 * <li>the Mapp format.
-	 * </ol> 
-	 * We should try not to use the system code anywhere outside
-	 * these 4 uses.
-	 * @return systemcode, a short unique code.
-	 */
-	public String getSystemCode()
-	{
-		return sysCode;
-	}
-	
-	/**
-	 * Return the main Url for this datasource,
-	 * that can be used to refer to the datasource in general.
-	 * (e.g. http://www.ensembl.org/)
-	 * 
-	 * May return null in case the main url is unknown.
-	 * @return main url
-	 */
-	public String getMainUrl()
-	{	
-		return mainUrl;
-	}
-
-	/**
-	 * @return type of entity that this DataSource describes, for example
-	 *   "metabolite", "gene", "protein" or "probe" 
-	 */
-	public String getType()
-	{
-		return type;
-	}
-	
-	/**
-	 * Creates a global identifier. 
-	 * It uses the MIRIAM data type list
-	 * to create a MIRIAM URI like "urn:miriam:uniprot:P12345", 
-	 * or if this DataSource is not included
-	 * in the MIRIAM data types list, a bridgedb URI.
-	 * @param id Id to generate URN from.
-	 * @return the URN. 
-	 */
-	public String getURN(String id)
-	{
-		String idPart = "";
-		try
-		{
-			idPart = URLEncoder.encode(id, "UTF-8");
-		} catch (UnsupportedEncodingException ex) { idPart = id; }
-		return urnBase + ":" + idPart;
-	}
-	
-	/**
-	 * Uses builder pattern to set optional attributes for a DataSource. For example, this allows you to use the 
-	 * following code:
-	 * <pre>
-	 * DataSource.register("X", "Affymetrix")
-	 *     .mainUrl("http://www.affymetrix.com")
-	 *     .type("probe")
-	 *     .primary(false);
-	 * </pre>
-	 */
-	public static final class Builder
-	{
-		private final DataSource current;
-		
-		/**
-		 * Create a Builder for a DataSource. Note that an existing DataSource is
-		 * modified rather than creating a new one.
-		 * This constructor should only be called by the register method.
-		 * @param current the DataSource to be modified
-		 */
-		private Builder(DataSource current)
-		{
-			this.current = current;
-		}
-		
-		/**
-		 * @return the DataSource under construction
-		 */
-		public DataSource asDataSource()
-		{
-			return current;
-		}
-		
-		/**
-		 * 
-		 * @param urlPattern is a template for generating valid URL's for identifiers. 
-		 * 	The pattern should contain the substring "$ID", which will be replaced by the actual identifier.
-		 * @return the same Builder object so you can chain setters
-		 */
-		public Builder urlPattern (String urlPattern)
-		{
-			if (urlPattern == null || "".equals (urlPattern))
-			{
-				current.prefix = "";
-				current.postfix = "";
-			}
-			else
-			{
-				int pos = urlPattern.indexOf("$ID");
-				if (pos == -1) throw new IllegalArgumentException("Url maker pattern for " + current + "' should have $ID in it");
-				current.prefix = urlPattern.substring(0, pos);
-				current.postfix = urlPattern.substring(pos + 3);
-			}
-			return this;
-		}
-		
-		/**
-		 * @param mainUrl url of homepage
-		 * @return the same Builder object so you can chain setters
-		 */
-		public Builder mainUrl (String mainUrl)
-		{
-			current.mainUrl = mainUrl;
-			return this;
-		}
-
-
-		/**
-		 * @param idExample an example id from this system
-		 * @return the same Builder object so you can chain setters
-		 */
-		public Builder idExample (String idExample)
-		{
-			current.idExample = idExample;
-			return this;
-		}
-		
-		/**
-		 * @param isPrimary secondary id's such as EC numbers, Gene Ontology or vendor-specific systems occur in data or linkouts,
-		 * 	but their use in pathways is discouraged
-		 * @return the same Builder object so you can chain setters
-		 */
-		public Builder primary (boolean isPrimary)
-		{
-			current.isPrimary = isPrimary;
-			return this;
-		}
-		
-		/**
-		 * @param type the type of datasource, for example "protein", "gene", "metabolite" 
-		 * @return the same Builder object so you can chain setters
-		 */
-		public Builder type (String type)
-		{
-			current.type = type;
-			return this;
-		}
-		
-		/**
-		 * @param organism organism for which this system code is suitable, or null for any / not applicable
-		 * @return the same Builder object so you can chain setters
-		 */
-		public Builder organism (Object organism)
-		{
-			current.organism = organism;
-			return this;
-		}
-		
-		/**
-		 * @param base for urn generation, for example "urn:miriam:uniprot"
-		 * @return the same Builder object so you can chain setters
-		 */
-		public Builder urnBase (String base)
-		{
-			current.urnBase = base;
-			return this;
-		}
-	}
-	
-	/** 
-	 * Register a new DataSource with (optional) detailed information.
-	 * This can be used by other modules to define new DataSources.
-	 * @param sysCode short unique code between 1-4 letters, originally used by GenMAPP
-	 * @param fullName full name used in GPML. Must be 20 or less characters
-	 * @return Builder that can be used for adding detailed information.
-	 */
-	public static Builder register(String sysCode, String fullName)
-	{
-		DataSource current = null;
-		if (fullName == null && sysCode == null) throw new NullPointerException();
-//		if (fullName != null && fullName.length() > 20) 
-//		{ 
-//			throw new IllegalArgumentException("full Name '" + fullName + "' must be 20 or less characters"); 
-//		}
-		
-		if (byFullName.containsKey(fullName))
-		{
-			current = byFullName.get(fullName);
-		}
-		else if (bySysCode.containsKey(sysCode))
-		{
-			current = bySysCode.get(sysCode);
-		}
-		else
-		{
-			current = new DataSource ();
-			registry.add (current);
-		}
-		
-		current.sysCode = sysCode;
-		current.fullName = fullName;
-
-		if (isSuitableKey(sysCode))
-			bySysCode.put(sysCode, current);
-		if (isSuitableKey(fullName))
-			byFullName.put(fullName, current);
-		
-		return new Builder(current);
-	}
-	
-	/**
-	 * Helper method to determine if a String is allowed as key for bySysCode and byFullname hashes.
-	 * Null values and empty strings are not allowed.
-	 * @param key key to check.
-	 * @return true if the key is allowed
-	 */
-	private static boolean isSuitableKey(String key)
-	{
-		return !(key == null || "".equals(key));
-	}
-	
-	
-	/** 
-	 * @param systemCode short unique code to query for
-	 * @return pre-existing DataSource object by system code, 
-	 * 	if it exists, or creates a new one. 
-	 */
-	public static DataSource getBySystemCode(String systemCode)
-	{
-		if (!bySysCode.containsKey(systemCode) && isSuitableKey(systemCode))
-		{
-			register (systemCode, null);
-		}
-		return bySysCode.get(systemCode);
-	}
-	
-	/** 
-	 * returns pre-existing DataSource object by 
-	 * full name, if it exists, 
-	 * or creates a new one. 
-	 * @param fullName full name to query for
-	 * @return DataSource
-	 */
-	public static DataSource getByFullName(String fullName)
-	{
-		if (!byFullName.containsKey(fullName) && isSuitableKey(fullName))
-		{
-			register (null, fullName);
-		}
-		return byFullName.get(fullName);
-	}
-	
-	/**
-		get all registered datasoures as a set.
-		@return set of all registered DataSources
-	*/ 
-	static public Set<DataSource> getDataSources()
-	{
-		return registry;
-	}
-	
-	/**
-	 * returns a filtered subset of available datasources.
-	 * @param primary Filter for specified primary-ness. If null, don't filter on primary-ness.
-	 * @param metabolite Filter for specified metabolite-ness. If null, don't filter on metabolite-ness.
-	 * @param o Filter for specified organism. If null, don't filter on organism.
-	 * @return filtered set.
-	 */
-	static public Set<DataSource> getFilteredSet (Boolean primary, Boolean metabolite, Object o)
-	{
-		final Set<DataSource> result = new HashSet<DataSource>();
-		for (DataSource ds : registry)
-		{
-			if (
-					(primary == null || ds.isPrimary() == primary) &&
-					(metabolite == null || ds.isMetabolite() == metabolite) &&
-					(o == null || ds.organism == null || o == ds.organism))
-			{
-				result.add (ds);
-			}
-		}
-		return result;
-	}
-	
-	/**
-	 * Get a list of all non-null full names.
-	 * <p>
-	 * Warning: the ordering of this list is undefined.
-	 * Two subsequent calls may give different results.
-	 * @return List of full names
-	 */
-	static public List<String> getFullNames()
-	{
-		final List<String> result = new ArrayList<String>();
-		result.addAll (byFullName.keySet());
-		return result;
-	}
-	/**
-	 * The string representation of a DataSource is equal to
-	 * it's full name. (e.g. "Ensembl")
-	 * @return String representation
-	 */
-	public String toString()
-	{
-		return fullName;
-	}
-	
-	/**
-	 * @return example Xref, mostly for testing purposes
-	 */
-	public Xref getExample ()
-	{
-		return new Xref (idExample, this);
-	}
-	
-	/**
-	 * @return if this is a primary DataSource or not. Primary DataSources 
-	 * are preferred when annotating models.
-	 * 
-	 * A DataSource is primary if it is not of type probe, 
-	 * so that means e.g. Affymetrix or Agilent probes are not primary. All
-	 * gene, protein and metabolite identifiers are primary.
-	 */
-	public boolean isPrimary()
-	{
-		return isPrimary;
-	}
-	
-	/**
-	 * @return if this DataSource describes metabolites or not.
-	 */
-	public boolean isMetabolite()
-	{
-		return type.equals ("metabolite");
-	}
-
-	/**
-	 * @return Organism that this DataSource describes, or null if multiple / not applicable.
-	 */
-	public Object getOrganism()
-	{
-		return organism;
-	}
-
-}
Index: /unk/corelib/src/org/bridgedb/Driver.java
===================================================================
--- /trunk/corelib/src/org/bridgedb/Driver.java (revision 248)
+++  (revision )
@@ -1,41 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb;
-
-/**
- * A Driver knows how to create an IDMapper instance.
- * The connect method should not be called directly, instead
- * use BridgeDb.connect() to automatically pick
- * the correct driver for a protocol.
- */
-public interface Driver 
-{
-	/**
-	 * Never call this method directly, use {@link BridgeDb#connect} instead.
-	 * This method interprets the location part of the connection string and uses
-	 * that to configure an {@link IDMapper}.
-	 * @return a new instance of the correct
-	 * 	IDMapper implementation every time, configured according to the locationString.
-	 * @param locationString string with all necessary information to configure the resource. 
-	 * 	e.g. this could contain a URL or file location with optional parameters at the end.
-	 * @throws IDMapperException when a connection to the resource could not be created, or
-	 *  the IDMapper implementation could not be instantiated for any reason. IDMapperException
-	 *  should be thrown also if the locationString could not be parsed, or if it was
-	 *  wrongly formatted. 
-	 */
-	IDMapper connect (String locationString) throws IDMapperException;
-}
Index: /unk/corelib/checks.xml
===================================================================
--- /trunk/corelib/checks.xml (revision 294)
+++  (revision )
@@ -1,64 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
-
-<!--
-    This configuration file was written by the eclipse-cs plugin configuration editor
--->
-<!--
-    Checkstyle-Configuration: bridgedb
-    Description: none
--->
-<module name="Checker">
-  <property name="severity" value="warning"/>
-  <module name="TreeWalker">
-    <module name="MethodName"/>
-    <module name="LocalVariableName"/>
-    <module name="LocalFinalVariableName"/>
-    <module name="ConstantName"/>
-    <module name="MemberName"/>
-    <module name="PackageName"/>
-    <module name="ParameterName"/>
-    <module name="StaticVariableName"/>
-    <module name="TypeName"/>
-    <module name="AvoidStarImport"/>
-    <module name="IllegalImport"/>
-    <module name="ImportOrder"/>
-    <module name="RedundantImport"/>
-    <module name="UnusedImports"/>
-    <module name="ExecutableStatementCount">
-      <property name="tokens" value="INSTANCE_INIT,STATIC_INIT,METHOD_DEF,CTOR_DEF"/>
-    </module>
-    <module name="CyclomaticComplexity"/>
-    <module name="JavadocType">
-      <property name="scope" value="package"/>
-    </module>
-    <module name="IllegalType">
-      <property name="tokens" value="METHOD_DEF,PARAMETER_DEF,VARIABLE_DEF"/>
-    </module>
-    <module name="DefaultComesLast"/>
-    <module name="EqualsHashCode"/>
-    <module name="IllegalInstantiation"/>
-    <module name="StringLiteralEquality"/>
-    <module name="IllegalThrows"/>
-    <module name="JavadocMethod">
-      <property name="logLoadErrors" value="true"/>
-      <property name="suppressLoadErrors" value="true"/>
-    </module>
-    <module name="JavadocStyle"/>
-    <module name="AnonInnerLength"/>
-    <module name="MethodLength"/>
-    <module name="ParameterNumber"/>
-    <module name="IllegalCatch"/>
-    <module name="ModifiedControlVariable"/>
-    <module name="ParameterAssignment"/>
-    <module name="RedundantThrows">
-      <property name="logLoadErrors" value="true"/>
-      <property name="suppressLoadErrors" value="true"/>
-    </module>
-    <module name="FinalClass"/>
-    <module name="HideUtilityClassConstructor"/>
-    <module name="MutableException"/>
-    <module name="VisibilityModifier"/>
-  </module>
-  <module name="FileLength"/>
-</module>
Index: /unk/corelib/version.props
===================================================================
--- /trunk/corelib/version.props (revision 258)
+++  (revision )
@@ -1,2 +1,0 @@
-# Current version of BridgeDb
-bridgedb.version=0.9
Index: /unk/corelib/build.xml
===================================================================
--- /trunk/corelib/build.xml (revision 296)
+++  (revision )
@@ -1,100 +1,0 @@
-<?xml version="1.0"?>
-<project name="BridgeDb" default="dist" basedir=".">
-
-  <!-- always be java 1.5 compatible -->
-  <property name="ant.build.javac.target" value="1.5"/>
-  <property name="ant.build.javac.source" value="1.5"/>
-	
-  <property name="jar.name" value="../dist/bridgedb.jar"/>
-  <property name="svn.exec.svnversion" value="svnversion"/>
-  <property name="checkstyle.output.file" value="warnings.txt"/>
-  <property file="version.props"/>
-  
-  <target name="prepare">
-	<tstamp /> <!-- set ${TODAY} and ${TSTAMP} -->
-	<mkdir dir="build"/>
-	<mkdir dir="doc"/>
-	<mkdir dir="../dist"/>
-	<exec executable="${svn.exec.svnversion}" outputproperty="subversion_revision" failifexecutionfails="false">
-		<arg line="-n ."/>
-	</exec>
-	<echo file="src/org/bridgedb/BridgeDb.properties"># Version and compilation information
-REVISION=${subversion_revision}
-COMPILE_DATE=${DSTAMP} ${TSTAMP}
-# copied from version.props
-bridgedb.version=${bridgedb.version}
-	</echo>  
-  </target>
-
-  <target name="build" depends="prepare">
-	<javac srcdir="src"
-		   includes="**"
-		   debug="true"
-		   destdir="build">
-	</javac>
-    <copy file="src/org/bridgedb/webservice/biomart/util/filterconversion.txt"
-          todir="build/org/bridgedb/webservice/biomart/util" />
-  </target>
-  
-  <target name="jar" depends="build">
-	<jar jarfile="${jar.name}">
-	  <manifest>
-		<attribute name="Class-Path" value="derby.jar"/>
-	  </manifest>
-	  <fileset dir="build" includes="**/*.class"/>
-      <fileset dir="build" includes="**/*.txt"/>
-	  <fileset dir="src" includes="**/*.properties"/>
-	</jar>
-    <copy file="lib/derby.jar"
-          todir="../dist" />
-  </target>
-
-  <target name="clean">
-	<delete dir="build"/>
-	<delete dir="doc"/>
-  </target>
-
-  <target name="dist-clean" depends="clean">
-	<delete file="${jar.name}"/>
-  </target>
-
-  <target name="dist" depends="jar"/>
-
-  	<taskdef resource="checkstyletask.properties"
-			 classpath="build-lib/checkstyle-all-5.0.jar"/>
-			 
-	<target name="test" depends="build">
-		<path id="test.classpath">
-			<pathelement location="build"/>
-			<pathelement location="lib/derby.jar"/>
-			<pathelement location="build-lib/junit.jar"/>
-			<pathelement location="build-lib/measure.jar"/>
-			<pathelement location="build-lib/derbyclient.jar"/>
-		</path>
-		<javac srcdir="test" debug="true" 
-					includes="**"
-					destdir="build"
-					source="1.5">
-			<classpath refid="test.classpath"/>
-		</javac>		
-		<junit printsummary="on" haltonfailure="true" fork="true">
-			<formatter type="brief" usefile="false"/>
-			<classpath refid="test.classpath"/>
-			<batchtest>
-				<fileset dir="test">
-					<include name="**/*Test*.java"/>
-				</fileset>
-			</batchtest>
-		</junit>
-	</target>
-
-	<target name="checkstyle">
-		<checkstyle config="checks.xml">
-			<fileset dir="src">
-				<include name="**/*.java"/>
-			</fileset>
-			<formatter toFile="${checkstyle.output.file}"/>
-		</checkstyle>	
-	</target>
-
-</project>
Index: /trunk/org.bridgedb.webservice.picr/test/org/bridgedb/webservice/picr/Test.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/test/org/bridgedb/webservice/picr/Test.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/test/org/bridgedb/webservice/picr/Test.java (revision 308)
@@ -0,0 +1,74 @@
+// BridgeDb,
+// An abstraction layer for identifer mapping services, both local and online.
+// Copyright 2006-2009 BridgeDb developers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+package org.bridgedb.webservice.picr;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.bridgedb.AttributeMapper;
+import org.bridgedb.BridgeDb;
+import org.bridgedb.DataSource;
+import org.bridgedb.IDMapper;
+import org.bridgedb.IDMapperException;
+import org.bridgedb.Xref;
+
+public class Test extends TestCase
+{
+	public void setUp() throws ClassNotFoundException
+	{
+		Class.forName ("org.bridgedb.webservice.picr.IDMapperPicr");
+	}
+	
+	public void test() throws IDMapperException
+	{
+		IDMapper idmap = BridgeDb.connect ("idmapper-picr:");
+		AttributeMapper amap = (AttributeMapper)idmap;
+		
+		Set<DataSource> dslist = idmap.getCapabilities().getSupportedTgtDataSources();
+		
+		final DataSource SGD = DataSource.getByFullName("SGD");
+		final DataSource PDB  = DataSource.getByFullName("PDB");
+		final DataSource ENSEMBL_YEAST = DataSource.getByFullName("ENSEMBL_S_CEREVISIAE");
+		assertTrue (dslist.contains(SGD));
+		assertTrue (dslist.contains(PDB));
+		assertTrue (dslist.contains(ENSEMBL_YEAST));
+		
+		Xref src1 = new Xref ("YER095W", ENSEMBL_YEAST);
+		for (DataSource ds : dslist) System.out.println (ds.getFullName());
+		
+		Set<Xref> srcRefs = new HashSet<Xref>();
+		srcRefs.add (src1);
+		DataSource[] targets = new DataSource[] { SGD, PDB, ENSEMBL_YEAST }; 
+		Map<Xref, Set<Xref>> result = idmap.mapID(srcRefs, targets);
+		
+		/*
+		This list is expected:
+		RAD51 SGD
+		YER095W SGD
+		YER095W ENSEMBL_S_CEREVISIAE
+		1SZP PDB
+		S000000897 SGD
+		*/
+		for (Xref ref : result.get(src1)) System.out.println (ref.getId() + " "  + ref.getDataSource().getFullName());
+
+		System.out.println (amap.getAttributes(src1, "Sequence").iterator().next());
+	}
+		
+}
Index: /trunk/org.bridgedb.webservice.picr/test/org/bridgedb/webservice/picr/TestRest.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/test/org/bridgedb/webservice/picr/TestRest.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/test/org/bridgedb/webservice/picr/TestRest.java (revision 308)
@@ -0,0 +1,82 @@
+// BridgeDb,
+// An abstraction layer for identifer mapping services, both local and online.
+// Copyright 2006-2009 BridgeDb developers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+package org.bridgedb.webservice.picr;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.bridgedb.BridgeDb;
+import org.bridgedb.DataSource;
+import org.bridgedb.IDMapper;
+import org.bridgedb.IDMapperException;
+import org.bridgedb.Xref;
+
+import junit.framework.TestCase;
+
+public class TestRest extends TestCase 
+{
+	boolean eventReceived = false;
+	
+	public void setUp() throws ClassNotFoundException
+	{
+		Class.forName ("org.bridgedb.webservice.picr.IDMapperPicrRest");
+	}
+
+        public void testDataSources() throws IDMapperException {
+            IDMapperPicrRest idMapper = new IDMapperPicrRest(true);
+            System.out.println(idMapper.getCapabilities().getSupportedSrcDataSources().toString());
+        }
+	
+	public void test() throws IDMapperException
+	{
+		IDMapper idmap = BridgeDb.connect ("idmapper-picr-rest:");
+		
+		Set<DataSource> dslist = idmap.getCapabilities().getSupportedTgtDataSources();
+
+		final DataSource SGD = DataSource.getByFullName("SGD");
+		final DataSource PDB  = DataSource.getByFullName("PDB");
+		final DataSource ENSEMBL_YEAST = DataSource.getByFullName("ENSEMBL_S_CEREVISIAE");
+		assertTrue (dslist.contains(SGD));
+		assertTrue (dslist.contains(PDB));
+		assertTrue (dslist.contains(ENSEMBL_YEAST));
+
+		Xref src1 = new Xref ("YER095W", ENSEMBL_YEAST);
+		for (DataSource ds : dslist) System.out.println (ds.getFullName());
+
+                assertTrue(idmap.xrefExists(src1));
+
+		Set<Xref> srcRefs = new HashSet<Xref>();
+		srcRefs.add (src1);
+		DataSource[] targets = new DataSource[] { SGD, PDB, ENSEMBL_YEAST };
+		//TODO: disabled while mapID is not yet implemented.
+//		Map<Xref, Set<Xref>> result = idmap.mapID(srcRefs, targets);
+
+		/*
+		This list is expected:
+		RAD51 SGD
+		YER095W SGD
+		YER095W ENSEMBL_S_CEREVISIAE
+		1SZP PDB
+		S000000897 SGD
+		*/
+//		for (Xref ref : result.get(src1))
+//                    System.out.println (ref.getId() + " "  + ref.getDataSource().getFullName());
+
+	}
+	
+}
Index: /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetMappedDatabaseNames.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetMappedDatabaseNames.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetMappedDatabaseNames.java (revision 308)
@@ -0,0 +1,34 @@
+
+package uk.ac.ebi.demo.picr.soap;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "")
+@XmlRootElement(name = "getMappedDatabaseNames")
+public class GetMappedDatabaseNames {
+
+
+}
Index: /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/package-info.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/package-info.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/package-info.java (revision 308)
@@ -0,0 +1,2 @@
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package uk.ac.ebi.demo.picr.soap;
Index: /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/UPEntry.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/UPEntry.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/UPEntry.java (revision 308)
@@ -0,0 +1,215 @@
+
+package uk.ac.ebi.demo.picr.soap;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+/**
+ * <p>Java class for UPEntry complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="UPEntry">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="CRC64" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="UPI" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="identicalCrossReferences" type="{http://model.picr.ebi.ac.uk}CrossReference" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="logicalCrossReferences" type="{http://model.picr.ebi.ac.uk}CrossReference" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="sequence" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="timestamp" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "UPEntry", namespace = "http://model.picr.ebi.ac.uk", propOrder = {
+    "crc64",
+    "upi",
+    "identicalCrossReferences",
+    "logicalCrossReferences",
+    "sequence",
+    "timestamp"
+})
+public class UPEntry {
+
+    @XmlElement(name = "CRC64", namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
+    protected String crc64;
+    @XmlElement(name = "UPI", namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
+    protected String upi;
+    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", nillable = true)
+    protected List<CrossReference> identicalCrossReferences;
+    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", nillable = true)
+    protected List<CrossReference> logicalCrossReferences;
+    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
+    protected String sequence;
+    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
+    protected XMLGregorianCalendar timestamp;
+
+    /**
+     * Gets the value of the crc64 property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getCRC64() {
+        return crc64;
+    }
+
+    /**
+     * Sets the value of the crc64 property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setCRC64(String value) {
+        this.crc64 = value;
+    }
+
+    /**
+     * Gets the value of the upi property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getUPI() {
+        return upi;
+    }
+
+    /**
+     * Sets the value of the upi property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setUPI(String value) {
+        this.upi = value;
+    }
+
+    /**
+     * Gets the value of the identicalCrossReferences property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the identicalCrossReferences property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getIdenticalCrossReferences().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link CrossReference }
+     * 
+     * 
+     */
+    public List<CrossReference> getIdenticalCrossReferences() {
+        if (identicalCrossReferences == null) {
+            identicalCrossReferences = new ArrayList<CrossReference>();
+        }
+        return this.identicalCrossReferences;
+    }
+
+    /**
+     * Gets the value of the logicalCrossReferences property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the logicalCrossReferences property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getLogicalCrossReferences().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link CrossReference }
+     * 
+     * 
+     */
+    public List<CrossReference> getLogicalCrossReferences() {
+        if (logicalCrossReferences == null) {
+            logicalCrossReferences = new ArrayList<CrossReference>();
+        }
+        return this.logicalCrossReferences;
+    }
+
+    /**
+     * Gets the value of the sequence property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getSequence() {
+        return sequence;
+    }
+
+    /**
+     * Sets the value of the sequence property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setSequence(String value) {
+        this.sequence = value;
+    }
+
+    /**
+     * Gets the value of the timestamp property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public XMLGregorianCalendar getTimestamp() {
+        return timestamp;
+    }
+
+    /**
+     * Sets the value of the timestamp property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public void setTimestamp(XMLGregorianCalendar value) {
+        this.timestamp = value;
+    }
+
+}
Index: /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/CrossReference.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/CrossReference.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/CrossReference.java (revision 308)
@@ -0,0 +1,279 @@
+
+package uk.ac.ebi.demo.picr.soap;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+/**
+ * <p>Java class for CrossReference complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="CrossReference">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="accession" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="accessionVersion" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="databaseDescription" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="databaseName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="dateAdded" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
+ *         &lt;element name="dateDeleted" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
+ *         &lt;element name="deleted" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         &lt;element name="gi" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="taxonId" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "CrossReference", namespace = "http://model.picr.ebi.ac.uk", propOrder = {
+    "accession",
+    "accessionVersion",
+    "databaseDescription",
+    "databaseName",
+    "dateAdded",
+    "dateDeleted",
+    "deleted",
+    "gi",
+    "taxonId"
+})
+public class CrossReference {
+
+    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
+    protected String accession;
+    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
+    protected String accessionVersion;
+    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
+    protected String databaseDescription;
+    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
+    protected String databaseName;
+    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
+    protected XMLGregorianCalendar dateAdded;
+    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
+    protected XMLGregorianCalendar dateDeleted;
+    @XmlElement(namespace = "http://model.picr.ebi.ac.uk")
+    protected boolean deleted;
+    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
+    protected String gi;
+    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
+    protected String taxonId;
+
+    /**
+     * Gets the value of the accession property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getAccession() {
+        return accession;
+    }
+
+    /**
+     * Sets the value of the accession property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setAccession(String value) {
+        this.accession = value;
+    }
+
+    /**
+     * Gets the value of the accessionVersion property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getAccessionVersion() {
+        return accessionVersion;
+    }
+
+    /**
+     * Sets the value of the accessionVersion property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setAccessionVersion(String value) {
+        this.accessionVersion = value;
+    }
+
+    /**
+     * Gets the value of the databaseDescription property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDatabaseDescription() {
+        return databaseDescription;
+    }
+
+    /**
+     * Sets the value of the databaseDescription property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDatabaseDescription(String value) {
+        this.databaseDescription = value;
+    }
+
+    /**
+     * Gets the value of the databaseName property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDatabaseName() {
+        return databaseName;
+    }
+
+    /**
+     * Sets the value of the databaseName property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDatabaseName(String value) {
+        this.databaseName = value;
+    }
+
+    /**
+     * Gets the value of the dateAdded property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public XMLGregorianCalendar getDateAdded() {
+        return dateAdded;
+    }
+
+    /**
+     * Sets the value of the dateAdded property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public void setDateAdded(XMLGregorianCalendar value) {
+        this.dateAdded = value;
+    }
+
+    /**
+     * Gets the value of the dateDeleted property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public XMLGregorianCalendar getDateDeleted() {
+        return dateDeleted;
+    }
+
+    /**
+     * Sets the value of the dateDeleted property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public void setDateDeleted(XMLGregorianCalendar value) {
+        this.dateDeleted = value;
+    }
+
+    /**
+     * Gets the value of the deleted property.
+     * 
+     */
+    public boolean isDeleted() {
+        return deleted;
+    }
+
+    /**
+     * Sets the value of the deleted property.
+     * 
+     */
+    public void setDeleted(boolean value) {
+        this.deleted = value;
+    }
+
+    /**
+     * Gets the value of the gi property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getGi() {
+        return gi;
+    }
+
+    /**
+     * Sets the value of the gi property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setGi(String value) {
+        this.gi = value;
+    }
+
+    /**
+     * Gets the value of the taxonId property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getTaxonId() {
+        return taxonId;
+    }
+
+    /**
+     * Sets the value of the taxonId property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setTaxonId(String value) {
+        this.taxonId = value;
+    }
+
+}
Index: /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForAccessionResponse.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForAccessionResponse.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForAccessionResponse.java (revision 308)
@@ -0,0 +1,71 @@
+
+package uk.ac.ebi.demo.picr.soap;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="getUPIForAccessionReturn" type="{http://model.picr.ebi.ac.uk}UPEntry" maxOccurs="unbounded"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "getUPIForAccessionReturn"
+})
+@XmlRootElement(name = "getUPIForAccessionResponse")
+public class GetUPIForAccessionResponse {
+
+    @XmlElement(required = true)
+    protected List<UPEntry> getUPIForAccessionReturn;
+
+    /**
+     * Gets the value of the getUPIForAccessionReturn property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the getUPIForAccessionReturn property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getGetUPIForAccessionReturn().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link UPEntry }
+     * 
+     * 
+     */
+    public List<UPEntry> getGetUPIForAccessionReturn() {
+        if (getUPIForAccessionReturn == null) {
+            getUPIForAccessionReturn = new ArrayList<UPEntry>();
+        }
+        return this.getUPIForAccessionReturn;
+    }
+
+}
Index: /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForAccession.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForAccession.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForAccession.java (revision 308)
@@ -0,0 +1,174 @@
+
+package uk.ac.ebi.demo.picr.soap;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="accession" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="ac_version" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="searchDatabases" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+ *         &lt;element name="taxonId" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="onlyActive" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "accession",
+    "acVersion",
+    "searchDatabases",
+    "taxonId",
+    "onlyActive"
+})
+@XmlRootElement(name = "getUPIForAccession")
+public class GetUPIForAccession {
+
+    @XmlElement(required = true)
+    protected String accession;
+    @XmlElement(name = "ac_version", required = true)
+    protected String acVersion;
+    @XmlElement(required = true)
+    protected List<String> searchDatabases;
+    @XmlElement(required = true)
+    protected String taxonId;
+    protected boolean onlyActive;
+
+    /**
+     * Gets the value of the accession property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getAccession() {
+        return accession;
+    }
+
+    /**
+     * Sets the value of the accession property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setAccession(String value) {
+        this.accession = value;
+    }
+
+    /**
+     * Gets the value of the acVersion property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getAcVersion() {
+        return acVersion;
+    }
+
+    /**
+     * Sets the value of the acVersion property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setAcVersion(String value) {
+        this.acVersion = value;
+    }
+
+    /**
+     * Gets the value of the searchDatabases property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the searchDatabases property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getSearchDatabases().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getSearchDatabases() {
+        if (searchDatabases == null) {
+            searchDatabases = new ArrayList<String>();
+        }
+        return this.searchDatabases;
+    }
+
+    /**
+     * Gets the value of the taxonId property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getTaxonId() {
+        return taxonId;
+    }
+
+    /**
+     * Sets the value of the taxonId property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setTaxonId(String value) {
+        this.taxonId = value;
+    }
+
+    /**
+     * Gets the value of the onlyActive property.
+     * 
+     */
+    public boolean isOnlyActive() {
+        return onlyActive;
+    }
+
+    /**
+     * Sets the value of the onlyActive property.
+     * 
+     */
+    public void setOnlyActive(boolean value) {
+        this.onlyActive = value;
+    }
+
+}
Index: /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForSequenceResponse.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForSequenceResponse.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForSequenceResponse.java (revision 308)
@@ -0,0 +1,64 @@
+
+package uk.ac.ebi.demo.picr.soap;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="getUPIForSequenceReturn" type="{http://model.picr.ebi.ac.uk}UPEntry"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "getUPIForSequenceReturn"
+})
+@XmlRootElement(name = "getUPIForSequenceResponse")
+public class GetUPIForSequenceResponse {
+
+    @XmlElement(required = true)
+    protected UPEntry getUPIForSequenceReturn;
+
+    /**
+     * Gets the value of the getUPIForSequenceReturn property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link UPEntry }
+     *     
+     */
+    public UPEntry getGetUPIForSequenceReturn() {
+        return getUPIForSequenceReturn;
+    }
+
+    /**
+     * Sets the value of the getUPIForSequenceReturn property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link UPEntry }
+     *     
+     */
+    public void setGetUPIForSequenceReturn(UPEntry value) {
+        this.getUPIForSequenceReturn = value;
+    }
+
+}
Index: /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/AccessionMapperInterface.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/AccessionMapperInterface.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/AccessionMapperInterface.java (revision 308)
@@ -0,0 +1,87 @@
+
+package uk.ac.ebi.demo.picr.soap;
+
+import java.util.List;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.1-02/02/2007 09:55 AM(vivekp)-FCS
+ * Generated source version: 2.1
+ * 
+ */
+@WebService(name = "AccessionMapperInterface", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
+@XmlSeeAlso({
+    ObjectFactory.class
+})
+public interface AccessionMapperInterface {
+
+
+    /**
+     * 
+     * @param searchDatabases
+     * @param taxonId
+     * @param onlyActive
+     * @param sequence
+     * @return
+     *     returns uk.ac.ebi.demo.picr.soap.UPEntry
+     */
+    @WebMethod(action = "getUPIForSequence")
+    @WebResult(name = "getUPIForSequenceReturn", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
+    @RequestWrapper(localName = "getUPIForSequence", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", className = "uk.ac.ebi.demo.picr.soap.GetUPIForSequence")
+    @ResponseWrapper(localName = "getUPIForSequenceResponse", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", className = "uk.ac.ebi.demo.picr.soap.GetUPIForSequenceResponse")
+    public UPEntry getUPIForSequence(
+        @WebParam(name = "sequence", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
+        String sequence,
+        @WebParam(name = "searchDatabases", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
+        List<String> searchDatabases,
+        @WebParam(name = "taxonId", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
+        String taxonId,
+        @WebParam(name = "onlyActive", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
+        boolean onlyActive);
+
+    /**
+     * 
+     * @param accession
+     * @param searchDatabases
+     * @param taxonId
+     * @param acVersion
+     * @param onlyActive
+     * @return
+     *     returns java.util.List<uk.ac.ebi.demo.picr.soap.UPEntry>
+     */
+    @WebMethod(action = "getUPIForAccession")
+    @WebResult(name = "getUPIForAccessionReturn", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
+    @RequestWrapper(localName = "getUPIForAccession", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", className = "uk.ac.ebi.demo.picr.soap.GetUPIForAccession")
+    @ResponseWrapper(localName = "getUPIForAccessionResponse", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", className = "uk.ac.ebi.demo.picr.soap.GetUPIForAccessionResponse")
+    public List<UPEntry> getUPIForAccession(
+        @WebParam(name = "accession", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
+        String accession,
+        @WebParam(name = "ac_version", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
+        String acVersion,
+        @WebParam(name = "searchDatabases", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
+        List<String> searchDatabases,
+        @WebParam(name = "taxonId", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
+        String taxonId,
+        @WebParam(name = "onlyActive", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
+        boolean onlyActive);
+
+    /**
+     * 
+     * @return
+     *     returns java.util.List<java.lang.String>
+     */
+    @WebMethod(action = "getMappedDatabaseNames")
+    @WebResult(name = "mappedDatabases", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
+    @RequestWrapper(localName = "getMappedDatabaseNames", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", className = "uk.ac.ebi.demo.picr.soap.GetMappedDatabaseNames")
+    @ResponseWrapper(localName = "getMappedDatabaseNamesResponse", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", className = "uk.ac.ebi.demo.picr.soap.GetMappedDatabaseNamesResponse")
+    public List<String> getMappedDatabaseNames();
+
+}
Index: /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/AccessionMapperService.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/AccessionMapperService.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/AccessionMapperService.java (revision 308)
@@ -0,0 +1,66 @@
+
+package uk.ac.ebi.demo.picr.soap;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceFeature;
+
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.1-02/02/2007 09:55 AM(vivekp)-FCS
+ * Generated source version: 2.1
+ * 
+ */
+@WebServiceClient(name = "AccessionMapperService", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", wsdlLocation = "http://www.ebi.ac.uk/Tools/picr/service?wsdl")
+public class AccessionMapperService
+    extends Service
+{
+
+    private final static URL ACCESSIONMAPPERSERVICE_WSDL_LOCATION;
+
+    static {
+        URL url = null;
+        try {
+            url = new URL("http://www.ebi.ac.uk/Tools/picr/service?wsdl");
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        }
+        ACCESSIONMAPPERSERVICE_WSDL_LOCATION = url;
+    }
+
+    public AccessionMapperService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public AccessionMapperService() {
+        super(ACCESSIONMAPPERSERVICE_WSDL_LOCATION, new QName("http://www.ebi.ac.uk/picr/AccessionMappingService", "AccessionMapperService"));
+    }
+
+    /**
+     * 
+     * @return
+     *     returns AccessionMapperInterface
+     */
+    @WebEndpoint(name = "AccessionMapperPort")
+    public AccessionMapperInterface getAccessionMapperPort() {
+        return (AccessionMapperInterface)super.getPort(new QName("http://www.ebi.ac.uk/picr/AccessionMappingService", "AccessionMapperPort"), AccessionMapperInterface.class);
+    }
+
+    /**
+     * 
+     * @param features
+     *     A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.
+     * @return
+     *     returns AccessionMapperInterface
+     */
+    @WebEndpoint(name = "AccessionMapperPort")
+    public AccessionMapperInterface getAccessionMapperPort(WebServiceFeature... features) {
+        return (AccessionMapperInterface)super.getPort(new QName("http://www.ebi.ac.uk/picr/AccessionMappingService", "AccessionMapperPort"), AccessionMapperInterface.class, features);
+    }
+
+}
Index: /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForSequence.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForSequence.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForSequence.java (revision 308)
@@ -0,0 +1,146 @@
+
+package uk.ac.ebi.demo.picr.soap;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="sequence" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="searchDatabases" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+ *         &lt;element name="taxonId" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="onlyActive" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "sequence",
+    "searchDatabases",
+    "taxonId",
+    "onlyActive"
+})
+@XmlRootElement(name = "getUPIForSequence")
+public class GetUPIForSequence {
+
+    @XmlElement(required = true)
+    protected String sequence;
+    @XmlElement(required = true)
+    protected List<String> searchDatabases;
+    @XmlElement(required = true)
+    protected String taxonId;
+    protected boolean onlyActive;
+
+    /**
+     * Gets the value of the sequence property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getSequence() {
+        return sequence;
+    }
+
+    /**
+     * Sets the value of the sequence property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setSequence(String value) {
+        this.sequence = value;
+    }
+
+    /**
+     * Gets the value of the searchDatabases property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the searchDatabases property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getSearchDatabases().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getSearchDatabases() {
+        if (searchDatabases == null) {
+            searchDatabases = new ArrayList<String>();
+        }
+        return this.searchDatabases;
+    }
+
+    /**
+     * Gets the value of the taxonId property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getTaxonId() {
+        return taxonId;
+    }
+
+    /**
+     * Sets the value of the taxonId property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setTaxonId(String value) {
+        this.taxonId = value;
+    }
+
+    /**
+     * Gets the value of the onlyActive property.
+     * 
+     */
+    public boolean isOnlyActive() {
+        return onlyActive;
+    }
+
+    /**
+     * Sets the value of the onlyActive property.
+     * 
+     */
+    public void setOnlyActive(boolean value) {
+        this.onlyActive = value;
+    }
+
+}
Index: /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetMappedDatabaseNamesResponse.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetMappedDatabaseNamesResponse.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/GetMappedDatabaseNamesResponse.java (revision 308)
@@ -0,0 +1,71 @@
+
+package uk.ac.ebi.demo.picr.soap;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="mappedDatabases" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "mappedDatabases"
+})
+@XmlRootElement(name = "getMappedDatabaseNamesResponse")
+public class GetMappedDatabaseNamesResponse {
+
+    @XmlElement(required = true)
+    protected List<String> mappedDatabases;
+
+    /**
+     * Gets the value of the mappedDatabases property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the mappedDatabases property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getMappedDatabases().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getMappedDatabases() {
+        if (mappedDatabases == null) {
+            mappedDatabases = new ArrayList<String>();
+        }
+        return this.mappedDatabases;
+    }
+
+}
Index: /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/ObjectFactory.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/ObjectFactory.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/soap/ObjectFactory.java (revision 308)
@@ -0,0 +1,96 @@
+
+package uk.ac.ebi.demo.picr.soap;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the uk.ac.ebi.demo.picr.soap package. 
+ * <p>An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: uk.ac.ebi.demo.picr.soap
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link GetUPIForSequence }
+     * 
+     */
+    public GetUPIForSequence createGetUPIForSequence() {
+        return new GetUPIForSequence();
+    }
+
+    /**
+     * Create an instance of {@link GetUPIForAccession }
+     * 
+     */
+    public GetUPIForAccession createGetUPIForAccession() {
+        return new GetUPIForAccession();
+    }
+
+    /**
+     * Create an instance of {@link GetUPIForSequenceResponse }
+     * 
+     */
+    public GetUPIForSequenceResponse createGetUPIForSequenceResponse() {
+        return new GetUPIForSequenceResponse();
+    }
+
+    /**
+     * Create an instance of {@link GetUPIForAccessionResponse }
+     * 
+     */
+    public GetUPIForAccessionResponse createGetUPIForAccessionResponse() {
+        return new GetUPIForAccessionResponse();
+    }
+
+    /**
+     * Create an instance of {@link GetMappedDatabaseNames }
+     * 
+     */
+    public GetMappedDatabaseNames createGetMappedDatabaseNames() {
+        return new GetMappedDatabaseNames();
+    }
+
+    /**
+     * Create an instance of {@link CrossReference }
+     * 
+     */
+    public CrossReference createCrossReference() {
+        return new CrossReference();
+    }
+
+    /**
+     * Create an instance of {@link UPEntry }
+     * 
+     */
+    public UPEntry createUPEntry() {
+        return new UPEntry();
+    }
+
+    /**
+     * Create an instance of {@link GetMappedDatabaseNamesResponse }
+     * 
+     */
+    public GetMappedDatabaseNamesResponse createGetMappedDatabaseNamesResponse() {
+        return new GetMappedDatabaseNamesResponse();
+    }
+
+}
Index: /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/swing/PICRAccessionDemo.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/swing/PICRAccessionDemo.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/swing/PICRAccessionDemo.java (revision 308)
@@ -0,0 +1,238 @@
+package uk.ac.ebi.demo.picr.swing;
+
+import uk.ac.ebi.demo.picr.business.PICRClient;
+import uk.ac.ebi.demo.picr.soap.UPEntry;
+import uk.ac.ebi.demo.picr.soap.CrossReference;
+
+import javax.swing.*;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.table.DefaultTableModel;
+import javax.xml.ws.soap.SOAPFaultException;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+
+/**
+ *    Copyright 2007 - European Bioinformatics Institute
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ *
+ * User: rcote
+ * Date: 17-May-2007
+ * Time: 10:37:54
+ * $Id: $
+ */
+public class PICRAccessionDemo extends JPanel {
+
+    //class that will do the communication with the webservice
+    private PICRClient client = new PICRClient();
+
+    public PICRAccessionDemo() {
+
+        //set general layout
+        setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
+
+        add(Box.createVerticalStrut(5));
+
+        //create components
+        JPanel row1 = new JPanel();
+        row1.setLayout(new BoxLayout(row1, BoxLayout.X_AXIS));
+        row1.add(Box.createHorizontalStrut(5));
+        row1.setBorder(BorderFactory.createTitledBorder(""));
+        row1.add(new JLabel("Accession:"));
+        row1.add(Box.createHorizontalStrut(10));
+        final JTextField accessionField = new JTextField(10);
+        accessionField.setMaximumSize(accessionField.getPreferredSize());
+        row1.add(Box.createHorizontalStrut(10));
+
+        row1.add(accessionField);
+        row1.add(Box.createHorizontalGlue());
+
+        JPanel row2 = new JPanel(new FlowLayout(FlowLayout.LEFT));
+        row2.setBorder(BorderFactory.createTitledBorder("Target Databases"));
+        final JList databaseList = new JList();
+        JScrollPane listScroller = new JScrollPane(databaseList);
+        listScroller.setMaximumSize(new Dimension(100, 10));
+        JButton loadDBButton = new JButton("Load Databases");
+        row2.add(listScroller);
+        row2.add(loadDBButton);
+
+        JPanel row3 = new JPanel(new FlowLayout(FlowLayout.LEFT));
+        JCheckBox onlyActiveCheckBox = new JCheckBox("Only Active");
+        onlyActiveCheckBox.setSelected(true);
+        row3.add(new JLabel("Options:  "));
+        row3.add(onlyActiveCheckBox);
+
+        add(row1);
+        add(row2);
+        add(row3);
+
+        final String[] columns = new String[]{"Database", "Accession", "Version", "Taxon ID"};
+        final JTable dataTable = new JTable(new Object[0][0], columns);
+        dataTable.setShowGrid(true);
+        add(new JScrollPane(dataTable));
+
+        JPanel buttonPanel = new JPanel();
+        JButton mapAccessionButton = new JButton("Generate Mapping!");
+        buttonPanel.add(mapAccessionButton);
+        add(buttonPanel);
+
+        //create listeners!
+
+        //clear previous accession on focus
+        accessionField.addFocusListener(new FocusListener() {
+            public void focusGained(FocusEvent e) {
+                accessionField.setText("");
+            }
+
+            public void focusLost(FocusEvent e) {
+            }
+        });
+
+        //update boolean flag in communication class
+        onlyActiveCheckBox.addChangeListener(new ChangeListener() {
+            public void stateChanged(ChangeEvent e) {
+                client.setOnlyActive(((JCheckBox) e.getSource()).isSelected());
+            }
+        });
+
+        //performs mapping call and updates interface with results
+        mapAccessionButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+
+                try {
+
+                    if (!"".equals(accessionField.getText())) {
+
+                        java.util.List<UPEntry> entries = client.performAccessionMapping(accessionField.getText(), databaseList.getSelectedValues());
+
+                        //compute size of arary
+                        if (entries != null) {
+                            int size = 0;
+                            for (UPEntry entry : entries) {
+                                for (CrossReference xref : entry.getIdenticalCrossReferences()) {
+                                    size++;
+                                }
+                                for (CrossReference xref : entry.getLogicalCrossReferences()) {
+                                    size++;
+                                }
+                            }
+
+                            if (size > 0) {
+
+                                final Object[][] data = new Object[size][4];
+                                int i = 0;
+                                for (UPEntry entry : entries) {
+                                    for (CrossReference xref : entry.getIdenticalCrossReferences()) {
+                                        data[i][0] = xref.getDatabaseName();
+                                        data[i][1] = xref.getAccession();
+                                        data[i][2] = xref.getAccessionVersion();
+                                        data[i][3] = xref.getTaxonId();
+                                        i++;
+                                    }
+                                    for (CrossReference xref : entry.getLogicalCrossReferences()) {
+                                        data[i][0] = xref.getDatabaseName();
+                                        data[i][1] = xref.getAccession();
+                                        data[i][2] = xref.getAccessionVersion();
+                                        data[i][3] = xref.getTaxonId();
+                                        i++;
+                                    }
+                                }
+
+                                //refresh
+                                DefaultTableModel dataModel = new DefaultTableModel();
+                                dataModel.setDataVector(data, columns);
+                                dataTable.setModel(dataModel);
+
+                                System.out.println("update done");
+
+                            } else {
+                                JOptionPane.showMessageDialog(null, "No Mappind data found.");
+                            }
+                        } else {
+                            JOptionPane.showMessageDialog(null, "No Mappind data found.");
+                        }
+                    } else {
+                        JOptionPane.showMessageDialog(null, "You must enter an accession to map.");
+                    }
+                } catch (SOAPFaultException soapEx) {
+                    JOptionPane.showMessageDialog(null, "A SOAP Error occurred.");
+                    soapEx.printStackTrace();
+                }
+            }
+        });
+
+        //loads list of mapping databases from communication class
+        loadDBButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+
+                try {
+
+                    java.util.List<String> databases = client.loadDatabases();
+                    if (databases != null && databases.size() > 0) {
+
+                        databaseList.setListData(databases.toArray());
+                        System.out.println("database refresh done");
+
+                    } else {
+                        JOptionPane.showMessageDialog(null, "No Databases Loaded!.");
+                    }
+
+                } catch (SOAPFaultException soapEx) {
+                    JOptionPane.showMessageDialog(null, "A SOAP Error occurred.");
+                    soapEx.printStackTrace();
+                }
+            }
+        });
+
+
+    }
+
+
+    public static void main(String[] args) {
+
+        //Schedule a job for the event-dispatching thread:
+        //creating and showing this application's GUI.
+        javax.swing.SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+
+    }
+
+    /**
+     * Create the GUI and show it.  For thread safety,
+     * this method should be invoked from the
+     * event-dispatching thread.
+     */
+    private static void createAndShowGUI() {
+        //Create and set up the window.
+        JFrame frame = new JFrame("Map By Accession Demo");
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+
+        //Create and set up the content pane.
+        JComponent newContentPane = new PICRAccessionDemo();
+        newContentPane.setOpaque(true); //content panes must be opaque
+        frame.setContentPane(newContentPane);
+
+        //Display the window.
+        frame.pack();
+        frame.setVisible(true);
+    }
+
+
+}
Index: /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/swing/PICRSequenceDemo.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/swing/PICRSequenceDemo.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/swing/PICRSequenceDemo.java (revision 308)
@@ -0,0 +1,223 @@
+package uk.ac.ebi.demo.picr.swing;
+
+import uk.ac.ebi.demo.picr.business.PICRClient;
+import uk.ac.ebi.demo.picr.soap.UPEntry;
+import uk.ac.ebi.demo.picr.soap.CrossReference;
+
+import javax.swing.*;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.table.DefaultTableModel;
+import javax.xml.ws.soap.SOAPFaultException;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+/**
+ *    Copyright 2007 - European Bioinformatics Institute
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ *
+ * User: rcote
+ * Date: 17-May-2007
+ * Time: 10:37:54
+ * $Id: $
+ */
+public class PICRSequenceDemo extends JPanel {
+
+    //class that will do the communication with the webservice
+    private PICRClient client = new PICRClient();
+
+    public PICRSequenceDemo() {
+
+        //set general layout
+        setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
+
+        add(Box.createVerticalStrut(5));
+
+        //create components
+        JPanel row1 = new JPanel();
+        row1.setLayout(new BoxLayout(row1, BoxLayout.X_AXIS));
+        row1.add(Box.createHorizontalStrut(5));
+        row1.setBorder(BorderFactory.createTitledBorder(""));
+        row1.add(new JLabel("Sequence:"));
+        row1.add(Box.createHorizontalStrut(10));
+        final JTextArea sequenceArea = new JTextArea(5, 40);
+        sequenceArea.setMaximumSize(sequenceArea.getPreferredSize());
+        row1.add(Box.createHorizontalStrut(10));
+
+        row1.add(sequenceArea);
+        row1.add(Box.createHorizontalGlue());
+
+        JPanel row2 = new JPanel(new FlowLayout(FlowLayout.LEFT));
+        row2.setBorder(BorderFactory.createTitledBorder("Target Databases"));
+        final JList databaseList = new JList();
+        JScrollPane listScroller = new JScrollPane(databaseList);
+        listScroller.setMaximumSize(new Dimension(100, 10));
+        JButton loadDBButton = new JButton("Load Databases");
+        row2.add(listScroller);
+        row2.add(loadDBButton);
+
+        JPanel row3 = new JPanel(new FlowLayout(FlowLayout.LEFT));
+        JCheckBox onlyActiveCheckBox = new JCheckBox("Only Active");
+        onlyActiveCheckBox.setSelected(true);
+        row3.add(new JLabel("Options:  "));
+        row3.add(onlyActiveCheckBox);
+
+        add(row1);
+        add(row2);
+        add(row3);
+
+        final String[] columns = new String[]{"Database", "Accession", "Version", "Taxon ID"};
+        final JTable dataTable = new JTable(new Object[0][0], columns);
+        dataTable.setShowGrid(true);
+        add(new JScrollPane(dataTable));
+
+        JPanel buttonPanel = new JPanel();
+        JButton mapAccessionButton = new JButton("Generate Mapping!");
+        buttonPanel.add(mapAccessionButton);
+        add(buttonPanel);
+
+        //create listeners!
+
+        //update boolean flag in communication class
+        onlyActiveCheckBox.addChangeListener(new ChangeListener() {
+            public void stateChanged(ChangeEvent e) {
+                client.setOnlyActive(((JCheckBox) e.getSource()).isSelected());
+            }
+        });
+
+        //performs mapping call and updates interface with results
+        mapAccessionButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+
+                try {
+
+                    if (!"".equals(sequenceArea.getText())) {
+
+                        java.util.List<UPEntry> entries = client.performSequenceMapping(sequenceArea.getText(), databaseList.getSelectedValues());
+
+                        //compute size of arary
+                        if (entries != null) {
+                            int size = 0;
+                            for (UPEntry entry : entries) {
+                                for (CrossReference xref : entry.getIdenticalCrossReferences()) {
+                                    size++;
+                                }
+                                for (CrossReference xref : entry.getLogicalCrossReferences()) {
+                                    size++;
+                                }
+                            }
+
+                            if (size > 0) {
+
+                                final Object[][] data = new Object[size][4];
+                                int i = 0;
+                                for (UPEntry entry : entries) {
+                                    for (CrossReference xref : entry.getIdenticalCrossReferences()) {
+                                        data[i][0] = xref.getDatabaseName();
+                                        data[i][1] = xref.getAccession();
+                                        data[i][2] = xref.getAccessionVersion();
+                                        data[i][3] = xref.getTaxonId();
+                                        i++;
+                                    }
+                                    for (CrossReference xref : entry.getLogicalCrossReferences()) {
+                                        data[i][0] = xref.getDatabaseName();
+                                        data[i][1] = xref.getAccession();
+                                        data[i][2] = xref.getAccessionVersion();
+                                        data[i][3] = xref.getTaxonId();
+                                        i++;
+                                    }
+                                }
+
+                                //refresh
+                                DefaultTableModel dataModel = new DefaultTableModel();
+                                dataModel.setDataVector(data, columns);
+                                dataTable.setModel(dataModel);
+
+                                System.out.println("update done");
+
+                            } else {
+                                JOptionPane.showMessageDialog(null, "No Mappind data found.");
+                            }
+                        } else {
+                            JOptionPane.showMessageDialog(null, "No Mappind data found.");
+                        }
+                    } else {
+                        JOptionPane.showMessageDialog(null, "You must enter a valid FASTA sequence to map.");
+                    }
+                } catch (SOAPFaultException soapEx) {
+                    JOptionPane.showMessageDialog(null, "A SOAP Error occurred.");
+                    soapEx.printStackTrace();
+                }
+            }
+        });
+
+        //loads list of mapping databases from communication class
+        loadDBButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+
+                try {
+
+                    java.util.List<String> databases = client.loadDatabases();
+                    if (databases != null && databases.size() > 0) {
+
+                        databaseList.setListData(databases.toArray());
+                        System.out.println("database refresh done");
+
+                    } else {
+                        JOptionPane.showMessageDialog(null, "No Databases Loaded!.");
+                    }
+
+                } catch (SOAPFaultException soapEx) {
+                    JOptionPane.showMessageDialog(null, "A SOAP Error occurred.");
+                    soapEx.printStackTrace();
+                }
+            }
+        });
+
+    }
+
+    /**
+     * Create the GUI and show it.  For thread safety,
+     * this method should be invoked from the
+     * event-dispatching thread.
+     */
+    private static void createAndShowGUI() {
+        //Create and set up the window.
+        JFrame frame = new JFrame("Map by Sequence Demo");
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+
+        //Create and set up the content pane.
+        JComponent newContentPane = new PICRSequenceDemo();
+        newContentPane.setOpaque(true); //content panes must be opaque
+        frame.setContentPane(newContentPane);
+
+        //Display the window.
+        frame.pack();
+        frame.setVisible(true);
+    }
+
+    public static void main(String[] args) {
+
+        //Schedule a job for the event-dispatching thread:
+        //creating and showing this application's GUI.
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+
+    }
+
+}
Index: /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/business/PICRClient.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/business/PICRClient.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/uk/ac/ebi/demo/picr/business/PICRClient.java (revision 308)
@@ -0,0 +1,123 @@
+package uk.ac.ebi.demo.picr.business;
+
+import uk.ac.ebi.demo.picr.soap.AccessionMapperService;
+import uk.ac.ebi.demo.picr.soap.AccessionMapperInterface;
+import uk.ac.ebi.demo.picr.soap.UPEntry;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collections;
+
+/**
+ *    Copyright 2007 - European Bioinformatics Institute
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ *
+ * User: rcote
+ * Date: 17-May-2007
+ * Time: 10:58:03
+ * $Id: $
+ */
+public class PICRClient {
+
+    //boolean flag used to communicate with PICR webservice query methods
+    private boolean onlyActive = false;
+
+    public boolean isOnlyActive() {
+        return onlyActive;
+    }
+
+    public void setOnlyActive(boolean onlyActive) {
+        this.onlyActive = onlyActive;
+    }
+
+    /**
+     * Calls PICR webservice and returns a list of UPEntries based on accession
+     * @param accession - the accession to map (may include version)
+     * @param databases - a list of databases to map to
+     * @return a list of UPEntry objects. List can be empty but not null.
+     */
+    public List<UPEntry> performAccessionMapping(String accession, Object[] databases) {
+
+        //get service
+        AccessionMapperService service = new AccessionMapperService();
+        AccessionMapperInterface port;
+        port = service.getAccessionMapperPort();
+
+        String ac_version = null;
+        int ndx = accession.indexOf('.');
+        if (ndx > 0) {
+            ac_version = accession.substring(ndx + 1);
+            accession = accession.substring(0, ndx);
+        }
+
+        //a list of all databases to map to
+        List<String> searchDB = null;
+        if (databases != null) {
+            searchDB = new ArrayList<String>();
+            for (int i = 0; i < databases.length; i++) {
+                searchDB.add(databases[i].toString());
+            }
+        }
+
+        return port.getUPIForAccession(accession, ac_version, searchDB, null, onlyActive);
+
+    }
+
+    /**
+     * Calls PICR webservice and returns a list of UPEntries based on sequence criteria
+     *
+     * @param sequence  - the FASTA sequence to map
+     * @param databases - a list of databases to map to
+     * @return a list of UPEntry objects. List can be empty but not null.
+     */
+    public List<UPEntry> performSequenceMapping(String sequence, Object[] databases) {
+
+        //get service
+        AccessionMapperService service = new AccessionMapperService();
+        AccessionMapperInterface port;
+        port = service.getAccessionMapperPort();
+
+        //a list of all databases to map to
+        List<String> searchDB = null;
+        if (databases != null) {
+            searchDB = new ArrayList<String>();
+            for (int i = 0; i < databases.length; i++) {
+                searchDB.add(databases[i].toString());
+            }
+        }
+
+        UPEntry entry = port.getUPIForSequence(sequence, searchDB, null, onlyActive);
+        if (entry != null) {
+            return Collections.singletonList(entry);
+        } else {
+            return Collections.emptyList();
+        }
+
+    }
+
+    /**
+     * calls PICR webservice and returns a list<String> of available databases
+     * @return a list of strings. List can be empty but not null.
+     */
+    public List<String> loadDatabases() {
+
+        //get service
+        AccessionMapperService service = new AccessionMapperService();
+        AccessionMapperInterface port;
+        port = service.getAccessionMapperPort();
+
+        return port.getMappedDatabaseNames();
+
+    }
+}
Index: /trunk/org.bridgedb.webservice.picr/src/org/bridgedb/webservice/picr/IDMapperPicr.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/org/bridgedb/webservice/picr/IDMapperPicr.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/org/bridgedb/webservice/picr/IDMapperPicr.java (revision 308)
@@ -0,0 +1,274 @@
+// BridgeDb,
+// An abstraction layer for identifer mapping services, both local and online.
+// Copyright 2006-2009 BridgeDb developers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+package org.bridgedb.webservice.picr;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.bridgedb.AbstractIDMapperCapabilities;
+import org.bridgedb.AttributeMapper;
+import org.bridgedb.BridgeDb;
+import org.bridgedb.DataSource;
+import org.bridgedb.IDMapper;
+import org.bridgedb.IDMapperCapabilities;
+import org.bridgedb.IDMapperException;
+import org.bridgedb.impl.InternalUtils;
+import org.bridgedb.webservice.IDMapperWebservice;
+import org.bridgedb.Xref;
+
+import uk.ac.ebi.demo.picr.business.PICRClient;
+import uk.ac.ebi.demo.picr.soap.CrossReference;
+import uk.ac.ebi.demo.picr.soap.UPEntry;
+
+public final class IDMapperPicr extends IDMapperWebservice implements AttributeMapper
+{
+    static 
+    {
+		BridgeDb.register ("idmapper-picr", new Driver());
+	}
+
+    private boolean onlyActive;
+    
+    private final Set<DataSource> supportedDatabases = new HashSet<DataSource>();
+    private final Object[] supportedDbObjects;
+    private final PICRClient client;
+
+    /**
+     *
+     * @param onlyActive using only active mappings if true
+     */
+    public IDMapperPicr(boolean onlyActive)
+    {
+        client = new PICRClient();
+        List<String> databases = client.loadDatabases();
+        for (String s : databases)
+        {
+        	supportedDatabases.add(DataSource.getByFullName(s));
+        }
+        supportedDbObjects = databases.toArray();
+        this.onlyActive = onlyActive;
+    }
+
+    /**
+     *
+     * @return true if using only active mappings; false otherwise
+     */
+    public boolean getOnlyActive() {
+        return onlyActive;
+    }
+
+    /**
+     *
+     * @param onlyActive using only active mappings if true
+     */
+    public void setOnlyActive(boolean onlyActive) {
+        this.onlyActive = onlyActive;
+    }
+
+    private static class Driver implements org.bridgedb.Driver
+	{
+        private Driver() { } // prevent outside instantiation
+
+		public IDMapper connect(String location) throws IDMapperException  
+		{
+            Map<String, String> args = 
+            	InternalUtils.parseLocation(location, "only-active");
+
+			boolean isOnlyActive = true;
+			if (args.containsKey("only-active"))
+			{
+				isOnlyActive = Boolean.parseBoolean(args.get("only-active"));
+			}
+			return new IDMapperPicr(isOnlyActive);
+		}
+	}
+	
+	private boolean closed = false;
+	public void close() throws IDMapperException 
+	{
+		closed = true;
+	}
+
+	public Set<Xref> freeSearch(String text, int limit)
+			throws IDMapperException {
+		throw new UnsupportedOperationException();
+	}
+
+	private class PICRCapabilities extends AbstractIDMapperCapabilities
+	{
+		public PICRCapabilities() 
+		{
+			super (supportedDatabases, false, null);
+		}
+	}
+	
+	private PICRCapabilities picrCapabilities = new PICRCapabilities();
+	
+	public IDMapperCapabilities getCapabilities() 
+	{
+		return picrCapabilities;
+	}
+
+	public boolean isConnected() 
+	{
+		return !closed;
+	}
+
+	/**
+	 * @{inheritDocs}
+	 */
+	public Map<Xref, Set<Xref>> mapID(Collection<Xref> srcXrefs,
+			DataSource... tgtDataSources) throws IDMapperException
+	{
+		return InternalUtils.mapMultiFromSingle(this, srcXrefs, tgtDataSources);
+	}
+			
+	/**
+	 * @{inheritDocs}
+	 */
+	public Set<Xref> mapID(Xref srcXref,
+			DataSource... tgtDataSources) throws IDMapperException 
+	{		
+		Object[] databases;
+		if (tgtDataSources.length == 0) 
+			databases = supportedDbObjects;
+		else
+			databases = objectsFromDataSources(tgtDataSources);
+		
+		Set<Xref> result = new HashSet<Xref>();
+		if (databases.length == 0) return result;
+		if (!supportedDatabases.contains(srcXref.getDataSource())) return result;
+
+		List<CrossReference> refs = new ArrayList<CrossReference>();
+		
+		List<UPEntry> entries = client.performAccessionMapping(srcXref.getId(), databases);
+        for (UPEntry entry : entries) {
+        	refs.addAll (entry.getIdenticalCrossReferences());
+            refs.addAll (entry.getLogicalCrossReferences());
+        }
+        
+        for (CrossReference ref : refs)
+        {
+        	// in onlyActive mode, check if it is deleted first
+        	if (!(onlyActive && ref.isDeleted()))
+			{
+        		Xref xref = new Xref (ref.getAccession(), DataSource.getByFullName(ref.getDatabaseName()));
+        		result.add (xref);
+			}
+        }
+		return result;
+	}
+	
+	/**
+	 * Only returns supported databases. Resulting array may be shorter than input.
+	 */
+	private Object[] objectsFromDataSources (DataSource... ds)
+	{
+		List<Object> databases = new ArrayList<Object>(ds.length);		
+		for (DataSource tgt : ds)
+		{
+			if (supportedDatabases.contains(tgt))
+				databases.add(tgt.getFullName());
+		}
+		return databases.toArray();
+	}
+	
+	public boolean xrefExists(Xref xref) throws IDMapperException 
+	{
+		if (!supportedDatabases.contains(xref.getDataSource())) return false;
+		List<UPEntry> result = client.performAccessionMapping(
+				xref.getId(), objectsFromDataSources(xref.getDataSource()));
+		return result.size() > 0;
+	}
+
+	/**
+	 *
+	 * @return false
+	 */
+	public boolean isFreeAttributeSearchSupported()
+	{
+		return false;
+	}
+
+	public Map<Xref, String> freeAttributeSearch(String query, String attrType,
+			int limit) throws IDMapperException 
+	{
+		throw new UnsupportedOperationException();
+	}
+
+	public Set<String> getAttributes(Xref ref, String attrType)
+			throws IDMapperException 
+	{
+		Set<String> result = new HashSet<String>();
+		if (!supportedDatabases.contains(ref.getDataSource())) return result;
+		
+		List<UPEntry> entries = client.performAccessionMapping(ref.getId(), supportedDbObjects);
+		for (UPEntry entry : entries)
+		{
+			if ("CRC64".equals (attrType))
+			{
+				result.add (entry.getCRC64());
+			}
+			else if ("Sequence".equals (attrType))
+			{
+				result.add (entry.getSequence());
+			}
+			else if ("UPI".equals (attrType))
+			{
+				result.add (entry.getUPI());
+			}
+			else if ("Timestamp".equals (attrType))
+			{
+				result.add ("" + entry.getTimestamp());
+			}
+		}
+		
+		return result;
+	}
+
+	private static final Set<String> SUPPORTED_ATTRIBUTES =  
+		new HashSet<String>(Arrays.asList(
+				new String[] {"CRC64", "Sequence", "UPI", "Timestamp"} ));
+	
+	public Set<String> getAttributeSet() throws IDMapperException 
+	{
+		return SUPPORTED_ATTRIBUTES;
+	}
+
+	public Map<String, Set<String>> getAttributes(Xref ref)
+			throws IDMapperException 
+	{
+		Map<String, Set<String>> result = new HashMap<String, Set<String>>();
+		if (!supportedDatabases.contains(ref.getDataSource())) return result;
+
+		List<UPEntry> entries = client.performAccessionMapping(ref.getId(), supportedDbObjects);
+		for (UPEntry entry : entries)
+		{			
+			InternalUtils.multiMapPut (result, "CRC64", entry.getCRC64());
+			InternalUtils.multiMapPut (result, "Sequence", entry.getSequence());
+			InternalUtils.multiMapPut (result, "UPI", entry.getUPI());
+			InternalUtils.multiMapPut (result, "Timestamp", "" + entry.getTimestamp());
+		}
+		return result;
+	}
+}
Index: /trunk/org.bridgedb.webservice.picr/src/org/bridgedb/webservice/picr/IDMapperPicrRest.java
===================================================================
--- /trunk/org.bridgedb.webservice.picr/src/org/bridgedb/webservice/picr/IDMapperPicrRest.java (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/src/org/bridgedb/webservice/picr/IDMapperPicrRest.java (revision 308)
@@ -0,0 +1,307 @@
+// BridgeDb,
+// An abstraction layer for identifer mapping services, both local and online.
+// Copyright 2006-2009 BridgeDb developers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+package org.bridgedb.webservice.picr;
+
+import java.net.URL;
+import java.net.URLConnection;
+
+import java.io.InputStream;
+import java.io.IOException;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.bridgedb.AbstractIDMapperCapabilities;
+import org.bridgedb.BridgeDb;
+import org.bridgedb.DataSource;
+import org.bridgedb.IDMapper;
+import org.bridgedb.IDMapperCapabilities;
+import org.bridgedb.IDMapperException;
+import org.bridgedb.impl.InternalUtils;
+import org.bridgedb.webservice.IDMapperWebservice;
+import org.bridgedb.Xref;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+//TODO: implements AttributeMapper
+public class IDMapperPicrRest extends IDMapperWebservice
+{
+    static 
+    {
+		BridgeDb.register ("idmapper-picr-rest", new Driver());
+	}
+
+    private String baseUrl = "http://www.ebi.ac.uk/Tools/picr/rest/";
+    private boolean onlyActive;
+    
+    private Set<DataSource> supportedDatabases = new HashSet<DataSource>();
+
+    /**
+     *
+     * @param onlyActive using only active mappings if true
+     */
+    public IDMapperPicrRest(boolean onlyActive) throws IDMapperException
+    {        
+        List<String> dbs;
+        try {
+            dbs = getMappedDataBaseNames();
+        } catch (Exception e) {
+            throw new IDMapperException(e);
+        }
+        for (String s : dbs)
+        {
+        	supportedDatabases.add(DataSource.getByFullName(s));
+        }
+        this.onlyActive = onlyActive;
+    }
+
+    /**
+     *
+     * @return true if using only active mappings; false otherwise
+     */
+    public boolean getOnlyActive() {
+        return onlyActive;
+    }
+
+    /**
+     *
+     * @param onlyActive using only active mappings if true
+     */
+    public void setOnlyActive(boolean onlyActive) {
+        this.onlyActive = onlyActive;
+    }
+
+    private static class Driver implements org.bridgedb.Driver
+	{
+        private Driver() { } // prevent outside instantiation
+
+		public IDMapper connect(String location) throws IDMapperException  
+		{
+            Map<String, String> args = 
+            	InternalUtils.parseLocation(location, "only-active");
+
+			boolean isOnlyActive = true;
+			if (args.containsKey("only-active"))
+			{
+				isOnlyActive = Boolean.parseBoolean(args.get("only-active"));
+			}
+			return new IDMapperPicrRest(isOnlyActive);
+		}
+	}
+	
+	private boolean closed = false;
+	public void close() throws IDMapperException 
+	{
+		closed = true;
+	}
+
+        /**
+         * free search is not supported
+         */
+	public Set<Xref> freeSearch(String text, int limit)
+			throws IDMapperException {
+		throw new UnsupportedOperationException();
+	}
+
+        private List<String> getMappedDataBaseNames() throws Exception {
+            String url = baseUrl + "getMappedDatabaseNames";
+            InputStream is = InternalUtils.getInputStream(url);
+            // Get the result as XML document.
+            final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+            final DocumentBuilder builder = factory.newDocumentBuilder();
+            final Document doc = builder.parse(is);
+            NodeList nodes = doc.getElementsByTagName("mappedDatabases");
+            int n = nodes.getLength();
+            List<String> dbs = new ArrayList<String>(n);
+            for (int i=0; i<n; i++) {
+                Node node = nodes.item(i);
+                dbs.add(node.getTextContent());
+            }
+            return dbs;
+        }
+
+	private class PICRCapabilities extends AbstractIDMapperCapabilities
+	{
+		public PICRCapabilities() 
+		{
+			super (supportedDatabases, false, null);
+		}
+	}
+	
+	private PICRCapabilities picrCapabilities = new PICRCapabilities();
+	
+	public IDMapperCapabilities getCapabilities() 
+	{
+		return picrCapabilities;
+	}
+
+	public boolean isConnected() 
+	{
+		return !closed;
+	}
+
+    /**
+     * {@inheritDoc}
+     */
+	public Map<Xref, Set<Xref>> mapID(Collection<Xref> srcXrefs,
+		DataSource... tgtDataSources) throws IDMapperException 
+	{
+		return InternalUtils.mapMultiFromSingle(this, srcXrefs, tgtDataSources);
+	}
+
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override public Set<Xref> mapID(Xref xref,
+			DataSource... tgtDataSources) throws IDMapperException 
+	{
+            if (xref==null) {
+                throw new NullPointerException(
+                            "srcXrefs or tgtDataSources cannot be null.");
+            }
+
+            Set<Xref> result = new HashSet<Xref>();
+
+            // remove unsupported data sources
+            Set<String> tgtDss = new HashSet<String>();
+            if (tgtDataSources.length > 0) {
+                for (DataSource ds : tgtDataSources) {
+                    if (supportedDatabases.contains(ds)) {
+                        tgtDss.add(ds.getFullName());
+                    }
+                }
+            } else {
+                for (DataSource ds : supportedDatabases) {
+                    tgtDss.add(ds.getFullName());
+                }
+            }
+
+            DataSource ds = xref.getDataSource();
+            if (!supportedDatabases.contains(ds))
+                return result;
+
+            Set<String> databases = new HashSet<String>(tgtDss.size()+1);
+            databases.addAll(tgtDss);
+            databases.add(ds.getFullName()); // add the source ds
+
+            String accession = xref.getId();
+
+            try {
+                result = mappingService(accession, databases);
+            } catch (Exception e) {
+            	throw new IDMapperException (e);
+            }
+ 
+            return result;
+	}
+
+        /**
+         * {@inheritDoc}
+         */
+	public boolean xrefExists(Xref xref) throws IDMapperException 
+	{
+            DataSource ds = xref.getDataSource();
+            if (!supportedDatabases.contains(ds))
+                return false;
+
+            Set<String> dss = new HashSet<String>();
+            dss.add(ds.getFullName());
+            
+            Set<Xref> xrefs = null;
+            try {
+                 xrefs = mappingService(xref.getId(), dss);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            
+            return xrefs!=null && !xrefs.isEmpty();
+	}
+
+        private Set<Xref> mappingService(String accession, Set<String> databases) 
+        throws IOException, SAXException, ParserConfigurationException
+ {
+            Set<Xref> result = new HashSet<Xref>();
+
+            StringBuilder url = new StringBuilder(baseUrl);
+            url.append("getUPIForAccession?");
+
+            if (!onlyActive) {
+                url.append("onlyactive=false&");
+            }
+
+            url.append("accession=");
+            url.append(accession);
+
+            for (String database : databases) {
+                url.append("&database=");
+                url.append(database);
+            }
+
+            final Document doc;
+            InputStream is = InternalUtils.getInputStream(url.toString());
+            if (is.available()<=0) return result;
+
+            // Get the result as XML document.
+            final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+            final DocumentBuilder builder = factory.newDocumentBuilder();
+            doc = builder.parse(is);
+
+            String[] tags = new String[] {"ns2:identicalCrossReferences"
+                        , "ns2:logicalCrossReferences"};
+            List<Node> nodes = new ArrayList<Node>();
+            for (String tag : tags) {
+                NodeList nodeList = doc.getElementsByTagName(tag);
+                int n = nodeList.getLength();
+                for (int i=0; i<n; i++) {
+                    nodes.add(nodeList.item(i));
+                }
+            }
+
+            for (Node node : nodes) {
+                NodeList children = node.getChildNodes();
+                int nc = children.getLength();
+                String tgtAcc = null;
+                String tgtDb = null;
+                for (int j=0; j<nc; j++) {
+                    Node child = children.item(j);
+                    if (child.getNodeName().compareTo("ns2:accession")==0) {
+                        tgtAcc = child.getTextContent();
+                    }  else if (child.getNodeName().compareTo("ns2:databaseName")==0) {
+                        tgtDb = child.getTextContent();
+                    }
+                    if (tgtAcc!=null && tgtDb!=null) {
+                        DataSource tgtDs = DataSource.getByFullName(tgtDb);
+                        result.add(new Xref(tgtAcc, tgtDs));
+                        break;
+                    }
+                }
+            }
+
+            return result;
+        }
+}
Index: /trunk/org.bridgedb.webservice.picr/build.xml
===================================================================
--- /trunk/org.bridgedb.webservice.picr/build.xml (revision 308)
+++ /trunk/org.bridgedb.webservice.picr/build.xml (revision 308)
@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<project name="org.bridgedb.webservice.picr" default="dist" basedir=".">
+
+  <!-- always be java 1.5 compatible -->
+  <property name="ant.build.javac.target" value="1.5"/>
+  <property name="ant.build.javac.source" value="1.5"/>
+	
+  <property name="jar.name" value="../dist/org.bridgedb.webservice.picr.jar"/>
+  
+  <target name="prepare">
+	<mkdir dir="build"/>
+  </target>
+
+  <path id="class.path">
+    <fileset dir="lib">
+      <include name="*.jar"/>
+    </fileset>
+    <fileset dir="../dist">
+      <include name="org.bridgedb.jar"/>
+    </fileset>
+  </path>
+
+  <target name="build" depends="prepare">
+	<javac srcdir="src"
+		   includes="**"
+		   debug="true"
+		   destdir="build">
+		<classpath refid="class.path"/>
+	</javac>
+  </target>
+  
+  <target name="jar" depends="build">
+    <manifestclasspath property="manifest.cp" jarfile="${jar.name}">
+      <classpath refid="class.path" />
+    </manifestclasspath>
+    <echo>${manifest.cp}</echo>
+	<jar jarfile="${jar.name}">
+	  <manifest>
+		<attribute name="Class-Path" value="${manifest.cp}"/>
+	  </manifest>
+	  <fileset dir="build"/>
+	  <fileset dir="src" includes="**/*.properties"/>
+	</jar>
+    <copy toDir="../dist"><path refid="class.path"/></copy>
+  </target>
+
+  <target name="dist" depends="jar"/>
+
+  <target name="clean">
+	<delete dir="build"/>
+  </target>
+
+  <target name="dist-clean" depends="clean">
+	<delete file="${jar.name}"/>
+	
+  </target>
+	<target name="test" depends="build">
+		<path id="test.classpath">
+			<path refid="class.path"/>
+			<pathelement location="build"/>
+			<pathelement location="../org.bridgedb/build-lib/junit.jar"/>
+		</path>
+		<javac srcdir="test" debug="true" 
+					includes="**"
+					destdir="build"
+					source="1.5">
+			<classpath refid="test.classpath"/>
+		</javac>		
+		<junit printsummary="on" haltonfailure="true" fork="true">
+			<formatter type="brief" usefile="false"/>
+			<classpath refid="test.classpath"/>
+			<batchtest>
+				<fileset dir="test">
+					<include name="**/*Test*.java"/>
+				</fileset>
+			</batchtest>
+		</junit>
+	</target>
+
+</project>
Index: /unk/batchmapper/src/org/bridgedb/tools/BatchMapper.java
===================================================================
--- /trunk/batchmapper/src/org/bridgedb/tools/BatchMapper.java (revision 188)
+++  (revision )
@@ -1,414 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.tools;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import org.bridgedb.BridgeDb;
-import org.bridgedb.IDMapperException;
-import org.bridgedb.DataSource;
-import org.bridgedb.IDMapperStack;
-import org.bridgedb.Xref;
-import org.bridgedb.bio.BioDataSource;
-
-public class BatchMapper 
-{
-	private static class Settings
-	{
-		File fInput = null;
-		File fOutput = null;
-		File fReport = null;
-		List<String> connectStrings = new ArrayList<String>();
-		DataSource is = null;
-		DataSource os = null;
-		int inputColumn = 0; 
-		int verbose = 0; // 0, 1 or 2
-		int mode = 0; // 0 or 1
-	}
-	
-	public static void main(String[] args)
-	{
-		BatchMapper mapper = new BatchMapper();
-		mapper.run(args);
-	}
-	
-	public void printUsage()
-	{
-		String version = "";
-		try
-		{
-			Properties props = new Properties();
-			props.load (BridgeDb.class.getResourceAsStream("BridgeDb.properties"));
-			version = props.getProperty("bridgedb.version") + 
-				" (r" + props.getProperty("REVISION") + ")";
-		}
-		catch (IOException ex) { version = ex.getMessage(); } 
-		System.out.println ("BatchMapper version " + version);
-		System.out.print (
-				"BatchMapper is a tool for mapping biological identifiers.\n" +
-				"Usage:\n"+
-				"	batchmapper -ls \n" +
-				"		List system codes \n" +
-				" or\n" +
-				"	batchmapper \n" +
-				"		[-v|-vv] \n" +
-				"		[-g <gene database>] \n " +
-				"		[-t <biomart text file>] \n " +
-				"		[-i <input file>] \n" +
-				"		-is <input system code> \n" +
-				"		-os <output system code> \n" +
-				"		[-o <output file>] \n" +
-				"		[-c <input column, 0-based>]\n" +
-				"		[-r <report file>] \n" +
-				"\n" +
-				"You should specify at least one -g or -t option \n");
-	}
-	
-	public String parseArgs(Settings settings, String[] args)
-	{
-		int pos = 0;
-		while (pos < args.length)
-		{
-			if (args[pos].equals ("-ls"))
-			{
-				settings.mode = 1;
-			} 
-			else if (args[pos].equals ("-v"))
-			{
-				settings.verbose = 1;
-			} 
-			else if (args[pos].equals("-vv"))
-			{
-				settings.verbose = 2;
-			}
-			else if (args[pos].equals("-g"))
-			{
-				pos++;
-				if (pos > args.length) return "File expected after -g";
-				File f = new File (args[pos]);
-				if (!f.exists()) return "File " + args[pos] + " does not exist";
-				settings.connectStrings.add ("idmapper-pgdb:" + f.getAbsolutePath());
-			}
-			else if (args[pos].equals("-t"))
-			{
-				pos++;
-				if (pos > args.length) return "File expected after -t";
-				File f = new File (args[pos]);
-				if (!f.exists()) return "File " + args[pos] + " does not exist";
-				try
-				{
-					settings.connectStrings.add ("idmapper-text:" + f.toURL());
-				}
-				catch (MalformedURLException ex)
-				{
-					return ex.getMessage();
-				}
-			}
-			else if (args[pos].equals("-i"))
-			{
-				pos++;
-				if (pos > args.length) return "File expected after -i";
-				settings.fInput = new File (args[pos]);
-				if (!settings.fInput.exists()) return "File " + args[pos] + " does not exist";
-			}
-			else if (args[pos].equals("-r"))
-			{
-				pos++;
-				if (pos > args.length) return "File expected after -r";
-				settings.fReport = new File (args[pos]);
-			}
-			else if (args[pos].equals("-c"))
-			{
-				pos++;
-				try
-				{
-					settings.inputColumn = Integer.parseInt (args[pos]);
-				}
-				catch (NumberFormatException ex)
-				{
-					return ex.getMessage();
-				}
-			}
-			else if (args[pos].equals("-o"))
-			{
-				pos++;
-				if (pos > args.length) return "File expected after -o";
-				settings.fOutput = new File (args[pos]);
-			}
-			else if (args[pos].equals("-is"))
-			{
-				pos++;
-				if (pos > args.length) return "System code expected after -is";
-				settings.is = DataSource.getBySystemCode(args[pos]);
-			}			
-			else if (args[pos].equals("-os"))
-			{
-				pos++;
-				if (pos > args.length) return "System code expected after -os";
-				settings.os = DataSource.getBySystemCode(args[pos]);
-			}			
-			else
-			{
-				return "Unrecognized option " + args[pos];
-			}
-			pos++;
-		}
-		if (settings.mode == 1)
-		{
-			if (settings.is != null ||
-				settings.os != null ||
-				settings.connectStrings.size() > 0 ||
-				settings.fInput != null ||
-				settings.fOutput != null ||
-				settings.inputColumn != 0 ||
-				settings.fReport != null)
-			{
-				return "-ls option can't be combined with -g, -t, -i, -is, -os, -o or -r options";
-			}
-		}
-		else
-		{
-			if (settings.connectStrings.size() == 0) return "Missing -t or -g options";
-			if (settings.is == null) return "Missing -is option";
-			if (settings.os == null) return "Missing -os option";
-		}
-		return null;
-	}
-	
-	
-	public static class Mapper
-	{
-		private List<String> connections = null;
-		private File fInput = null;
-		private File fOutput = null;
-		private File fReport = null;
-		private DataSource is = null;
-		private DataSource os = null;
-		private int inputColumn = 0; 
-		private int verbose = 0; // 0, 1 or 2
-
-		PrintStream report = System.out;
-		private IDMapperStack gdb;
-		
-		private List<Xref> missing = new ArrayList<Xref>();
-		private List<Xref> ambiguous = new ArrayList<Xref>();
-		int totalLines = 0;
-		int okLines = 0;
-
-		public Mapper(List<String> connections, File fInput, File fOutput, File fReport, DataSource is, DataSource os, int inputColumn, int verbose)
-		{
-			this.connections = connections;
-			this.fInput = fInput;
-			this.fOutput = fOutput;
-			this.fReport = fReport;
-			this.is = is;
-			this.os = os;
-			this.inputColumn = inputColumn;
-			this.verbose = verbose;
-		}
-		
-		private void connectGdb() throws IDMapperException
-		{
-			gdb = new IDMapperStack();
-			for (String connectionString : connections)
-			{
-				gdb.addIDMapper(connectionString);
-			}
-		}
-		
-		public void writeMapping() throws IOException, IDMapperException
-		{
-			LineNumberReader reader;
-			PrintWriter writer;
-			if (fInput != null)
-			{
-				reader = new LineNumberReader(new FileReader (fInput));
-			}
-			else
-			{
-				reader = new LineNumberReader(new InputStreamReader(System.in));
-			}
-			String line;
-			if (fOutput != null)
-			{
-				writer = new PrintWriter (new FileWriter (fOutput));
-			}
-			else
-			{
-				writer = new PrintWriter (System.out);
-			}
-			while ((line = reader.readLine()) != null)
-			{
-				String[] fields = line.split("\t");
-				if (fields.length > inputColumn && fields[inputColumn] != null)
-				{
-					Xref srcRef = new Xref(fields[inputColumn], is);
-					Set<Xref> srcSet = new HashSet<Xref>();
-					srcSet.add(srcRef);
-					Map<Xref, Set<Xref>> mapresult = gdb.mapID(srcSet, os);
-					Set<Xref> destRefs = mapresult.get (srcRef);
-					if (destRefs == null || destRefs.size() == 0)
-					{
-						missing.add (srcRef);
-					}
-					else if (destRefs.size() >= 2)
-					{
-						ambiguous.add (srcRef);
-					}
-					
-					if (destRefs != null && destRefs.size() > 0)
-					{
-						okLines++;
-						// use first one
-						writer.print(destRefs.toArray(new Xref[0])[0].getId());
-					}
-					totalLines++;
-				}
-				writer.println("\t" + line);
-			}
-			reader.close();
-			writer.close();
-		}
-		
-		public void reportMapping()
-		{
-			report.println ("Missing   : " + missing.size());
-			report.println ("Ambiguous : " + ambiguous.size());
-			report.println ("Ok        : " + okLines);
-			report.println ("           _______ +");
-			report.println ("Total     : " + totalLines);
-			report.println();
-			if (verbose >= 1)
-			{
-				// missing id's
-				report.println ("Missing id's:");
-				for (int i = 0; i < missing.size(); ++i)
-				{
-					report.print (missing.get(i));
-					if (i < missing.size()-1) report.print (", ");
-					if (i % 5 == 4) report.println();
-				}
-				report.println();
-
-				// ambiguous id's
-				report.println ("Ambiguous id's:");
-				for (int i = 0; i < ambiguous.size(); ++i)
-				{
-					report.print (ambiguous.get(i));
-					if (i < ambiguous.size()-1) report.print (", ");
-					if (i % 5 == 4) report.println();
-				}
-				report.println();
-			}
-		}
-
-		public void run()
-		{
-			try
-			{
-				if (fReport != null)
-				{
-					report = new PrintStream(new FileOutputStream(fReport));
-				}
-				connectGdb();
-				writeMapping();
-				reportMapping();
-				if (fReport != null)
-				{
-					report.close();
-				}
-			}
-			catch (IOException ex)
-			{
-				ex.printStackTrace();
-			}
-			catch (IDMapperException ex)
-			{
-				ex.printStackTrace();
-			}
-		}
-	}
-	
-	public void reportSystemCodes()
-	{
-		List<DataSource> sortedList = new ArrayList<DataSource>();
-		sortedList.addAll (DataSource.getDataSources());
-		Collections.sort (sortedList, new Comparator<DataSource>() {
-
-			public int compare(DataSource a, DataSource b) 
-			{
-				return a.getSystemCode().compareTo(b.getSystemCode());
-			}} ); 
-		
-		for (DataSource ds : sortedList)
-		{
-			System.out.printf("%4s %-20s %-40s\n", ds.getSystemCode(), ds.getFullName(), ds.getExample().getId()); 
-		}
-	}
-	
-	public void run(String[] args)
-	{
-		BioDataSource.init();
-		Settings settings = new Settings();
-		String error = parseArgs(settings, args);
-		if (error != null)
-		{
-			System.err.println ("Error: " + error);
-			printUsage();
-			System.exit(1);
-		}
-		try
-		{
-			Class.forName("org.bridgedb.file.IDMapperText");
-			Class.forName("org.bridgedb.rdb.IDMapperRdb");
-		}
-		catch (ClassNotFoundException ex)
-		{
-			ex.printStackTrace();
-			//TODO: better exception handling
-		}
-		if (settings.mode == 0)
-		{			
-			Mapper mapper = new Mapper(
-					settings.connectStrings, 
-					settings.fInput, settings.fOutput, settings.fReport, 
-					settings.is, settings.os, settings.inputColumn, settings.verbose);
-			mapper.run();
-		}
-		else
-		{
-			reportSystemCodes();
-		}
-	}		
-}
Index: /unk/batchmapper/src/org/bridgedb/tools/Lookup.java
===================================================================
--- /trunk/batchmapper/src/org/bridgedb/tools/Lookup.java (revision 105)
+++  (revision )
@@ -1,86 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.tools;
-
-import java.awt.BorderLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JTextField;
-
-public class Lookup implements ActionListener
-{
-	private JFrame frame;
-	private JTextField txtSearch;
-	private JButton btnGo;
-	private JButton btnCancel;
-	
-	public void createAndShowGUI()
-	{
-		frame = new JFrame();
-		frame.setTitle ("Identifier Lookup tool");
-		
-		btnGo = new JButton ("Search");
-		btnGo.addActionListener(this);
-		btnCancel = new JButton ("Cancel");
-		btnCancel.addActionListener(this);
-		
-		JPanel pnlButtons = new JPanel();
-		pnlButtons.add (btnGo);
-		pnlButtons.add (btnCancel);
-		
-		frame.setLayout(new BorderLayout());
-		frame.getContentPane().add (pnlButtons, BorderLayout.NORTH);
-		
-		frame.add (txtSearch);
-		
-		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-		frame.pack();
-		frame.setVisible(true);
-	}
-
-	/**
-	 * Look up biologiacal identifiers by symbol or related identifier,
-	 * using the bridgeDb API.
-	 * 
-	 * Gives out linkouts, cross references and background information
-	 * 
-	 * @param args
-	 */
-	public static void main(String[] args) 
-	{
-		Lookup lookup = new Lookup();
-		lookup.createAndShowGUI();
-	}
-
-	public void actionPerformed(ActionEvent ae) 
-	{
-		if (ae.getSource() == btnCancel)
-		{
-			frame.dispose();
-		}
-		else if (ae.getSource() == btnGo)
-		{
-			JOptionPane.showMessageDialog(frame, "Not implemented");
-		}
-	}
-
-}
Index: /unk/batchmapper/build.xml
===================================================================
--- /trunk/batchmapper/build.xml (revision 139)
+++  (revision )
@@ -1,49 +1,0 @@
-<?xml version="1.0"?>
-<project name="BatchMapper" default="jar" basedir=".">
-	
-	<property name="jar.file" value="../dist/bridgedb-batchmapper.jar"/>
-	
-	<path id="project.class.path">
-		<pathelement location="build"/>
-		<pathelement location="../dist/bridgedb.jar"/>
-		<pathelement location="../dist/bridgedb-bio.jar"/>
-		<!--TODO make sure corelib build is called first -->
-	</path>
-
-	<target name="prepare">
-		<mkdir dir="../dist"/>
-		<mkdir dir="build"/>
-	</target>
-	
-	<target name="clean" description="Remove all generated files.">
-		<delete dir="${build.dir}"/>
-	</target>
-	
-	<target name="compile" depends="prepare" description="Compile all sources">
-		<javac srcdir="src" 
-			    debug="true"	
-			    destdir="build">
-			<classpath refid="project.class.path"/>
-		</javac>
-	</target>
-
-	<target name="test" depends="compile" description="Test batchmapper">
-		<!-- TODO -->
-	</target>
-
-	<target name="jar" depends="compile">
-		<jar jarfile="${jar.file}">
-			<manifest>
-				<attribute name="Main-Class" value="org.bridgedb.tools.BatchMapper"/>
-				<attribute name="Class-Path" value="bridgedb.jar bridgedb-bio.jar"/>
-			</manifest>
-			<fileset dir="build" includes="**/*.class"/>
-		</jar>
-	</target>
-	
-	<target name="dist-clean" description="Remove all generated files.">
-		<delete file="${jar.file}"/>
-	</target>
-	
-	<target name="dist" depends="jar"/>
-</project>
Index: /unk/picr/test/org/bridgedb/webservice/picr/Test.java
===================================================================
--- /trunk/picr/test/org/bridgedb/webservice/picr/Test.java (revision 215)
+++  (revision )
@@ -1,74 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.webservice.picr;
-
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.bridgedb.AttributeMapper;
-import org.bridgedb.BridgeDb;
-import org.bridgedb.DataSource;
-import org.bridgedb.IDMapper;
-import org.bridgedb.IDMapperException;
-import org.bridgedb.Xref;
-
-public class Test extends TestCase
-{
-	public void setUp() throws ClassNotFoundException
-	{
-		Class.forName ("org.bridgedb.webservice.picr.IDMapperPicr");
-	}
-	
-	public void test() throws IDMapperException
-	{
-		IDMapper idmap = BridgeDb.connect ("idmapper-picr:");
-		AttributeMapper amap = (AttributeMapper)idmap;
-		
-		Set<DataSource> dslist = idmap.getCapabilities().getSupportedTgtDataSources();
-		
-		final DataSource SGD = DataSource.getByFullName("SGD");
-		final DataSource PDB  = DataSource.getByFullName("PDB");
-		final DataSource ENSEMBL_YEAST = DataSource.getByFullName("ENSEMBL_S_CEREVISIAE");
-		assertTrue (dslist.contains(SGD));
-		assertTrue (dslist.contains(PDB));
-		assertTrue (dslist.contains(ENSEMBL_YEAST));
-		
-		Xref src1 = new Xref ("YER095W", ENSEMBL_YEAST);
-		for (DataSource ds : dslist) System.out.println (ds.getFullName());
-		
-		Set<Xref> srcRefs = new HashSet<Xref>();
-		srcRefs.add (src1);
-		DataSource[] targets = new DataSource[] { SGD, PDB, ENSEMBL_YEAST }; 
-		Map<Xref, Set<Xref>> result = idmap.mapID(srcRefs, targets);
-		
-		/*
-		This list is expected:
-		RAD51 SGD
-		YER095W SGD
-		YER095W ENSEMBL_S_CEREVISIAE
-		1SZP PDB
-		S000000897 SGD
-		*/
-		for (Xref ref : result.get(src1)) System.out.println (ref.getId() + " "  + ref.getDataSource().getFullName());
-
-		System.out.println (amap.getAttributes(src1, "Sequence").iterator().next());
-	}
-		
-}
Index: /unk/picr/test/org/bridgedb/webservice/picr/TestRest.java
===================================================================
--- /trunk/picr/test/org/bridgedb/webservice/picr/TestRest.java (revision 221)
+++  (revision )
@@ -1,82 +1,0 @@
-// BridgeDb,
-// An abstraction layer for identifer mapping services, both local and online.
-// Copyright 2006-2009 BridgeDb developers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-package org.bridgedb.webservice.picr;
-
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.bridgedb.BridgeDb;
-import org.bridgedb.DataSource;
-import org.bridgedb.IDMapper;
-import org.bridgedb.IDMapperException;
-import org.bridgedb.Xref;
-
-import junit.framework.TestCase;
-
-public class TestRest extends TestCase 
-{
-	boolean eventReceived = false;
-	
-	public void setUp() throws ClassNotFoundException
-	{
-		Class.forName ("org.bridgedb.webservice.picr.IDMapperPicrRest");
-	}
-
-        public void testDataSources() throws IDMapperException {
-            IDMapperPicrRest idMapper = new IDMapperPicrRest(true);
-            System.out.println(idMapper.getCapabilities().getSupportedSrcDataSources().toString());
-        }
-	
-	public void test() throws IDMapperException
-	{
-		IDMapper idmap = BridgeDb.connect ("idmapper-picr-rest:");
-		
-		Set<DataSource> dslist = idmap.getCapabilities().getSupportedTgtDataSources();
-
-		final DataSource SGD = DataSource.getByFullName("SGD");
-		final DataSource PDB  = DataSource.getByFullName("PDB");
-		final DataSource ENSEMBL_YEAST = DataSource.getByFullName("ENSEMBL_S_CEREVISIAE");
-		assertTrue (dslist.contains(SGD));
-		assertTrue (dslist.contains(PDB));
-		assertTrue (dslist.contains(ENSEMBL_YEAST));
-
-		Xref src1 = new Xref ("YER095W", ENSEMBL_YEAST);
-		for (DataSource ds : dslist) System.out.println (ds.getFullName());
-
-                assertTrue(idmap.xrefExists(src1));
-
-		Set<Xref> srcRefs = new HashSet<Xref>();
-		srcRefs.add (src1);
-		DataSource[] targets = new DataSource[] { SGD, PDB, ENSEMBL_YEAST };
-		//TODO: disabled while mapID is not yet implemented.
-//		Map<Xref, Set<Xref>> result = idmap.mapID(srcRefs, targets);
-
-		/*
-		This list is expected:
-		RAD51 SGD
-		YER095W SGD
-		YER095W ENSEMBL_S_CEREVISIAE
-		1SZP PDB
-		S000000897 SGD
-		*/
-//		for (Xref ref : result.get(src1))
-//                    System.out.println (ref.getId() + " "  + ref.getDataSource().getFullName());
-
-	}
-	
-}
Index: /unk/picr/src/uk/ac/ebi/demo/picr/soap/GetMappedDatabaseNames.java
===================================================================
--- /trunk/picr/src/uk/ac/ebi/demo/picr/soap/GetMappedDatabaseNames.java (revision 152)
+++  (revision )
@@ -1,34 +1,0 @@
-
-package uk.ac.ebi.demo.picr.soap;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for anonymous complex type.
- * 
- * <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType>
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *       &lt;/sequence>
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * 
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "")
-@XmlRootElement(name = "getMappedDatabaseNames")
-public class GetMappedDatabaseNames {
-
-
-}
Index: /unk/picr/src/uk/ac/ebi/demo/picr/soap/package-info.java
===================================================================
--- /trunk/picr/src/uk/ac/ebi/demo/picr/soap/package-info.java (revision 152)
+++  (revision )
@@ -1,2 +1,0 @@
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
-package uk.ac.ebi.demo.picr.soap;
Index: /unk/picr/src/uk/ac/ebi/demo/picr/soap/UPEntry.java
===================================================================
--- /trunk/picr/src/uk/ac/ebi/demo/picr/soap/UPEntry.java (revision 152)
+++  (revision )
@@ -1,215 +1,0 @@
-
-package uk.ac.ebi.demo.picr.soap;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-
-/**
- * <p>Java class for UPEntry complex type.
- * 
- * <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name="UPEntry">
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="CRC64" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         &lt;element name="UPI" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         &lt;element name="identicalCrossReferences" type="{http://model.picr.ebi.ac.uk}CrossReference" maxOccurs="unbounded" minOccurs="0"/>
- *         &lt;element name="logicalCrossReferences" type="{http://model.picr.ebi.ac.uk}CrossReference" maxOccurs="unbounded" minOccurs="0"/>
- *         &lt;element name="sequence" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         &lt;element name="timestamp" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
- *       &lt;/sequence>
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * 
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "UPEntry", namespace = "http://model.picr.ebi.ac.uk", propOrder = {
-    "crc64",
-    "upi",
-    "identicalCrossReferences",
-    "logicalCrossReferences",
-    "sequence",
-    "timestamp"
-})
-public class UPEntry {
-
-    @XmlElement(name = "CRC64", namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
-    protected String crc64;
-    @XmlElement(name = "UPI", namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
-    protected String upi;
-    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", nillable = true)
-    protected List<CrossReference> identicalCrossReferences;
-    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", nillable = true)
-    protected List<CrossReference> logicalCrossReferences;
-    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
-    protected String sequence;
-    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
-    protected XMLGregorianCalendar timestamp;
-
-    /**
-     * Gets the value of the crc64 property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link String }
-     *     
-     */
-    public String getCRC64() {
-        return crc64;
-    }
-
-    /**
-     * Sets the value of the crc64 property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link String }
-     *     
-     */
-    public void setCRC64(String value) {
-        this.crc64 = value;
-    }
-
-    /**
-     * Gets the value of the upi property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link String }
-     *     
-     */
-    public String getUPI() {
-        return upi;
-    }
-
-    /**
-     * Sets the value of the upi property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link String }
-     *     
-     */
-    public void setUPI(String value) {
-        this.upi = value;
-    }
-
-    /**
-     * Gets the value of the identicalCrossReferences property.
-     * 
-     * <p>
-     * This accessor method returns a reference to the live list,
-     * not a snapshot. Therefore any modification you make to the
-     * returned list will be present inside the JAXB object.
-     * This is why there is not a <CODE>set</CODE> method for the identicalCrossReferences property.
-     * 
-     * <p>
-     * For example, to add a new item, do as follows:
-     * <pre>
-     *    getIdenticalCrossReferences().add(newItem);
-     * </pre>
-     * 
-     * 
-     * <p>
-     * Objects of the following type(s) are allowed in the list
-     * {@link CrossReference }
-     * 
-     * 
-     */
-    public List<CrossReference> getIdenticalCrossReferences() {
-        if (identicalCrossReferences == null) {
-            identicalCrossReferences = new ArrayList<CrossReference>();
-        }
-        return this.identicalCrossReferences;
-    }
-
-    /**
-     * Gets the value of the logicalCrossReferences property.
-     * 
-     * <p>
-     * This accessor method returns a reference to the live list,
-     * not a snapshot. Therefore any modification you make to the
-     * returned list will be present inside the JAXB object.
-     * This is why there is not a <CODE>set</CODE> method for the logicalCrossReferences property.
-     * 
-     * <p>
-     * For example, to add a new item, do as follows:
-     * <pre>
-     *    getLogicalCrossReferences().add(newItem);
-     * </pre>
-     * 
-     * 
-     * <p>
-     * Objects of the following type(s) are allowed in the list
-     * {@link CrossReference }
-     * 
-     * 
-     */
-    public List<CrossReference> getLogicalCrossReferences() {
-        if (logicalCrossReferences == null) {
-            logicalCrossReferences = new ArrayList<CrossReference>();
-        }
-        return this.logicalCrossReferences;
-    }
-
-    /**
-     * Gets the value of the sequence property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link String }
-     *     
-     */
-    public String getSequence() {
-        return sequence;
-    }
-
-    /**
-     * Sets the value of the sequence property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link String }
-     *     
-     */
-    public void setSequence(String value) {
-        this.sequence = value;
-    }
-
-    /**
-     * Gets the value of the timestamp property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link XMLGregorianCalendar }
-     *     
-     */
-    public XMLGregorianCalendar getTimestamp() {
-        return timestamp;
-    }
-
-    /**
-     * Sets the value of the timestamp property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link XMLGregorianCalendar }
-     *     
-     */
-    public void setTimestamp(XMLGregorianCalendar value) {
-        this.timestamp = value;
-    }
-
-}
Index: /unk/picr/src/uk/ac/ebi/demo/picr/soap/CrossReference.java
===================================================================
--- /trunk/picr/src/uk/ac/ebi/demo/picr/soap/CrossReference.java (revision 152)
+++  (revision )
@@ -1,279 +1,0 @@
-
-package uk.ac.ebi.demo.picr.soap;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-
-/**
- * <p>Java class for CrossReference complex type.
- * 
- * <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name="CrossReference">
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="accession" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         &lt;element name="accessionVersion" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         &lt;element name="databaseDescription" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         &lt;element name="databaseName" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         &lt;element name="dateAdded" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
- *         &lt;element name="dateDeleted" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
- *         &lt;element name="deleted" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         &lt;element name="gi" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         &lt;element name="taxonId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       &lt;/sequence>
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * 
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "CrossReference", namespace = "http://model.picr.ebi.ac.uk", propOrder = {
-    "accession",
-    "accessionVersion",
-    "databaseDescription",
-    "databaseName",
-    "dateAdded",
-    "dateDeleted",
-    "deleted",
-    "gi",
-    "taxonId"
-})
-public class CrossReference {
-
-    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
-    protected String accession;
-    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
-    protected String accessionVersion;
-    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
-    protected String databaseDescription;
-    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
-    protected String databaseName;
-    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
-    protected XMLGregorianCalendar dateAdded;
-    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
-    protected XMLGregorianCalendar dateDeleted;
-    @XmlElement(namespace = "http://model.picr.ebi.ac.uk")
-    protected boolean deleted;
-    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
-    protected String gi;
-    @XmlElement(namespace = "http://model.picr.ebi.ac.uk", required = true, nillable = true)
-    protected String taxonId;
-
-    /**
-     * Gets the value of the accession property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link String }
-     *     
-     */
-    public String getAccession() {
-        return accession;
-    }
-
-    /**
-     * Sets the value of the accession property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link String }
-     *     
-     */
-    public void setAccession(String value) {
-        this.accession = value;
-    }
-
-    /**
-     * Gets the value of the accessionVersion property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link String }
-     *     
-     */
-    public String getAccessionVersion() {
-        return accessionVersion;
-    }
-
-    /**
-     * Sets the value of the accessionVersion property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link String }
-     *     
-     */
-    public void setAccessionVersion(String value) {
-        this.accessionVersion = value;
-    }
-
-    /**
-     * Gets the value of the databaseDescription property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link String }
-     *     
-     */
-    public String getDatabaseDescription() {
-        return databaseDescription;
-    }
-
-    /**
-     * Sets the value of the databaseDescription property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link String }
-     *     
-     */
-    public void setDatabaseDescription(String value) {
-        this.databaseDescription = value;
-    }
-
-    /**
-     * Gets the value of the databaseName property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link String }
-     *     
-     */
-    public String getDatabaseName() {
-        return databaseName;
-    }
-
-    /**
-     * Sets the value of the databaseName property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link String }
-     *     
-     */
-    public void setDatabaseName(String value) {
-        this.databaseName = value;
-    }
-
-    /**
-     * Gets the value of the dateAdded property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link XMLGregorianCalendar }
-     *     
-     */
-    public XMLGregorianCalendar getDateAdded() {
-        return dateAdded;
-    }
-
-    /**
-     * Sets the value of the dateAdded property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link XMLGregorianCalendar }
-     *     
-     */
-    public void setDateAdded(XMLGregorianCalendar value) {
-        this.dateAdded = value;
-    }
-
-    /**
-     * Gets the value of the dateDeleted property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link XMLGregorianCalendar }
-     *     
-     */
-    public XMLGregorianCalendar getDateDeleted() {
-        return dateDeleted;
-    }
-
-    /**
-     * Sets the value of the dateDeleted property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link XMLGregorianCalendar }
-     *     
-     */
-    public void setDateDeleted(XMLGregorianCalendar value) {
-        this.dateDeleted = value;
-    }
-
-    /**
-     * Gets the value of the deleted property.
-     * 
-     */
-    public boolean isDeleted() {
-        return deleted;
-    }
-
-    /**
-     * Sets the value of the deleted property.
-     * 
-     */
-    public void setDeleted(boolean value) {
-        this.deleted = value;
-    }
-
-    /**
-     * Gets the value of the gi property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link String }
-     *     
-     */
-    public String getGi() {
-        return gi;
-    }
-
-    /**
-     * Sets the value of the gi property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link String }
-     *     
-     */
-    public void setGi(String value) {
-        this.gi = value;
-    }
-
-    /**
-     * Gets the value of the taxonId property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link String }
-     *     
-     */
-    public String getTaxonId() {
-        return taxonId;
-    }
-
-    /**
-     * Sets the value of the taxonId property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link String }
-     *     
-     */
-    public void setTaxonId(String value) {
-        this.taxonId = value;
-    }
-
-}
Index: /unk/picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForAccessionResponse.java
===================================================================
--- /trunk/picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForAccessionResponse.java (revision 152)
+++  (revision )
@@ -1,71 +1,0 @@
-
-package uk.ac.ebi.demo.picr.soap;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for anonymous complex type.
- * 
- * <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType>
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="getUPIForAccessionReturn" type="{http://model.picr.ebi.ac.uk}UPEntry" maxOccurs="unbounded"/>
- *       &lt;/sequence>
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * 
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
-    "getUPIForAccessionReturn"
-})
-@XmlRootElement(name = "getUPIForAccessionResponse")
-public class GetUPIForAccessionResponse {
-
-    @XmlElement(required = true)
-    protected List<UPEntry> getUPIForAccessionReturn;
-
-    /**
-     * Gets the value of the getUPIForAccessionReturn property.
-     * 
-     * <p>
-     * This accessor method returns a reference to the live list,
-     * not a snapshot. Therefore any modification you make to the
-     * returned list will be present inside the JAXB object.
-     * This is why there is not a <CODE>set</CODE> method for the getUPIForAccessionReturn property.
-     * 
-     * <p>
-     * For example, to add a new item, do as follows:
-     * <pre>
-     *    getGetUPIForAccessionReturn().add(newItem);
-     * </pre>
-     * 
-     * 
-     * <p>
-     * Objects of the following type(s) are allowed in the list
-     * {@link UPEntry }
-     * 
-     * 
-     */
-    public List<UPEntry> getGetUPIForAccessionReturn() {
-        if (getUPIForAccessionReturn == null) {
-            getUPIForAccessionReturn = new ArrayList<UPEntry>();
-        }
-        return this.getUPIForAccessionReturn;
-    }
-
-}
Index: /unk/picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForAccession.java
===================================================================
--- /trunk/picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForAccession.java (revision 152)
+++  (revision )
@@ -1,174 +1,0 @@
-
-package uk.ac.ebi.demo.picr.soap;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for anonymous complex type.
- * 
- * <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType>
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="accession" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         &lt;element name="ac_version" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         &lt;element name="searchDatabases" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
- *         &lt;element name="taxonId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         &lt;element name="onlyActive" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *       &lt;/sequence>
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * 
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
-    "accession",
-    "acVersion",
-    "searchDatabases",
-    "taxonId",
-    "onlyActive"
-})
-@XmlRootElement(name = "getUPIForAccession")
-public class GetUPIForAccession {
-
-    @XmlElement(required = true)
-    protected String accession;
-    @XmlElement(name = "ac_version", required = true)
-    protected String acVersion;
-    @XmlElement(required = true)
-    protected List<String> searchDatabases;
-    @XmlElement(required = true)
-    protected String taxonId;
-    protected boolean onlyActive;
-
-    /**
-     * Gets the value of the accession property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link String }
-     *     
-     */
-    public String getAccession() {
-        return accession;
-    }
-
-    /**
-     * Sets the value of the accession property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link String }
-     *     
-     */
-    public void setAccession(String value) {
-        this.accession = value;
-    }
-
-    /**
-     * Gets the value of the acVersion property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link String }
-     *     
-     */
-    public String getAcVersion() {
-        return acVersion;
-    }
-
-    /**
-     * Sets the value of the acVersion property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link String }
-     *     
-     */
-    public void setAcVersion(String value) {
-        this.acVersion = value;
-    }
-
-    /**
-     * Gets the value of the searchDatabases property.
-     * 
-     * <p>
-     * This accessor method returns a reference to the live list,
-     * not a snapshot. Therefore any modification you make to the
-     * returned list will be present inside the JAXB object.
-     * This is why there is not a <CODE>set</CODE> method for the searchDatabases property.
-     * 
-     * <p>
-     * For example, to add a new item, do as follows:
-     * <pre>
-     *    getSearchDatabases().add(newItem);
-     * </pre>
-     * 
-     * 
-     * <p>
-     * Objects of the following type(s) are allowed in the list
-     * {@link String }
-     * 
-     * 
-     */
-    public List<String> getSearchDatabases() {
-        if (searchDatabases == null) {
-            searchDatabases = new ArrayList<String>();
-        }
-        return this.searchDatabases;
-    }
-
-    /**
-     * Gets the value of the taxonId property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link String }
-     *     
-     */
-    public String getTaxonId() {
-        return taxonId;
-    }
-
-    /**
-     * Sets the value of the taxonId property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link String }
-     *     
-     */
-    public void setTaxonId(String value) {
-        this.taxonId = value;
-    }
-
-    /**
-     * Gets the value of the onlyActive property.
-     * 
-     */
-    public boolean isOnlyActive() {
-        return onlyActive;
-    }
-
-    /**
-     * Sets the value of the onlyActive property.
-     * 
-     */
-    public void setOnlyActive(boolean value) {
-        this.onlyActive = value;
-    }
-
-}
Index: /unk/picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForSequenceResponse.java
===================================================================
--- /trunk/picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForSequenceResponse.java (revision 152)
+++  (revision )
@@ -1,64 +1,0 @@
-
-package uk.ac.ebi.demo.picr.soap;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for anonymous complex type.
- * 
- * <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType>
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="getUPIForSequenceReturn" type="{http://model.picr.ebi.ac.uk}UPEntry"/>
- *       &lt;/sequence>
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * 
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
-    "getUPIForSequenceReturn"
-})
-@XmlRootElement(name = "getUPIForSequenceResponse")
-public class GetUPIForSequenceResponse {
-
-    @XmlElement(required = true)
-    protected UPEntry getUPIForSequenceReturn;
-
-    /**
-     * Gets the value of the getUPIForSequenceReturn property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link UPEntry }
-     *     
-     */
-    public UPEntry getGetUPIForSequenceReturn() {
-        return getUPIForSequenceReturn;
-    }
-
-    /**
-     * Sets the value of the getUPIForSequenceReturn property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link UPEntry }
-     *     
-     */
-    public void setGetUPIForSequenceReturn(UPEntry value) {
-        this.getUPIForSequenceReturn = value;
-    }
-
-}
Index: /unk/picr/src/uk/ac/ebi/demo/picr/soap/AccessionMapperInterface.java
===================================================================
--- /trunk/picr/src/uk/ac/ebi/demo/picr/soap/AccessionMapperInterface.java (revision 152)
+++  (revision )
@@ -1,87 +1,0 @@
-
-package uk.ac.ebi.demo.picr.soap;
-
-import java.util.List;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.ws.RequestWrapper;
-import javax.xml.ws.ResponseWrapper;
-
-
-/**
- * This class was generated by the JAXWS SI.
- * JAX-WS RI 2.1-02/02/2007 09:55 AM(vivekp)-FCS
- * Generated source version: 2.1
- * 
- */
-@WebService(name = "AccessionMapperInterface", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
-@XmlSeeAlso({
-    ObjectFactory.class
-})
-public interface AccessionMapperInterface {
-
-
-    /**
-     * 
-     * @param searchDatabases
-     * @param taxonId
-     * @param onlyActive
-     * @param sequence
-     * @return
-     *     returns uk.ac.ebi.demo.picr.soap.UPEntry
-     */
-    @WebMethod(action = "getUPIForSequence")
-    @WebResult(name = "getUPIForSequenceReturn", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
-    @RequestWrapper(localName = "getUPIForSequence", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", className = "uk.ac.ebi.demo.picr.soap.GetUPIForSequence")
-    @ResponseWrapper(localName = "getUPIForSequenceResponse", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", className = "uk.ac.ebi.demo.picr.soap.GetUPIForSequenceResponse")
-    public UPEntry getUPIForSequence(
-        @WebParam(name = "sequence", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
-        String sequence,
-        @WebParam(name = "searchDatabases", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
-        List<String> searchDatabases,
-        @WebParam(name = "taxonId", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
-        String taxonId,
-        @WebParam(name = "onlyActive", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
-        boolean onlyActive);
-
-    /**
-     * 
-     * @param accession
-     * @param searchDatabases
-     * @param taxonId
-     * @param acVersion
-     * @param onlyActive
-     * @return
-     *     returns java.util.List<uk.ac.ebi.demo.picr.soap.UPEntry>
-     */
-    @WebMethod(action = "getUPIForAccession")
-    @WebResult(name = "getUPIForAccessionReturn", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
-    @RequestWrapper(localName = "getUPIForAccession", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", className = "uk.ac.ebi.demo.picr.soap.GetUPIForAccession")
-    @ResponseWrapper(localName = "getUPIForAccessionResponse", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", className = "uk.ac.ebi.demo.picr.soap.GetUPIForAccessionResponse")
-    public List<UPEntry> getUPIForAccession(
-        @WebParam(name = "accession", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
-        String accession,
-        @WebParam(name = "ac_version", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
-        String acVersion,
-        @WebParam(name = "searchDatabases", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
-        List<String> searchDatabases,
-        @WebParam(name = "taxonId", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
-        String taxonId,
-        @WebParam(name = "onlyActive", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
-        boolean onlyActive);
-
-    /**
-     * 
-     * @return
-     *     returns java.util.List<java.lang.String>
-     */
-    @WebMethod(action = "getMappedDatabaseNames")
-    @WebResult(name = "mappedDatabases", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService")
-    @RequestWrapper(localName = "getMappedDatabaseNames", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", className = "uk.ac.ebi.demo.picr.soap.GetMappedDatabaseNames")
-    @ResponseWrapper(localName = "getMappedDatabaseNamesResponse", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", className = "uk.ac.ebi.demo.picr.soap.GetMappedDatabaseNamesResponse")
-    public List<String> getMappedDatabaseNames();
-
-}
Index: /unk/picr/src/uk/ac/ebi/demo/picr/soap/AccessionMapperService.java
===================================================================
--- /trunk/picr/src/uk/ac/ebi/demo/picr/soap/AccessionMapperService.java (revision 152)
+++  (revision )
@@ -1,66 +1,0 @@
-
-package uk.ac.ebi.demo.picr.soap;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebEndpoint;
-import javax.xml.ws.WebServiceClient;
-import javax.xml.ws.WebServiceFeature;
-
-
-/**
- * This class was generated by the JAXWS SI.
- * JAX-WS RI 2.1-02/02/2007 09:55 AM(vivekp)-FCS
- * Generated source version: 2.1
- * 
- */
-@WebServiceClient(name = "AccessionMapperService", targetNamespace = "http://www.ebi.ac.uk/picr/AccessionMappingService", wsdlLocation = "http://www.ebi.ac.uk/Tools/picr/service?wsdl")
-public class AccessionMapperService
-    extends Service
-{
-
-    private final static URL ACCESSIONMAPPERSERVICE_WSDL_LOCATION;
-
-    static {
-        URL url = null;
-        try {
-            url = new URL("http://www.ebi.ac.uk/Tools/picr/service?wsdl");
-        } catch (MalformedURLException e) {
-            e.printStackTrace();
-        }
-        ACCESSIONMAPPERSERVICE_WSDL_LOCATION = url;
-    }
-
-    public AccessionMapperService(URL wsdlLocation, QName serviceName) {
-        super(wsdlLocation, serviceName);
-    }
-
-    public AccessionMapperService() {
-        super(ACCESSIONMAPPERSERVICE_WSDL_LOCATION, new QName("http://www.ebi.ac.uk/picr/AccessionMappingService", "AccessionMapperService"));
-    }
-
-    /**
-     * 
-     * @return
-     *     returns AccessionMapperInterface
-     */
-    @WebEndpoint(name = "AccessionMapperPort")
-    public AccessionMapperInterface getAccessionMapperPort() {
-        return (AccessionMapperInterface)super.getPort(new QName("http://www.ebi.ac.uk/picr/AccessionMappingService", "AccessionMapperPort"), AccessionMapperInterface.class);
-    }
-
-    /**
-     * 
-     * @param features
-     *     A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.
-     * @return
-     *     returns AccessionMapperInterface
-     */
-    @WebEndpoint(name = "AccessionMapperPort")
-    public AccessionMapperInterface getAccessionMapperPort(WebServiceFeature... features) {
-        return (AccessionMapperInterface)super.getPort(new QName("http://www.ebi.ac.uk/picr/AccessionMappingService", "AccessionMapperPort"), AccessionMapperInterface.class, features);
-    }
-
-}
Index: /unk/picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForSequence.java
===================================================================
--- /trunk/picr/src/uk/ac/ebi/demo/picr/soap/GetUPIForSequence.java (revision 152)
+++  (revision )
@@ -1,146 +1,0 @@
-
-package uk.ac.ebi.demo.picr.soap;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for anonymous complex type.
- * 
- * <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType>
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="sequence" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         &lt;element name="searchDatabases" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
- *         &lt;element name="taxonId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         &lt;element name="onlyActive" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *       &lt;/sequence>
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * 
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
-    "sequence",
-    "searchDatabases",
-    "taxonId",
-    "onlyActive"
-})
-@XmlRootElement(name = "getUPIForSequence")
-public class GetUPIForSequence {
-
-    @XmlElement(required = true)
-    protected String sequence;
-    @XmlElement(required = true)
-    protected List<String> searchDatabases;
-    @XmlElement(required = true)
-    protected String taxonId;
-    protected boolean onlyActive;
-
-    /**
-     * Gets the value of the sequence property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link String }
-     *     
-     */
-    public String getSequence() {
-        return sequence;
-    }
-
-    /**
-     * Sets the value of the sequence property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link String }
-     *     
-     */
-    public void setSequence(String value) {
-        this.sequence = value;
-    }
-
-    /**
-     * Gets the value of the searchDatabases property.
-     * 
-     * <p>
-     * This accessor method returns a reference to the live list,
-     * not a snapshot. Therefore any modification you make to the
-     * returned list will be present inside the JAXB object.
-     * This is why there is not a <CODE>set</CODE> method for the searchDatabases property.
-     * 
-     * <p>
-     * For example, to add a new item, do as follows:
-     * <pre>
-     *    getSearchDatabases().add(newItem);
-     * </pre>
-     * 
-     * 
-     * <p>
-     * Objects of the following type(s) are allowed in the list
-     * {@link String }
-     * 
-     * 
-     */
-    public List<String> getSearchDatabases() {
-        if (searchDatabases == null) {
-            searchDatabases = new ArrayList<String>();
-        }
-        return this.searchDatabases;
-    }
-
-    /**
-     * Gets the value of the taxonId property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link String }
-     *     
-     */
-    public String getTaxonId() {
-        return taxonId;
-    }
-
-    /**
-     * Sets the value of the taxonId property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link String }
-     *     
-     */
-    public void setTaxonId(String value) {
-        this.taxonId = value;
-    }
-
-    /**
-     * Gets the value of the onlyActive property.
-     * 
-     */
-    public boolean isOnlyActive() {
-        return onlyActive;
-    }
-
-    /**
-     * Sets the value of the onlyActive property.
-     * 
-     */
-    public void setOnlyActive(boolean value) {
-        this.onlyActive = value;
-    }
-
-}
Index: /unk/picr/src/uk/ac/ebi/demo/picr/soap/GetMappedDatabaseNamesResponse.java
===================================================================
--- /trunk/picr/src/uk/ac/ebi/demo/picr/soap/GetMappedDatabaseNamesResponse.java (revision 152)
+++  (revision )
@@ -1,71 +1,0 @@
-
-package uk.ac.ebi.demo.picr.soap;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for anonymous complex type.
- * 
- * <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType>
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="mappedDatabases" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
- *       &lt;/sequence>
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * 
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
-    "mappedDatabases"
-})
-@XmlRootElement(name = "getMappedDatabaseNamesResponse")
-public class GetM