linkml / prefixmaps

Semantic prefix map registry
https://linkml.io/prefixmaps/
Apache License 2.0
10 stars 3 forks source link

Updated instantation of `curies.Converter` #25

Closed cthoyt closed 1 year ago

cthoyt commented 1 year ago

As an alternative to https://github.com/cthoyt/curies/pull/22, this PR does the following:

  1. 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)
  2. Updates examples in the README related to curies to use this more detailed export
  3. 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.

Blocked By