-
I would love some kind of high level orientation documentation for this library.
I'm losing some time trying to work out how to wrangle a sophia::term::SimpleIri into a sophia::iri::Iri, and either missing something that isn't quite obvious enough or doing something entirely misconceived in the first place... do I go through changing everything into one... or the other? I'm bouncing around the docs and source to work out what implements which variations of From and how many different ways I can get out a &str, or Box or MownStr. I think just one or two high level tips would really help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Yes, the high-level user documentation is long overdue :-/ But at the moment I'm busy refactoring the code. Hopefully, once this is done, it will be less of a mess ;-) In the meantime, I will try to help you make sense of it.
If your are interested specifically in IRIs, and not any other kind of terms, then you should use the four types provides by
As a bonus: the way to get rid of a IriRefBox::new_unchecked(si.value().into()) (or Hope this helps. |
Beta Was this translation helpful? Give feedback.
Yes, the high-level user documentation is long overdue :-/ But at the moment I'm busy refactoring the code. Hopefully, once this is done, it will be less of a mess ;-)
In the meantime, I will try to help you make sense of it.
sophia_iri
(republished assophia::iri
) provides simple string wrappers whose sole purpose is to guarantee that the string is a valid IRI (resp. IRI reference). That's the most basic way to represent an IRI.sophia_term
(republished assophia_term
), on the other hand, provides a number of types for representing RDF terms (using different kinds of smart pointers for stri…