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

Modifying example query with aggregation fails #646

Open
ch-sander opened this issue Oct 17, 2024 · 2 comments
Open

Modifying example query with aggregation fails #646

ch-sander opened this issue Oct 17, 2024 · 2 comments
Labels

Comments

@ch-sander
Copy link

If I load a preset query with a count and then modify this query, I will get an error in the console and the UI for the aggregation empties:

SparqlGenerator.ts:55 Uncaught TypeError: Cannot read properties of undefined (reading 'selectedVariable')
    at po.generateQuery (SparqlGenerator.ts:55:39)
    at fo.generateQuery (GenerateQuery.ts:51:32)
    at HTMLDivElement.<anonymous> (ActionStore.ts:52:34)
    at RemoveEndClass.ts:45:22
    at HTMLLIElement.<anonymous> (GroupWrapperEventStore.ts:36:9)
    at ClassTypeId.ts:118:20
    at HTMLSpanElement.<anonymous> (UnselectBtn.ts:10:7)
    at HTMLSpanElement.dispatch (jquery.js:5430:27)
    at e.9755.S.event.add.m.handle (jquery.js:5234:28)

example query:

{
  "distinct": true,
  "variables": [
    {
      "expression": {
        "type": "aggregate",
        "aggregation": "count",
        "distinct": false,
        "expression": {
          "termType": "Variable",
          "value": "institution_1"
        }
      },
      "variable": {
        "termType": "Variable",
        "value": "institution_1_count"
      }
    },
    {
      "termType": "Variable",
      "value": "region_4"
    }
  ],
  "order": null,
  "branches": [
    {
      "line": {
        "s": "institution_1",
        "p": "http://www.graceful17.org/shacl/sparnatural-config/primary_place",
        "o": "place_2",
        "sType": "http://www.graceful17.org/shacl/sparnatural-config/institution",
        "oType": "http://www.graceful17.org/shacl/sparnatural-config/place",
        "values": []
      },
      "children": [
        {
          "line": {
            "s": "place_2",
            "p": "http://www.graceful17.org/shacl/sparnatural-config/falls_within",
            "o": "region_4",
            "sType": "http://www.graceful17.org/shacl/sparnatural-config/place",
            "oType": "http://www.graceful17.org/shacl/sparnatural-config/region",
            "values": []
          },
          "children": []
        }
      ]
    }
  ]
}

grafik

@tfrancart
Copy link
Contributor

I cannot reproduce. Could you be more precise on the sequence of action you are taking to reproduce the bug ? what exactly are you modifying after loading the query ?

@ch-sander
Copy link
Author

Sure!

Issue.646.mp4
  1. I open (or create) a query that has more than one branch. I used one that has a count aggregation, but maybe that's not even the issue.
  2. I delete on line/branch in the query
  3. the panel for aggregation/sort will then be empty. The query still works, though.

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

No branches or pull requests

2 participants