Permalink
Browse files

More consistency: listAlgorithms() takes the ontology server SPARQL e…

…nd point as input, like the rest
  • Loading branch information...
1 parent aef0273 commit 06594fd3174388d392998e3e5224762ac6b99625 @egonw egonw committed Nov 13, 2010
@@ -187,37 +187,25 @@ public String getManagerName() {
return dataSets;
}
- public List<String> listAlgorithms(String service, IProgressMonitor monitor)
+ public List<String> listAlgorithms(String ontologyServer, IProgressMonitor monitor)
throws BioclipseException {
- List<String> dataSets = new ArrayList<String>();
-
if (monitor == null) monitor = new NullProgressMonitor();
+ IStringMatrix results = new StringMatrix();
- monitor.beginTask("Requesting available algorithms...", 3);
- IRDFStore store = rdf.createInMemoryStore();
+ monitor.beginTask("Requesting available algorithms...", 1);
try {
// download the list of data sets as RDF
- rdf.importURL(store, service + "algorithm", monitor);
- monitor.worked(1);
-
- // query the downloaded RDF
- IStringMatrix results = rdf.sparql(store, QUERY_ALGORITHMS);
+ results = rdf.sparqlRemote(ontologyServer, QUERY_ALGORITHMS, monitor);
monitor.worked(1);
-
- // return the data set identifiers
- dataSets = results.getColumn("algo");
- monitor.worked(1);
- } catch (BioclipseException exception) {
- throw exception;
} catch (Exception exception) {
throw new BioclipseException(
- "Error while accessing RDF API of service",
+ "Error while accessing the OpenTox ontology server at: " + ontologyServer,
exception
);
}
monitor.done();
- return dataSets;
+ return results.getColumn("algo");
}
/**
@@ -262,7 +250,7 @@ public IStringMatrix listDescriptors(String serviceSPARQL, IProgressMonitor moni
monitor.worked(1);
} catch (Exception exception) {
throw new BioclipseException(
- "Error while accessing RDF API of service",
+ "Error while accessing the OpenTox ontology server at: " + serviceSPARQL,
exception
);
}
@@ -283,7 +271,7 @@ public IStringMatrix listDescriptors(String serviceSPARQL, IProgressMonitor moni
monitor.worked(1);
} catch (Exception exception) {
throw new BioclipseException(
- "Error while accessing RDF API of service",
+ "Error while accessing the OpenTox ontology server at: " + serviceSPARQL,
exception
);
}

0 comments on commit 06594fd

Please sign in to comment.