I have some data I'm playing with that seemed like a good fit for RDF-style interaction, so I thought I'd give ruby-rdf a whirl.
I'm using ruby-rdf
, sparql
, and rdf-do
(backed by do_sqlite3
).
I've found that even on a relatively small dataset (just a couple of hundred statements), it takes minutes to execute a SPARQL query like the following:
SELECT ?time
WHERE {
?obs1 a <http://example.com/sometype> .
?obs2 a <http://example.com/sometype> .
?obs1 <http://example.com/end> ?time .
?obs2 <http://example.com/start> ?time .
?obs1 <http://example.com/someprop> ?fromProp .
?obs2 <http://example.com/someprop> ?toProp .
?obs2 <http://example.com/someprop> "interesting" .
FILTER ( ?fromProp != ?toProp )
}
By contrast, the built-in RDF::Graph
repository loaded with the same
statements executed the same queries in under a second.
This surprised me a little, so I'm wondering:
-
Is this difference something I should expect? (Perhaps
RDF::Graph
is heavily optimised, butRDF::Repository::DataObjects
is not yet) -
Am I doing something wrong? (maybe the query is too complex, or perhaps SQLite is an inappropriate store for hundreds of statements)
Any guidance would be appreciated.