-
Notifications
You must be signed in to change notification settings - Fork 160
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
Inverse property path with optional ?
does not work in some cases
#2727
Comments
I quite agree - we keep monkey-patching the code, but it really needs a good overhaul.
I think we should look at writing a dedicated class for handling of path expressions. Or at the very least get rid of the awful if-else constructions in visit(PathSequence) and handle things properly. |
Original issue: https://ontotext.atlassian.net/browse/GDB-4650, where we have a more complex case of collecting VIAF names with a more complex path like this |
I'm doing a little spiking on this in my spare time, to see if I can come up with a refactor that makes sense. |
- drastically simplified path modifier handling, as a lot of the logic was legacy from the old (now unsupported) prop{min,max} syntax
- drastically simplified path modifier handling, as a lot of the logic was legacy from the old (now unsupported) prop{min,max} syntax
As far as I can see the actual output is correct
As far as I can see the actual output is correct
GH-2727 simplified path expression processing and fixed nested inverse optional handling
There is an issue with the Inverse property paths in conjunction with
?
optional modifier when grouping with brackets (forced precedense) are used.To reproduce load following data:
This query works as expected, returning 4 results:
This query, that uses the default operator precedense, also works correctly returning 4 results
This query returns correctly 3 results:
but when we add
?
optional modifier, it is expected to return the above 3 results plus the so calledself
result but instead, it only return one result (self
):which is unexpected.
the produced query model in the wrong case is not inversed (urn:object is on subject position and the var on object position, e.g. these are not swapped according to the
^
inverse modifier used.Tried to find a solution/quick fix but the code around the transaltion of property paths is a bit of a mess. For simple inverse paths like the one used in the above queries the code could be patched somehow but if the path is more complex and involves either alternatives or other segments that are also inversed the number of
swaps
could not be deduced after the recursive step finishes converting the nested segments so it is hard to decide wheter to swap the subj/obj positions or not.Hope this description is clear enough ...
The text was updated successfully, but these errors were encountered: