add support for showDeprecated parameter in hierarchy queries; touche… #1173
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.
…s #1143
This draft PR brings support for
showDeprecated
parameter in multiple hierarchy-related queries. However, implementing this has proven to be a bit difficult and this PR is not yet ready. There seems to be quite a bit of different cases involved and,, thus, open, questions, e.g.,Deprecated concept (attached to hierarchy) is opened, what to do with hierarchy? E.g., https://finto.fi/juho/fi/page/p4304
-- Show it normally
-- Show the hierarchy 'till the opened deprecated concept (this is what this draft PR is doing)
-- Only show the deprecated concept (and maybe it's non-deprecated children?)
-- Previous one combined with "base" hierarchy
-- Something else, what?
If a concept lies below a deprecated one, what to do with hierarchy? E.g., https://finto.fi/juho/fi/page/p5875
-- Show the whole tree without deprecated ones ("jumping" over deprecated ones)
-- Only show the hierarchy 'till there is non-deprecated concepts (current implementation, additionally, breadcrumbs halt at the very same non-deprecated concept)
-- Somethings else, what?
Deprecated sub-tree
-- Show that part, if one of those is chosen?
Requires tests for each of the ones above, both live and PHPUnit. One must pay attention that changing some functions here may affect the input of other queries, too (e.g.,
queryTransitiveProperty
).Other questions:
Additional note: after playing a bit back and forth, it seems like it could be possible to just return the states of concepts (whether a concept is deprecated or not) and from there, adjust the hierarchy in either JavaScript or in the
transform*
function. This would simplify the required code quite a bit compared to what it would have to be - e.g., thedeprecatedClauses
in files changed may not be complete in many cases. E.g., skipping deprecated broader concepts in hierarchy in cases of non-deprecated subconcepts is not a very easy feat to do directly in SPARQL.