Fix Skosmos 2 deprecated concept pages (bool value causes crash)#1673
Merged
Fix Skosmos 2 deprecated concept pages (bool value causes crash)#1673
Conversation
kouralex
reviewed
Aug 30, 2024
…label for owl:deprecated property
|
joelit
approved these changes
Aug 30, 2024
Contributor
joelit
left a comment
There was a problem hiding this comment.
LGTM - all use cases that were affected seem to work now
4 tasks
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
Concept pages for deprecated concepts are currently broken in Skosmos 2. The bool value for
owl:deprecatedis causing a crash in Concept->removeDuplicateValues, like this:I had to do some digging to figure out the cause. It happens only when there is a rdfs:label available for the owl:deprecated property in the current vocabulary, or the default graph. Having a label makes Concept->getProperties consider the owl:deprecated property, but it will crash in Concept->removeDuplicateValues because the value of owl:deprecated is of type bool that the code wasn't prepared for.
This PR fixes the crash by adding an extra is_object check. To verify that the fix is working, there is a new unit test as well as a new test vocabulary containing triples that can be accessed through the default graph. Also, owl:deprecated is added to the list of deleted properties to keep it from being displayed on the concept page.
Link to relevant issue(s), if any
Fixes #1635 (for skosmos 2)
Description of the changes in this PR
is_object($label)checkowl:deprecatedto list of properties that will not be displayed on concept page (otherwise it would be shown to the user)Known problems or uncertainties in this PR
The same fix has to be done for Skosmos 3 as well.
Checklist
.sr-onlyclass, color contrast)