eyereasoner 1.14.1 → 2.1.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,26 @@ async function main() {
153
149
  main();
154
150
  ```
155
151
 
152
+ ## CLI Usage
153
+
154
+ This package also exposes a CLI interface for using the reasoner. It can be used via `npx`
155
+
156
+ ```bash
157
+ # Run the command using the latest version of eyereasoner on npm
158
+ npx eyereasoner --nope --quiet ./socrates.n3 --query ./socrates-query.n3
159
+ ```
160
+
161
+ or by globally installing `eyereasoner`
162
+
163
+ ```bash
164
+ # Gloablly install eyereasoner
165
+ npm i -g eyereasoner
166
+ # Run a command with eyereasoner
167
+ eyereasoner --nope --quiet ./socrates.n3 --query ./socrates-query.n3
168
+ ```
169
+
170
+
171
+
156
172
  ## License
157
173
  ©2022–present
158
174
  [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();