Hi,
We¹re trying to build a caching layer in the front of our triplestore
server. But to get the most out of such a cache, it¹s
quite important to normalize incoming SPARQL queries so that instead of
directly hitting the backend triplestore for the query:
select * where {?subject ?predicate ?object}
we could reuse the results already cached for the previous query, say:
select * where {?s ?p ?o}
as despite of different variable names those queries really express the very
same information need¹ if you like.
We thought that the best way of doing so would be to use the feature that
ARQ has in store, namely SPARQL Algebra.
The problem with that approach is, however, that the algebras being produced
by Algebra.compile(query) routine are not ³abstract enough²
for our purpose. For the former queries we would get respectively:
(bgp (triple ?subject ?predicate ?object))
(bgp (triple ?s ?p ?o))
So the question is whether we are missing something and there is indeed a
general way of obtaining the algebras that wouldn¹t be any different for
semantically identical queries (like those two above) or we have to resort
to some built in-house tweaks and tricks (e.g. normalizing variable names,
sorting algebra nodes on the same tree level alphabetically etc. etc.) ?
Kind regards,
Rafal Ozga
********************************************************************************
DISCLAIMER: This e-mail is confidential and should not be used by anyone who is
not the original intended recipient. If you have received this e-mail in error
please inform the sender and delete it from your mailbox or any other storage
mechanism. Neither Macmillan Publishers Limited nor any of its agents accept
liability for any statements made which are clearly the sender's own and not
expressly made on behalf of Macmillan Publishers Limited or one of its agents.
Please note that neither Macmillan Publishers Limited nor any of its agents
accept any responsibility for viruses that may be contained in this e-mail or
its attachments and it is your responsibility to scan the e-mail and
attachments (if any). No contracts may be concluded on behalf of Macmillan
Publishers Limited or its agents by means of e-mail communication. Macmillan
Publishers Limited Registered in England and Wales with registered number
785998
Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS
********************************************************************************