SPARQL in Holochain

So after looking into holochain, and the data structure for links these are basically RDF, so can SPARQL be used on them?
Has anybody looked into this? I can’t find any reference to RDF triples or SPARQL in any holochain documentation or mattermost.

Have you looked into SPARQL for HoloREA @pospi?

Not in any great detail, but I did have a brief look in the context of using Holochain to implement Solid pubs (outcome there was that we merely need lower-level access to the conductor HTTP gateway to respond to standard HTTP verbs).

The other part is compiling a SPARQL query engine into an app DNA, which just depends on how much Rust has matured in this area. It looks like the rdf crate has some basics for parsing RDF documents but not much for SPARQL syntax, though it seems like it’s planned. Not much else other than some WIP attempts seems to exist.

So, though the basics of storing Turtle files and using RDF to parse them looks like it’s achievable with what’s available now; unless there are some good SPARQL libs out there full support for this is likely a ways off.

Reviving the thread.

There is more substantial work about SPARQL and RDF stores in Rust ecosystem, e.g. Oxigraph, from it’s README:

Oxigraph is a graph database implementing the SPARQL standard.
Its goal is to provide a compliant, safe, and fast graph database based on the RocksDB and Sled key-value stores. It is written in Rust. It also provides a set of utility functions for reading, writing, and processing RDF files.

It has a pretty robust implementation of SPARQL 1.1, and as it can be seen from source code, it can evaluate queries ontop of any store as long as it implements ReadableEncodedStore trait:

pub(crate) fn evaluate_query<R: ReadableEncodedStore + 'static>(
    store: R,
    query: impl TryInto<Query, Error = impl Into<EvaluationError>>,
    options: QueryOptions,
) -> Result<QueryResults, EvaluationError> {
// ...
}

I’m pretty new to Rust, and to database development in general, but it seems to me that this could be adopted with some reasonable effort. I’m very much interested in working on something like this, but I’ll need help from someone with experience in these matters.