Skip to content

Commit

Permalink
add member specific quads to member
Browse files Browse the repository at this point in the history
  • Loading branch information
ajuvercr committed Feb 13, 2024
1 parent 780fca4 commit e436c8d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/CBDShapeExtractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ export class CBDShapeExtractor {
const idSet = new Set(ids.map((x) => x.value));

const memberSpecificQuads: { [id: string]: Array<Quad> } = {};
for (let id of ids) {
memberSpecificQuads[id.value] = [];
}
const newStore = new Store();
for (let quad of store.readQuads(null, null, null, null)) {
if (quad.graph.termType == "NamedNode" && idSet.has(quad.graph.value)) {
if (!(quad.graph.value in memberSpecificQuads)) {
memberSpecificQuads[quad.graph.value] = [];
}
memberSpecificQuads[quad.graph.value].push(quad);
} else {
newStore.add(quad);
Expand All @@ -87,6 +87,7 @@ export class CBDShapeExtractor {
shapeId,
(graphsToIgnore || []).slice(),
).then((quads) => {
quads.push(...memberSpecificQuads[id.value]);
if (itemExtracted) {
itemExtracted({ subject: id, quads });
}
Expand Down

0 comments on commit e436c8d

Please sign in to comment.