pchampin / sophia_rs

Sophia: a Rust toolkit for RDF and Linked Data
Other
210 stars 23 forks source link

Use sophia to connect to a SparQL db (in my case AnzoGraph) #97

Open 007vasy opened 3 years ago

007vasy commented 3 years ago

Hi!

Thank you for this library!

I am working on a graphQL -> sparQL translator in Rust (https://github.com/007vasy/warpgrapher?organization=007vasy&organization=007vasy) and I having a hard time figuring out how to use sophia to connect to a database and execute the queries againts it. Could you give some pointers?

pchampin commented 3 years ago

Hi @007vasy and thanks for your interest. No wonder you didn't find how to do it: there is currently no implemenation of a SPARQL-protocol client in Sophia... :-/ But I'll add this to my TODO list.

007vasy commented 3 years ago

@pchampin that is great to hear! Is there anything what I can assist you with? I am not a Rust expert, however if you give me some pointers I will try to help and assist. (I have developed a graphQL endpoint for Anzograph which uses SparQL protocol in a JS)

007vasy commented 3 years ago

https://github.com/007vasy/rust-sparql-client/blob/main/src/main.rs this is a bare bones code, however with anzograph it could be used as base for a sparql client for anzograph (I made it work with that db)

pchampin commented 3 years ago

I have a first version of a a SPARQL client for Sophia here: https://github.com/pchampin/sophia_sparql_client

It is not on crates.io yet because it relies on the SparqlDataset trait which is only available in the github version of Sophia at the moment, but I'll release it at the same time as the next version of Sophia.

In the meantime, you can still use it directly from github: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies-from-git-repositories

007vasy commented 3 years ago

thanks! @pchampin :)