Skip to content
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

Incorrect query generation when unselecting EndClassGroup #465

Closed
tfrancart opened this issue Apr 4, 2023 · 6 comments
Closed

Incorrect query generation when unselecting EndClassGroup #465

tfrancart opened this issue Apr 4, 2023 · 6 comments
Labels
kind: Bug 🐞 Bug priority: High ⬆️ High-priority issue what: SPARQL generation SPARQL query generation / compatibility

Comments

@tfrancart
Copy link
Contributor

  1. Generate a simple query X --property--> Y = all
  2. Change the EndClassGroup to Z, select "all", and click on the eye of "Z" to select it : X --property--> Z (selected) = all

The generated SPARQL query is wrong as an extra variable is generated for X:

image

image

here the variable "?Lot_partenaire_4" should not be here

@tfrancart tfrancart added kind: Bug 🐞 Bug what: SPARQL generation SPARQL query generation / compatibility labels Apr 4, 2023
@tfrancart
Copy link
Contributor Author

this comes from the ActionStore.variables array

@tfrancart
Copy link
Contributor Author

This can come from the fact that in RemoveEndClass.ts we are recreating the complete CriteriaGroup, which triggers a new variable generation

image

@SteinerPascal
Copy link
Collaborator

Should I have a look at it?

@tfrancart
Copy link
Contributor Author

Hello @SteinerPascal if you have some time, yes I would gladly welcome help because I have been scratching my head on this for a couple of hours and cannot get to anything. I feel there is 2 problems:

  1. There is an extra variable in the SPARQL
  2. The variable counter is not reset when triggering RemoveEndClass, and the CriteriaGroup is recreated just like it was new, so all variables are renumbered.

It would be better if the variable names are consistent, and what was once xxxx_1 remains xxxx_1.

@tfrancart tfrancart added the priority: High ⬆️ High-priority issue label Apr 19, 2023
@tfrancart
Copy link
Contributor Author

  1. RemoveEndClass empties CriteriaGroup and recreate a completely new one, then reselect the first class based on previous selection
  2. The recreation of the StartClassGroup uses a new sequence counter from the actionStore.sparqlVarID
  3. RemoveEndClass ask to "updateVarList" that should reset actionStore.variables based on the actually selected variables in the UI
  4. When clicking on the eye, onSelectViewVar event is triggered, which calls selectViewVar, then readVariablesFromUI, and this is where the bug is : this returns the extra, unwanted "xxxx_1" variable.

@tfrancart
Copy link
Contributor Author

I think in the updateDraggables function, we just remove the HTML but we don't actually remove the draggable from the list of draggables.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: Bug 🐞 Bug priority: High ⬆️ High-priority issue what: SPARQL generation SPARQL query generation / compatibility
Projects
None yet
Development

No branches or pull requests

2 participants