Question

I working on SPARQL query performance on Jena SDB. For persistence, Jena SDB stores triples in a relational database (e.g., MySQL). How Jena SDB handle a SPARQL query? Does it:

  1. load all the data from MySQL into its memory format, and then run the sparql query in memory; or
  2. translate the SPARQL query in SQL and send it to MySQL?

The second hypothesis seems most likely to me, since this will take advantage of the indices provided by the relational database. Does someone have a clue about this, or any reference about Jena internal data format to handle SPARQL query?

Was it helpful?

Solution

  1. No (it does not read everything into memory)
  2. Yes (it generates SQL)

See the output of sdbprint which shows the SQL generated. It is not one SQL query for one SPARQL query in all cases.

Jena TDB is faster and scales better than Jena SDB. SDB should only be used where layering on an existing SQL deployment is necessary.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top