Skip to content

Commit

Permalink
fix: Update version of chart
Browse files Browse the repository at this point in the history
This is a temporary fix for something that seems like a bigger problem.

The symptom was that during the edition.spec tests, we'd have a data
loading error in place of the chart.

This is because inside the observationsQuery, one of the pattern
has an undefined subject.

The pattern is the one $cubeNode cube:observationSet ?observationSet0.
Here, $cubeNode is a NamedNode whose term should be the cube iri.

However here, the cube iri is undefined. The cube iri is taken from the
source, trying to find an outward edge with ns.view.cube and then
getting the term from the result.

The problem is that there is two edges from the source, one to the
old version of the cube, and one to the new version. This causes
the .term lookup here (https://github.com/zazuko/rdf-cube-view-query/blob/fac3834aadfdd3807ae96577ae12c9c5e865664e/lib/query/ViewQuery/Sources.js#L37)
to return undefined (because there are two links), so "terms" should be
used.

The problem goes away when updating the cube from the config (since
the old version is not loaded anymore), or when not using the cache
(using directly getRawCube instead of cachedGetRawCube). We still
do not know while not using the cache fixes the bad behavior.

TLDR: When using the cached cube loader, we cannot load cubes with an old
version: this seems to be because when we load several versions of a
cube, the source node ends up having two outward links (one to the
old version, one to the new version), instead of one outward link
to the right cube.
  • Loading branch information
ptbrowne committed Nov 14, 2022
1 parent a870752 commit fc2040d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion e2e/fixtures/offentliche-ausgaben-chart-config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"state": "CONFIGURING_CHART",
"dataSet": "https://environment.ld.admin.ch/foen/fab_Offentliche_Ausgaben_test3/7",
"dataSet": "https://environment.ld.admin.ch/foen/fab_Offentliche_Ausgaben_test3/8",
"dataSource": {
"type": "sparql",
"url": "https://int.lindas.admin.ch/query"
Expand Down

0 comments on commit fc2040d

Please sign in to comment.