eyereasoner 1.14.1 → 2.0.0

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/README.md CHANGED
@@ -15,12 +15,8 @@ The simplest way to use this package is to execute a query over a dataset and ge
15
15
  import { basicQuery } from 'eyereasoner';
16
16
 
17
17
  async function main() {
18
- const {
19
- // The result of the query (as an array of quads)
20
- result,
21
- // The proof of the results (as an array of quads)
22
- proof
23
- } = await basicQuery(dataQuads, queryQuads);
18
+ // The result of the query (as an array of quads)
19
+ const result = await basicQuery(dataQuads, queryQuads);
24
20
  }
25
21
 
26
22
  main();
@@ -153,6 +149,14 @@ async function main() {
153
149
  main();
154
150
  ```
155
151
 
152
+ ## CLI Usage
153
+
154
+ Globally installing `eyereasoner` using `npm i -g eyereasoner` will also expose a CLI interface for using the reasoner:
155
+
156
+ ```bash
157
+ eyereasoner --nope --quiet ./socrates.n3 --query ./socrates-query.n3
158
+ ```
159
+
156
160
  ## License
157
161
  ©2022–present
158
162
  [Jesse Wright](https://github.com/jeswr),
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const path_1 = __importDefault(require("path"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const __1 = require("..");
10
+ async function main() {
11
+ const Module = await (0, __1.SwiplEye)();
12
+ // Make any local files available to the reasoner
13
+ for (const arg of process.argv.slice(2)) {
14
+ const p = path_1.default.join(process.cwd(), arg);
15
+ if (fs_1.default.existsSync(p)) {
16
+ Module.FS.writeFile(arg, fs_1.default.readFileSync(p));
17
+ }
18
+ }
19
+ (0, __1.queryOnce)(Module, 'main', process.argv.slice(2));
20
+ }
21
+ main();