[OTDev] how to get compound URIs for the compounds I add to a dataset?

Egon Willighagen egon.willighagen at gmail.com
Fri Oct 29 17:30:50 CEST 2010


On Fri, Oct 29, 2010 at 5:23 PM, Nina Jeliazkova
<jeliazkova.nina at gmail.com> wrote:
> Yet another option.

OK, something related... I'm now creating a data set and then
requesting it's features with:

http://apps.ideaconsult.net:8080/ambit2/dataset/11955/features

(data sets I remove afterwards, so this link will not work...)

I'm using this code (fullURI is the one above):

HttpMethod method = new GetMethod(fullURI);
		method.setRequestHeader("Accept", "text/uri-list");
		client.executeMethod(method);
		System.out.println(method.getResponseBodyAsString());
		method.releaseConnection();
		List<String> features = new ArrayList<String>();
		BufferedReader reader = new BufferedReader(
			new StringReader(method.getResponseBodyAsString())
		);
		String line;
		while ((line = reader.readLine()) != null) {
			line = line.trim();
			if (line.length() > 0) features.add(line);
		}
		return features;

But I get an HTML page instead of the URIs of the features instead...

What Accept should I be using? Can't find this in the 1.1 specs...

Egon

-- 
Dr E.L. Willighagen
Postdoctoral Research Associate
University of Cambridge
Homepage: http://egonw.github.com/
LinkedIn: http://se.linkedin.com/in/egonw
Blog: http://chem-bla-ics.blogspot.com/
PubList: http://www.citeulike.org/user/egonw/tag/papers



More information about the Development mailing list