gtfierro / reasonable

OWL 2 Reasoner built on DataFrog
BSD 3-Clause "New" or "Revised" License
66 stars 4 forks source link

reasonable wasm? #12

Open bollwyvl opened 2 years ago

bollwyvl commented 2 years ago

Thanks for reasonable!

It would be lovely to use reasonable in the browser (and maybe on the server): oxigraph has proven quite effective there, and may have some patterns worth copying... if indeed it wouldn't be possible to use them directly together. Unfortunately, I don't know how one would go about this!

Semi-tangentially, by wrapping it in JS, it's possible pyodide, a wasm-based python distribution, could make use of it more rapidly, as a working python+rust toolchain in the browser is still a bit further off.

gtfierro commented 2 years ago

Hi @bollwyvl! I totally agree --- indeed, I've been using in-browser oxigraph for tools like https://gtfierro.github.io/223p-web-sparql/ and https://sparql.gtf.fyi/.

I've been holding off on producing the WASM version of reasonable because I wanted to develop a better solution for storing the intermediate relations which can take up a lot of memory. It also isn't currently able to take advantage of Oxigraph's existing storage of triples. However, now I'm thinking that these aren't critical blockers and that it would be worth putting together the JS/WASM interface to reasonable so we can at least see how it performs. I"ll see what I can do! It's nearing the end of the semester here so I'll be pretty busy but I'll see what I can put together over the next couple weeks

gtfierro commented 1 year ago

Hi @bollwyvl -- sorry for the delay on this, but I've finally got reasonable compiling to WASM here: https://github.com/gtfierro/reasonable/tree/wasm/reasonable-wasm. I have to divert attention to other things for a little while, but there is a "Context" class that can accept triples, pass them to reasonable, and return the newly materialized triples. I'll see if I can write up a simple example soon

bollwyvl commented 1 year ago

I emoted earlier, but just wanted to say thank you for pursuing this.

Not to distract from the Other Things (I know how that goes), but do you imagine this deploy its own oxigraph, or would somehow work with an existing oxigraph "vm"?

gtfierro commented 1 year ago

Hi @bollwyvl -- great question. I've currently moved to oxrdf and rio to handle the RDF model and I/O to avoid the heavy dependency on RocksDB via oxigraph. I think it wouldn't be too terrible to support pulling triples from an Oxigraph store; there will be an in-memory copy of those triples due to the way this is currently implemented. Would that be ok in the near-term?

bollwyvl commented 1 year ago

Haven't been able to play in the space in a while, so not sure what the ramifications are fully!