-
Notifications
You must be signed in to change notification settings - Fork 28
Clarify that URI-typed slots expect non-relative URI values. #453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add a new type `AbsoluteURI`, based on the LinkML type `uri` but with the added restriction that the URI must be absolute. Update `uri`-typed slots to make them use the `AbsoluteURI` type instead. Add a recommendation that implementations SHOULD still accept relative URIs in all `AbsoluteURI`-typed slots, when they are processing a SSSOM 1.0 set. closes #448
…RI). We rename the `sssom:AbsoluteURI` to `sssom:NonRelativeURI`. "Absolute URI" is a misnomer and a possible source of confusion, because the RFC 3986 uses that name to refer to URIs that both (1) have a scheme component and (2) do not have a fragment component. In the context of SSSOM, we only want (1): we want to forbid relative URI references that do not have a scheme, but we do _not_ want to forbid non-relative URIs that have a fragment. (The name `NonRelativeURI` is somewhat ridiculous, as per the RFC 3986 all URIs are necessarily non-relative, and only "URI references" can be relative; but we cannot name our type "URI" because of the risk of confusion with the LinkML type, which despite its name refers in fact to URI references... ><) We also explicitly clarify that the type is specifically intended to exclude relative URI references, and provide some examples of both valid URIs and invalid relative URI references.
matentzn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is across the board better than what we currently have - I wonder if we should technically speaking separate nonRelativeURI from URL, as the latter excludes URNs? Some of the slots (about a third I think) clearly want URLs, not arbitrary non relative URIs. Happy to wave this one through though, just suggesting!
I’d say no. The distinction between a URI and a relative URI reference is a clear and non-ambiguous one: if there is no scheme component (i.e. if the string does not start with The distinction between a URI and a URL is much less clear (as the RFC 3986 itself says). In fact, it is clear only for URNs (URIs with a Examples of URIs that, strictly speaking, are also locators, but that may not be considered as such depending on the capabilities of the program manipulating them:
So, I think SSSOM should stay clear of this and only ever mention URI, without trying to draw a line between URLs and non-URLs. |
When describing the typing change of the `see_also` slot, the "changes in SSSOM 1.1" section should correctly refer to the new type as `sssom:NonRelativeURI` instead of `sssom:AbsoluteURI`. Co-authored-by: Nico Matentzoglu <nicolas.matentzoglu@gmail.com>
ehartley
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the range of the prefix_url slot also be changed to NonRelativeURI?
Co-authored-by: Emily Hartley <ehartley@c-path.org>
I sure hope no one would ever even think of using relative URI references in a curie map! What would that even mean? :D … But if we don’t explicitly forbid it, then it is almost guaranteed that someone, somewhere, will do exactly that just because they (think they) can, so I agree. I will change the range of (As an aside, it is unfortunate that this slot has been named |
Hum, on second thought, not so sure about that. The So, something like this: where the final identifiers are of the form So I don’t think we should change that now. We may think that semantic identifiers should always be fully resolvable IRIs, and that relative identifiers like in the example above are not great, but if people do have such identifiers they should be allowed to use them in SSSOM. |
matentzn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you!
ehartley
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Resolves [#448]
docs/have been added/updated if necessarymake testhas been run locally[ ] tests have been added/updated (if applicable)URI-typed slots are expected to contain (non-relative) URIs only, but the LinkML
uritype accepts both URIs and relative URI references (something that is not very clear in the LinkML’s metamodel, but the implementation of theURItype leaves no doubt that relative URI references are considered valid values).So we add a new
NonRelativeURItype, based on the LinkMLuritype but with the added restriction that the URI must not be a relative URI reference. Of note, that restriction is only documented, not enforced: it is up to implementations to actually check that the value of aNonRelativeURI-typed slot is indeed a non-relative URI, as the underlying LinkML implementation will accept both non-relative and relative URI references.All slots that were previously defined with a
urirange are redefined to use the newNonAbsoluteURItype.Since it has never been clear, in SSSOM 1.0, that URI-typed slots were supposed to contain only non-relative URIs, for backwards compatibility it is RECOMMENDED that implementations still accept relative URI references when processing sets compliant with version 1.0 of the spec.