rio icon indicating copy to clipboard operation
rio copied to clipboard

Add JSON-LD Support

Open JordanShurmer opened this issue 5 years ago • 9 comments

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.

JordanShurmer avatar Dec 03 '19 14:12 JordanShurmer

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.

Tpt avatar Dec 03 '19 16:12 Tpt

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.

JordanShurmer avatar Dec 03 '19 20:12 JordanShurmer

Perhaps the sophia_jsonld crate could be useful: https://github.com/pchampin/sophia_rs

Only supports expanded syntax at this time.

joepio avatar May 13 '20 14:05 joepio

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.

damooo avatar Feb 01 '22 14:02 damooo

here is a high level overview of approach taken by above lib : https://www.rubensworks.net/blog/2019/03/13/streaming-rdf-parsers/

damooo avatar Feb 01 '22 15:02 damooo

There is also the json_ld crate (src) which comes with support for expansion, compaction and flattening.

almereyda avatar Feb 11 '23 17:02 almereyda

Any progress on this? Having json-ld supported would be sooo great!

ccamel avatar Nov 14 '23 08:11 ccamel

@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.

Tpt avatar Nov 14 '23 08:11 Tpt

@amimart fyi.

ccamel avatar Jan 11 '24 08:01 ccamel