Open dclements opened 11 months ago
Generally, URLs and IRI should be valid based on the spec that defines them. I don't think we actually do rigorous validity checks, however. IIRC, there are some cases where setting base_IRI
to null
might be done (need to look at the test cases more thoroughly). In this case, it would be better to see if it is null
, as doing an actual validity check is not really warranted.
While base_url
is a required parameter, its value may be null
. If an IRI, it MUST be a valid IRI, but we don't explicitly check for IRI validity. This would leave open the possibility that an implementation might use an invalid IRI for expansion, and another might actually do the validity check and skip it using the context URL instead.
In 5.2.1 of the context processing algorithm it says:
But in the description of section 4.1.2 it says the following:
Implementations seem to diverge in how they handle this with Rust's json-ld treating it as optional, the java titanium just ignores that it might not be a "valid" IRI, as does the ocaml RDF implementation.
Because this is a sub-algorithm for other algorithms (though it isn't treated as such per se) there don't seem to be any tests rooted in the inputs or expected outputs for this algorithm, but looking at where it does get called:
This is for the situation where the term definition is an expanded term definition containing a local context that must be a valid context definition. That does allow your
base
to benull
but it is difficult to tell at a glance whether this would come up in practice during the processing.So it seems like one of the following must be true:
base_url
is an optional (or at least nullable) attribute, but it cannot be "invalid."