[MOBY-guts] biomoby commit
Gary Schiltz
gss at pub.open-bio.org
Mon Mar 21 21:42:01 UTC 2005
gss
Mon Mar 21 16:42:01 EST 2005
Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools
In directory pub.open-bio.org:/tmp/cvs-serv9239/src/org/semanticmoby/ref/tools
Modified Files:
KeywordFinder.java MOBYProperties.java DiscoveryQuery.java
InvocationBroker.java URIInvestigator.java KeywordQuery.java
Log Message:
Misc
moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools KeywordFinder.java,1.1,1.2 MOBYProperties.java,1.1,1.2 DiscoveryQuery.java,1.1,1.2 InvocationBroker.java,1.1,1.2 URIInvestigator.java,1.1,1.2 KeywordQuery.java,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordFinder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordFinder.java 2004/11/22 22:58:40 1.1
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordFinder.java 2005/03/21 21:42:01 1.2
@@ -7,9 +7,7 @@
import java.util.*;
import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.shared.*;
-import com.hp.hpl.jena.vocabulary.OWL;
-import com.hp.hpl.jena.vocabulary.RDF;
-import com.hp.hpl.jena.vocabulary.RDFS;
+import com.hp.hpl.jena.vocabulary.*;
public class KeywordFinder
{
===================================================================
RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/MOBYProperties.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/MOBYProperties.java 2004/11/22 22:58:40 1.1
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/MOBYProperties.java 2005/03/21 21:42:01 1.2
@@ -5,7 +5,6 @@
import javax.servlet.ServletContext;
-
/**
* This abstract class contains a set of static methods for retrieving
* properties that are stored in the S-MOBY properties file.
@@ -13,10 +12,9 @@
public abstract class MOBYProperties
{
/**
- * The name of the S-MOBY properties file. The file itself should
- * exist in some directory in the Java class path.
+ * The path to the S-MOBY properties file.
*/
- private static String PROP_FILE_NAME = "smoby.properties";
+ private static String PROP_FILE_NAME = "/WEB-INF/smoby.properties";
/**
* A static Properties object for accessing the properties file.
@@ -67,12 +65,12 @@
if (props == null) // Only try to read it once
{
props = new Properties();
- InputStream is = context.getResourceAsStream(PROP_FILE_NAME);
- if (is == null) {
+ String path = context.getRealPath(PROP_FILE_NAME);
+ if (path == null) {
throw new FileNotFoundException(
"Properties file \"" + PROP_FILE_NAME + "\" not found");
}
- props.load(is);
+ props.load(new FileInputStream(path));
}
}
}
===================================================================
RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/DiscoveryQuery.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/DiscoveryQuery.java 2004/11/22 22:58:40 1.1
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/DiscoveryQuery.java 2005/03/21 21:42:01 1.2
@@ -110,7 +110,7 @@
Model dbModel = null;
try
{
- Model queryModel = ((MOBYProvider) queryProvider).getUnderlying();
+ Model queryModel = ((MOBYProvider) queryProvider).getModel();
String queryString = buildQueryString(queryModel);
StorageManager manager = new StorageManager();
dbModel = manager.openDBModel();
===================================================================
RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/InvocationBroker.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/InvocationBroker.java 2004/11/22 22:58:40 1.1
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/InvocationBroker.java 2005/03/21 21:42:01 1.2
@@ -7,7 +7,6 @@
import javax.servlet.http.*;
import org.apache.commons.httpclient.*;
import org.semanticmoby.graph.*;
-import org.semanticmoby.graph.tools.*;
import org.semanticmoby.http.*;
import org.semanticmoby.parser.*;
import org.semanticmoby.vocabulary.MOBY;
@@ -59,14 +58,14 @@
private String rdfxmlString(MOBYProvider provider)
{
StringWriter writer = new StringWriter();
- provider.getUnderlying().write(writer);
+ provider.getModel().write(writer);
return writer.toString();
}
private String n3String(MOBYProvider provider)
{
StringWriter writer = new StringWriter();
- provider.getUnderlying().write(writer, "N3");
+ provider.getModel().write(writer, "N3");
return writer.toString();
}
@@ -247,7 +246,7 @@
private String getInputURI(MOBYProvider provider)
{
try {
- Model model = provider.getUnderlying();
+ Model model = provider.getModel();
Statement stmt = model.listStatements(
provider.getResource(), MOBY.inputURI,
(String) null).nextStatement();
@@ -260,7 +259,7 @@
private String getOutputURI(MOBYProvider provider)
{
try {
- Model model = provider.getUnderlying();
+ Model model = provider.getModel();
Statement stmt = model.listStatements(
provider.getResource(), MOBY.outputURI,
(String) null).nextStatement();
@@ -295,26 +294,6 @@
private boolean requiresInputs(MOBYProvider provider)
{
- MOBYProviderTraverser traverser = new MOBYProviderTraverser();
- try {
- traverser.traverse(provider,
- new MOBYProviderVisitorAdapter(){
- public void visitSubjectPropValStmtEnd(
- MOBYPropertyValueStatement stmt)
- throws MOBYProviderTraversalException
- {
- if (stmt.getValue().isResource()) {
- MOBYResource res = (MOBYResource) stmt.getValue();
- if (res.isBlank()) {
- throw new MOBYProviderTraversalException();
- }
- }
- }
- },
- true);
- } catch (MOBYProviderTraversalException e) {
- return true;
- }
- return false;
+ return getInputURI(provider) != null;
}
}
\ No newline at end of file
===================================================================
RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/URIInvestigator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/URIInvestigator.java 2004/11/22 22:58:40 1.1
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/URIInvestigator.java 2005/03/21 21:42:01 1.2
@@ -247,7 +247,9 @@
Parser parser = Parser.forInputStream(in, Parser.LANGUAGE_RDF_XML);
provider = parser.parseProvider();
}
- catch (Throwable t) {}
+ catch (Throwable t) {
+ System.err.println("Parse error: " + t);
+ }
// De-register the provider, printing a removal message if
// a provider couldn't be parsed
===================================================================
RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordQuery.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordQuery.java 2004/11/22 22:58:40 1.1
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordQuery.java 2005/03/21 21:42:01 1.2
@@ -26,6 +26,7 @@
}
public List findMatchingProviders()
+ throws Exception
{
List matching = new ArrayList();
@@ -53,10 +54,12 @@
catch (StorageException e)
{
System.err.println(e);
+ throw e;
}
catch (SQLException e)
{
System.err.println(e);
+ throw e;
}
return matching;
More information about the MOBY-guts
mailing list