-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1520 from zazuko/shared-dim-slow
feat: searchable shared dimensions
- Loading branch information
Showing
19 changed files
with
370 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@cube-creator/shared-dimensions-api": minor | ||
--- | ||
|
||
Improve loading speed of Shared Dimensions in UI (closes #1509) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@cube-creator/shared-dimensions-api": minor | ||
--- | ||
|
||
Shared dimensions are now searchable and paginated in search results on dimension mapping and hierarchy screens (re #1509, closes #1481) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
import type { NamedNode, Quad } from '@rdfjs/types' | ||
import $rdf from 'rdf-ext' | ||
import clownface from 'clownface' | ||
import clownface, { GraphPointer } from 'clownface' | ||
import { hydra, rdf } from '@tpluscode/rdf-ns-builders' | ||
|
||
interface CollectionHandler { | ||
memberType: NamedNode | ||
collectionType: NamedNode | ||
view?: NamedNode | ||
memberQuads: Quad[] | ||
collection: NamedNode | ||
} | ||
|
||
export function getCollection({ collection, memberQuads, memberType, collectionType }: CollectionHandler) { | ||
export function getCollection({ collection, view, memberQuads, memberType, collectionType }: CollectionHandler): GraphPointer<NamedNode> { | ||
const dataset = $rdf.dataset(memberQuads) | ||
|
||
const graph = clownface({ dataset }) | ||
const members = graph.has(rdf.type, memberType) | ||
|
||
return graph.node(collection) | ||
graph.node(collection) | ||
.addOut(rdf.type, [hydra.Collection, collectionType]) | ||
.addOut(hydra.member, members) | ||
.addOut(hydra.totalItems, members.terms.length) | ||
|
||
if (view) { | ||
graph.node(view) | ||
.addOut(rdf.type, hydra.PartialCollectionView) | ||
.addIn(hydra.view, collection) | ||
} | ||
|
||
return graph.node(collection) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.