eyeling 1.16.2 → 1.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cli.js CHANGED
@@ -188,10 +188,12 @@ function main() {
188
188
  // collect log:outputString triples from the instantiated query conclusions.
189
189
  let outTriples;
190
190
  if (hasQueries) {
191
- const res = engine.forwardChainAndCollectLogQueryConclusions(facts, frules, brules, qrules);
191
+ const res = engine.forwardChainAndCollectLogQueryConclusions(facts, frules, brules, qrules, null, {
192
+ captureExplanations: engine.getProofCommentsEnabled(),
193
+ });
192
194
  outTriples = res.queryTriples;
193
195
  } else {
194
- engine.forwardChain(facts, frules, brules);
196
+ engine.forwardChain(facts, frules, brules, null, { captureExplanations: false });
195
197
  outTriples = facts;
196
198
  }
197
199
 
@@ -302,15 +304,21 @@ function main() {
302
304
  }
303
305
  if (entries.length) console.log();
304
306
 
305
- engine.forwardChain(facts, frules, brules, (df) => {
306
- if (engine.getProofCommentsEnabled()) {
307
- engine.printExplanation(df, outPrefixes);
308
- console.log(engine.tripleToN3(df.fact, outPrefixes));
309
- console.log();
310
- } else {
311
- console.log(engine.tripleToN3(df.fact, outPrefixes));
312
- }
313
- });
307
+ engine.forwardChain(
308
+ facts,
309
+ frules,
310
+ brules,
311
+ (df) => {
312
+ if (engine.getProofCommentsEnabled()) {
313
+ engine.printExplanation(df, outPrefixes);
314
+ console.log(engine.tripleToN3(df.fact, outPrefixes));
315
+ console.log();
316
+ } else {
317
+ console.log(engine.tripleToN3(df.fact, outPrefixes));
318
+ }
319
+ },
320
+ { captureExplanations: engine.getProofCommentsEnabled() },
321
+ );
314
322
  return;
315
323
  }
316
324
 
@@ -330,7 +338,9 @@ function main() {
330
338
  outTriples = res.queryTriples;
331
339
  outDerived = res.queryDerived;
332
340
  } else {
333
- derived = engine.forwardChain(facts, frules, brules);
341
+ derived = engine.forwardChain(facts, frules, brules, null, {
342
+ captureExplanations: engine.getProofCommentsEnabled(),
343
+ });
334
344
  outDerived = derived;
335
345
  outTriples = derived.map((df) => df.fact);
336
346
  }