eyeling 1.33.1 → 1.33.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/README.md +8 -0
- package/bin/eyeling.cjs +1 -1
- package/dist/browser/eyeling.browser.js +1 -1
- package/examples/eyelang/INTEGRATION.md +7 -0
- package/examples/eyelang/README.md +15 -76
- package/examples/eyelang/SPEC.md +1 -2
- package/examples/eyelang/output/vulnerability-impact.pl +20 -0
- package/examples/eyelang/vulnerability-impact.pl +70 -0
- package/examples/output/vulnerability-impact.n3 +22 -0
- package/examples/vulnerability-impact.n3 +80 -0
- package/eyelang.d.ts +0 -12
- package/eyeling.js +1 -1
- package/index.d.ts +0 -4
- package/index.js +2 -6
- package/lib/cli.js +1 -1
- package/lib/eyelang/bin.js +1 -1
- package/lib/eyelang/builtins/{aggregation.mjs → aggregation.js} +1 -1
- package/lib/eyelang/builtins/{alphametic.mjs → alphametic.js} +1 -1
- package/lib/eyelang/builtins/{arithmetic.mjs → arithmetic.js} +1 -1
- package/lib/eyelang/builtins/{core.mjs → core.js} +1 -1
- package/lib/eyelang/builtins/{formula.mjs → formula.js} +1 -1
- package/lib/eyelang/builtins/{lists.mjs → lists.js} +1 -1
- package/lib/eyelang/builtins/{matrix.mjs → matrix.js} +1 -1
- package/lib/eyelang/builtins/{number-theory.mjs → number-theory.js} +1 -1
- package/lib/eyelang/builtins/{portfolio.mjs → portfolio.js} +1 -1
- package/lib/eyelang/builtins/{registry.mjs → registry.js} +14 -15
- package/lib/eyelang/builtins/{search.mjs → search.js} +5 -5
- package/lib/eyelang/builtins/{strings.mjs → strings.js} +1 -1
- package/lib/eyelang/builtins/{sudoku.mjs → sudoku.js} +1 -1
- package/lib/eyelang/{cli.mjs → cli.js} +6 -18
- package/lib/eyelang/{explain.mjs → explain.js} +4 -4
- package/lib/eyelang/{hash.mjs → hash.js} +2 -2
- package/lib/eyelang/{index.mjs → index.js} +11 -12
- package/lib/eyelang/package.json +3 -0
- package/lib/eyelang/{parser.mjs → parser.js} +1 -1
- package/lib/eyelang/{program.mjs → program.js} +2 -9
- package/lib/eyelang/{solver.mjs → solver.js} +4 -4
- package/package.json +3 -3
- package/test/eyelang/run-conformance.mjs +1 -1
- package/test/eyelang/run-examples.mjs +2 -3
- package/test/eyelang/run-regression.mjs +4 -65
- package/test/eyelang/test-style.mjs +10 -7
- package/test/eyelang.test.js +1 -1
- package/test/run.js +186 -37
- package/examples/eyelang/annotation-rdf12.ttl +0 -12
- package/examples/eyelang/directional-language.ttl +0 -9
- package/examples/eyelang/eyeling-ackermann.n3 +0 -41
- package/examples/eyelang/eyeling-age-threshold.n3 +0 -12
- package/examples/eyelang/eyeling-alignment-demo.n3 +0 -11
- package/examples/eyelang/eyeling-allen-interval-calculus-small.n3 +0 -13
- package/examples/eyelang/eyeling-backward-recursion.n3 +0 -11
- package/examples/eyelang/eyeling-backward.n3 +0 -10
- package/examples/eyelang/eyeling-basic-monadic-small.n3 +0 -11
- package/examples/eyelang/eyeling-bmi.n3 +0 -10
- package/examples/eyelang/eyeling-cat-koko.n3 +0 -15
- package/examples/eyelang/eyeling-collatz-small.n3 +0 -11
- package/examples/eyelang/eyeling-collection.n3 +0 -11
- package/examples/eyelang/eyeling-complex-arithmetic.n3 +0 -10
- package/examples/eyelang/eyeling-context-association.n3 +0 -11
- package/examples/eyelang/eyeling-control-system-small.n3 +0 -11
- package/examples/eyelang/eyeling-crypto-builtins-extra.n3 +0 -10
- package/examples/eyelang/eyeling-crypto-builtins.n3 +0 -8
- package/examples/eyelang/eyeling-deep-taxonomy-10.n3 +0 -18
- package/examples/eyelang/eyeling-derived-backward-rule-flat.n3 +0 -10
- package/examples/eyelang/eyeling-derived-rule-flat.n3 +0 -9
- package/examples/eyelang/eyeling-digital-product-passport-small.n3 +0 -11
- package/examples/eyelang/eyeling-dijkstra-tiny.n3 +0 -14
- package/examples/eyelang/eyeling-dog-license.n3 +0 -13
- package/examples/eyelang/eyeling-drone-corridor-planner-small.n3 +0 -13
- package/examples/eyelang/eyeling-equals.n3 +0 -8
- package/examples/eyelang/eyeling-equivalence-classes.n3 +0 -11
- package/examples/eyelang/eyeling-euler-identity.n3 +0 -9
- package/examples/eyelang/eyeling-existential-rule.n3 +0 -9
- package/examples/eyelang/eyeling-expression-eval.n3 +0 -11
- package/examples/eyelang/eyeling-family-cousins-extended.n3 +0 -12
- package/examples/eyelang/eyeling-fastpow.n3 +0 -10
- package/examples/eyelang/eyeling-fibonacci.n3 +0 -44
- package/examples/eyelang/eyeling-french-cities-reachability.n3 +0 -22
- package/examples/eyelang/eyeling-goldbach-small.n3 +0 -22
- package/examples/eyelang/eyeling-good-cobbler.n3 +0 -9
- package/examples/eyelang/eyeling-list-builtins.n3 +0 -10
- package/examples/eyelang/eyeling-list-collection-extra.n3 +0 -9
- package/examples/eyelang/eyeling-math-builtins.n3 +0 -9
- package/examples/eyelang/eyeling-string-builtins-extra.n3 +0 -9
- package/examples/eyelang/eyeling-string-builtins.n3 +0 -10
- package/examples/eyelang/eyeling-time-builtins.n3 +0 -11
- package/examples/eyelang/eyeling-time-components-extra.n3 +0 -10
- package/examples/eyelang/eyeling-witch.n3 +0 -10
- package/examples/eyelang/family-cousins.n3 +0 -17
- package/examples/eyelang/n3-builtins.n3 +0 -28
- package/examples/eyelang/output/annotation-rdf12.ttl +0 -1
- package/examples/eyelang/output/directional-language.ttl +0 -1
- package/examples/eyelang/output/eyeling-ackermann.n3 +0 -12
- package/examples/eyelang/output/eyeling-age-threshold.n3 +0 -4
- package/examples/eyelang/output/eyeling-alignment-demo.n3 +0 -1
- package/examples/eyelang/output/eyeling-allen-interval-calculus-small.n3 +0 -3
- package/examples/eyelang/output/eyeling-backward-recursion.n3 +0 -9
- package/examples/eyelang/output/eyeling-backward.n3 +0 -1
- package/examples/eyelang/output/eyeling-basic-monadic-small.n3 +0 -8
- package/examples/eyelang/output/eyeling-bmi.n3 +0 -2
- package/examples/eyelang/output/eyeling-cat-koko.n3 +0 -3
- package/examples/eyelang/output/eyeling-collatz-small.n3 +0 -3
- package/examples/eyelang/output/eyeling-collection.n3 +0 -1
- package/examples/eyelang/output/eyeling-complex-arithmetic.n3 +0 -5
- package/examples/eyelang/output/eyeling-context-association.n3 +0 -4
- package/examples/eyelang/output/eyeling-control-system-small.n3 +0 -4
- package/examples/eyelang/output/eyeling-crypto-builtins-extra.n3 +0 -3
- package/examples/eyelang/output/eyeling-crypto-builtins.n3 +0 -2
- package/examples/eyelang/output/eyeling-deep-taxonomy-10.n3 +0 -32
- package/examples/eyelang/output/eyeling-derived-backward-rule-flat.n3 +0 -4
- package/examples/eyelang/output/eyeling-derived-rule-flat.n3 +0 -2
- package/examples/eyelang/output/eyeling-digital-product-passport-small.n3 +0 -3
- package/examples/eyelang/output/eyeling-dijkstra-tiny.n3 +0 -9
- package/examples/eyelang/output/eyeling-dog-license.n3 +0 -1
- package/examples/eyelang/output/eyeling-drone-corridor-planner-small.n3 +0 -5
- package/examples/eyelang/output/eyeling-equals.n3 +0 -1
- package/examples/eyelang/output/eyeling-equivalence-classes.n3 +0 -2
- package/examples/eyelang/output/eyeling-euler-identity.n3 +0 -3
- package/examples/eyelang/output/eyeling-existential-rule.n3 +0 -4
- package/examples/eyelang/output/eyeling-expression-eval.n3 +0 -3
- package/examples/eyelang/output/eyeling-family-cousins-extended.n3 +0 -6
- package/examples/eyelang/output/eyeling-fastpow.n3 +0 -4
- package/examples/eyelang/output/eyeling-fibonacci.n3 +0 -6
- package/examples/eyelang/output/eyeling-french-cities-reachability.n3 +0 -25
- package/examples/eyelang/output/eyeling-goldbach-small.n3 +0 -2
- package/examples/eyelang/output/eyeling-good-cobbler.n3 +0 -2
- package/examples/eyelang/output/eyeling-list-builtins.n3 +0 -6
- package/examples/eyelang/output/eyeling-list-collection-extra.n3 +0 -5
- package/examples/eyelang/output/eyeling-math-builtins.n3 +0 -5
- package/examples/eyelang/output/eyeling-string-builtins-extra.n3 +0 -3
- package/examples/eyelang/output/eyeling-string-builtins.n3 +0 -4
- package/examples/eyelang/output/eyeling-time-builtins.n3 +0 -4
- package/examples/eyelang/output/eyeling-time-components-extra.n3 +0 -5
- package/examples/eyelang/output/eyeling-witch.n3 +0 -2
- package/examples/eyelang/output/family-cousins.n3 +0 -8
- package/examples/eyelang/output/n3-builtins.n3 +0 -6
- package/examples/eyelang/output/socrates.n3 +0 -1
- package/examples/eyelang/output/triple-term.n3 +0 -2
- package/examples/eyelang/socrates.n3 +0 -11
- package/examples/eyelang/triple-term.n3 +0 -9
- package/lib/eyelang/builtins/n3.mjs +0 -483
- package/lib/eyelang/rdf.mjs +0 -747
- /package/lib/eyelang/builtins/{control.mjs → control.js} +0 -0
- /package/lib/eyelang/{term.mjs → term.js} +0 -0
package/test/run.js
CHANGED
|
@@ -5,57 +5,206 @@ const cp = require('node:child_process');
|
|
|
5
5
|
|
|
6
6
|
const { C, formatDuration } = require('./report');
|
|
7
7
|
|
|
8
|
+
const node = process.execPath;
|
|
9
|
+
|
|
10
|
+
// Run test files directly instead of through `npm run …`. This keeps the
|
|
11
|
+
// output in the compact Eyeling reporter style and avoids npm's script banners
|
|
12
|
+
// between the colored OK/FAIL test lines.
|
|
8
13
|
const sections = [
|
|
9
|
-
['Build bundle',
|
|
10
|
-
['Packlist checks',
|
|
11
|
-
['API tests',
|
|
12
|
-
['Streaming RDF Messages tests',
|
|
13
|
-
['Builtin contract tests',
|
|
14
|
-
['Store tests',
|
|
15
|
-
['Examples tests',
|
|
16
|
-
['Proof examples tests',
|
|
17
|
-
['Manifest tests',
|
|
18
|
-
['RDF 1.2 syntax tests',
|
|
19
|
-
['Playground tests',
|
|
20
|
-
['Eyelang second-engine tests',
|
|
21
|
-
['
|
|
14
|
+
['Build bundle', node, ['tools/bundle.js']],
|
|
15
|
+
['Packlist checks', node, ['test/packlist.test.js']],
|
|
16
|
+
['API tests', node, ['test/api.test.js']],
|
|
17
|
+
['Streaming RDF Messages tests', node, ['test/stream_messages.test.js']],
|
|
18
|
+
['Builtin contract tests', node, ['test/builtins.test.js']],
|
|
19
|
+
['Store tests', node, ['test/store.test.js']],
|
|
20
|
+
['Examples tests', node, ['test/examples.test.js']],
|
|
21
|
+
['Proof examples tests', node, ['test/examples.test.js', '--proof-only']],
|
|
22
|
+
['Manifest tests', node, ['test/manifest.test.js']],
|
|
23
|
+
['RDF 1.2 syntax tests', node, ['test/rdf12.test.js']],
|
|
24
|
+
['Playground tests', node, ['test/playground.test.js']],
|
|
25
|
+
['Eyelang second-engine tests', node, ['test/eyelang.test.js']],
|
|
26
|
+
['Eyelang corpus tests', node, ['test/eyelang/run-all.mjs']],
|
|
27
|
+
['Package tests', node, ['test/package.test.js']],
|
|
22
28
|
];
|
|
23
29
|
|
|
30
|
+
const aggregate = {
|
|
31
|
+
total: 0,
|
|
32
|
+
ok: 0,
|
|
33
|
+
incomplete: 0,
|
|
34
|
+
nonconform: 0,
|
|
35
|
+
crashed: 0,
|
|
36
|
+
};
|
|
37
|
+
|
|
24
38
|
function sectionLine(kind, label, ms) {
|
|
25
39
|
const suffix = typeof ms === 'number' ? ` (${formatDuration(ms)})` : '';
|
|
26
40
|
console.log(`${C.y}==${C.n} ${kind} ${label}${suffix}`);
|
|
27
41
|
}
|
|
28
42
|
|
|
43
|
+
function stripAnsi(s) {
|
|
44
|
+
return String(s).replace(/\x1b\[[0-9;]*m/g, '');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function makeSectionSummary() {
|
|
48
|
+
return {
|
|
49
|
+
// Normal Eyeling tests use report.js: "OK 001 ..." / "FAIL 001 ...".
|
|
50
|
+
reportOk: 0,
|
|
51
|
+
reportFail: 0,
|
|
52
|
+
// Older corpus runners used: "1 OK ..." / "1 FAIL ...". Keep
|
|
53
|
+
// parsing that shape so aggregate totals remain robust across local runs.
|
|
54
|
+
numberedOk: 0,
|
|
55
|
+
numberedFail: 0,
|
|
56
|
+
// notation3tests prints a suite-level line with the real manifest count.
|
|
57
|
+
manifestTotal: null,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function parseLineForSummary(rawLine, summary) {
|
|
62
|
+
const line = stripAnsi(rawLine).trimEnd();
|
|
63
|
+
if (!line) return;
|
|
64
|
+
|
|
65
|
+
if (/^OK\s+\d{3}\s/.test(line)) {
|
|
66
|
+
summary.reportOk++;
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (/^FAIL\s+\d{3}\s/.test(line)) {
|
|
70
|
+
summary.reportFail++;
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (/^\d+\s+OK\s+/.test(line)) {
|
|
74
|
+
summary.numberedOk++;
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (/^\d+\s+FAIL\s+/.test(line)) {
|
|
78
|
+
summary.numberedFail++;
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const manifest = line.match(
|
|
83
|
+
/^TOTAL\s+\[COUNT:(\d+)\]\s+OK:\s*[^0-9]*(\d+)[^0-9]+INCOMPLETE:\s*[^0-9]*(\d+)[^0-9]+NONCONFORM:\s*[^0-9]*(\d+)[^0-9]+CRASHED:\s*[^0-9]*(\d+)/,
|
|
84
|
+
);
|
|
85
|
+
if (manifest) {
|
|
86
|
+
summary.manifestTotal = {
|
|
87
|
+
count: Number(manifest[1]),
|
|
88
|
+
ok: Number(manifest[2]),
|
|
89
|
+
incomplete: Number(manifest[3]),
|
|
90
|
+
nonconform: Number(manifest[4]),
|
|
91
|
+
crashed: Number(manifest[5]),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function makeStreamingParser(summary) {
|
|
97
|
+
let buffer = '';
|
|
98
|
+
return {
|
|
99
|
+
feed(chunk) {
|
|
100
|
+
buffer += String(chunk);
|
|
101
|
+
const lines = buffer.split(/\r?\n/);
|
|
102
|
+
buffer = lines.pop() || '';
|
|
103
|
+
for (const line of lines) parseLineForSummary(line, summary);
|
|
104
|
+
},
|
|
105
|
+
finish() {
|
|
106
|
+
if (buffer) parseLineForSummary(buffer, summary);
|
|
107
|
+
buffer = '';
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function addSectionToAggregate(summary) {
|
|
113
|
+
if (summary.manifestTotal) {
|
|
114
|
+
aggregate.total += summary.manifestTotal.count;
|
|
115
|
+
aggregate.ok += summary.manifestTotal.ok;
|
|
116
|
+
aggregate.incomplete += summary.manifestTotal.incomplete;
|
|
117
|
+
aggregate.nonconform += summary.manifestTotal.nonconform;
|
|
118
|
+
aggregate.crashed += summary.manifestTotal.crashed;
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const ok = summary.reportOk + summary.numberedOk;
|
|
123
|
+
const failed = summary.reportFail + summary.numberedFail;
|
|
124
|
+
aggregate.total += ok + failed;
|
|
125
|
+
aggregate.ok += ok;
|
|
126
|
+
aggregate.nonconform += failed;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function scoreLine() {
|
|
130
|
+
const score = aggregate.total === 0 ? 0 : (100 * aggregate.ok) / aggregate.total;
|
|
131
|
+
return `TOTAL [COUNT:${aggregate.total}] OK: ⭐${aggregate.ok}⭐ INCOMPLETE: ⭐${aggregate.incomplete}⭐ NONCONFORM: ⭐${aggregate.nonconform}⭐ CRASHED: ⭐${aggregate.crashed}⭐ => SCORE: ⭐⭐⭐${score.toFixed(1)}⭐⭐⭐`;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function childEnv() {
|
|
135
|
+
const env = { ...process.env };
|
|
136
|
+
if (!env.NO_COLOR && C.g && !env.FORCE_COLOR) env.FORCE_COLOR = '1';
|
|
137
|
+
return env;
|
|
138
|
+
}
|
|
139
|
+
|
|
29
140
|
function runSection(label, cmd, args) {
|
|
30
141
|
console.log('');
|
|
31
142
|
sectionLine('Start', label);
|
|
32
143
|
const startedAt = Date.now();
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
144
|
+
const summary = makeSectionSummary();
|
|
145
|
+
const stdoutParser = makeStreamingParser(summary);
|
|
146
|
+
const stderrParser = makeStreamingParser(summary);
|
|
147
|
+
|
|
148
|
+
return new Promise((resolve) => {
|
|
149
|
+
const child = cp.spawn(cmd, args, {
|
|
150
|
+
cwd: process.cwd(),
|
|
151
|
+
env: childEnv(),
|
|
152
|
+
shell: process.platform === 'win32',
|
|
153
|
+
stdio: ['inherit', 'pipe', 'pipe'],
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
child.stdout.on('data', (chunk) => {
|
|
157
|
+
stdoutParser.feed(chunk);
|
|
158
|
+
process.stdout.write(chunk);
|
|
159
|
+
});
|
|
160
|
+
child.stderr.on('data', (chunk) => {
|
|
161
|
+
stderrParser.feed(chunk);
|
|
162
|
+
process.stderr.write(chunk);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
child.on('error', (err) => {
|
|
166
|
+
stdoutParser.finish();
|
|
167
|
+
stderrParser.finish();
|
|
168
|
+
addSectionToAggregate(summary);
|
|
169
|
+
aggregate.total++;
|
|
170
|
+
aggregate.crashed++;
|
|
171
|
+
const elapsed = Date.now() - startedAt;
|
|
172
|
+
console.error(`${C.r}FAIL${C.n} ${label}: ${err.message || String(err)}`);
|
|
173
|
+
sectionLine('End', `${label} failed`, elapsed);
|
|
174
|
+
console.log('');
|
|
175
|
+
resolve(1);
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
child.on('close', (code, signal) => {
|
|
179
|
+
stdoutParser.finish();
|
|
180
|
+
stderrParser.finish();
|
|
181
|
+
addSectionToAggregate(summary);
|
|
182
|
+
const elapsed = Date.now() - startedAt;
|
|
183
|
+
const status = typeof code === 'number' ? code : 1;
|
|
184
|
+
if (status !== 0 && summary.reportFail + summary.numberedFail === 0 && !summary.manifestTotal) {
|
|
185
|
+
aggregate.total++;
|
|
186
|
+
aggregate.crashed++;
|
|
187
|
+
}
|
|
188
|
+
const suffix = signal ? ` (${signal})` : '';
|
|
189
|
+
sectionLine('End', status === 0 ? `${label} passed` : `${label} failed${suffix}`, elapsed);
|
|
190
|
+
console.log('');
|
|
191
|
+
resolve(status);
|
|
192
|
+
});
|
|
38
193
|
});
|
|
39
|
-
const elapsed = Date.now() - startedAt;
|
|
40
|
-
if (r.error) {
|
|
41
|
-
console.error(`${C.r}FAIL${C.n} ${label}: ${r.error.message || String(r.error)}`);
|
|
42
|
-
sectionLine('End', `${label} failed`, elapsed);
|
|
43
|
-
console.log('');
|
|
44
|
-
return 1;
|
|
45
|
-
}
|
|
46
|
-
const status = typeof r.status === 'number' ? r.status : 1;
|
|
47
|
-
sectionLine('End', status === 0 ? `${label} passed` : `${label} failed`, elapsed);
|
|
48
|
-
console.log('');
|
|
49
|
-
return status;
|
|
50
194
|
}
|
|
51
195
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
196
|
+
(async function main() {
|
|
197
|
+
let status = 0;
|
|
198
|
+
for (const [label, cmd, args] of sections) {
|
|
199
|
+
const sectionStatus = await runSection(label, cmd, args);
|
|
200
|
+
if (sectionStatus !== 0) {
|
|
201
|
+
status = sectionStatus;
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
58
204
|
}
|
|
59
|
-
}
|
|
60
205
|
|
|
61
|
-
|
|
206
|
+
console.log('');
|
|
207
|
+
console.log(scoreLine());
|
|
208
|
+
|
|
209
|
+
process.exit(status);
|
|
210
|
+
})();
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# Inspired by eyereasoner/eyeling examples/annotation.n3.
|
|
2
|
-
# Demonstrates RDF 1.2 annotation syntax lowered through rdf:reifies.
|
|
3
|
-
VERSION "1.2"
|
|
4
|
-
PREFIX : <http://example.org/annotation#>
|
|
5
|
-
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
|
6
|
-
|
|
7
|
-
:a :name "Alice" ~ :t {| :statedBy :bob ; :recorded "2021-07-07"^^xsd:date |} .
|
|
8
|
-
|
|
9
|
-
{ ?Statement rdf:reifies <<( ?Person :name ?Name )>> .
|
|
10
|
-
?Statement :statedBy ?Agent . }
|
|
11
|
-
=>
|
|
12
|
-
{ ?Person :nameStatementBy ?Agent . } .
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/ackermann.n3.
|
|
2
|
-
# Demonstrates <= rules over RDF lists and exact BigInt-capable math builtins.
|
|
3
|
-
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/ackermann#>.
|
|
5
|
-
|
|
6
|
-
# ackermann(x, y) = hyper(x, y + 3, 2) - 3.
|
|
7
|
-
{ (?X ?Y) :ackermann ?A } <= {
|
|
8
|
-
(?Y 3) math:sum ?B.
|
|
9
|
-
(?X ?B 2) :ackermann ?C.
|
|
10
|
-
(?C 3) math:difference ?A.
|
|
11
|
-
}.
|
|
12
|
-
|
|
13
|
-
# Successor, addition, multiplication, and exponentiation levels.
|
|
14
|
-
{ (0 ?Y ?Z) :ackermann ?A } <= { (?Y 1) math:sum ?A }.
|
|
15
|
-
{ (1 ?Y ?Z) :ackermann ?A } <= { (?Y ?Z) math:sum ?A }.
|
|
16
|
-
{ (2 ?Y ?Z) :ackermann ?A } <= { (?Y ?Z) math:product ?A }.
|
|
17
|
-
{ (3 ?Y ?Z) :ackermann ?A } <= { (?Z ?Y) math:exponentiation ?A }.
|
|
18
|
-
|
|
19
|
-
# Tetration and higher hyperoperations.
|
|
20
|
-
{ (?X 0 ?Z) :ackermann 1 } <= { ?X math:greaterThan 3 }.
|
|
21
|
-
{ (?X ?Y ?Z) :ackermann ?A } <= {
|
|
22
|
-
?X math:greaterThan 3.
|
|
23
|
-
?Y math:notEqualTo 0.
|
|
24
|
-
(?Y 1) math:difference ?B.
|
|
25
|
-
(?X ?B ?Z) :ackermann ?C.
|
|
26
|
-
(?X 1) math:difference ?D.
|
|
27
|
-
(?D ?C ?Z) :ackermann ?A.
|
|
28
|
-
}.
|
|
29
|
-
|
|
30
|
-
{ (0 0) :ackermann ?A } => { :ackermann_0_0 :value ?A }.
|
|
31
|
-
{ (0 6) :ackermann ?A } => { :ackermann_0_6 :value ?A }.
|
|
32
|
-
{ (1 2) :ackermann ?A } => { :ackermann_1_2 :value ?A }.
|
|
33
|
-
{ (1 7) :ackermann ?A } => { :ackermann_1_7 :value ?A }.
|
|
34
|
-
{ (2 2) :ackermann ?A } => { :ackermann_2_2 :value ?A }.
|
|
35
|
-
{ (2 9) :ackermann ?A } => { :ackermann_2_9 :value ?A }.
|
|
36
|
-
{ (3 4) :ackermann ?A } => { :ackermann_3_4 :value ?A }.
|
|
37
|
-
{ (3 1000) :ackermann ?A } => { :ackermann_3_1000 :value ?A }.
|
|
38
|
-
{ (4 0) :ackermann ?A } => { :ackermann_4_0 :value ?A }.
|
|
39
|
-
{ (4 1) :ackermann ?A } => { :ackermann_4_1 :value ?A }.
|
|
40
|
-
{ (4 2) :ackermann ?A } => { :ackermann_4_2 :value ?A }.
|
|
41
|
-
{ (5 0) :ackermann ?A } => { :ackermann_5_0 :value ?A }.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/age.n3.
|
|
2
|
-
# Classifies people against age thresholds using N3 math builtins.
|
|
3
|
-
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/age#>.
|
|
5
|
-
|
|
6
|
-
:alice :age 23.
|
|
7
|
-
:bob :age 17.
|
|
8
|
-
:carol :age 65.
|
|
9
|
-
|
|
10
|
-
{ ?P :age ?A. ?A math:notLessThan 18. } => { ?P :adult true. }.
|
|
11
|
-
{ ?P :age ?A. ?A math:notLessThan 65. } => { ?P :senior true. }.
|
|
12
|
-
{ ?P :adult true. ?P :senior true. } => { ?P :discount :seniorPass. }.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/alignment-demo.n3.
|
|
2
|
-
# Simple vocabulary alignment using owl:sameAs and an explicit transfer rule.
|
|
3
|
-
@prefix owl: <http://www.w3.org/2002/07/owl#>.
|
|
4
|
-
@prefix schema: <https://schema.org/>.
|
|
5
|
-
@prefix ex: <https://example.org/ns#>.
|
|
6
|
-
@prefix : <https://eyereasoner.github.io/ns#>.
|
|
7
|
-
|
|
8
|
-
ex:label = schema:name.
|
|
9
|
-
:alice ex:label "Alice".
|
|
10
|
-
|
|
11
|
-
{ ?p owl:sameAs ?q. ?s ?p ?o. } => { ?s ?q ?o. }.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/allen-interval-calculus.n3.
|
|
2
|
-
# Classifies a few interval relations with math comparisons.
|
|
3
|
-
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/allen#>.
|
|
5
|
-
|
|
6
|
-
:a :start 1; :end 3.
|
|
7
|
-
:b :start 3; :end 5.
|
|
8
|
-
:c :start 4; :end 8.
|
|
9
|
-
:d :start 1; :end 8.
|
|
10
|
-
|
|
11
|
-
{ ?X :end ?XE. ?Y :start ?YS. ?XE math:equalTo ?YS. } => { (?X ?Y) :allen :meets. }.
|
|
12
|
-
{ ?X :start ?XS; :end ?XE. ?Y :start ?YS; :end ?YE. ?XS math:lessThan ?YS. ?XE math:greaterThan ?YS. ?XE math:lessThan ?YE. } => { (?X ?Y) :allen :overlaps. }.
|
|
13
|
-
{ ?X :start ?XS; :end ?XE. ?Y :start ?YS; :end ?YE. ?XS math:equalTo ?YS. ?XE math:lessThan ?YE. } => { (?X ?Y) :allen :starts. }.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/backward-recursion.n3.
|
|
2
|
-
# Demonstrates recursive <= rules.
|
|
3
|
-
@prefix : <urn:example#>.
|
|
4
|
-
|
|
5
|
-
:a :parent :b.
|
|
6
|
-
:b :parent :c.
|
|
7
|
-
:c :parent :d.
|
|
8
|
-
|
|
9
|
-
{ ?x :ancestor ?y } <= { ?x :parent ?y }.
|
|
10
|
-
{ ?x :ancestor ?z } <= { ?x :parent ?y. ?y :ancestor ?z }.
|
|
11
|
-
{ :a :ancestor ?who } => { :a :reaches ?who }.
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/backward.n3.
|
|
2
|
-
# Backward rule example: <= acts like a :- rule over N3 triples.
|
|
3
|
-
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/ns#>.
|
|
5
|
-
|
|
6
|
-
# something is more interesting if it is greater
|
|
7
|
-
{ ?X :moreInterestingThan ?Y. } <= { ?X math:greaterThan ?Y. }.
|
|
8
|
-
|
|
9
|
-
# derivation (forward)
|
|
10
|
-
{ 5 :moreInterestingThan 3. } => { 5 :isIndeedMoreInterestingThan 3. }.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/basic-monadic.n3.
|
|
2
|
-
# A tiny monadic propagation benchmark.
|
|
3
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/basic-monadic#>.
|
|
4
|
-
|
|
5
|
-
:i0 a :N0.
|
|
6
|
-
:i1 a :N0.
|
|
7
|
-
:i2 a :N1.
|
|
8
|
-
|
|
9
|
-
{ ?X a :N0. } => { ?X a :N1. }.
|
|
10
|
-
{ ?X a :N1. } => { ?X a :N2. }.
|
|
11
|
-
{ ?X a :N2. } => { ?X :accepted true. }.
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/bmi.n3.
|
|
2
|
-
# Computes BMI from mass and squared height using math builtins.
|
|
3
|
-
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/ns#>.
|
|
5
|
-
|
|
6
|
-
:alice :massKg 72;
|
|
7
|
-
:heightM 1.8.
|
|
8
|
-
|
|
9
|
-
{ ?P :heightM ?H. (?H 2) math:exponentiation ?H2. } => { ?P :heightSquared ?H2. }.
|
|
10
|
-
{ ?P :massKg ?M. ?P :heightSquared ?H2. (?M ?H2) math:quotient ?BMI. } => { ?P :bmi ?BMI. }.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/cat-koko.n3.
|
|
2
|
-
# The original derives nested rules; this version keeps the animal split and log:notEqualTo test.
|
|
3
|
-
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/ns#>.
|
|
5
|
-
|
|
6
|
-
:Koko a :Animal.
|
|
7
|
-
|
|
8
|
-
{ :Koko a :Animal. } => {
|
|
9
|
-
:catKoko a :Cat.
|
|
10
|
-
:britishKoko a :BritishShortHair.
|
|
11
|
-
}.
|
|
12
|
-
|
|
13
|
-
{ ?X a :Cat. ?Y a :BritishShortHair. ?X log:notEqualTo ?Y. } => {
|
|
14
|
-
:test :is true.
|
|
15
|
-
}.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/collatz-1000.n3.
|
|
2
|
-
# A small, bounded Collatz step demonstration.
|
|
3
|
-
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/collatz#>.
|
|
5
|
-
|
|
6
|
-
:case6 :value 6.
|
|
7
|
-
:case7 :value 7.
|
|
8
|
-
|
|
9
|
-
{ ?C :value ?N. (?N 2) math:remainder 0. (?N 2) math:integerQuotient ?M. } => { ?C :next ?M. }.
|
|
10
|
-
{ ?C :value ?N. (?N 2) math:remainder 1. (?N 3) math:product ?T. (?T 1) math:sum ?M. } => { ?C :next ?M. }.
|
|
11
|
-
{ ?C :next ?N. ?N math:greaterThan 10. } => { ?C :jumpsAboveTen true. }.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/collection.n3.
|
|
2
|
-
# Shows N3/RDF collections in subject and object positions.
|
|
3
|
-
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/collection#>.
|
|
5
|
-
|
|
6
|
-
(1 _:b2 (2)) :p2 :q2.
|
|
7
|
-
_:b2 :p :q.
|
|
8
|
-
|
|
9
|
-
{ (1 _:b2 (2)) list:length ?Length. } => {
|
|
10
|
-
:collection :length ?Length.
|
|
11
|
-
}.
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/complex.n3.
|
|
2
|
-
# Computes complex addition on pair-shaped RDF collections.
|
|
3
|
-
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/complex#>.
|
|
5
|
-
|
|
6
|
-
:z1 :cartesian (3 4).
|
|
7
|
-
:z2 :cartesian (5 -2).
|
|
8
|
-
|
|
9
|
-
{ ?A :cartesian (?AR ?AI). ?B :cartesian (?BR ?BI). (?AR ?BR) math:sum ?RR. (?AI ?BI) math:sum ?RI. } => { (?A ?B) :sum (?RR ?RI). }.
|
|
10
|
-
{ (:z1 :z2) :sum ?Z. } => { :example :complexSum ?Z. }.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/context-association.n3.
|
|
2
|
-
# Associates named contexts with facts and derives their subjects.
|
|
3
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/context-association#>.
|
|
4
|
-
|
|
5
|
-
:ctx1 :contains :fact1.
|
|
6
|
-
:ctx2 :contains :fact2.
|
|
7
|
-
:fact1 :subject :alice; :predicate :likes; :object :tea.
|
|
8
|
-
:fact2 :subject :bob; :predicate :likes; :object :coffee.
|
|
9
|
-
|
|
10
|
-
{ ?C :contains ?F. ?F :subject ?S. } => { ?C :mentions ?S. }.
|
|
11
|
-
{ ?C :mentions ?S. } => { ?S :mentionedIn ?C. }.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/control-system.n3.
|
|
2
|
-
# Flags control measurements outside a safe envelope.
|
|
3
|
-
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/control-system#>.
|
|
5
|
-
|
|
6
|
-
:loop1 :target 100; :actual 103; :tolerance 5.
|
|
7
|
-
:loop2 :target 100; :actual 111; :tolerance 5.
|
|
8
|
-
|
|
9
|
-
{ ?L :target ?T; :actual ?A. (?A ?T) math:difference ?D. ?D math:absoluteValue ?Abs. } => { ?L :absoluteError ?Abs. }.
|
|
10
|
-
{ ?L :absoluteError ?E; :tolerance ?Tol. ?E math:notGreaterThan ?Tol. } => { ?L :status :ok. }.
|
|
11
|
-
{ ?L :absoluteError ?E; :tolerance ?Tol. ?E math:greaterThan ?Tol. } => { ?L :status :alarm. }.
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/crypto-builtins-tests.n3.
|
|
2
|
-
# Extra digest checks beyond the compact builtins demo.
|
|
3
|
-
@prefix crypto: <http://www.w3.org/2000/10/swap/crypto#>.
|
|
4
|
-
@prefix string: <http://www.w3.org/2000/10/swap/string#>.
|
|
5
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/crypto-extra#>.
|
|
6
|
-
|
|
7
|
-
:payload :text "eyelang".
|
|
8
|
-
|
|
9
|
-
{ :payload :text ?T. ?T crypto:sha256 ?H. ?H string:length ?L. } => { :payload :sha256Length ?L; :sha256 ?H. }.
|
|
10
|
-
{ :payload :sha256Length 64. } => { :payload :hashLooksComplete true. }.
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# Inspired by eyeling/examples/crypto-builtins-tests.n3.
|
|
2
|
-
@prefix crypto: <http://www.w3.org/2000/10/swap/crypto#>.
|
|
3
|
-
@prefix : <https://eyereasoner.github.io/ns#>.
|
|
4
|
-
|
|
5
|
-
:payload :text "eyelang".
|
|
6
|
-
|
|
7
|
-
{ :payload :text ?Text. ?Text crypto:sha256 ?Digest. } => { :payload :sha256 ?Digest. }.
|
|
8
|
-
{ :payload :text ?Text. ?Text crypto:md5 ?Digest. } => { :payload :md5 ?Digest. }.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/deep-taxonomy-10.n3.
|
|
2
|
-
# Depth-10 classification chain.
|
|
3
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/deep-taxonomy-10#>.
|
|
4
|
-
|
|
5
|
-
:ind a :N0.
|
|
6
|
-
|
|
7
|
-
{ ?X a :N0. } => { ?X a :N1, :I1, :J1. }.
|
|
8
|
-
{ ?X a :N1. } => { ?X a :N2, :I2, :J2. }.
|
|
9
|
-
{ ?X a :N2. } => { ?X a :N3, :I3, :J3. }.
|
|
10
|
-
{ ?X a :N3. } => { ?X a :N4, :I4, :J4. }.
|
|
11
|
-
{ ?X a :N4. } => { ?X a :N5, :I5, :J5. }.
|
|
12
|
-
{ ?X a :N5. } => { ?X a :N6, :I6, :J6. }.
|
|
13
|
-
{ ?X a :N6. } => { ?X a :N7, :I7, :J7. }.
|
|
14
|
-
{ ?X a :N7. } => { ?X a :N8, :I8, :J8. }.
|
|
15
|
-
{ ?X a :N8. } => { ?X a :N9, :I9, :J9. }.
|
|
16
|
-
{ ?X a :N9. } => { ?X a :N10, :I10, :J10. }.
|
|
17
|
-
{ ?X a :N10. } => { ?X a :A2. }.
|
|
18
|
-
{ :ind a :A2. } => { :test :is true. }.
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/derived-backward-rule.n3.
|
|
2
|
-
# Demonstrates an inverse-property rule without nested-rule materialization.
|
|
3
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/derived-backward-rule#>.
|
|
4
|
-
|
|
5
|
-
:parentOf :invOf :childOf.
|
|
6
|
-
:alice :parentOf :bob.
|
|
7
|
-
:claire :parentOf :diana.
|
|
8
|
-
|
|
9
|
-
{ ?P :invOf ?Q. ?Y ?P ?X. } => { ?X ?Q ?Y. }.
|
|
10
|
-
{ ?X :childOf ?Y. } => { ?X :hasParent ?Y. }.
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/derived-rule.n3.
|
|
2
|
-
# eyelang's N3 layer does not materialize nested rules yet, so this is a flat equivalent.
|
|
3
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/derived-rule#>.
|
|
4
|
-
|
|
5
|
-
:Minka a :Cat.
|
|
6
|
-
:Charly a :Dog.
|
|
7
|
-
|
|
8
|
-
{ ?X a :Cat. ?Y a :Dog. } => { :test :is true. }.
|
|
9
|
-
{ ?X a :Cat. ?Y a :Dog. } => { ?X :compatibleWith ?Y. }.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/digital-product-passport.n3.
|
|
2
|
-
# Simple product passport conformance rules.
|
|
3
|
-
@prefix string: <http://www.w3.org/2000/10/swap/string#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/digital-product-passport#>.
|
|
5
|
-
|
|
6
|
-
:bike1 :serial "EU-BIKE-001"; :batteryId "BAT-77"; :recycledContent "32%".
|
|
7
|
-
:toy1 :serial "TOY-9"; :batteryId ""; :recycledContent "0%".
|
|
8
|
-
|
|
9
|
-
{ ?P :serial ?S. ?S string:startsWith "EU-". } => { ?P :hasEuSerial true. }.
|
|
10
|
-
{ ?P :batteryId ?B. ?B string:startsWith "BAT-". } => { ?P :hasBatteryPassport true. }.
|
|
11
|
-
{ ?P :hasEuSerial true. ?P :hasBatteryPassport true. } => { ?P :passportStatus :ready. }.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/dijkstra.n3.
|
|
2
|
-
# Tiny weighted path expansion without aggregate minimization.
|
|
3
|
-
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/dijkstra#>.
|
|
5
|
-
|
|
6
|
-
:e1 :from :a; :to :b; :cost 2.
|
|
7
|
-
:e2 :from :a; :to :c; :cost 5.
|
|
8
|
-
:e3 :from :b; :to :c; :cost 1.
|
|
9
|
-
:e4 :from :b; :to :d; :cost 4.
|
|
10
|
-
:e5 :from :c; :to :d; :cost 1.
|
|
11
|
-
|
|
12
|
-
{ ?E :from ?S; :to ?O; :cost ?C. } => { (?S ?O) :pathCost ?C. }.
|
|
13
|
-
{ (?S ?M) :pathCost ?C1. ?E :from ?M; :to ?O; :cost ?C2. (?C1 ?C2) math:sum ?CT. } => { (?S ?O) :pathCost ?CT. }.
|
|
14
|
-
{ (:a :d) :pathCost ?C. ?C math:notGreaterThan 6. } => { :route :candidateCost ?C. }.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/dog.n3.
|
|
2
|
-
# The original uses log:collectAllIn; this compatibility example supplies the count directly.
|
|
3
|
-
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/ns#>.
|
|
5
|
-
|
|
6
|
-
:alice :hasDog :dog1, :dog2, :dog3, :dog4, :dog5;
|
|
7
|
-
:dogCount 5.
|
|
8
|
-
:bob :hasDog :dog6, :dog7;
|
|
9
|
-
:dogCount 2.
|
|
10
|
-
|
|
11
|
-
{ ?Subject :dogCount ?Count. ?Count math:greaterThan 4. } => {
|
|
12
|
-
?Subject :mustHave :dogLicense.
|
|
13
|
-
}.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/drone-corridor-planner.n3.
|
|
2
|
-
# Finds allowed drone corridor hops under wind limits.
|
|
3
|
-
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/drone-corridor#>.
|
|
5
|
-
|
|
6
|
-
:c1 :from :dock; :to :tower; :wind 12.
|
|
7
|
-
:c2 :from :tower; :to :field; :wind 18.
|
|
8
|
-
:c3 :from :dock; :to :field; :wind 25.
|
|
9
|
-
:policy :maxWind 20.
|
|
10
|
-
|
|
11
|
-
{ ?C :from ?A; :to ?B; :wind ?W. :policy :maxWind ?M. ?W math:notGreaterThan ?M. } => { ?C :allowed true. }.
|
|
12
|
-
{ ?C :allowed true; :from ?A; :to ?B. } => { ?A :canFlyTo ?B. }.
|
|
13
|
-
{ :dock :canFlyTo :tower. :tower :canFlyTo :field. } => { :mission :hasTwoHopRoute true. }.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/equivalence-classes-overlap-implies-same-class.n3.
|
|
2
|
-
# If two class sets share a member, they are linked as the same class.
|
|
3
|
-
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/equivalence-classes#>.
|
|
5
|
-
|
|
6
|
-
:classA :member :alice, :bob.
|
|
7
|
-
:classB :member :bob, :carol.
|
|
8
|
-
:classC :member :diana.
|
|
9
|
-
|
|
10
|
-
{ ?C1 :member ?X. ?C2 :member ?X. ?C1 log:notEqualTo ?C2. } => { ?C1 :sameClassAs ?C2. }.
|
|
11
|
-
{ ?C1 :sameClassAs ?C2. } => { ?C2 :sameClassAs ?C1. }.
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/euler-identity.n3.
|
|
2
|
-
# Numeric trigonometric builtins around pi.
|
|
3
|
-
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
4
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/euler-identity#>.
|
|
5
|
-
|
|
6
|
-
:pi :radians 3.141592653589793.
|
|
7
|
-
|
|
8
|
-
{ :pi :radians ?P. ?P math:cos ?C. ?P math:sin ?S. } => { :euler :cosPi ?C; :sinPi ?S. }.
|
|
9
|
-
{ :euler :cosPi ?C. ?C math:notGreaterThan -1. } => { :euler :cosPiAtMinusOne true. }.
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# Adapted from eyeling/examples/existential-rule.n3.
|
|
2
|
-
# Uses explicit blank-node witnesses in the rule head.
|
|
3
|
-
@prefix : <https://eyereasoner.github.io/eyeling/examples/existential-rule#>.
|
|
4
|
-
|
|
5
|
-
:Socrates a :Human.
|
|
6
|
-
:Plato a :Human.
|
|
7
|
-
|
|
8
|
-
{ ?S a :Human. } => { ?S :hasNature _:humanNature. }.
|
|
9
|
-
{ ?S :hasNature _:humanNature. } => { ?S :witnessed true. }.
|