- From: Steve Harris <S.W.Harris@ecs.soton.ac.uk>
- Date: Mon, 10 Oct 2005 13:56:08 +0100
- To: Gareth Andrew <freega@freegarethandrew.org>
- Cc: SWIG <semantic-web@w3.org>
On Mon, Oct 10, 2005 at 02:44:31AM +0100, Gareth Andrew wrote: > 2. Performance: Even if the data is completely open, and the > economics doesn't come into play, performance is a major issue. > SPARQL queries are designed to be written by Semantic Web > engineers, much as SQL queries are designed to be written by > database engineers. As an example, consider the following query > > PREFIX foaf: > PREFIX dc: > SELECT ?book > WHERE { ?book dc:creator ?who > ?who foaf:name "J. K. Rowling" > } > > This query (if the WHERE clause is evaluated top to bottom) is > highly inefficient, it first searches for all triples with > property dc:creator, then filters those such that the > dc:creator's foaf:name is "J. K. Rowling". A much more efficient > query reverses the patterns in the WHERE clause. I believe > automated query rewriting is beyond state of the art at the > moment and will continue to be for the foreseeable future, > especially when you consider the technical challenge of throwing > inferencing into the mix, and the social challenge of open > access (eg. consider the query "SELECT ?s ?p ?o WHERE > { ?s ?p ?o}"). This is absolutly not beyond the state of the art, you can simply use tried and trusted relational optimisation techniques to determine that you should evaluate the 2nd triple first, I know of at least 4 RDF engines that do this, and I expect the vast majority do. The open access issue is a little trickier, my engine uses a complexity estimator to determine wether it should attempt to answer unauthenticated queries or not, based on the ammount of i/o that will be requred. Generally it is quite accurate, and it certainly catches wildcard queries. eg. http://triplestore.aktors.org/rdql/?query=SELECT+%3Fx+WHERE+%28%3Fx+%3Fy+%3Fz%29&xslt= that endpoint is RDQL, not SPARQL, but the same applies to the SPARQL verson. - Steve
Received on Monday, 10 October 2005 12:56:33 UTC