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 +22 -6
- package/dist/bin/index.d.ts +2 -0
- package/dist/bin/index.js +21 -0
- package/dist/eye.d.ts +2 -0
- package/dist/eye.js +3 -0
- package/dist/index.d.ts +5 -7
- package/dist/index.js +6 -8
- package/dist/swipl-bundled.temp.js +227 -264
- package/dist/transformers.d.ts +5 -38
- package/dist/transformers.js +17 -87
- package/package.json +10 -12
- package/dist/eye.pl.d.ts +0 -2
- package/dist/eye.pl.js +0 -5
- package/dist/eye.pvm.d.ts +0 -2
- package/dist/eye.pvm.js +0 -5
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
|
-
|
|
19
|
-
|
|
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,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();
|