Skip to content

Commit

Permalink
Merge pull request #56 from ddvlanck/main
Browse files Browse the repository at this point in the history
Patch for property path quads
  • Loading branch information
ddvlanck authored Nov 17, 2021
2 parents 7dcdf32 + 4b88bfe commit 58d7949
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ class BucketizerFragmentStrategy {
const bucketPath = `${config.storage}/${(0, Sanitizer_1.sanitize)(node)}.${fileExtension}`;
const otherPages = relations.map(relation => relation.nodeId);
pages = [...new Set([...pages, ...otherPages, node])];
const controlQuads = this.createHypermediaControlQuads(relations, node, outputDirPath, fileExtension, treePathQuad, propertyPathQuads);
tasks.push(this.writeToBucket(bucketPath, controlQuads));
const quads = this.createHypermediaControlQuads(relations, node, outputDirPath, fileExtension, treePathQuad, propertyPathQuads);
tasks.push(this.writeToBucket(bucketPath, quads));
});
pages.forEach(async (page) => tasks.push(this.addCollectionInformation(page, outputDirPath, config.url, config.storage, fileExtension)));
await Promise.all(tasks);
Expand All @@ -313,7 +313,8 @@ class BucketizerFragmentStrategy {
const quads = [];
const bucketPath = `${outputDirPath}/${(0, Sanitizer_1.sanitize)(node)}.${fileExtension}`;
// This indicates that the property path is a list of predicates instead of just one predicate
if (treePathQuad && treePathQuad.object.termType === 'BlankNode') {
// And only add property path quads if page contains actual relations
if (relations.length > 0 && treePathQuad && treePathQuad.object.termType === 'BlankNode') {
quads.push(...propertyPathQuads);
}
relations.forEach(relation => {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/fragment-strategy/BucketizerFragmentStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ class BucketizerFragmentStrategy implements FragmentStrategy {
const bucketPath = `${outputDirPath}/${sanitize(node)}.${fileExtension}`;

// This indicates that the property path is a list of predicates instead of just one predicate
if (treePathQuad && treePathQuad.object.termType === 'BlankNode') {
// And only add property path quads if page contains actual relations
if (relations.length > 0 && treePathQuad && treePathQuad.object.termType === 'BlankNode') {
quads.push(...propertyPathQuads);
}

Expand Down

0 comments on commit 58d7949

Please sign in to comment.