-
Notifications
You must be signed in to change notification settings - Fork 74
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
Fix template handling of full IRIs #783
Conversation
The code looks good, but you know what I'm going to say! 😄 We need some unit tests, please. |
Done! |
* @param iri IRI to check | ||
* @return true if no invalid characters found | ||
*/ | ||
public static boolean shortFormIsValid(IRI iri) { |
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.
Is valid what? CURIE? QName? String?
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.
It validates that the short form does not contain invalid characters. I guess shortFormContainsInvalidCharacters
(returns true on invalid) or something like that sounded too long to me but I can change it.
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.
My point is that there are no invalid characters in general, without saying what the standard is. There are invalid characters for a CURIE, or a QName, or an IRI, or a Python function name.
I'll think about it a little more and make changes myself.
I asked for three different error messages, but when I went to review this closely only two made sense to me, so I removed one. |
Resolves #782
docs/
have been added/updatedmvn verify
says all tests passmvn site
says all JavaDocs correctCHANGELOG.md
has been updatedIn the issue,
http://example.com/resource/1
is not a technically a valid QName, and we updated the processing of IDs/IRIs in templates last May to make sure all IRIs were also valid QNames. This is because the writer would fail on invalid QNames, but it seems like it's only certain invalid QNames... Even though it's not valid, OWLAPI seems to still handle it OK as opposed to the CURIEs that were never expanded to IRIs (see #688).The QName check in OWLAPI fails every time for
http://example.com/resource/1
so I made a hack around it with a newisQName
method in IOHelper. It will still fail for CURIEs with undefined namespaces, as we expect.