rio
rio copied to clipboard
Add JSON-LD Support
Another common RDF format is json-ld. In fact, this is a required format for ldp servers. I'll gladly contribute to this when I get the time, but I figured I should go ahead and open this issue.
I assume this would involve adding a new crate rio_jsonld
, following the paradigm already established for the other parsers.
Hi @JordanShurmer! It would be amazing to have JsonLD support in Rio.
The official JSON-LD RDF (de)serialization algorithm depends on other algorithms that seems out of scope of Rio. It might be nice to have a separate library implementing and exposing JSON-LD algorithms and then provide a wrapper for it in Rio allowing to do (de)serialization using the same interface as for the other formats supported by Rio.
PS: I have just seen that you started a Solid server project in Rust. I would be pleased to help and you could find useful my Oxigraph project.
Yeah, that makes sense having the algorithm as a crate which a rio crate depends on.
Yeah, I was looking at that project earlier today :) Definitely similarities, and I welcome any contributions to the solid-rust project. It's just me so far, so there's not any legit project plan or timeline or whatever, but feel free to contribute however you want. This is my first real rust project, so I'm sure there's overall improvements/architectural changes that could be made too.
Perhaps the sophia_jsonld crate could be useful: https://github.com/pchampin/sophia_rs
Only supports expanded syntax at this time.
The official JSON-LD RDF (de)serialization algorithm depends on other algorithms that seems out of scope of Rio.
@Tpt , Official de-serialization algos seem to assume loading entire json as object, and derive semantic statements by manipulating/analyzing those json structures. This definitely is out of scope for rio.
And there is popular jsonld-streaming-parser.js lib, that do parse json-ld docs in streaming way, much like parsers for other syntaxes. This is one of standard lib in rdfjs ecosystem. This model can fit in scope of rio, i hope. There is also corresponding streaming serialization library too.
here is a high level overview of approach taken by above lib : https://www.rubensworks.net/blog/2019/03/13/streaming-rdf-parsers/
There is also the json_ld crate (src) which comes with support for expansion, compaction and flattening.
Any progress on this? Having json-ld supported would be sooo great!
@ccamel Sadly not in Rio. But the great news is that the json_ld
crate new supports emitting quads. So, there is a Rust solution.
@amimart fyi.