static private String manifestURI = "OWLManifest.rdf";
static private boolean manifestInFactory = true;
static public Test suite() {
TestSuite s = new TestSuite("OWL-Syntax");
// s.addTest(Extra.suite());
// s.addTest(CmdLineTidyTest.suite());
InputStream manifest;
if (factory == null) {
if (internet) {
factory = new TestInputStreamFactory(wgTestDir, wgTestDir);
} else {
factory = new TestInputStreamFactory(wgTestDir, "wg");
}
}
if (manifestInFactory) {
manifest = factory.open(manifestURI);
} else {
try {
try {
manifest = new URL(manifestURI).openStream();
} catch (MalformedURLException e) {
manifest = new FileInputStream(manifestURI);
}
} catch (IOException e) {
throw new JenaException(e);
}
}
Model m = ModelFactory.createDefaultModel();
m.read(manifest, "");
Query query =
new Query(
"SELECT ?s, ?t, ?f, ?l "
+ "WHERE (?f rdf:type "
+ " <http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#RDF-XML-Document> )"
+ " (?t ?p ?f ) "
+ " (?t rtest:status ?s) "
+ " (?f otest:level ?l ) "
+ "AND ?s ne \"OBSOLETED\""
+ "USING rtest FOR <http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#>"
+ " otest FOR <http://www.w3.org/2002/03owlt/testOntology#>");
// Need to set the source if the query does not.
query.setSource(m);
QueryExecution qe = new QueryEngine(query);
QueryResults results = qe.exec();
for (Iterator iter = results; iter.hasNext();) {
ResultBinding res = (ResultBinding) iter.next();
addTest(s, res, m);
}
results.close();
s.addTest(new DummyTest());
return s;
}