Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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