You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Mariano Rodriguez <ro...@inf.unibz.it> on 2011/12/05 23:06:58 UTC
Benchmarking reasoning performance part 2
Dear all,
I bother you again with more basic questions, we havent yet reached experimenting with tdbloader.
I am having issues with performance of
the OWL reasoner with a LUBM size 1 and Im wondering if Im doing something wrong.
I started with Lubm 100, and an extended LUBM schema, however, things were so slow that
I downgraded to lubm 1 and the original lubm ontology, still things are slow. Everything
is done in memory right now.
This is the code at the moment:
Model lubm1 = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MICRO_RULE_INF);
lubm1.read("file:/Users/mariano/Documents/Archive/Work/projects/semantic-index/univ-bench-original.owl", "RDF/XML");
lubm1.read("file:/Users/mariano/Documents/Archive/Work/projects/semantic-index/uba1.7/lubm1/university-data-1univ.nt", "N-TRIPLE");
This is relatively fast, few seconds.
Then for each of the 14 original LUBM queries I'm doing
Query query = QueryFactory.create(queries[i]);
QueryExecution qexec = QueryExecutionFactory.create(query, lubm1);
try {
ResultSet results = qexec.execSelect();
log.info("Counting");
int rcount = 0;
while (results.hasNext()) {
QuerySolution soln = results.next();
rcount += 1;
}
log.info("Count: {}", rcount);
} finally {
qexec.close();
}
The first query looks like this:
PREFIX : <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT DISTINCT ?x WHERE { ?x a :GraduateStudent. ?x :takesCourse <http://www.Department0.University0.edu/GraduateCourse0> .}
The results are fine. However, the time to compute them is slow. In particular, returning from qexec.exectSelect is very fast (few millisecond)
but retrieving the count is very slow, even if its just a couple of rows. Am I doing something wrong here?
I'm now thinking it might be actually better to store the model, complete with inferences in TDB, and then querying. Would this be more efficient? If so, would this code suffice?
String directory = /Users/mariano/Documents/Archive/Work/projects/semantic-index/lubm/benchmarks/jena/tdb10";
Model database = TDBFactory.createModel(directory);
database.add(lubm1);
database.commit();
database.close();
Thank you in advance,
Best regards,
Mariano
Mariano Rodriguez Muro
http://www.inf.unibz.it/~rodriguez/
KRDB Research Center
Faculty of Computer Science
Free University of Bozen-Bolzano (FUB)
Piazza Domenicani 3,
I-39100 Bozen-Bolzano BZ, Italy
猴
Re: Benchmarking reasoning performance part 2
Posted by Mariano Rodriguez <ro...@inf.unibz.it>.
> The results are fine. However, the time to compute them is slow. In particular, returning from qexec.exectSelect is very fast (few millisecond)
> but retrieving the count is very slow, even if its just a couple of rows. Am I doing something wrong here?
my bad, its not the count, its the execution of the query that is slow. The rest of the questions still apply :)
Re: Benchmarking reasoning performance part 2
Posted by Dave Reynolds <da...@gmail.com>.
On Mon, 2011-12-05 at 23:06 +0100, Mariano Rodriguez wrote:
> The results are fine. However, the time to compute them is slow. In particular, returning from qexec.exectSelect is very fast (few millisecond)
> but retrieving the count is very slow, even if its just a couple of rows.
The inference doesn't start until you start to pull on results, then
there is a large upfront forward inference cost and smaller per-query
backward inference steps.
> Am I doing something wrong here?
Didn't notice anything particularly wrong, the rule reasoner must just
be slow on that data. Don't know why.
As Andy said, using the streaming RDFS inference is probably a better
match.
> I'm now thinking it might be actually better to store the model, complete with inferences in TDB, and then querying. Would this be more efficient? If so, would this code suffice?
Yes. There is no point in doing inference over TDB, the normal mode of
use is to compute the wanted closure in memory and then store in the
persistent store for efficient query later.
Dave
> String directory = /Users/mariano/Documents/Archive/Work/projects/semantic-index/lubm/benchmarks/jena/tdb10";
> Model database = TDBFactory.createModel(directory);
> database.add(lubm1);
> database.commit();
> database.close();
>
>
> Thank you in advance,
> Best regards,
> Mariano
>
>
>
>
>
>
>
> Mariano Rodriguez Muro
> http://www.inf.unibz.it/~rodriguez/
> KRDB Research Center
> Faculty of Computer Science
> Free University of Bozen-Bolzano (FUB)
> Piazza Domenicani 3,
> I-39100 Bozen-Bolzano BZ, Italy
> 猴
>
>
>
>