json-ld
json-ld copied to clipboard
Feature Request (Docs): Add documentation for generic arguments
I am struggling to understand, at the very least, the full name for all the generic arguments. For example, what is a B
? Providing the name only in the documentation would be a huge help.
Bonus points for a few examples of the types that might go into the generic args.
Sorry for the trouble, yes it's lacking a lot of documentation.
For the record before I find time to continue writing the doc:
-
I
is the type of IRIs. If you are not using a vocabulary it can beiref::IriBuf
. Otherwise any type compatible with theIriVocabulary
you are using. Sometimes this parameter is namedT
, this is an inconsistency I must solve. -
B
is the type of blank node identifiers. If you are not using a vocabulary it can berdf_types::BlankIdBuf
. Otherwise any type compatible with theBlankVocabulary
you are using. -
V
is the vocabulary type if you are using any function ending in_with
. It usually must implementIriVocabulary
orBlankIdVocabulary
(or theirMut
counterpart), or both (shorthanded with theVocabulary
trait). It mapsI
to IRIs, andB
to blank node identifiers. A common value forV
isrdf_types::vocabulary::IndexVocabulary
that works withI
andB
both equal tordf_types::vocabulary::Index
that is essentially a wrapper aroundusize
. -
G
is the identifier generator type, implementingrdf_types::Generator
. It is used by all the functions that need to generate fresh node identifiers. A good choice forG
isrdf_types::generator::Blank
that will generate fresh blank node identifiers. -
L
is the document loader type, implementingjsonld::Loader
. It is used to load remote JSON-LD documents. Multiple loader implementation are provided, the most compliant to the JSON-LD spec beingReqwestLoader
that can be enabled with thereqwest
feature. -
M
is the metadata type. JSON-LD is a syntactic representation of an RDF dataset. This parameter is used to keep track of the position of each syntactic node in the original source file. You can use()
if you are not interested in keeping this information. You can uselocspan::Span
to keep only the span in the source file, orlocspan::Location<I>
to keep the span along with the source file name (although it is not recommended ifI
is memory consuming, likeIriBuf
).
I think that's most of the parameters you will encounter.