Closed hoijui closed 7 months ago
Thanks for this PR. I totally agree that it should be easy for beginners to start experimenting with Sophia. That being said, I am not 100% this is the good place for that.
Some times ago @huhn511 made a PR to include a use-documentation for Sophia, generated with mdBook. This books is currently very(!) minimalistic, but it contains a Getting started section, containing almost exactly the code you suggest. I believe this is a better place for such a self-contained example. Would you agree?
Of course, the book needs to be accessible, which was not the case (bad GH-pages configuration... this is now fixed), and should be linked to from the README in order to be findable.
ahh yeah indeed, same; I am fine with it being there, so once/if it is accessible as you say, then you can close this PR. and yeah.. very minimal.. it is basically only this one example. :D
Maybe an easy head-start would be, to link to some crates/software that uses sophia, and has easily accessible code (without having to read many functions in many files). ... if you know of any.
Comming back to sophia again after some time, and.. it is still hard to get started.
// do something with t
-> how?ouh well, to document it for myself for next time:
for t in graph.triples() {
let t = t?; // rethrow error if any
// do something with t:
println!("{}", t.s()); // prints the subject
}
(I found it in my own code in an other software ... what a memory!)
Thanks for your renewed interest for Sophia, despite the absence of introductory material :)
Please notice that the main
branch is now tagged as v0.8.0-alpha, which introduces a number of signifcant changes in the API. This refactoring has been taking most of the time I could dedicate to Sophia in 2022, hence the stand-by on documentation.
The book (generated from the book
folder) is still in a very preliminary state, but any PR to flesh it out are welcome. As soon as it begins to contain enough material, I will link it from the README and the API documentation.
Closing this PR. As discussed above, the book is a better place for this kind of material.
This allows to:
cargo init
src/main.rs
... and be good to go.
To me, it would make sense to hide some of it in further examples, if there were any, but at least one should be very easy to use and do first experiments with. It certainly helps rust newbs saving a ton of time, for the penalty of adding ~ four lines of standard code.