fix guessVocabularyFromURI when some vocabulary has no URI space#1559
Merged
fix guessVocabularyFromURI when some vocabulary has no URI space#1559
Conversation
|
Kudos, SonarCloud Quality Gate passed!
|
4 tasks
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1559 +/- ##
============================================
+ Coverage 70.20% 70.22% +0.01%
- Complexity 1664 1665 +1
============================================
Files 32 32
Lines 4293 4295 +2
============================================
+ Hits 3014 3016 +2
Misses 1279 1279 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








Reasons for creating this PR
I ran into a bug when displaying external mappings (to LCSH and Wikidata) on a YSO concept page. I've configured one unrelated vocabulary (YSO-time) without setting a URI space. That breaks the mappings display:
It turns out that if there is a vocabulary without a defined URI space, then external mappings of other vocabularies do not resolve properly because the Model.guessVocabularyFromURI method breaks. This PR fixes the problem by using an additional if check for empty URI space.
Link to relevant issue(s), if any
Description of the changes in this PR
When constructing a cache of URI space to vocabulary mappings, don't include vocabularies that don't have a URI space.
Known problems or uncertainties in this PR
Ideally there should be a unit test, but we don't have any existing tests for empty URI space either.
The same fix should be applied to Skosmos 3 as well. I will do that in a separate PR.
Checklist
.sr-onlyclass, color contrast)