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

ValidationConstraintFailedException does not contain lastName column #269

Closed
palagdan opened this issue Sep 2, 2024 · 2 comments · Fixed by #270
Closed

ValidationConstraintFailedException does not contain lastName column #269

palagdan opened this issue Sep 2, 2024 · 2 comments · Fixed by #270
Assignees

Comments

@palagdan
Copy link
Collaborator

palagdan commented Sep 2, 2024

Screenshot from 2024-09-02 14-46-47

In the constraint-validation example, after the pipeline fails, the ValidationConstraintFailedException does not contain lastName due to strange bindings.

 private void checkConstraints(Model model, QuerySolution bindings, List<Resource> constraintQueries) 

Screenshot from 2024-08-30 12-52-44

@palagdan palagdan self-assigned this Sep 2, 2024
@palagdan
Copy link
Collaborator Author

palagdan commented Sep 2, 2024

I changed the for loop to traverse through all variables(not in solution, in resultSet), but I found out that lastName is empty.

    ResultSet rs = execution.execSelect();
                constraintViolated = rs.hasNext();
                if(constraintViolated){
                    for(int i = 0; i < ExecutionConfig.getEvidenceNumber() && rs.hasNext(); i++){
                        QuerySolution solution = rs.next() ;
                        Map<String, RDFNode> evidenceMap = new LinkedHashMap<>();
                        for (String varName : rs.getResultVars()) {
                            RDFNode value = solution.get(varName);
                            if (value != null) {
                                evidenceMap.put(varName, value);
                            } else {
                                evidenceMap.put(varName, model.createLiteral("")); 
                            }
                        }
                        evidences.add(evidenceMap);
                    }
                }

Image

@palagdan palagdan changed the title ValidationConstraintFailedException does not contain some columns ValidationConstraintFailedException does not contain lastName columns Sep 2, 2024
@palagdan palagdan changed the title ValidationConstraintFailedException does not contain lastName columns ValidationConstraintFailedException does not contain lastName column Sep 2, 2024
palagdan added a commit that referenced this issue Sep 2, 2024
palagdan added a commit that referenced this issue Sep 2, 2024
@blcham
Copy link
Contributor

blcham commented Sep 11, 2024

see my comment in PR #270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants