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

Unversion dimension values locally #1135

Open
bprusinowski opened this issue Aug 22, 2023 · 0 comments
Open

Unversion dimension values locally #1135

bprusinowski opened this issue Aug 22, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@bprusinowski
Copy link
Collaborator

Currently, we unversion the dimension values by sending a query with all values using http:https://schema.org/sameAs predicate to LINDAS. While this is a performant query, it still takes some time to fetch the unversioned values. Based on this conversation we might drop the queries and unversion the values locally, by stripping the version number and improve performance of the application a little bit.

Potential implementation:

// Experimental method to unversion a dimension value locally. To be used / removed
// once we have a confirmation from Zazuko that this works.
// https://zulip.zazuko.com/#narrow/stream/32-bar-ld-ext/topic/unversioning.20dimension.20values
// const unversionValue = (
// d: string,
// props: {
// resolvedDimension: ResolvedDimension;
// }
// ) => {
// const { resolvedDimension } = props;
// const { cube, dimension } = resolvedDimension;
// // If dimension is versioned, the cube must be versioned too.
// if (dimensionIsVersioned(dimension)) {
// const versionedCubeIri = cube.term?.value ?? "";
// const unversionedCubeIri = versionedCubeIri
// .split("/")
// // Remove the version number.
// .slice(0, -1)
// .join("/");
// return `${unversionedCubeIri}/${d.replace(versionedCubeIri + "/", "")}`;
// }
// return d;
// };
// const unversioned = Object.fromEntries(
// Object.entries(d).map(([k, v]) => {
// const dim = cubeDimensionsByIri[k];
// if (dim) {
// const unversionedValue = unversionValue(v.value, {
// resolvedDimension: dim,
// });
// return [k, rdf.namedNode(unversionedValue)];
// }
// return [k, v];
// })
// );

@bprusinowski bprusinowski added the enhancement New feature or request label Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant