eyeling 1.28.4 → 1.28.5
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/dist/browser/eyeling.browser.js +5 -1
- package/eyeling.js +5 -1
- package/lib/builtins.js +5 -1
- package/package.json +1 -1
- package/test/builtins.test.js +8 -0
|
@@ -142,6 +142,10 @@ function __assertBuiltinHandlerResult(iri, out) {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
function apiTermToN3(term, prefixes = PrefixEnv.newDefault()) {
|
|
146
|
+
return termToN3(term, prefixes || PrefixEnv.newDefault());
|
|
147
|
+
}
|
|
148
|
+
|
|
145
149
|
function __buildBuiltinRegistrationApi() {
|
|
146
150
|
if (__builtinApiSingleton) return __builtinApiSingleton;
|
|
147
151
|
|
|
@@ -154,7 +158,7 @@ function __buildBuiltinRegistrationApi() {
|
|
|
154
158
|
literalParts,
|
|
155
159
|
termToJsString,
|
|
156
160
|
termToJsStringDecoded,
|
|
157
|
-
termToN3,
|
|
161
|
+
termToN3: apiTermToN3,
|
|
158
162
|
iriValue,
|
|
159
163
|
unifyTerm,
|
|
160
164
|
applySubstTerm,
|
package/eyeling.js
CHANGED
|
@@ -142,6 +142,10 @@ function __assertBuiltinHandlerResult(iri, out) {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
function apiTermToN3(term, prefixes = PrefixEnv.newDefault()) {
|
|
146
|
+
return termToN3(term, prefixes || PrefixEnv.newDefault());
|
|
147
|
+
}
|
|
148
|
+
|
|
145
149
|
function __buildBuiltinRegistrationApi() {
|
|
146
150
|
if (__builtinApiSingleton) return __builtinApiSingleton;
|
|
147
151
|
|
|
@@ -154,7 +158,7 @@ function __buildBuiltinRegistrationApi() {
|
|
|
154
158
|
literalParts,
|
|
155
159
|
termToJsString,
|
|
156
160
|
termToJsStringDecoded,
|
|
157
|
-
termToN3,
|
|
161
|
+
termToN3: apiTermToN3,
|
|
158
162
|
iriValue,
|
|
159
163
|
unifyTerm,
|
|
160
164
|
applySubstTerm,
|
package/lib/builtins.js
CHANGED
|
@@ -131,6 +131,10 @@ function __assertBuiltinHandlerResult(iri, out) {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
function apiTermToN3(term, prefixes = PrefixEnv.newDefault()) {
|
|
135
|
+
return termToN3(term, prefixes || PrefixEnv.newDefault());
|
|
136
|
+
}
|
|
137
|
+
|
|
134
138
|
function __buildBuiltinRegistrationApi() {
|
|
135
139
|
if (__builtinApiSingleton) return __builtinApiSingleton;
|
|
136
140
|
|
|
@@ -143,7 +147,7 @@ function __buildBuiltinRegistrationApi() {
|
|
|
143
147
|
literalParts,
|
|
144
148
|
termToJsString,
|
|
145
149
|
termToJsStringDecoded,
|
|
146
|
-
termToN3,
|
|
150
|
+
termToN3: apiTermToN3,
|
|
147
151
|
iriValue,
|
|
148
152
|
unifyTerm,
|
|
149
153
|
applySubstTerm,
|
package/package.json
CHANGED
package/test/builtins.test.js
CHANGED
|
@@ -110,6 +110,14 @@ const cases = [
|
|
|
110
110
|
assert.deepEqual(Object.keys(api.ns).sort(), expectedNsKeys);
|
|
111
111
|
},
|
|
112
112
|
},
|
|
113
|
+
{
|
|
114
|
+
name: 'custom builtin helper termToN3 uses default prefixes when omitted',
|
|
115
|
+
run() {
|
|
116
|
+
const api = builtins.__testBuildBuiltinApi();
|
|
117
|
+
assert.equal(api.termToN3(api.internIri('http://www.w3.org/2000/10/swap/log#implies')), 'log:implies');
|
|
118
|
+
assert.equal(api.termToN3(api.internLiteral('"abc"')), '"abc"');
|
|
119
|
+
},
|
|
120
|
+
},
|
|
113
121
|
{
|
|
114
122
|
name: 'registerBuiltinModule accepts supported module export forms',
|
|
115
123
|
run() {
|