Closed phillord closed 7 months ago
There is already a simple RDF/XML formatter in RIo: https://docs.rs/rio_xml/0.5.1/rio_xml/struct.RdfXmlFormatter.html
Yes, I have seen. I have currently implemented most of my library in terms of sophia. I'm actually fairly unclear about the relationship between sophia and rio; I know that rio has a sophia adaptor as a feature. It isn't clear to me whether I should be using rio directly or sophia as I am at the moment (this wasn't a principled decision on my behalf; I just found sophia first!).
I'm actually fairly unclear about the relationship between sophia and rio; I know that rio has a sophia adaptor as a feature.
It's a bit complicated indeed.
Rio implements some sophia_api
traits and sophia
wraps the Rio parsers (RDF/XML and Turtle/Trig/Ntriples/NQuads) to provide its own parsing APIs. To summaries, Rio crates have an optional dependency on sophia_api
and sophia
depends on sophia_api
and on the Rio crates. Rio also provides formatters (used in e.g. Oxigraph) but Sophia uses it owns formatters for Turtle and derived formats.
Thank you for the explanation. It's very clear!
To complete @Tpt's excellent summary: it would indeed be nice to wrap Rio formattes into Sophia's serializer API, the same way it is currently done for parsers... TODO++
The latest commit (017aab4f) adds a wrapper around Rio's RDF/XML and Turtle parsers. An example of how to use it is provided in sophia/examples/convert.rs
.
Thank you indeed!
As far as I can see there isn't an XML serializer available at the moment. This would be a nice to have.