@coasys/ad4m-connect 0.13.0-test-interpretation → 0.13.0-test-interpretation-2
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/core.js +157 -110
- package/dist/core.js.map +2 -2
- package/dist/index.js +157 -110
- package/dist/index.js.map +3 -3
- package/dist/utils.js +1 -1
- package/dist/web.js +157 -110
- package/dist/web.js.map +3 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -52,7 +52,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
// ../package.json
|
|
55
|
-
var version = "0.13.0-test-interpretation";
|
|
55
|
+
var version = "0.13.0-test-interpretation-2";
|
|
56
56
|
|
|
57
57
|
// src/utils.ts
|
|
58
58
|
function isEmbedded() {
|
|
@@ -792,6 +792,14 @@ var Literal = class {
|
|
|
792
792
|
const numberString = body.substring(7);
|
|
793
793
|
return parseFloat(numberString);
|
|
794
794
|
}
|
|
795
|
+
if (body.startsWith("boolean:")) {
|
|
796
|
+
const boolString = decodeURIComponent(body.substring(8));
|
|
797
|
+
if (boolString === "true")
|
|
798
|
+
return true;
|
|
799
|
+
if (boolString === "false")
|
|
800
|
+
return false;
|
|
801
|
+
throw new Error(`Can't parse boolean literal: ${boolString}`);
|
|
802
|
+
}
|
|
795
803
|
if (body.startsWith("json:")) {
|
|
796
804
|
const json = body.substring(5);
|
|
797
805
|
return JSON.parse(decodeURIComponent(json));
|
|
@@ -1118,6 +1126,10 @@ var SHACLShape = class {
|
|
|
1118
1126
|
}
|
|
1119
1127
|
if (prop.writable !== void 0) {
|
|
1120
1128
|
turtle += ` ad4m:writable ${prop.writable} ;
|
|
1129
|
+
`;
|
|
1130
|
+
}
|
|
1131
|
+
if (prop.identity !== void 0) {
|
|
1132
|
+
turtle += ` ad4m:identity ${prop.identity} ;
|
|
1121
1133
|
`;
|
|
1122
1134
|
}
|
|
1123
1135
|
turtle = turtle.slice(0, -2) + "\n";
|
|
@@ -1608,7 +1620,8 @@ var SHACLShape = class {
|
|
|
1608
1620
|
where_predicates: p2.wherePredicates,
|
|
1609
1621
|
filter: p2.filter,
|
|
1610
1622
|
transform: p2.transform,
|
|
1611
|
-
interpretation_hint: p2.interpretationHint
|
|
1623
|
+
interpretation_hint: p2.interpretationHint,
|
|
1624
|
+
identity: p2.identity
|
|
1612
1625
|
})),
|
|
1613
1626
|
constructor_actions: this.constructor_actions,
|
|
1614
1627
|
destructor_actions: this.destructor_actions
|
|
@@ -1633,7 +1646,7 @@ var SHACLShape = class {
|
|
|
1633
1646
|
hasValue: p2.has_value,
|
|
1634
1647
|
local: p2.local,
|
|
1635
1648
|
writable: p2.writable,
|
|
1636
|
-
resolveLanguage: p2.resolve_language,
|
|
1649
|
+
resolveLanguage: p2.resolve_language ?? p2.resolveLanguage,
|
|
1637
1650
|
setter: p2.setter,
|
|
1638
1651
|
adder: p2.adder,
|
|
1639
1652
|
remover: p2.remover,
|
|
@@ -1647,7 +1660,8 @@ var SHACLShape = class {
|
|
|
1647
1660
|
wherePredicates: p2.where_predicates,
|
|
1648
1661
|
filter: p2.filter,
|
|
1649
1662
|
transform: p2.transform,
|
|
1650
|
-
interpretationHint: p2.interpretation_hint
|
|
1663
|
+
interpretationHint: p2.interpretation_hint,
|
|
1664
|
+
identity: p2.identity
|
|
1651
1665
|
});
|
|
1652
1666
|
}
|
|
1653
1667
|
if (json.constructor_actions) {
|
|
@@ -1716,16 +1730,19 @@ function buildSHACL(subjectName, target, properties, allRelationsMeta, conforman
|
|
|
1716
1730
|
name: propName,
|
|
1717
1731
|
path: propMeta.through
|
|
1718
1732
|
};
|
|
1719
|
-
if (propMeta.
|
|
1720
|
-
propShape.datatype =
|
|
1721
|
-
} else
|
|
1722
|
-
const
|
|
1723
|
-
if (
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1733
|
+
if (propMeta.datatype) {
|
|
1734
|
+
propShape.datatype = propMeta.datatype;
|
|
1735
|
+
} else {
|
|
1736
|
+
const isLiteral = propMeta.resolveLanguage === void 0 || propMeta.resolveLanguage === "literal";
|
|
1737
|
+
if ((propMeta.initial !== void 0 || isLiteral) && !propMeta.getter) {
|
|
1738
|
+
const initialType = typeof obj[propName];
|
|
1739
|
+
if (initialType === "number") {
|
|
1740
|
+
propShape.datatype = "xsd://integer";
|
|
1741
|
+
} else if (initialType === "boolean") {
|
|
1742
|
+
propShape.datatype = "xsd://boolean";
|
|
1743
|
+
} else if (initialType === "string" || isLiteral) {
|
|
1744
|
+
propShape.datatype = "xsd://string";
|
|
1745
|
+
}
|
|
1729
1746
|
}
|
|
1730
1747
|
}
|
|
1731
1748
|
if (propMeta.required) {
|
|
@@ -1799,7 +1816,12 @@ function buildSHACL(subjectName, target, properties, allRelationsMeta, conforman
|
|
|
1799
1816
|
name: relName,
|
|
1800
1817
|
path: synthesizedPath
|
|
1801
1818
|
};
|
|
1802
|
-
|
|
1819
|
+
if (relMeta.datatype) {
|
|
1820
|
+
relShape.datatype = relMeta.datatype;
|
|
1821
|
+
relShape.nodeKind = "Literal";
|
|
1822
|
+
} else {
|
|
1823
|
+
relShape.nodeKind = "IRI";
|
|
1824
|
+
}
|
|
1803
1825
|
relShape.relationKind = relMeta.kind;
|
|
1804
1826
|
if (relMeta.kind === "hasOne" || relMeta.kind === "belongsToOne") {
|
|
1805
1827
|
relShape.maxCount = 1;
|
|
@@ -2078,33 +2100,6 @@ function Optional(opts) {
|
|
|
2078
2100
|
readOnly: opts.readOnly ?? false
|
|
2079
2101
|
});
|
|
2080
2102
|
}
|
|
2081
|
-
function Flag(opts) {
|
|
2082
|
-
return function(target, key) {
|
|
2083
|
-
if (!opts.through && !opts.value) {
|
|
2084
|
-
throw new Error("SubjectFlag requires a 'through' and 'value' option");
|
|
2085
|
-
}
|
|
2086
|
-
if (!opts.through) {
|
|
2087
|
-
throw new Error("SubjectFlag requires a 'through' option");
|
|
2088
|
-
}
|
|
2089
|
-
if (!opts.value) {
|
|
2090
|
-
throw new Error("SubjectFlag requires a 'value' option");
|
|
2091
|
-
}
|
|
2092
|
-
const entry = {
|
|
2093
|
-
through: opts.through,
|
|
2094
|
-
required: true,
|
|
2095
|
-
initial: opts.value,
|
|
2096
|
-
flag: true,
|
|
2097
|
-
readOnly: true,
|
|
2098
|
-
writable: false
|
|
2099
|
-
};
|
|
2100
|
-
const ctor = target.constructor;
|
|
2101
|
-
if (!propertyRegistry.has(ctor))
|
|
2102
|
-
propertyRegistry.set(ctor, {});
|
|
2103
|
-
propertyRegistry.get(ctor)[key] = entry;
|
|
2104
|
-
target[key] = opts.value;
|
|
2105
|
-
Object.defineProperty(target, key, { configurable: true, writable: true });
|
|
2106
|
-
};
|
|
2107
|
-
}
|
|
2108
2103
|
function Model$1(opts) {
|
|
2109
2104
|
return function(target) {
|
|
2110
2105
|
target.prototype.className = opts.name;
|
|
@@ -2124,7 +2119,6 @@ function Property(opts) {
|
|
|
2124
2119
|
...opts,
|
|
2125
2120
|
required,
|
|
2126
2121
|
readOnly: opts.readOnly ?? false,
|
|
2127
|
-
resolveLanguage: opts.resolveLanguage ?? "literal",
|
|
2128
2122
|
initial: opts.initial ?? (required ? "literal:string:uninitialized" : void 0)
|
|
2129
2123
|
});
|
|
2130
2124
|
}
|
|
@@ -2166,7 +2160,8 @@ function HasMany(first, second) {
|
|
|
2166
2160
|
local: opts.local,
|
|
2167
2161
|
...opts.getter && { getter: opts.getter },
|
|
2168
2162
|
...opts.filter !== void 0 && { filter: opts.filter },
|
|
2169
|
-
...opts.where && { where: opts.where }
|
|
2163
|
+
...opts.where && { where: opts.where },
|
|
2164
|
+
...opts.datatype && { datatype: opts.datatype }
|
|
2170
2165
|
};
|
|
2171
2166
|
const relKey = key;
|
|
2172
2167
|
if (opts.through) {
|
|
@@ -2708,6 +2703,9 @@ var PerspectiveProxy = class {
|
|
|
2708
2703
|
async addAutoProcessorEventListener(cb) {
|
|
2709
2704
|
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").addAutoProcessorEventListener(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, cb);
|
|
2710
2705
|
}
|
|
2706
|
+
async addAutoProcessorNeighbourhoodStateListener(cb) {
|
|
2707
|
+
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").addAutoProcessorNeighbourhoodStateListener(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, cb);
|
|
2708
|
+
}
|
|
2711
2709
|
async infer(query) {
|
|
2712
2710
|
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").queryProlog(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, query);
|
|
2713
2711
|
}
|
|
@@ -3150,16 +3148,14 @@ var PerspectiveProxy = class {
|
|
|
3150
3148
|
return null;
|
|
3151
3149
|
}
|
|
3152
3150
|
const flowUri = flowUriLinks[0].data.target;
|
|
3153
|
-
const
|
|
3154
|
-
const
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
predicate: r4.p,
|
|
3162
|
-
target: r4.o
|
|
3151
|
+
const flowLevelLinks = await this.get(new LinkQuery({ source: flowUri }));
|
|
3152
|
+
const childUris = flowLevelLinks.filter((l5) => l5.data.predicate === "ad4m://hasState" || l5.data.predicate === "ad4m://hasTransition").map((l5) => l5.data.target);
|
|
3153
|
+
const childResults = await Promise.all(childUris.map((uri) => this.get(new LinkQuery({ source: uri }))));
|
|
3154
|
+
const allExprs = [...flowLevelLinks, ...childResults.flat()];
|
|
3155
|
+
const flowLinks = allExprs.map((l5) => ({
|
|
3156
|
+
source: l5.data.source,
|
|
3157
|
+
predicate: l5.data.predicate,
|
|
3158
|
+
target: l5.data.target
|
|
3163
3159
|
}));
|
|
3164
3160
|
return SHACLFlow.fromLinks(flowLinks, flowUri);
|
|
3165
3161
|
}
|
|
@@ -3837,9 +3833,9 @@ var PerspectiveClient = class {
|
|
|
3837
3833
|
async linkMutations(uuid, mutations, status) {
|
|
3838
3834
|
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.linkMutations", { uuid, mutations, status });
|
|
3839
3835
|
}
|
|
3840
|
-
async runInterpretation(uuid, transcript, basePrefix, classes) {
|
|
3836
|
+
async runInterpretation(uuid, transcript, basePrefix, classes, existingScope, mintScope) {
|
|
3841
3837
|
const RUN_INTERPRETATION_TIMEOUT_MS = 20 * 60 * 1e3;
|
|
3842
|
-
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.runInterpretation", { uuid, transcript, basePrefix, classes }, RUN_INTERPRETATION_TIMEOUT_MS);
|
|
3838
|
+
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.runInterpretation", { uuid, transcript, basePrefix, classes, existingScope, mintScope }, RUN_INTERPRETATION_TIMEOUT_MS);
|
|
3843
3839
|
}
|
|
3844
3840
|
async addAutoProcessor(uuid, config) {
|
|
3845
3841
|
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.addAutoProcessor", { uuid, ...config });
|
|
@@ -3859,7 +3855,20 @@ var PerspectiveClient = class {
|
|
|
3859
3855
|
cb(data);
|
|
3860
3856
|
}
|
|
3861
3857
|
});
|
|
3862
|
-
__classPrivateFieldGet$9(this,
|
|
3858
|
+
let existing = __classPrivateFieldGet$9(this, _PerspectiveClient_linkUnsubscribers, "f").get(uuid) || [];
|
|
3859
|
+
existing.push(unsub);
|
|
3860
|
+
__classPrivateFieldGet$9(this, _PerspectiveClient_linkUnsubscribers, "f").set(uuid, existing);
|
|
3861
|
+
await __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").waitForSubscription();
|
|
3862
|
+
}
|
|
3863
|
+
async addAutoProcessorNeighbourhoodStateListener(uuid, cb) {
|
|
3864
|
+
const unsub = __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").subscribe((data) => {
|
|
3865
|
+
if (data.type === "auto-processor-neighbourhood-state" && data.perspectiveUuid === uuid) {
|
|
3866
|
+
cb(data);
|
|
3867
|
+
}
|
|
3868
|
+
});
|
|
3869
|
+
let existing = __classPrivateFieldGet$9(this, _PerspectiveClient_linkUnsubscribers, "f").get(uuid) || [];
|
|
3870
|
+
existing.push(unsub);
|
|
3871
|
+
__classPrivateFieldGet$9(this, _PerspectiveClient_linkUnsubscribers, "f").set(uuid, existing);
|
|
3863
3872
|
await __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").waitForSubscription();
|
|
3864
3873
|
}
|
|
3865
3874
|
async addLinkExpression(uuid, link, status = "shared", batchId) {
|
|
@@ -9390,10 +9399,6 @@ function isArrayType(schema) {
|
|
|
9390
9399
|
function isObjectType(schema) {
|
|
9391
9400
|
return isSchemaType(schema, "object");
|
|
9392
9401
|
}
|
|
9393
|
-
function isNumericType(schema) {
|
|
9394
|
-
const normalized = normalizeSchemaType(schema.type);
|
|
9395
|
-
return normalized === "number" || normalized === "integer";
|
|
9396
|
-
}
|
|
9397
9402
|
function determineNamespace(schema, options) {
|
|
9398
9403
|
if (options.namespace) {
|
|
9399
9404
|
return options.namespace;
|
|
@@ -9515,10 +9520,6 @@ function buildModelFromJSONSchema(BaseClass, schema, options) {
|
|
|
9515
9520
|
DynamicModelClass.prototype[setterName] = function() {
|
|
9516
9521
|
};
|
|
9517
9522
|
} else {
|
|
9518
|
-
let resolveLanguage = getPropertyOption(propertyName, propertySchema, options, "resolveLanguage");
|
|
9519
|
-
if (!resolveLanguage && options.resolveLanguage) {
|
|
9520
|
-
resolveLanguage = options.resolveLanguage;
|
|
9521
|
-
}
|
|
9522
9523
|
const local = getPropertyOption(propertyName, propertySchema, options, "local");
|
|
9523
9524
|
let readOnly = getPropertyOption(propertyName, propertySchema, options, "readOnly");
|
|
9524
9525
|
if (readOnly === void 0) {
|
|
@@ -9527,16 +9528,10 @@ function buildModelFromJSONSchema(BaseClass, schema, options) {
|
|
|
9527
9528
|
}
|
|
9528
9529
|
const writable = !readOnly;
|
|
9529
9530
|
let initial = getPropertyOption(propertyName, propertySchema, options, "initial");
|
|
9530
|
-
|
|
9531
|
-
|
|
9531
|
+
const resolveLanguage = getPropertyOption(propertyName, propertySchema, options, "resolveLanguage");
|
|
9532
|
+
if (isObjectType(propertySchema)) {
|
|
9532
9533
|
console.warn(`Property "${propertyName}" is an object type. It will be stored as JSON. Consider flattening complex objects for better semantic querying.`);
|
|
9533
9534
|
}
|
|
9534
|
-
if ((resolveLanguage === void 0 || resolveLanguage === null) && isNumericType(propertySchema)) {
|
|
9535
|
-
resolveLanguage = "literal";
|
|
9536
|
-
}
|
|
9537
|
-
if (resolveLanguage === void 0 || resolveLanguage === null) {
|
|
9538
|
-
resolveLanguage = "literal";
|
|
9539
|
-
}
|
|
9540
9535
|
if (isRequired && !initial) {
|
|
9541
9536
|
if (isObjectType(propertySchema)) {
|
|
9542
9537
|
initial = "literal:json:{}";
|
|
@@ -9548,7 +9543,7 @@ function buildModelFromJSONSchema(BaseClass, schema, options) {
|
|
|
9548
9543
|
through: predicate,
|
|
9549
9544
|
required: isRequired,
|
|
9550
9545
|
writable,
|
|
9551
|
-
...resolveLanguage && { resolveLanguage },
|
|
9546
|
+
...resolveLanguage !== void 0 && { resolveLanguage },
|
|
9552
9547
|
...local !== void 0 && { local },
|
|
9553
9548
|
...initial && { initial }
|
|
9554
9549
|
};
|
|
@@ -9611,13 +9606,43 @@ function hasJsOnlyWhereFilters(metadata, allRelationsMetadata, where) {
|
|
|
9611
9606
|
}
|
|
9612
9607
|
return false;
|
|
9613
9608
|
}
|
|
9614
|
-
function
|
|
9615
|
-
if (
|
|
9609
|
+
function looksLikeUri(value) {
|
|
9610
|
+
if (!/^[a-zA-Z][a-zA-Z0-9+\-._]*:/.test(value))
|
|
9616
9611
|
return false;
|
|
9617
|
-
if (
|
|
9612
|
+
if (/[\s<>{}"\u0000-\u001F\u007F-\u009F]/.test(value))
|
|
9618
9613
|
return false;
|
|
9619
9614
|
return true;
|
|
9620
9615
|
}
|
|
9616
|
+
function valueToLiteralIri(value) {
|
|
9617
|
+
if (typeof value === "string") {
|
|
9618
|
+
if (looksLikeUri(value))
|
|
9619
|
+
return value;
|
|
9620
|
+
return Literal.from(value).toUrl();
|
|
9621
|
+
}
|
|
9622
|
+
if (typeof value === "number") {
|
|
9623
|
+
return Literal.from(value).toUrl();
|
|
9624
|
+
}
|
|
9625
|
+
if (typeof value === "boolean") {
|
|
9626
|
+
return Literal.from(value).toUrl();
|
|
9627
|
+
}
|
|
9628
|
+
if (value !== null && typeof value === "object") {
|
|
9629
|
+
return Literal.from(value).toUrl();
|
|
9630
|
+
}
|
|
9631
|
+
return Literal.from(String(value)).toUrl();
|
|
9632
|
+
}
|
|
9633
|
+
function effectiveLiteralStorage(meta) {
|
|
9634
|
+
const lang = meta.resolveLanguage;
|
|
9635
|
+
if (lang === void 0)
|
|
9636
|
+
return { kind: "deterministic" };
|
|
9637
|
+
if (lang === "literal")
|
|
9638
|
+
return { kind: "envelope" };
|
|
9639
|
+
return { kind: "custom", language: lang };
|
|
9640
|
+
}
|
|
9641
|
+
function isLiteralStoredProperty(propMeta) {
|
|
9642
|
+
if (propMeta.flag)
|
|
9643
|
+
return false;
|
|
9644
|
+
return effectiveLiteralStorage(propMeta).kind === "deterministic";
|
|
9645
|
+
}
|
|
9621
9646
|
function escapeSPARQL(value) {
|
|
9622
9647
|
return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/\0/g, "").replace(/\f/g, "\\u000C");
|
|
9623
9648
|
}
|
|
@@ -10353,7 +10378,7 @@ var Ad4mModel = class {
|
|
|
10353
10378
|
predicate,
|
|
10354
10379
|
required: isRequired,
|
|
10355
10380
|
readOnly: propertySchema["x-ad4m"]?.writable === false,
|
|
10356
|
-
...propertySchema["x-ad4m"]?.resolveLanguage && { resolveLanguage: propertySchema["x-ad4m"].resolveLanguage },
|
|
10381
|
+
...propertySchema["x-ad4m"]?.resolveLanguage !== void 0 && { resolveLanguage: propertySchema["x-ad4m"].resolveLanguage },
|
|
10357
10382
|
...propertySchema["x-ad4m"]?.initial && { initial: propertySchema["x-ad4m"].initial },
|
|
10358
10383
|
...propertySchema["x-ad4m"]?.local !== void 0 && { local: propertySchema["x-ad4m"].local }
|
|
10359
10384
|
};
|
|
@@ -10369,7 +10394,7 @@ var Ad4mModel = class {
|
|
|
10369
10394
|
}
|
|
10370
10395
|
constructor(perspective, baseExpression) {
|
|
10371
10396
|
this._snapshot = null;
|
|
10372
|
-
this._baseExpression = baseExpression ? baseExpression :
|
|
10397
|
+
this._baseExpression = baseExpression ? baseExpression : `ad4m://obj/${makeRandomId(24)}`;
|
|
10373
10398
|
this._perspective = perspective;
|
|
10374
10399
|
}
|
|
10375
10400
|
get id() {
|
|
@@ -10659,12 +10684,16 @@ var Ad4mModel = class {
|
|
|
10659
10684
|
return;
|
|
10660
10685
|
}
|
|
10661
10686
|
const actions = this.generatePropertySetterAction(key, metadata);
|
|
10662
|
-
let resolveLanguage = metadata.resolveLanguage;
|
|
10663
10687
|
if (value === void 0 || value === null || value === "") {
|
|
10664
10688
|
return;
|
|
10665
10689
|
}
|
|
10666
|
-
|
|
10667
|
-
|
|
10690
|
+
const mode = effectiveLiteralStorage(metadata);
|
|
10691
|
+
if (mode.kind === "custom") {
|
|
10692
|
+
value = await this._perspective.createExpression(value, mode.language);
|
|
10693
|
+
} else if (mode.kind === "envelope") {
|
|
10694
|
+
value = await this._perspective.createExpression(value, "literal");
|
|
10695
|
+
} else {
|
|
10696
|
+
value = valueToLiteralIri(value);
|
|
10668
10697
|
}
|
|
10669
10698
|
await this._perspective.executeAction(actions, this._baseExpression, [{ name: "value", value }], batchId);
|
|
10670
10699
|
}
|
|
@@ -10737,14 +10766,14 @@ var Ad4mModel = class {
|
|
|
10737
10766
|
}
|
|
10738
10767
|
const metadata = this.constructor.getModelMetadata();
|
|
10739
10768
|
const hasConstructor = Object.values(metadata.properties).some((p2) => p2.required || p2.flag || p2.initial !== void 0);
|
|
10740
|
-
const
|
|
10769
|
+
const deferredExpressionProps = [];
|
|
10741
10770
|
if (hasConstructor) {
|
|
10742
10771
|
const initialValues = {};
|
|
10743
10772
|
for (const [key, value] of Object.entries(this)) {
|
|
10744
10773
|
if (value !== void 0 && value !== null && !(Array.isArray(value) && value.length > 0) && !value?.action) {
|
|
10745
10774
|
const propMeta = metadata.properties[key];
|
|
10746
|
-
if (propMeta
|
|
10747
|
-
|
|
10775
|
+
if (propMeta && effectiveLiteralStorage(propMeta).kind !== "deterministic") {
|
|
10776
|
+
deferredExpressionProps.push(key);
|
|
10748
10777
|
continue;
|
|
10749
10778
|
}
|
|
10750
10779
|
initialValues[key] = value;
|
|
@@ -10754,7 +10783,7 @@ var Ad4mModel = class {
|
|
|
10754
10783
|
await this.perspective.createSubject(className, this._baseExpression, initialValues, batchId);
|
|
10755
10784
|
}
|
|
10756
10785
|
await this.innerUpdate(!hasConstructor, batchId);
|
|
10757
|
-
for (const key of
|
|
10786
|
+
for (const key of deferredExpressionProps) {
|
|
10758
10787
|
const value = this[key];
|
|
10759
10788
|
if (value !== void 0 && value !== null) {
|
|
10760
10789
|
await this.setProperty(key, value, batchId);
|
|
@@ -11170,7 +11199,6 @@ var __metadata = function(k2, v2) {
|
|
|
11170
11199
|
var AutoProcessorConfig = class AutoProcessorConfig2 extends Ad4mModel {
|
|
11171
11200
|
constructor() {
|
|
11172
11201
|
super(...arguments);
|
|
11173
|
-
this.type = "ad4m://AutoProcessor";
|
|
11174
11202
|
this.processorId = "";
|
|
11175
11203
|
this.sourceScopeQuery = "";
|
|
11176
11204
|
this.interpretationClasses = [];
|
|
@@ -11179,10 +11207,6 @@ var AutoProcessorConfig = class AutoProcessorConfig2 extends Ad4mModel {
|
|
|
11179
11207
|
this.claimTtlMs = "60000";
|
|
11180
11208
|
}
|
|
11181
11209
|
};
|
|
11182
|
-
__decorate([
|
|
11183
|
-
Flag({ through: "rdf://type", value: "ad4m://AutoProcessor" }),
|
|
11184
|
-
__metadata("design:type", String)
|
|
11185
|
-
], AutoProcessorConfig.prototype, "type", void 0);
|
|
11186
11210
|
__decorate([
|
|
11187
11211
|
Property({ through: "ad4m://processor_id", required: true, identity: true }),
|
|
11188
11212
|
__metadata("design:type", String)
|
|
@@ -11192,11 +11216,11 @@ __decorate([
|
|
|
11192
11216
|
__metadata("design:type", String)
|
|
11193
11217
|
], AutoProcessorConfig.prototype, "sourceScopeQuery", void 0);
|
|
11194
11218
|
__decorate([
|
|
11195
|
-
Optional({ through: "ad4m://base_prefix"
|
|
11219
|
+
Optional({ through: "ad4m://base_prefix" }),
|
|
11196
11220
|
__metadata("design:type", String)
|
|
11197
11221
|
], AutoProcessorConfig.prototype, "basePrefix", void 0);
|
|
11198
11222
|
__decorate([
|
|
11199
|
-
HasMany({ through: "ad4m://interpretation_class" }),
|
|
11223
|
+
HasMany({ through: "ad4m://interpretation_class", datatype: "xsd:string" }),
|
|
11200
11224
|
__metadata("design:type", Array)
|
|
11201
11225
|
], AutoProcessorConfig.prototype, "interpretationClasses", void 0);
|
|
11202
11226
|
__decorate([
|
|
@@ -11204,7 +11228,7 @@ __decorate([
|
|
|
11204
11228
|
__metadata("design:type", String)
|
|
11205
11229
|
], AutoProcessorConfig.prototype, "debounceMs", void 0);
|
|
11206
11230
|
__decorate([
|
|
11207
|
-
Optional({ through: "ad4m://batch_min"
|
|
11231
|
+
Optional({ through: "ad4m://batch_min" }),
|
|
11208
11232
|
__metadata("design:type", String)
|
|
11209
11233
|
], AutoProcessorConfig.prototype, "batchMin", void 0);
|
|
11210
11234
|
__decorate([
|
|
@@ -11212,7 +11236,7 @@ __decorate([
|
|
|
11212
11236
|
__metadata("design:type", String)
|
|
11213
11237
|
], AutoProcessorConfig.prototype, "batchMax", void 0);
|
|
11214
11238
|
__decorate([
|
|
11215
|
-
Optional({ through: "ad4m://max_wait_ms"
|
|
11239
|
+
Optional({ through: "ad4m://max_wait_ms" }),
|
|
11216
11240
|
__metadata("design:type", String)
|
|
11217
11241
|
], AutoProcessorConfig.prototype, "maxWaitMs", void 0);
|
|
11218
11242
|
__decorate([
|
|
@@ -11220,52 +11244,75 @@ __decorate([
|
|
|
11220
11244
|
__metadata("design:type", String)
|
|
11221
11245
|
], AutoProcessorConfig.prototype, "claimTtlMs", void 0);
|
|
11222
11246
|
__decorate([
|
|
11223
|
-
Optional({ through: "ad4m://source_window_ms"
|
|
11247
|
+
Optional({ through: "ad4m://source_window_ms" }),
|
|
11224
11248
|
__metadata("design:type", String)
|
|
11225
11249
|
], AutoProcessorConfig.prototype, "sourceWindowMs", void 0);
|
|
11226
11250
|
__decorate([
|
|
11227
|
-
Optional({ through: "ad4m://dedup_strategy"
|
|
11251
|
+
Optional({ through: "ad4m://dedup_strategy" }),
|
|
11228
11252
|
__metadata("design:type", String)
|
|
11229
11253
|
], AutoProcessorConfig.prototype, "dedupStrategy", void 0);
|
|
11254
|
+
__decorate([
|
|
11255
|
+
Optional({ through: "ad4m://existing_scope" }),
|
|
11256
|
+
__metadata("design:type", String)
|
|
11257
|
+
], AutoProcessorConfig.prototype, "existingScope", void 0);
|
|
11258
|
+
__decorate([
|
|
11259
|
+
Optional({ through: "ad4m://mint_scope" }),
|
|
11260
|
+
__metadata("design:type", String)
|
|
11261
|
+
], AutoProcessorConfig.prototype, "mintScope", void 0);
|
|
11262
|
+
__decorate([
|
|
11263
|
+
Optional({ through: "ad4m://debug_mode", resolveLanguage: "literal" }),
|
|
11264
|
+
__metadata("design:type", String)
|
|
11265
|
+
], AutoProcessorConfig.prototype, "debugMode", void 0);
|
|
11266
|
+
__decorate([
|
|
11267
|
+
Optional({ through: "ad4m://persist_debug", resolveLanguage: "literal" }),
|
|
11268
|
+
__metadata("design:type", String)
|
|
11269
|
+
], AutoProcessorConfig.prototype, "persistDebug", void 0);
|
|
11270
|
+
__decorate([
|
|
11271
|
+
Optional({ through: "ad4m://emit_debug_events", resolveLanguage: "literal" }),
|
|
11272
|
+
__metadata("design:type", String)
|
|
11273
|
+
], AutoProcessorConfig.prototype, "emitDebugEvents", void 0);
|
|
11230
11274
|
AutoProcessorConfig = __decorate([
|
|
11231
|
-
Model$1({ name: "
|
|
11275
|
+
Model$1({ name: "AutoProcessor" })
|
|
11232
11276
|
], AutoProcessorConfig);
|
|
11233
11277
|
var InterpretationRun = class InterpretationRun2 extends Ad4mModel {
|
|
11234
11278
|
constructor() {
|
|
11235
11279
|
super(...arguments);
|
|
11236
|
-
this.type = "ad4m://interpretation-run";
|
|
11237
11280
|
this.runId = "";
|
|
11238
11281
|
this.sources = [];
|
|
11239
11282
|
}
|
|
11240
11283
|
};
|
|
11241
|
-
__decorate([
|
|
11242
|
-
Flag({ through: "ad4m://type", value: "ad4m://interpretation-run" }),
|
|
11243
|
-
__metadata("design:type", String)
|
|
11244
|
-
], InterpretationRun.prototype, "type", void 0);
|
|
11245
11284
|
__decorate([
|
|
11246
11285
|
Property({ through: "ad4m://interp/run_id", required: true, identity: true }),
|
|
11247
11286
|
__metadata("design:type", String)
|
|
11248
11287
|
], InterpretationRun.prototype, "runId", void 0);
|
|
11249
11288
|
__decorate([
|
|
11250
|
-
Optional({ through: "ad4m://interp/model"
|
|
11289
|
+
Optional({ through: "ad4m://interp/model" }),
|
|
11251
11290
|
__metadata("design:type", String)
|
|
11252
11291
|
], InterpretationRun.prototype, "model", void 0);
|
|
11253
11292
|
__decorate([
|
|
11254
|
-
Optional({ through: "ad4m://interp/prompt_version"
|
|
11293
|
+
Optional({ through: "ad4m://interp/prompt_version" }),
|
|
11255
11294
|
__metadata("design:type", String)
|
|
11256
11295
|
], InterpretationRun.prototype, "promptVersion", void 0);
|
|
11257
11296
|
__decorate([
|
|
11258
|
-
Optional({ through: "ad4m://interp/ran_at"
|
|
11297
|
+
Optional({ through: "ad4m://interp/ran_at" }),
|
|
11259
11298
|
__metadata("design:type", String)
|
|
11260
11299
|
], InterpretationRun.prototype, "ranAt", void 0);
|
|
11261
11300
|
__decorate([
|
|
11262
|
-
Optional({ through: "ad4m://interp/processor"
|
|
11301
|
+
Optional({ through: "ad4m://interp/processor" }),
|
|
11263
11302
|
__metadata("design:type", String)
|
|
11264
11303
|
], InterpretationRun.prototype, "processor", void 0);
|
|
11265
11304
|
__decorate([
|
|
11266
|
-
HasMany({ through: "ad4m://interp/sources" }),
|
|
11305
|
+
HasMany({ through: "ad4m://interp/sources", datatype: "xsd:string" }),
|
|
11267
11306
|
__metadata("design:type", Array)
|
|
11268
11307
|
], InterpretationRun.prototype, "sources", void 0);
|
|
11308
|
+
__decorate([
|
|
11309
|
+
Optional({ through: "ad4m://interp/debug_prompt", resolveLanguage: "literal" }),
|
|
11310
|
+
__metadata("design:type", String)
|
|
11311
|
+
], InterpretationRun.prototype, "debugPrompt", void 0);
|
|
11312
|
+
__decorate([
|
|
11313
|
+
Optional({ through: "ad4m://interp/debug_response", resolveLanguage: "literal" }),
|
|
11314
|
+
__metadata("design:type", String)
|
|
11315
|
+
], InterpretationRun.prototype, "debugResponse", void 0);
|
|
11269
11316
|
InterpretationRun = __decorate([
|
|
11270
11317
|
Model$1({ name: "InterpretationRun" })
|
|
11271
11318
|
], InterpretationRun);
|
|
@@ -11276,11 +11323,11 @@ var InterpretationOverlay = class InterpretationOverlay2 extends Ad4mModel {
|
|
|
11276
11323
|
}
|
|
11277
11324
|
};
|
|
11278
11325
|
__decorate([
|
|
11279
|
-
Property({ through: "ad4m://interp/kind", required: true
|
|
11326
|
+
Property({ through: "ad4m://interp/kind", required: true }),
|
|
11280
11327
|
__metadata("design:type", String)
|
|
11281
11328
|
], InterpretationOverlay.prototype, "kind", void 0);
|
|
11282
11329
|
__decorate([
|
|
11283
|
-
Optional({ through: "ad4m://interp/run"
|
|
11330
|
+
Optional({ through: "ad4m://interp/run" }),
|
|
11284
11331
|
__metadata("design:type", String)
|
|
11285
11332
|
], InterpretationOverlay.prototype, "run", void 0);
|
|
11286
11333
|
InterpretationOverlay = __decorate([
|