Permalink
Browse files

More consistent variable naming: clearer difference between service a…

…nd ontology server
  • Loading branch information...
1 parent 450871e commit fd92f578a1fdc15ff3374abb1ca9d67b846608ff @egonw egonw committed Nov 13, 2010
@@ -29,13 +29,13 @@
private static RDFManager rdf = new RDFManager();
- public static Map<String,String> getProperties(String service, String feature) {
+ public static Map<String,String> getProperties(String ontologyServer, String feature) {
String propertiesQuery =
"select ?pred ?value where {" +
" <" + feature + "> ?pred ?value" +
"}";
Map<String,String> properties = new HashMap<String, String>();
- IStringMatrix matrix = rdf.sparqlRemote(service, propertiesQuery , null);
+ IStringMatrix matrix = rdf.sparqlRemote(ontologyServer, propertiesQuery , null);
for (int i=0; i<matrix.getRowCount(); i++) {
String predicate = matrix.get(i, "pred");
String value = matrix.get(i, "value");
@@ -30,13 +30,13 @@
private static RDFManager rdf = new RDFManager();
- public static Map<String,String> getProperties(String service, String feature) {
+ public static Map<String,String> getProperties(String ontologyServer, String feature) {
String propertiesQuery =
"select ?pred ?value where {" +
" <" + feature + "> ?pred ?value" +
"}";
Map<String,String> properties = new HashMap<String, String>();
- IStringMatrix matrix = rdf.sparqlRemote(service, propertiesQuery , null);
+ IStringMatrix matrix = rdf.sparqlRemote(ontologyServer, propertiesQuery , null);
for (int i=0; i<matrix.getRowCount(); i++) {
String predicate = matrix.get(i, "pred");
String value = matrix.get(i, "value");
@@ -29,13 +29,13 @@
private static RDFManager rdf = new RDFManager();
- public static Map<String,String> getProperties(String service, String feature) {
+ public static Map<String,String> getProperties(String ontologyServer, String feature) {
String propertiesQuery =
"select ?pred ?value where {" +
" <" + feature + "> ?pred ?value" +
"}";
Map<String,String> properties = new HashMap<String, String>();
- IStringMatrix matrix = rdf.sparqlRemote(service, propertiesQuery , null);
+ IStringMatrix matrix = rdf.sparqlRemote(ontologyServer, propertiesQuery , null);
for (int i=0; i<matrix.getRowCount(); i++) {
String predicate = matrix.get(i, "pred");
String value = matrix.get(i, "value");
@@ -13,8 +13,6 @@
import java.util.List;
import java.util.Map;
-import org.eclipse.core.runtime.IProgressMonitor;
-
import net.bioclipse.core.PublishedClass;
import net.bioclipse.core.PublishedMethod;
import net.bioclipse.core.Recorded;
@@ -88,67 +86,74 @@
@Recorded
@PublishedMethod(
methodSummary=
- "Lists the available information on the feature from the ontology server.",
- params="String service, String feature"
+ "Lists the available information on the feature from the given OpenTox ontology server's SPARQL " +
+ "end point.",
+ params="String ontologyServer, String feature"
)
- public Map<String,String> getFeatureInfo(String service, String feature);
+ public Map<String,String> getFeatureInfo(String ontologyServer, String feature);
@Recorded
@PublishedMethod(
methodSummary=
- "Lists the available information on the feature from the ontology server.",
- params="String service, List<String> features"
+ "Lists the available information on the feature from the given OpenTox ontology server's SPARQL " +
+ "end point.",
+ params="String ontologyServer, List<String> features"
)
- public Map<String,Map<String,String>> getFeatureInfo(String service, List<String> features);
+ public Map<String,Map<String,String>> getFeatureInfo(String ontologyServer, List<String> features);
@Recorded
@PublishedMethod(
methodSummary=
- "Lists the available information on the model from the ontology server.",
- params="String service, String model"
+ "Lists the available information on the model from the given OpenTox ontology server's SPARQL " +
+ "end point.",
+ params="String ontologyServer, String model"
)
- public Map<String,String> getModelInfo(String service, String model);
+ public Map<String,String> getModelInfo(String ontologyServer, String model);
@Recorded
@PublishedMethod(
methodSummary=
- "Lists the available information on the models from the ontology server.",
- params="String service, List<String> models"
+ "Lists the available information on the models from the given OpenTox ontology server's SPARQL " +
+ "end point.",
+ params="String ontologyServer, List<String> models"
)
- public Map<String,Map<String,String>> getModelInfo(String service, List<String> models);
+ public Map<String,Map<String,String>> getModelInfo(String ontologyServer, List<String> models);
@Recorded
@PublishedMethod(
methodSummary=
- "Lists the available information on the algorithm from the ontology server.",
- params="String service, String algorithm"
+ "Lists the available information on the algorithm from the given OpenTox ontology server's SPARQL " +
+ "end point.",
+ params="String ontologyServer, String algorithm"
)
- public Map<String,String> getAlgorithmInfo(String service, String algorithm);
+ public Map<String,String> getAlgorithmInfo(String ontologyServer, String algorithm);
@Recorded
@PublishedMethod(
methodSummary=
- "Lists the available information on the algorithm from the ontology server.",
- params="String service, List<String> algorithms"
+ "Lists the available information on the algorithm from the given OpenTox ontology server's SPARQL " +
+ "end point.",
+ params="String ontologyServer, List<String> algorithms"
)
- public Map<String,Map<String,String>> getAlgorithmInfo(String service, List<String> algorithms);
+ public Map<String,Map<String,String>> getAlgorithmInfo(String ontologyServer, List<String> algorithms);
@Recorded
@PublishedMethod(
methodSummary=
- "Lists the algorithms available from the given service.",
- params="String service"
+ "Lists the algorithms available from the given OpenTox ontology server's SPARQL " +
+ "end point.",
+ params="String ontologyServer"
)
- public List<String> listAlgorithms(String service);
+ public List<String> listAlgorithms(String ontologyServer);
@Recorded
@PublishedMethod(
methodSummary=
- "Lists the descriptors available from the given service SPARQL " +
+ "Lists the descriptors available from the given OpenTox ontology server's SPARQL " +
"end point.",
- params="String serviceSPARQL"
+ params="String ontologyServer"
)
- public IStringMatrix listDescriptors(String serviceSPARQL);
+ public IStringMatrix listDescriptors(String ontologyServer);
@Recorded
@PublishedMethod(
@@ -81,69 +81,69 @@ public String getManagerName() {
return "opentox";
}
- public Map<String,String> getFeatureInfo(String service, String feature, IProgressMonitor monitor) {
+ public Map<String,String> getFeatureInfo(String ontologyServer, String feature, IProgressMonitor monitor) {
if (monitor == null) monitor = new NullProgressMonitor();
monitor.beginTask("Downloading feature information", 1);
- Map<String,String> properties = Feature.getProperties(service, feature);
+ Map<String,String> properties = Feature.getProperties(ontologyServer, feature);
monitor.done();
return properties;
}
- public Map<String,String> getModelInfo(String service, String feature, IProgressMonitor monitor) {
+ public Map<String,String> getModelInfo(String ontologyServer, String model, IProgressMonitor monitor) {
if (monitor == null) monitor = new NullProgressMonitor();
monitor.beginTask("Downloading model information", 1);
- Map<String,String> properties = Model.getProperties(service, feature);
+ Map<String,String> properties = Model.getProperties(ontologyServer, model);
monitor.done();
return properties;
}
- public Map<String,String> getAlgorithmInfo(String service, String feature, IProgressMonitor monitor) {
+ public Map<String,String> getAlgorithmInfo(String ontologyServer, String algorithm, IProgressMonitor monitor) {
if (monitor == null) monitor = new NullProgressMonitor();
monitor.beginTask("Downloading algorithm information", 1);
- Map<String,String> properties = Algorithm.getProperties(service, feature);
+ Map<String,String> properties = Algorithm.getProperties(ontologyServer, algorithm);
monitor.done();
return properties;
}
- public Map<String,Map<String,String>> getFeatureInfo(String service, List<String> features, IProgressMonitor monitor) {
+ public Map<String,Map<String,String>> getFeatureInfo(String ontologyServer, List<String> features, IProgressMonitor monitor) {
if (monitor == null) monitor = new NullProgressMonitor();
monitor.beginTask("Downloading feature information", features.size());
Map<String,Map<String,String>> results = new HashMap<String, Map<String,String>>();
for (String feature : features) {
- results.put(feature, Feature.getProperties(service, feature));
+ results.put(feature, Feature.getProperties(ontologyServer, feature));
monitor.worked(1);
}
monitor.done();
return results;
}
- public Map<String,Map<String,String>> getAlgorithmInfo(String service, List<String> features, IProgressMonitor monitor) {
+ public Map<String,Map<String,String>> getAlgorithmInfo(String ontologyServer, List<String> algorithms, IProgressMonitor monitor) {
if (monitor == null) monitor = new NullProgressMonitor();
- monitor.beginTask("Downloading algorithm information", features.size());
+ monitor.beginTask("Downloading algorithm information", algorithms.size());
Map<String,Map<String,String>> results = new HashMap<String, Map<String,String>>();
- for (String feature : features) {
- results.put(feature, Algorithm.getProperties(service, feature));
+ for (String algorithm : algorithms) {
+ results.put(algorithm, Algorithm.getProperties(ontologyServer, algorithm));
monitor.worked(1);
}
monitor.done();
return results;
}
- public Map<String,Map<String,String>> getModelInfo(String service, List<String> features, IProgressMonitor monitor) {
+ public Map<String,Map<String,String>> getModelInfo(String ontologyServer, List<String> features, IProgressMonitor monitor) {
if (monitor == null) monitor = new NullProgressMonitor();
monitor.beginTask("Downloading model information", features.size());
Map<String,Map<String,String>> results = new HashMap<String, Map<String,String>>();
for (String feature : features) {
- results.put(feature, Model.getProperties(service, feature));
+ results.put(feature, Model.getProperties(ontologyServer, feature));
monitor.worked(1);
}
monitor.done();
@@ -235,7 +235,7 @@ private IStringMatrix regex(IStringMatrix matrix, String column, String substrin
return table;
}
- public IStringMatrix listDescriptors(String serviceSPARQL, IProgressMonitor monitor)
+ public IStringMatrix listDescriptors(String ontologyServer, IProgressMonitor monitor)
throws BioclipseException {
if (monitor == null) monitor = new NullProgressMonitor();
IStringMatrix results = new StringMatrix();
@@ -244,13 +244,13 @@ public IStringMatrix listDescriptors(String serviceSPARQL, IProgressMonitor moni
try {
// download the list of data sets as RDF
results = regex(
- rdf.sparqlRemote(serviceSPARQL, SPARQL_DESCRIPTORS, monitor),
+ rdf.sparqlRemote(ontologyServer, SPARQL_DESCRIPTORS, monitor),
"algo", "org.openscience.cdk"
);
monitor.worked(1);
} catch (Exception exception) {
throw new BioclipseException(
- "Error while accessing the OpenTox ontology server at: " + serviceSPARQL,
+ "Error while accessing the OpenTox ontology server at: " + ontologyServer,
exception
);
}
@@ -259,19 +259,19 @@ public IStringMatrix listDescriptors(String serviceSPARQL, IProgressMonitor moni
return results;
}
- public List<String> listModels(String serviceSPARQL, IProgressMonitor monitor)
+ public List<String> listModels(String ontologyServer, IProgressMonitor monitor)
throws BioclipseException {
if (monitor == null) monitor = new NullProgressMonitor();
IStringMatrix results = new StringMatrix();
monitor.beginTask("Requesting available descriptors...", 1);
try {
// download the list of data sets as RDF
- results = rdf.sparqlRemote(serviceSPARQL, QUERY_MODELS, monitor);
+ results = rdf.sparqlRemote(ontologyServer, QUERY_MODELS, monitor);
monitor.worked(1);
} catch (Exception exception) {
throw new BioclipseException(
- "Error while accessing the OpenTox ontology server at: " + serviceSPARQL,
+ "Error while accessing the OpenTox ontology server at: " + ontologyServer,
exception
);
}

0 comments on commit fd92f57

Please sign in to comment.