fix handling of URIs in the default namespace by jclerman · Pull Request #2365 · RDFLib/rdflib (original) (raw)
I think I'd like to update the PR to allow an optional
generate
parameter oncurie()
, and pass its value tocompute_qname()
's parameter of the same name. My own preference would be to make the default valueFalse
- I think that would still make this technically an impure function, but at least the default behavior would be to leave the NamespaceManager unchanged.
A parameter like that would be nice, but I would not say essential. If the namespace manager was a blank slate, I would prefer to default to generate=False
, but the existing behaviour of other functions makes it a bit controversial to do that, as they generate by default (i.e. have generate=True
as a default). I think having NamespaceManager.curie
behave the same as most other methods on NamespaceManager
is probably best (as it does at this point in time), even though it does not feel entirely right to default to generate=True
.
So, it is up to you if you want to add a generate parameter to this PR, happy if you change this PR to add it. I would though say it should default to generate=True
for the reasons above, and if it does, it is also fine to add it later. I would not necessarily say generate=False
would be wrong because it would not be, but in context I think generate=True
is more correct.