Adds a new output type to the Context class: Context.as_extended_prefix_map() that keeps not only the canonical, bijective prefix map, but also the synonyms for the prefix and namespaces. Note that curies uses slightly different terminology (i.e. uri_prefix instead of namespace)
Updates examples in the README related to curies to use this more detailed export
Adds tests that this export works as expected
While this has the benefit of keeping prefixmaps and curies uncoupled, I think this would be better if the Context object just had an as_converter method which deduplicated this repeated code, though.
As an alternative to https://github.com/cthoyt/curies/pull/22, this PR does the following:
Context
class:Context.as_extended_prefix_map()
that keeps not only the canonical, bijective prefix map, but also the synonyms for the prefix and namespaces. Note thatcuries
uses slightly different terminology (i.e.uri_prefix
instead ofnamespace
)curies
to use this more detailed exportWhile this has the benefit of keeping
prefixmaps
andcuries
uncoupled, I think this would be better if theContext
object just had anas_converter
method which deduplicated this repeated code, though.Blocked By