Skip to content

Commit

Permalink
Add option to build a blazegraph journal that includes all versions o…
Browse files Browse the repository at this point in the history
…f all digital objects
  • Loading branch information
bherr2 committed Dec 4, 2024
1 parent 63ba9e1 commit a7010a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ program
program
.command('create-db')
.description('Create a blazegraph database from select digital objects')
.option('--include-all-versions', 'Include all versions of all digital objects when building', false)
.option('--journal <journal>', 'override journal output path')
.action((_options, command) => {
createDb(getContext(program, command));
});
Expand Down
6 changes: 4 additions & 2 deletions src/finalizing/build-blazegraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ import { getDeployedDigitalObjects, getRedundantGraph } from './utils.js';
*/
export function buildBlazegraphJournal(context) {
const digitalObjects = getDeployedDigitalObjects(context, false);
const journal = resolve(context.deploymentHome, 'blazegraph.jnl');
const journal = context.journal ?? resolve(context.deploymentHome, 'blazegraph.jnl');
sh.rm('-f', journal);

let sparqlUpdate = '';

const digitalObjectsToDeploy = digitalObjects.filter((o) => o.version === 'latest' || o.version === 'draft');
const digitalObjectsToDeploy = digitalObjects.filter(
(o) => context.includeAllVersions || o.version === 'latest' || o.version === 'draft'
);

for (const obj of digitalObjectsToDeploy) {
let doString = obj.doString;
Expand Down

0 comments on commit a7010a7

Please sign in to comment.