Skip to content

Commit

Permalink
fix: Also consider rest of the sh:or when retrieving min or max values
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Oct 19, 2023
1 parent 25c562e commit a06f614
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions app/rdf/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,18 @@ export const getCubeDimensionValues = async ({
];
}

const firstPointer = dimension.out(ns.sh.or).out(ns.rdf.first);
const firstMin = firstPointer.out(ns.sh.minInclusive);
const firstMax = firstPointer.out(ns.sh.maxInclusive);
const listPointer = dimension
.out(ns.sh.or)
.out([ns.rdf.first, ns.rdf.rest]);
const listMin = listPointer.out(ns.sh.minInclusive);
const listMax = listPointer.out(ns.sh.maxInclusive);

if (
typeof firstMin.value !== "undefined" &&
typeof firstMax.value !== "undefined"
typeof listMin.value !== "undefined" &&
typeof listMax.value !== "undefined"
) {
const min = +firstMin.value;
const max = +firstMax.value;
const min = +listMin.value;
const max = +listMax.value;

return [
{ value: min, label: `${min}` },
Expand Down

0 comments on commit a06f614

Please sign in to comment.