@_linked/core 2.22.9 → 2.23.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/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.23.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#282](https://github.com/linked-fw/core/pull/282) [`32834ea`](https://github.com/linked-fw/core/commit/32834ea450a2bd7ae98e77758ccbca322d94a4d3) Thanks [@flyon](https://github.com/flyon)! - Every core shape is now registered by whatever loads it, including under a bundler.
8
+
9
+ - `PropertyShape.in` (sh:in) refers to `List` by value instead of by name, and `List` is
10
+ registered from `utils/Package.ts` next to `NodeShape` and `PropertyShape`. Loading the SHACL
11
+ metamodel (`package.js` + `shapes/SHACL.js`) is now enough to query or create `in`; before,
12
+ that threw `Shape class not found for https://linked.cm/shape/core/List` unless something
13
+ else had loaded `shapes/List`.
14
+ - New `@_linked/core/shapes/index`: a side-effect-only module that loads every shape core
15
+ defines. The package entry imports it.
16
+ - `sideEffects` now includes `shapes/*` and the package entry. Before, a bundler dropped a bare
17
+ `import '@_linked/core/shapes/List'`, and `import {validate} from '@_linked/core'` registered
18
+ no core shape at all. A consumer of the entry now bundles the SHACL metamodel with it
19
+ (measured: +40 kB unminified in a Vite build that imports only `validate`).
20
+ - `PathNode`, `NodeShape` and `PropertyShape` have explicit shape names. Bundled, `PathNode`
21
+ collided with the ontology term `coreOntology.PathNode` and was renamed `PathNode2`, which
22
+ registered it under the wrong IRI. Their IRIs are unchanged.
23
+
3
24
  ## 2.22.9
4
25
 
5
26
  ### Patch Changes
@@ -1,3 +1,4 @@
1
+ import './shapes/index.js';
1
2
  export { syncShapes, syncShape } from './shapes/syncShapes.js';
2
3
  export { rdfList } from './shapes/List.js';
3
4
  export { serializePathToNodeData } from './shapes/serializePathToNodeData.js';
package/lib/esm/index.js CHANGED
@@ -3,6 +3,8 @@
3
3
  * License, v. 2.0. If a copy of the MPL was not distributed with this
4
4
  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
5
  */
6
+ // Registers every shape core defines (side effects only).
7
+ import './shapes/index.js';
6
8
  export { syncShapes, syncShape } from './shapes/syncShapes.js';
7
9
  export { rdfList } from './shapes/List.js';
8
10
  export { serializePathToNodeData } from './shapes/serializePathToNodeData.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,sEAAsE;AACtE,OAAO,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACxC,kEAAkE;AAClE,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAQnF,OAAO,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACvD,2CAA2C;AAC3C,OAAO,EAAC,aAAa,EAAE,YAAY,EAAC,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAEzC,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EACL,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAC,YAAY,EAAE,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAEzE,sBAAsB;AACtB,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAM/C,+BAA+B;AAC/B,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAG/D,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAGrE,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAGzD,8CAA8C;AAC9C,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAAC,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAe3C,sEAAsE;AACtE,OAAO,EACL,cAAc,EACd,WAAW,GACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,cAAc,EACd,iBAAiB,GAClB,MAAM,gCAAgC,CAAC","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nexport {syncShapes, syncShape} from './shapes/syncShapes.js';\nexport {rdfList} from './shapes/List.js';\nexport {serializePathToNodeData} from './shapes/serializePathToNodeData.js';\n// Core public API surface (documented as root imports in the README).\nexport {Shape} from './shapes/Shape.js';\n// SHACL-aligned validation of plain data objects against a shape.\nexport {validate, assertValid, ShapeValidationError} from './shapes/validation.js';\nexport type {\n ValidationReport,\n ValidationResult,\n ValidationMode,\n ValidateOptions,\n ValidatableShape,\n} from './shapes/validation.js';\nexport {LinkedStorage} from './utils/LinkedStorage.js';\n// New dynamic query building API (Phase 2)\nexport {SelectBuilder, QueryBuilder} from './queries/QueryBuilder.js';\nexport {lower} from './queries/lower.js';\nexport type {LowerableQuery} from './queries/lower.js';\nexport {fromJSON} from './queries/fromJSON.js';\nexport type {QueryJSON} from './queries/fromJSON.js';\nexport {\n getQueryContext,\n setQueryContext,\n subscribeQueryContext,\n PendingQueryContext,\n UnresolvedContextError,\n} from './queries/QueryContext.js';\nexport {\n CONTEXT_REF_KEY,\n encodeContextRef,\n isContextRefJSON,\n resolveContextId,\n} from './queries/ContextRef.js';\nexport type {ContextRefJSON} from './queries/ContextRef.js';\nexport {PropertyPath, walkPropertyPath} from './queries/PropertyPath.js';\n\n// Phase 3a — FieldSet\nexport {FieldSet} from './queries/FieldSet.js';\nexport type {FieldSetEntry, FieldSetInput, FieldSetJSON, FieldSetFieldJSON} from './queries/FieldSet.js';\n\n// Phase 4 — Serialization types\nexport type {QueryBuilderJSON} from './queries/QueryBuilder.js';\n\n// Phase 3b — Mutation builders\nexport {AskBuilder, isAskQuery} from './queries/AskBuilder.js';\nexport type {AskSpec} from './queries/AskBuilder.js';\nexport type {AskQuery, AskQueryJSON, RawAskInput} from './queries/AskQuery.js';\nexport {CountBuilder, isCountQuery} from './queries/CountBuilder.js';\nexport type {CountSpec} from './queries/CountBuilder.js';\nexport type {CountQuery, CountQueryJSON, RawCountInput} from './queries/CountQuery.js';\nexport {CreateBuilder} from './queries/CreateBuilder.js';\nexport {UpdateBuilder} from './queries/UpdateBuilder.js';\nexport {DeleteBuilder} from './queries/DeleteBuilder.js';\nexport type {DeleteId} from './queries/DeleteBuilder.js';\n\n// Expressions — computed fields and functions\nexport {ExpressionNode} from './expressions/ExpressionNode.js';\nexport type {ExpressionInput, PropertyRefMap} from './expressions/ExpressionNode.js';\nexport {Expr} from './expressions/Expr.js';\nexport type {\n ExpressionUpdateProxy,\n ExpressionUpdateResult,\n BaseExpressionMethods,\n NumericExpressionMethods,\n StringExpressionMethods,\n DateExpressionMethods,\n BooleanExpressionMethods,\n} from './expressions/ExpressionMethods.js';\n\n// Phase 5 — Component query integration\nexport type {LinkedComponentInterface, QueryComponentLike} from './queries/SelectQuery.js';\n\n\n// Mutation DSL-JSON serialization (create/update/delete to/from JSON)\nexport {\n encodeNodeData,\n encodeValue,\n} from './queries/MutationSerialization.js';\nexport {\n decodeNodeData,\n lowerMutationJSON,\n} from './queries/lowerMutationJSON.js';\nexport type {\n MutationJSON,\n CreateMutationJSON,\n UpdateMutationJSON,\n DeleteMutationJSON,\n MutationValueJSON,\n MutationNodeDataJSON,\n} from './queries/MutationSerialization.js';\n\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,0DAA0D;AAC1D,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,sEAAsE;AACtE,OAAO,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACxC,kEAAkE;AAClE,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAQnF,OAAO,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACvD,2CAA2C;AAC3C,OAAO,EAAC,aAAa,EAAE,YAAY,EAAC,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAEzC,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EACL,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAC,YAAY,EAAE,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAEzE,sBAAsB;AACtB,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAM/C,+BAA+B;AAC/B,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAG/D,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAGrE,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAGzD,8CAA8C;AAC9C,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAAC,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAe3C,sEAAsE;AACtE,OAAO,EACL,cAAc,EACd,WAAW,GACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,cAAc,EACd,iBAAiB,GAClB,MAAM,gCAAgC,CAAC","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\n// Registers every shape core defines (side effects only).\nimport './shapes/index.js';\nexport {syncShapes, syncShape} from './shapes/syncShapes.js';\nexport {rdfList} from './shapes/List.js';\nexport {serializePathToNodeData} from './shapes/serializePathToNodeData.js';\n// Core public API surface (documented as root imports in the README).\nexport {Shape} from './shapes/Shape.js';\n// SHACL-aligned validation of plain data objects against a shape.\nexport {validate, assertValid, ShapeValidationError} from './shapes/validation.js';\nexport type {\n ValidationReport,\n ValidationResult,\n ValidationMode,\n ValidateOptions,\n ValidatableShape,\n} from './shapes/validation.js';\nexport {LinkedStorage} from './utils/LinkedStorage.js';\n// New dynamic query building API (Phase 2)\nexport {SelectBuilder, QueryBuilder} from './queries/QueryBuilder.js';\nexport {lower} from './queries/lower.js';\nexport type {LowerableQuery} from './queries/lower.js';\nexport {fromJSON} from './queries/fromJSON.js';\nexport type {QueryJSON} from './queries/fromJSON.js';\nexport {\n getQueryContext,\n setQueryContext,\n subscribeQueryContext,\n PendingQueryContext,\n UnresolvedContextError,\n} from './queries/QueryContext.js';\nexport {\n CONTEXT_REF_KEY,\n encodeContextRef,\n isContextRefJSON,\n resolveContextId,\n} from './queries/ContextRef.js';\nexport type {ContextRefJSON} from './queries/ContextRef.js';\nexport {PropertyPath, walkPropertyPath} from './queries/PropertyPath.js';\n\n// Phase 3a — FieldSet\nexport {FieldSet} from './queries/FieldSet.js';\nexport type {FieldSetEntry, FieldSetInput, FieldSetJSON, FieldSetFieldJSON} from './queries/FieldSet.js';\n\n// Phase 4 — Serialization types\nexport type {QueryBuilderJSON} from './queries/QueryBuilder.js';\n\n// Phase 3b — Mutation builders\nexport {AskBuilder, isAskQuery} from './queries/AskBuilder.js';\nexport type {AskSpec} from './queries/AskBuilder.js';\nexport type {AskQuery, AskQueryJSON, RawAskInput} from './queries/AskQuery.js';\nexport {CountBuilder, isCountQuery} from './queries/CountBuilder.js';\nexport type {CountSpec} from './queries/CountBuilder.js';\nexport type {CountQuery, CountQueryJSON, RawCountInput} from './queries/CountQuery.js';\nexport {CreateBuilder} from './queries/CreateBuilder.js';\nexport {UpdateBuilder} from './queries/UpdateBuilder.js';\nexport {DeleteBuilder} from './queries/DeleteBuilder.js';\nexport type {DeleteId} from './queries/DeleteBuilder.js';\n\n// Expressions — computed fields and functions\nexport {ExpressionNode} from './expressions/ExpressionNode.js';\nexport type {ExpressionInput, PropertyRefMap} from './expressions/ExpressionNode.js';\nexport {Expr} from './expressions/Expr.js';\nexport type {\n ExpressionUpdateProxy,\n ExpressionUpdateResult,\n BaseExpressionMethods,\n NumericExpressionMethods,\n StringExpressionMethods,\n DateExpressionMethods,\n BooleanExpressionMethods,\n} from './expressions/ExpressionMethods.js';\n\n// Phase 5 — Component query integration\nexport type {LinkedComponentInterface, QueryComponentLike} from './queries/SelectQuery.js';\n\n\n// Mutation DSL-JSON serialization (create/update/delete to/from JSON)\nexport {\n encodeNodeData,\n encodeValue,\n} from './queries/MutationSerialization.js';\nexport {\n decodeNodeData,\n lowerMutationJSON,\n} from './queries/lowerMutationJSON.js';\nexport type {\n MutationJSON,\n CreateMutationJSON,\n UpdateMutationJSON,\n DeleteMutationJSON,\n MutationValueJSON,\n MutationNodeDataJSON,\n} from './queries/MutationSerialization.js';\n\n"]}
@@ -0,0 +1,20 @@
1
+ import { Shape } from './Shape.js';
2
+ /**
3
+ * SHACL/RDF ordered-list cell shape (`rdf:List`).
4
+ *
5
+ * A list is a chain of cells: `first` holds the value, `rest` points to the next cell
6
+ * (or `rdf:nil`). The cell is `dependent` (it has no independent existence) and `rest` is
7
+ * a `contains` edge, so deleting/replacing a list cascade-cleans the whole spine — while
8
+ * `first` is NOT a `contains` edge, so the list's *contents* (shared IRIs/values) are kept.
9
+ *
10
+ * This module holds the class only, and must never import `package.js`: `utils/Package.ts`
11
+ * imports it to register `List` by value (as it does NodeShape and PropertyShape) and to use
12
+ * it as the value shape of `PropertyShape.in`. Importing `package.js` from here would be a
13
+ * cycle, with `corePackage` still uninitialised when this module evaluates. The public module
14
+ * is `List.ts`, which loads the registration.
15
+ */
16
+ export declare class List<T = unknown> extends Shape {
17
+ static targetClass: import("../utils/NodeReference.js").NodeReferenceValue;
18
+ get first(): T;
19
+ get rest(): List<T>;
20
+ }
@@ -0,0 +1,44 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ /*
8
+ * This Source Code Form is subject to the terms of the Mozilla Public
9
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
10
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
11
+ */
12
+ import { Shape } from './Shape.js';
13
+ import { linkedProperty, objectProperty } from './SHACL.js';
14
+ import { rdf } from '../ontologies/rdf.js';
15
+ /**
16
+ * SHACL/RDF ordered-list cell shape (`rdf:List`).
17
+ *
18
+ * A list is a chain of cells: `first` holds the value, `rest` points to the next cell
19
+ * (or `rdf:nil`). The cell is `dependent` (it has no independent existence) and `rest` is
20
+ * a `contains` edge, so deleting/replacing a list cascade-cleans the whole spine — while
21
+ * `first` is NOT a `contains` edge, so the list's *contents* (shared IRIs/values) are kept.
22
+ *
23
+ * This module holds the class only, and must never import `package.js`: `utils/Package.ts`
24
+ * imports it to register `List` by value (as it does NodeShape and PropertyShape) and to use
25
+ * it as the value shape of `PropertyShape.in`. Importing `package.js` from here would be a
26
+ * cycle, with `corePackage` still uninitialised when this module evaluates. The public module
27
+ * is `List.ts`, which loads the registration.
28
+ */
29
+ export class List extends Shape {
30
+ get first() {
31
+ return null;
32
+ }
33
+ get rest() {
34
+ return null;
35
+ }
36
+ }
37
+ List.targetClass = rdf.List;
38
+ __decorate([
39
+ linkedProperty({ path: rdf.first, maxCount: 1 })
40
+ ], List.prototype, "first", null);
41
+ __decorate([
42
+ objectProperty({ path: rdf.rest, maxCount: 1, shape: List, contains: true })
43
+ ], List.prototype, "rest", null);
44
+ //# sourceMappingURL=List.class.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.class.js","sourceRoot":"","sources":["../../../src/shapes/List.class.ts"],"names":[],"mappings":";;;;;;AAAA;;;;GAIG;AACH,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AACjC,OAAO,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAC,GAAG,EAAC,MAAM,sBAAsB,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,IAAkB,SAAQ,KAAK;IAI1C,IAAI,KAAK;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,IAAI;QACN,OAAO,IAAI,CAAC;IACd,CAAC;;AAVM,gBAAW,GAAG,GAAG,CAAC,IAAI,CAAC;AAG9B;IADC,cAAc,CAAC,EAAC,IAAI,EAAE,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAC,CAAC;iCAG9C;AAGD;IADC,cAAc,CAAC,EAAC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;gCAG1E","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport {Shape} from './Shape.js';\nimport {linkedProperty, objectProperty} from './SHACL.js';\nimport {rdf} from '../ontologies/rdf.js';\n\n/**\n * SHACL/RDF ordered-list cell shape (`rdf:List`).\n *\n * A list is a chain of cells: `first` holds the value, `rest` points to the next cell\n * (or `rdf:nil`). The cell is `dependent` (it has no independent existence) and `rest` is\n * a `contains` edge, so deleting/replacing a list cascade-cleans the whole spine — while\n * `first` is NOT a `contains` edge, so the list's *contents* (shared IRIs/values) are kept.\n *\n * This module holds the class only, and must never import `package.js`: `utils/Package.ts`\n * imports it to register `List` by value (as it does NodeShape and PropertyShape) and to use\n * it as the value shape of `PropertyShape.in`. Importing `package.js` from here would be a\n * cycle, with `corePackage` still uninitialised when this module evaluates. The public module\n * is `List.ts`, which loads the registration.\n */\nexport class List<T = unknown> extends Shape {\n static targetClass = rdf.List;\n\n @linkedProperty({path: rdf.first, maxCount: 1})\n get first(): T {\n return null;\n }\n\n @objectProperty({path: rdf.rest, maxCount: 1, shape: List, contains: true})\n get rest(): List<T> {\n return null;\n }\n}\n"]}
@@ -1,17 +1,6 @@
1
- import { Shape } from './Shape.js';
2
- /**
3
- * SHACL/RDF ordered-list cell shape (`rdf:List`).
4
- *
5
- * A list is a chain of cells: `first` holds the value, `rest` points to the next cell
6
- * (or `rdf:nil`). The cell is `dependent` (it has no independent existence) and `rest` is
7
- * a `contains` edge, so deleting/replacing a list cascade-cleans the whole spine — while
8
- * `first` is NOT a `contains` edge, so the list's *contents* (shared IRIs/values) are kept.
9
- */
10
- export declare class List<T = unknown> extends Shape {
11
- static targetClass: import("../utils/NodeReference.js").NodeReferenceValue;
12
- get first(): T;
13
- get rest(): List<T>;
14
- }
1
+ import '../utils/Package.js';
2
+ import { List } from './List.class.js';
3
+ export { List };
15
4
  /**
16
5
  * Node-data for a single cell / the `rdf:nil` terminal. Accepted by the create pipeline.
17
6
  */
@@ -1,44 +1,14 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
1
  /*
8
2
  * This Source Code Form is subject to the terms of the Mozilla Public
9
3
  * License, v. 2.0. If a copy of the MPL was not distributed with this
10
4
  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
11
5
  */
12
- import { linkedShape } from '../package.js';
13
- import { Shape } from './Shape.js';
14
- import { linkedProperty, objectProperty } from './SHACL.js';
6
+ // Registers List (together with the rest of the SHACL metamodel), so importing this module
7
+ // on its own is enough to make List resolvable. The class lives in List.class.ts because
8
+ // utils/Package.ts needs it by value and cannot import this module's registration path.
9
+ import '../utils/Package.js';
10
+ import { List } from './List.class.js';
15
11
  import { rdf } from '../ontologies/rdf.js';
16
- /**
17
- * SHACL/RDF ordered-list cell shape (`rdf:List`).
18
- *
19
- * A list is a chain of cells: `first` holds the value, `rest` points to the next cell
20
- * (or `rdf:nil`). The cell is `dependent` (it has no independent existence) and `rest` is
21
- * a `contains` edge, so deleting/replacing a list cascade-cleans the whole spine — while
22
- * `first` is NOT a `contains` edge, so the list's *contents* (shared IRIs/values) are kept.
23
- */
24
- let List = class List extends Shape {
25
- get first() {
26
- return null;
27
- }
28
- get rest() {
29
- return null;
30
- }
31
- };
32
- List.targetClass = rdf.List;
33
- __decorate([
34
- linkedProperty({ path: rdf.first, maxCount: 1 })
35
- ], List.prototype, "first", null);
36
- __decorate([
37
- objectProperty({ path: rdf.rest, maxCount: 1, shape: List, contains: true })
38
- ], List.prototype, "rest", null);
39
- List = __decorate([
40
- linkedShape({ dependent: true })
41
- ], List);
42
12
  export { List };
43
13
  /**
44
14
  * Build the nested `List` node-data chain for an ordered `rdf:List`, terminating at `rdf:nil`.
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/shapes/List.ts"],"names":[],"mappings":";;;;;;AAAA;;;;GAIG;AACH,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AACjC,OAAO,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAC,GAAG,EAAC,MAAM,sBAAsB,CAAC;AAEzC;;;;;;;GAOG;AAEI,IAAM,IAAI,GAAV,MAAM,IAAkB,SAAQ,KAAK;IAI1C,IAAI,KAAK;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,IAAI;QACN,OAAO,IAAI,CAAC;IACd,CAAC;;AAVM,gBAAW,GAAG,GAAG,CAAC,IAAI,AAAX,CAAY;AAG9B;IADC,cAAc,CAAC,EAAC,IAAI,EAAE,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAC,CAAC;iCAG9C;AAGD;IADC,cAAc,CAAC,EAAC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;gCAG1E;AAXU,IAAI;IADhB,WAAW,CAAC,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC;GAClB,IAAI,CAYhB;;AASD;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CACrB,KAAU,EACV,IAAsB;IAEtB,MAAM,IAAI,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAC;IACxB,MAAM,KAAK,GAAG,CAAC,CAAS,EAAmB,EAAE;QAC3C,IAAI,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACtB,OAAO,EAAC,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,EAAC,CAAC;QAC1B,CAAC;QACD,MAAM,IAAI,GAAoB;YAC5B,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;YACf,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;SACnB,CAAC;QACF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,IAAI,CAAC,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC;QAC7B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IACF,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport {linkedShape} from '../package.js';\nimport {Shape} from './Shape.js';\nimport {linkedProperty, objectProperty} from './SHACL.js';\nimport {rdf} from '../ontologies/rdf.js';\n\n/**\n * SHACL/RDF ordered-list cell shape (`rdf:List`).\n *\n * A list is a chain of cells: `first` holds the value, `rest` points to the next cell\n * (or `rdf:nil`). The cell is `dependent` (it has no independent existence) and `rest` is\n * a `contains` edge, so deleting/replacing a list cascade-cleans the whole spine — while\n * `first` is NOT a `contains` edge, so the list's *contents* (shared IRIs/values) are kept.\n */\n@linkedShape({dependent: true})\nexport class List<T = unknown> extends Shape {\n static targetClass = rdf.List;\n\n @linkedProperty({path: rdf.first, maxCount: 1})\n get first(): T {\n return null;\n }\n\n @objectProperty({path: rdf.rest, maxCount: 1, shape: List, contains: true})\n get rest(): List<T> {\n return null;\n }\n}\n\n/**\n * Node-data for a single cell / the `rdf:nil` terminal. Accepted by the create pipeline.\n */\nexport type RdfListNodeData =\n | {id: string}\n | {shape: typeof List; first: unknown; rest: RdfListNodeData; __id?: string};\n\n/**\n * Build the nested `List` node-data chain for an ordered `rdf:List`, terminating at `rdf:nil`.\n * Pass `opts.base` to mint deterministic cell ids (`{base}/0`, `{base}/1`, …); otherwise the\n * create pipeline mints ids. The empty list serializes to `rdf:nil`.\n *\n * @example Playlist.create({ tracks: rdfList([t1, t2, t3]) })\n */\nexport function rdfList<T>(\n items: T[],\n opts?: {base?: string},\n): RdfListNodeData {\n const base = opts?.base;\n const build = (i: number): RdfListNodeData => {\n if (i >= items.length) {\n return {id: rdf.nil.id};\n }\n const cell: RdfListNodeData = {\n shape: List,\n first: items[i],\n rest: build(i + 1),\n };\n if (base !== undefined) {\n cell.__id = `${base}/${i}`;\n }\n return cell;\n };\n return build(0);\n}\n"]}
1
+ {"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/shapes/List.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,2FAA2F;AAC3F,yFAAyF;AACzF,wFAAwF;AACxF,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAC,IAAI,EAAC,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAC,GAAG,EAAC,MAAM,sBAAsB,CAAC;AAEzC,OAAO,EAAC,IAAI,EAAC,CAAC;AASd;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CACrB,KAAU,EACV,IAAsB;IAEtB,MAAM,IAAI,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAC;IACxB,MAAM,KAAK,GAAG,CAAC,CAAS,EAAmB,EAAE;QAC3C,IAAI,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACtB,OAAO,EAAC,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,EAAC,CAAC;QAC1B,CAAC;QACD,MAAM,IAAI,GAAoB;YAC5B,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;YACf,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;SACnB,CAAC;QACF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,IAAI,CAAC,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC;QAC7B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IACF,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\n// Registers List (together with the rest of the SHACL metamodel), so importing this module\n// on its own is enough to make List resolvable. The class lives in List.class.ts because\n// utils/Package.ts needs it by value and cannot import this module's registration path.\nimport '../utils/Package.js';\nimport {List} from './List.class.js';\nimport {rdf} from '../ontologies/rdf.js';\n\nexport {List};\n\n/**\n * Node-data for a single cell / the `rdf:nil` terminal. Accepted by the create pipeline.\n */\nexport type RdfListNodeData =\n | {id: string}\n | {shape: typeof List; first: unknown; rest: RdfListNodeData; __id?: string};\n\n/**\n * Build the nested `List` node-data chain for an ordered `rdf:List`, terminating at `rdf:nil`.\n * Pass `opts.base` to mint deterministic cell ids (`{base}/0`, `{base}/1`, …); otherwise the\n * create pipeline mints ids. The empty list serializes to `rdf:nil`.\n *\n * @example Playlist.create({ tracks: rdfList([t1, t2, t3]) })\n */\nexport function rdfList<T>(\n items: T[],\n opts?: {base?: string},\n): RdfListNodeData {\n const base = opts?.base;\n const build = (i: number): RdfListNodeData => {\n if (i >= items.length) {\n return {id: rdf.nil.id};\n }\n const cell: RdfListNodeData = {\n shape: List,\n first: items[i],\n rest: build(i + 1),\n };\n if (base !== undefined) {\n cell.__id = `${base}/${i}`;\n }\n return cell;\n };\n return build(0);\n}\n"]}
@@ -25,6 +25,9 @@ import { List } from './List.js';
25
25
  * Operands are polymorphic (a predicate IRI, a nested `PathNode`, or a `List`), so no fixed
26
26
  * `valueShape` is declared except for `alternativePath`, which is always an `rdf:List`.
27
27
  */
28
+ // Named explicitly: the class shares its name with the ontology term coreOntology.PathNode,
29
+ // and a bundler resolving that collision renames the class (PathNode2), which would change
30
+ // the shape's IRI.
28
31
  let PathNode = class PathNode extends Shape {
29
32
  get inversePath() {
30
33
  return null;
@@ -59,7 +62,7 @@ __decorate([
59
62
  objectProperty({ path: shacl.zeroOrOnePath, maxCount: 1, contains: true })
60
63
  ], PathNode.prototype, "zeroOrOnePath", null);
61
64
  PathNode = __decorate([
62
- linkedShape({ dependent: true })
65
+ linkedShape({ name: 'PathNode', dependent: true })
63
66
  ], PathNode);
64
67
  export { PathNode };
65
68
  //# sourceMappingURL=PathNode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PathNode.js","sourceRoot":"","sources":["../../../src/shapes/PathNode.ts"],"names":[],"mappings":";;;;;;AAAA;;;;GAIG;AACH,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AACjC,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B;;;;;;;;;GASG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,KAAK;IAIjC,IAAI,WAAW;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,aAAa;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,aAAa;QACf,OAAO,IAAI,CAAC;IACd,CAAC;;AAzBM,oBAAW,GAAG,YAAY,CAAC,QAAQ,AAAxB,CAAyB;AAG3C;IADC,cAAc,CAAC,EAAC,IAAI,EAAE,KAAK,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;2CAGtE;AAGD;IADC,cAAc,CAAC,EAAC,IAAI,EAAE,KAAK,CAAC,eAAe,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;+CAGvF;AAGD;IADC,cAAc,CAAC,EAAC,IAAI,EAAE,KAAK,CAAC,cAAc,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;8CAGzE;AAGD;IADC,cAAc,CAAC,EAAC,IAAI,EAAE,KAAK,CAAC,aAAa,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;6CAGxE;AAGD;IADC,cAAc,CAAC,EAAC,IAAI,EAAE,KAAK,CAAC,aAAa,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;6CAGxE;AA1BU,QAAQ;IADpB,WAAW,CAAC,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC;GAClB,QAAQ,CA2BpB","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport {linkedShape} from '../package.js';\nimport {Shape} from './Shape.js';\nimport {objectProperty} from './SHACL.js';\nimport {shacl} from '../ontologies/shacl.js';\nimport {coreOntology} from '../ontologies/linked-core.js';\nimport {List} from './List.js';\n\n/**\n * Operator node for SHACL property paths that are NOT a simple predicate or a sequence:\n * inverse (`sh:inversePath`), alternative (`sh:alternativePath` → an `rdf:List`), and the\n * cardinality forms (`sh:zeroOrMorePath`/`sh:oneOrMorePath`/`sh:zeroOrOnePath`).\n *\n * Each operator edge is `contains` (the operand subtree is owned), and the node itself is\n * `dependent`, so a property-shape's complex `sh:path` cascade-cleans on delete/replace.\n * Operands are polymorphic (a predicate IRI, a nested `PathNode`, or a `List`), so no fixed\n * `valueShape` is declared except for `alternativePath`, which is always an `rdf:List`.\n */\n@linkedShape({dependent: true})\nexport class PathNode extends Shape {\n static targetClass = coreOntology.PathNode;\n\n @objectProperty({path: shacl.inversePath, maxCount: 1, contains: true})\n get inversePath(): unknown {\n return null;\n }\n\n @objectProperty({path: shacl.alternativePath, maxCount: 1, shape: List, contains: true})\n get alternativePath(): List {\n return null;\n }\n\n @objectProperty({path: shacl.zeroOrMorePath, maxCount: 1, contains: true})\n get zeroOrMorePath(): unknown {\n return null;\n }\n\n @objectProperty({path: shacl.oneOrMorePath, maxCount: 1, contains: true})\n get oneOrMorePath(): unknown {\n return null;\n }\n\n @objectProperty({path: shacl.zeroOrOnePath, maxCount: 1, contains: true})\n get zeroOrOnePath(): unknown {\n return null;\n }\n}\n"]}
1
+ {"version":3,"file":"PathNode.js","sourceRoot":"","sources":["../../../src/shapes/PathNode.ts"],"names":[],"mappings":";;;;;;AAAA;;;;GAIG;AACH,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AACjC,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B;;;;;;;;;GASG;AACH,4FAA4F;A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\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport {linkedShape} from '../package.js';\nimport {Shape} from './Shape.js';\nimport {objectProperty} from './SHACL.js';\nimport {shacl} from '../ontologies/shacl.js';\nimport {coreOntology} from '../ontologies/linked-core.js';\nimport {List} from './List.js';\n\n/**\n * Operator node for SHACL property paths that are NOT a simple predicate or a sequence:\n * inverse (`sh:inversePath`), alternative (`sh:alternativePath` → an `rdf:List`), and the\n * cardinality forms (`sh:zeroOrMorePath`/`sh:oneOrMorePath`/`sh:zeroOrOnePath`).\n *\n * Each operator edge is `contains` (the operand subtree is owned), and the node itself is\n * `dependent`, so a property-shape's complex `sh:path` cascade-cleans on delete/replace.\n * Operands are polymorphic (a predicate IRI, a nested `PathNode`, or a `List`), so no fixed\n * `valueShape` is declared except for `alternativePath`, which is always an `rdf:List`.\n */\n// Named explicitly: the class shares its name with the ontology term coreOntology.PathNode,\n// and a bundler resolving that collision renames the class (PathNode2), which would change\n// the shape's IRI.\n@linkedShape({name: 'PathNode', dependent: true})\nexport class PathNode extends Shape {\n static targetClass = coreOntology.PathNode;\n\n @objectProperty({path: shacl.inversePath, maxCount: 1, contains: true})\n get inversePath(): unknown {\n return null;\n }\n\n @objectProperty({path: shacl.alternativePath, maxCount: 1, shape: List, contains: true})\n get alternativePath(): List {\n return null;\n }\n\n @objectProperty({path: shacl.zeroOrMorePath, maxCount: 1, contains: true})\n get zeroOrMorePath(): unknown {\n return null;\n }\n\n @objectProperty({path: shacl.oneOrMorePath, maxCount: 1, contains: true})\n get oneOrMorePath(): unknown {\n return null;\n }\n\n @objectProperty({path: shacl.zeroOrOnePath, maxCount: 1, contains: true})\n get zeroOrOnePath(): unknown {\n return null;\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import './SHACL.js';
2
+ import './List.js';
3
+ import './PathNode.js';
@@ -0,0 +1,14 @@
1
+ /*
2
+ * This Source Code Form is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ */
6
+ // Loads every shape @_linked/core defines, for their registration side effects only.
7
+ // Consumers: `import '@_linked/core/shapes/index'`. Nothing is exported from here.
8
+ //
9
+ // Shape, NodeShape, PropertyShape and List are registered by utils/Package.ts, because the
10
+ // SHACL metamodel cannot decorate itself. List.js loads it; SHACL.js alone does not.
11
+ import './SHACL.js';
12
+ import './List.js';
13
+ import './PathNode.js';
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shapes/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qFAAqF;AACrF,mFAAmF;AACnF,EAAE;AACF,2FAA2F;AAC3F,qFAAqF;AACrF,OAAO,YAAY,CAAC;AACpB,OAAO,WAAW,CAAC;AACnB,OAAO,eAAe,CAAC","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\n// Loads every shape @_linked/core defines, for their registration side effects only.\n// Consumers: `import '@_linked/core/shapes/index'`. Nothing is exported from here.\n//\n// Shape, NodeShape, PropertyShape and List are registered by utils/Package.ts, because the\n// SHACL metamodel cannot decorate itself. List.js loads it; SHACL.js alone does not.\nimport './SHACL.js';\nimport './List.js';\nimport './PathNode.js';\n"]}
@@ -6,6 +6,7 @@
6
6
  import { createPropertyShape, getAndClearCallbacks, getNodeShapeUri, getPackageUri, setPackagePublishConfig, NodeShape, PropertyShape, } from '../shapes/SHACL.js';
7
7
  import { createNodeShapeData } from '../shapes/nodeShapeData.js';
8
8
  import { Shape } from '../shapes/Shape.js';
9
+ import { List } from '../shapes/List.class.js';
9
10
  import { Prefix } from './Prefix.js';
10
11
  import { coreOntology } from '../ontologies/linked-core.js';
11
12
  import { rdf } from '../ontologies/rdf.js';
@@ -288,15 +289,27 @@ export function initTree() {
288
289
  initTree();
289
290
  //now that this file is set up, we can link linked shapes in the core module itself
290
291
  export const corePackage = linkedPackage('@_linked/core');
292
+ // NodeShape, PropertyShape and List share their names with ontology terms (shacl.NodeShape,
293
+ // shacl.PropertyShape, rdf.List), so a bundler may rename the classes. Explicit names keep
294
+ // their IRIs independent of that.
291
295
  corePackage.linkedShape({
296
+ name: 'NodeShape',
292
297
  description: 'Represents a SHACL NodeShape; defines constraints for a class of RDF nodes. Links to multiple PropertyShapes. (schema, constraint, class validation)',
293
298
  })(NodeShape);
294
299
  corePackage.linkedShape({
300
+ name: 'PropertyShape',
295
301
  description: 'Represents a SHACL PropertyShape; specifies rules for one property of a NodeShape (path, datatype, cardinality). (validation rule, property constraint)',
296
302
  // A property shape has no independent existence — it is owned by its NodeShape via the
297
303
  // `contains` sh:property edge, so deleting the NodeShape cascade-deletes it.
298
304
  dependent: true,
299
305
  })(PropertyShape);
306
+ // List is registered here, by value, because PropertyShape.in below uses it as its value
307
+ // shape. Naming it by string instead would leave it unregistered for anyone who loads the
308
+ // SHACL metamodel without importing shapes/List (backlog 045).
309
+ corePackage.linkedShape({
310
+ name: 'List',
311
+ dependent: true,
312
+ })(List);
300
313
  // ValidationReport / ValidationResult removed in core metadata rewrite
301
314
  //ALL the following is to support Shape having get/set methods with property shapes
302
315
  //and Shape itself having a nodeShape
@@ -398,7 +411,7 @@ createPropertyShape({
398
411
  // PropertyShape.class
399
412
  createPropertyShape({ path: shacl.class, shape: Shape, maxCount: 1 }, 'class', shacl.IRI, PropertyShape);
400
413
  // PropertyShape.in → an rdf:List (owned)
401
- createPropertyShape({ path: shacl.in, shape: ['@_linked/core', 'List'], maxCount: 1, contains: true }, 'in', shacl.IRI, PropertyShape);
414
+ createPropertyShape({ path: shacl.in, shape: List, maxCount: 1, contains: true }, 'in', shacl.IRI, PropertyShape);
402
415
  // PropertyShape pair constraints (values are property IRIs)
403
416
  // Labelled `equalsConstraint`, not `equals`: `equals` is a query-builder method, so a
404
417
  // property under that label is unreachable through the DSL (backlog 041). The name also
@@ -1 +1 @@
1
- {"version":3,"file":"Package.js","sourceRoot":"","sources":["../../../src/utils/Package.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,SAAS,EACT,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAC,mBAAmB,EAAqB,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAC,KAAK,EAAwB,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAC,GAAG,EAAC,MAAM,sBAAsB,CAAC;AACzC,OAAO,EAAC,wBAAwB,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAC,KAAK,EAAC,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAC,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAC,GAAG,EAAC,MAAM,sBAAsB,CAAC;AASzC,kEAAkE;AAClE,kDAAkD;AAClD,IAAI,UAAU,GAAa,IAAI,GAAG,EAAE,CAAC;AACrC,IAAI,qBAAqB,GAAG,KAAK,CAAC;AA8KlC,MAAM,CAAC,IAAI,aAAa,GAAG,EAAE,CAAC;AAE9B,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAE/C,aAAa,GAAG,KAAK,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAc;IAEjD,qBAAqB,GAAG,KAAK,CAAC;IAC9B,qEAAqE;IACrE,IAAI,qBAAqB,EACzB,CAAC;QACC,0EAA0E;QAC1E,UAAU,CAAC,OAAO,CAAC,CAAC,cAAc,EAAE,EAAE;YACpC,iFAAiF;YACjF,IAAI,cAAc,CAAC,OAAO,CAAC,E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EAAE,CAAC,EAAC,EACtE,eAAe,EACf,KAAK,CAAC,OAAO,EACb,aAAa,CACd,CAAC;AAEF,gFAAgF;AAChF,mBAAmB,CACjB,EAAC,IAAI,EAAE,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAC,EACjE,UAAU,EACV,KAAK,CAAC,OAAO,EACb,aAAa,CACd,CAAC;AAEF,mDAAmD;AACnD,mBAAmB,CACjB,EAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAC,EACxD,QAAQ,EACR,KAAK,CAAC,OAAO,EACb,SAAS,CACV,CAAC;AACF,mBAAmB,CACjB,EAAC,IAAI,EAAE,KAAK,CAAC,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAC,EAC7C,mBAAmB,EACnB,KAAK,CAAC,GAAG,EACT,SAAS,CACV,CAAC;AACF,mBAAmB,CACjB,EAAC,IAAI,EAAE,YAAY,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAC,EAClE,WAAW,EACX,KAAK,CAAC,OAAO,EACb,SAAS,CACV,CAAC","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport {\n createPropertyShape,\n getAndClearCallbacks,\n getNodeShapeUri,\n getPackageUri,\n setPackagePublishConfig,\n NodeShape,\n PropertyShape,\n} from '../shapes/SHACL.js';\nimport {createNodeShapeData, type NodeShapeData} from '../shapes/nodeShapeData.js';\nimport {Shape, type ShapeConstructor} from '../shapes/Shape.js';\nimport {Prefix} from './Prefix.js';\nimport {coreOntology} from '../ontologies/linked-core.js';\nimport {rdf} from '../ontologies/rdf.js';\nimport {addNodeShapeToShapeClass,getShapeClass} from './ShapeClass.js';\nimport {shacl} from '../ontologies/shacl.js';\nimport {rdfs} from '../ontologies/rdfs.js';\nimport {xsd} from '../ontologies/xsd.js';\nimport type {NodeReferenceValue} from './NodeReference.js';\n\n//global tree\ndeclare var _linked: any;\ndeclare var window;\ndeclare var global;\n\n\n// var packageParsePromises: Map<string,Promise<any>> = new Map();\n// var loadedPackages: Set<NamedNode> = new Set();\nlet ontologies: Set<any> = new Set();\nlet _autoLoadOntologyData = false;\n/**\n * a map of requested property shapes for specific nodes\n * The value is a promise if it's still loading, or true if it is fully loaded\n */\n// type ClassDecorator = <T extends {new (...args: any[]): {}}>(\n// constructor: T,\n// ) => T;\n\nexport type ShapeConfig = {\n /**\n * The name this shape is identified by, overriding the class name.\n *\n * A shape's IRI is `<baseUri>shape/<package>/<name>`, and `Server.call`\n * routes on it — so the name is persisted data, not a label. Taking it from\n * `constructor.name` couples that data to how the code was compiled: a\n * minifier renames the class, and so does a plain name collision, because a\n * shape and the ontology term it targets deliberately share a name. Either\n * one silently changes what the shape *is*.\n *\n * Optional, and defaults to `constructor.name`, so existing shapes are\n * unaffected. Set it where the identity has to outlive the build.\n */\n name?: string;\n /**\n * A short description of the shape, what it represents and what it is used for.\n * will be stored as rdfs:comment on the shape node\n */\n description?: string;\n /**\n * Marks this shape's instances as *dependent* (composition / no independent existence):\n * they may be cascade-deleted when reached through a `contains` property.\n */\n dependent?: boolean;\n /**\n * Close the shape (sh:closed): target nodes with properties outside this shape are invalid.\n */\n closed?: boolean;\n /**\n * Properties permitted in addition to the declared ones when the shape is closed\n * (sh:ignoredProperties).\n */\n ignoredProperties?: NodeReferenceValue[];\n};\n\nexport type PackageMetadata = {\n id: string;\n packageName: string;\n type: NodeReferenceValue;\n};\n\n/**\n * This object, returned by [linkedPackage()](/docs/lincd.js/modules/utils_Module#linkedPackage),\n * contains the decorators to link different parts of a LINCD module.\n */\nexport interface LinkedPackageObject\n{\n /**\n * Links a typescript class to a SHACL shape.\n * This decorator creates a SHACL shape and looks at the static property [targetClass](/docs/lincd.js/classes/shapes_Shape.Shape#targetclass)\n * The rest of the shape is typically 'shaped' by methods that use [property decorators](/docs/lincd.js/modules/utils_ShapeDecorators).\n *\n * @example\n * Example of a typescript class using the \\@linkedShape decorator:\n * ```tsx\n * @linkedShape\n * export class Person extends Shape { ... }\n * ```\n * Or with options:\n * ```tsx\n * @linkedShape({ description: \"...\" })\n * export class Person extends Shape { ... }\n * ```\n */\n linkedShape: {\n <T extends typeof Shape>(constructor: T): void;\n <T extends typeof Shape>(config?: ShapeConfig): (constructor: T) => void;\n };\n /**\n * Use this decorator to make any other classes or functions available on demand to other LINCD modules.\n * It does not change the object it is applied on.\n * This is specifically required for their use in an open-ended LINCD application.\n *\n * @example\n * An example helper utility using the \\@linkedUtil decorator:\n * ```tsx\n * @linkedUtil\n * export class Sort {\n * static byName(persons:Person[]) {\n * return persons.sort((p1,p2) => p1.name < p2.name ? -1 : 1)\n * }\n * ```\n */\n linkedUtil: (constructor: any) => any;\n /**\n * Used to notify LINCD.js of an ontology.\n * See also the [Ontology guides](/docs/guides/linked-code/ontologies).\n *\n * @param allFileExports - all the objects that are exported by the ontology file (use `import * as _this from \"./path-to-this-file\")`)\n * @param nameSpace - the result of [createNameSpace](/docs/lincd.js/modules/utils_NameSpace#createnamespace). This allows consumers to generate NamedNodes that may not be listed in this ontology if needed\n * @param prefixAndFileName - a suggested prefix chosen by you. Make sure the suggestedPrefix matches the file name and the name of the exported object that groups all entities together\n * @param loadDataFunction - a method that loads _and parses_ the raw ontology data. This means the ontology will be loaded into the local graph. The returned result is mostly a JSONLDParsePromise (from lincd-jsonld/JSONLD, not bundled in LINCD.js)\n * @param dataSource - the relative path to the raw data of the ontology\n * @example\n * Example of an Ontology File that used linkedOntology()\n * ```tsx\n * import {NamedNode} from 'lincd/models';\n * import {JSONLD} from 'lincd-jsonld/JSONLD';\n * import {createNameSpace} from 'lincd/utils/NameSpace';\n * import {linkedOntology} from '../package.js';\n * import * as _this from './my.js-ontology';\n *\n * let dataFile = '../data/my.js-ontology.json';\n * export var loadData = () => JSONLD.parsePromise(import(dataFile));\n *\n * export var ns = createNameSpace('http://www.my-ontology.com/');\n *\n * export var _self: NamedNode = ns('');\n *\n * // Classes\n * export var ExampleClass: NamedNode = ns('ExampleClass');\n *\n * // Properties\n * export var exampleProperty: NamedNode = ns('exampleProperty');\n *\n * export const myOntology = {\n * ExampleClass,\n * exampleProperty,\n * };\n *\n * linkedOntology(_this, ns, 'myOntology', loadData, dataFile);\n * ```\n */\n linkedOntology: (\n allFileExports,\n nameSpace: (term: string) => NodeReferenceValue,\n suggestedPrefixAndFileName: string,\n loadDataFunction?: () => Promise<any>,\n dataSource?: string | string[],\n ) => void;\n /**\n * Low level method used by other decorators to write to the modules' object in the LINCD tree.\n * You should typically not need this.\n * @param exportFileName - the file name that this exported object is available under. Needs to be unique across the module.\n * @param exportedObject - the exported object (the class, constant, function, etc)\n */\n registerPackageExport: (exportedObject: any) => void;\n\n /**\n * Get a Shape subclass registered in this package by name.\n * Returns undefined if the shape is not registered or bundled.\n *\n * Useful for avoiding circular dependencies between shapes.\n * E.g. `getOneAs(..., getPackageShape('ImageObject'))` in Thing.ts\n * avoids importing ImageObject (which extends Thing).\n */\n getPackageShape: (name: string) => ShapeConstructor | undefined;\n /**\n * A reference to the modules' object in the LINCD tree.\n * Contains all linked components of the module.\n */\n packageExports: any;\n packageName: string;\n packageMetadata: PackageMetadata;\n\n /**\n * Register a file (a javascript module) and all its exported objects.\n * Specifically helpful for registering multiple functional components if you declare them without a function name\n * @param _this\n * @param _module\n */\n registerPackageModule(_module): void;\n}\n\nexport var DEFAULT_LIMIT = 12;\n\nexport function setDefaultPageLimit(limit: number)\n{\n DEFAULT_LIMIT = limit;\n}\n\nexport function autoLoadOntologyData(value: boolean)\n{\n _autoLoadOntologyData = value;\n //this may be set to true after some ontologies have already indexed,\n if (_autoLoadOntologyData)\n {\n // so in that case we load all data of ontologies that are already indexed\n ontologies.forEach((ontologyExport) => {\n //see linkedOntology() where we store the data loading method under the _load key\n if (ontologyExport['_load'])\n {\n ontologyExport['_load']();\n }\n });\n }\n}\n\n\nexport function linkedPackage(\n packageName: string,\n options?: {baseUri?: string},\n): LinkedPackageObject\n{\n // Declare the package's publish root before any shape/metadata IRI is built.\n // The slug is derived from `packageName`; only `baseUri` is configurable — CN\n // injects a workspace-scoped root for private packages, first-party packages\n // default to linked.cm.\n setPackagePublishConfig(packageName, options);\n let packageMetadata = registerPackageMetadata(packageName);\n let packageTreeObject = registerPackageInTree(packageName);\n\n //#Create declarators for this module\n let registerPackageExport = function(object) {\n // Plan-011 §I2 interim — \"Key X was already defined\" warning silenced\n // until the duplicate-instance root cause is investigated. With Vite\n // SSR resolving workspace packages from src/, package.ts evaluates\n // twice and every export key trips this warning. The overwrite is\n // safe because the second registration is the same class.\n packageTreeObject[object.name] = object;\n };\n\n let registerInPackageTree = function(exportName,exportedObject) {\n packageTreeObject[exportName] = exportedObject;\n };\n\n function registerPackageModule(_module): void\n {\n for (var key in _module.exports)\n {\n //if the exported object itself is not named or its name is _wrappedComponent\n //then we give it the same name as it's export name.\n if (\n !_module.exports[key].name ||\n _module.exports[key].name === '_wrappedComponent'\n )\n {\n Object.defineProperty(_module.exports[key],'name',{value: key});\n //manual 'hack' to set the name of the original function\n if (\n _module.exports[key]['original'] &&\n !_module.exports[key]['original']['name']\n )\n {\n Object.defineProperty(_module.exports[key]['original'],'name',{\n value: key + '_implementation',\n });\n }\n }\n registerInPackageTree(key,_module.exports[key]);\n }\n }\n\n //create a declarator function which Components of this module can use register themselves and add themselves to the global tree\n let linkedUtil = function(constructor) {\n //add the component class of this module to the global tree\n registerPackageExport(constructor);\n\n //return the original class without modifications\n return constructor;\n };\n\n // helper that contains the previous body; applies the decorator work to a given constructor\n function applyLinkedShape<T extends typeof Shape>(\n constructor: T,\n options?: ShapeConfig,\n ): void\n {\n if(!constructor) {\n throw new Error('Constructor is undefined, skipping registration: '+constructor?.toString().substring(0,100)+' '+JSON.stringify(options));\n return;\n }\n // add the component class of this module to the global tree\n registerPackageExport(constructor);\n\n // register the component and its shape\n Shape.registerByType(constructor);\n\n // Track the un-sanitized package name on the constructor so consumers\n // (e.g. LincdServerProxy) can route backend calls using the real module\n // specifier (e.g. '@_linked/server'), not the lossy URI-sanitized form\n // ('-_linked-server' — non-recoverable via decodeURIComponent).\n if (!Object.getOwnPropertyNames(constructor).includes('packageName')) {\n (constructor as any).packageName = packageName;\n }\n\n // if no shape object has been attached to the constructor\n if (!Object.getOwnPropertyNames(constructor).includes('shape'))\n {\n // The shape's identity. An explicit name wins; otherwise the class name,\n // which is what every existing shape relies on.\n const shapeName = options?.name ?? constructor.name;\n\n // A class name ending in a digit, with no explicit name given, is almost\n // always a bundler disambiguating a collision — `BackendAPIStore2` when\n // the ontology term of the same name took the binding first. The shape\n // then registers under an IRI the rest of the system will never ask for,\n // and the only symptom is a 501 several layers away. Say so here, where\n // it is cheap and early.\n if (!options?.name && /\\d$/.test(constructor.name)) {\n console.warn(\n `[linked] Shape '${constructor.name}' in '${packageName}' has a name ending in a digit, ` +\n `which usually means a bundler renamed it to avoid a collision — often with the ` +\n `ontology term it targets. Its IRI will not match what consumers ask for. ` +\n `Pass an explicit name: @linkedShape({name: '...'}).`,\n );\n }\n\n // create a new node shape (plain metadata object) for this shapeClass\n const nodeShape: NodeShapeData = createNodeShapeData(\n getNodeShapeUri(packageName, shapeName),\n );\n // connect the typescript class to its NodeShape\n constructor.shape = nodeShape;\n // set the name\n nodeShape.label = shapeName;\n\n if (options)\n {\n if (options.description)\n {\n nodeShape.description = options.description;\n }\n if (options.dependent)\n {\n nodeShape.dependent = true;\n }\n if (options.closed !== undefined)\n {\n nodeShape.closed = options.closed;\n }\n if (options.ignoredProperties)\n {\n nodeShape.ignoredProperties = options.ignoredProperties;\n }\n }\n\n // also keep track of the reverse: nodeShape to typescript class\n addNodeShapeToShapeClass(nodeShape,constructor);\n\n //track what extends what (nodeShape level)\n const extendingShapeClass = Object.getPrototypeOf(\n constructor,\n ) as typeof Shape;\n const extendingShape = extendingShapeClass.shape;\n //if this shape class is extending something other then Shape\n if (extendingShape && !(extendingShapeClass === Shape)) {\n //store which nodeShape this nodeShape extends\n nodeShape.extends = {id: extendingShape.id};\n }\n \n\n // run deferred callbacks from property decorators\n if (constructor['shapeCallbacks'])\n {\n constructor['shapeCallbacks'].forEach((callback) => {\n callback(nodeShape);\n });\n const nodeCallbacks = getAndClearCallbacks(nodeShape.id);\n if(nodeCallbacks) {\n nodeCallbacks.forEach((callback) => {\n callback(nodeShape);\n });\n }\n delete constructor['shapeCallbacks'];\n }\n }\n else\n {\n console.warn('This ShapeClass already has a shape: ',constructor.shape);\n }\n\n if (constructor.targetClass)\n {\n (constructor.shape as NodeShapeData).targetClass = constructor.targetClass;\n }\n\n // return the original class without modifications\n // return constructor;\n }\n\n // Overloaded signatures to support both usages\n function linkedShape<T extends typeof Shape>(constructor: T): void;\n function linkedShape<T extends typeof Shape>(\n options?: ShapeConfig,\n ): (constructor: T) => void;\n function linkedShape(arg?: any): void | ((constructor: any) => void)\n {\n // usage as @linkedShape\n if (typeof arg === 'function')\n {\n applyLinkedShape(arg);\n return;\n }\n // usage as @linkedShape({...}) or @linkedShape()\n const options: ShapeConfig | undefined = arg;\n return function <T extends typeof Shape>(constructor: T): void {\n applyLinkedShape(constructor,options);\n };\n }\n\n /**\n *\n * @param exports all exports of the file, simply provide \"this\" as value!\n * @param dataSource the path leading to the ontology's data file\n * @param nameSpace the base URI of the ontology\n * @param prefixAndFileName the file name MUST match the prefix for this ontology\n */\n let linkedOntology = function(\n exports,\n nameSpace: (term: string) => NodeReferenceValue,\n prefixAndFileName: string,\n loadData?,\n dataSource?: string | string[],\n ) {\n let exportsCopy = {...exports};\n //store specifics in exports. And make sure we can detect this as an ontology later\n exportsCopy['_ns'] = nameSpace;\n exportsCopy['_prefix'] = prefixAndFileName;\n exportsCopy['_load'] = loadData;\n exportsCopy['_data'] = dataSource;\n\n //register the prefix here (so just calling linkedOntology with a prefix will automatically register that prefix)\n if (prefixAndFileName)\n {\n //run the namespace without any term name, this will give back a named node with just the namespace as URI, then get that URI to provide it as full URI\n Prefix.add(prefixAndFileName,nameSpace('').id);\n }\n\n ontologies.add(exportsCopy);\n //register all the exports under the prefix. NOTE: this means the file name HAS to match the prefix\n registerInPackageTree(prefixAndFileName,exportsCopy);\n // });\n\n if (_autoLoadOntologyData)\n {\n loadData().catch((err) => {\n console.warn(\n 'Could not load ontology data. Do you need to rebuild the module of the ' +\n prefixAndFileName +\n ' ontology?',\n err,\n );\n });\n }\n };\n\n /**\n * This method is used to get a shape class in this package by its name.\n * This can be used to avoid circular dependencies between shapes.\n * @param name\n */\n let getPackageShape = (name: string): ShapeConstructor | undefined => {\n //get the named node of the node shape first,\n //then get the shape class that defines this node shape\n return getShapeClass(\n getNodeShapeUri(packageName, name),\n );\n };\n\n //return the declarators so the module can use them\n return {\n linkedShape,\n linkedUtil,\n linkedOntology,\n registerPackageExport,\n registerPackageModule,\n getPackageShape,\n packageExports: packageTreeObject,\n packageName: packageName,\n packageMetadata,\n } as LinkedPackageObject;\n}\n\nfunction registerPackageInTree(packageName,packageExports?)\n{\n //if something with this name already registered in the global tree\n if (packageName in _linked._modules)\n {\n // Plan-011 §I2 interim — silenced until the duplicate-Linked-instance\n // root cause is investigated. Vite SSR resolving workspace packages\n // from src/ for HMR causes each package.ts to evaluate twice, so this\n // warning fired ~80x per boot. Same package, same exports — the\n // Object.assign below preserves the registry correctly.\n Object.assign(_linked._modules[packageName],packageExports);\n }\n else\n {\n //initiate an empty object for this module in the global tree\n _linked._modules[packageName] = packageExports || {};\n }\n return _linked._modules[packageName];\n}\n\nfunction registerPackageMetadata(packageName: string): PackageMetadata\n{\n if (!_linked._packages)\n {\n _linked._packages = {};\n }\n if (packageName in _linked._packages)\n {\n return _linked._packages[packageName];\n }\n const packageMetadata: PackageMetadata = {\n id: getPackageUri(packageName),\n packageName,\n type: coreOntology.Package,\n };\n _linked._packages[packageName] = packageMetadata;\n return packageMetadata;\n}\n\n\nexport function initTree()\n{\n let globalObject =\n typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : undefined;\n // Idempotent: if the global tree is already set up (by another copy of\n // this Package.ts in the same Node process — structural under Vite SSR,\n // which evaluates the file once for its own SSR transform AND once via\n // Node's resolver when a non-Vite import path reaches @_linked/core),\n // attach to it instead of throwing. Both instances write the same\n // _modules / _packages registry shape.\n //\n // Legacy `lincd` package's Package.ts (separate file) still throws on\n // dup — that throw signals a REAL problem (legacy `lincd` should never\n // load in a clean post-eradication state).\n if (!('_linked' in globalObject))\n {\n globalObject['_linked'] = {_modules: {}, _packages: {}};\n }\n}\n\n//when this file is used, make sure the tree is initialized\ninitTree();\n\n//now that this file is set up, we can link linked shapes in the core module itself\nexport const corePackage = linkedPackage('@_linked/core');\ncorePackage.linkedShape({\n description:\n 'Represents a SHACL NodeShape; defines constraints for a class of RDF nodes. Links to multiple PropertyShapes. (schema, constraint, class validation)',\n})(NodeShape);\ncorePackage.linkedShape({\n description:\n 'Represents a SHACL PropertyShape; specifies rules for one property of a NodeShape (path, datatype, cardinality). (validation rule, property constraint)',\n // A property shape has no independent existence — it is owned by its NodeShape via the\n // `contains` sh:property edge, so deleting the NodeShape cascade-deletes it.\n dependent: true,\n})(PropertyShape);\n// ValidationReport / ValidationResult removed in core metadata rewrite\n\n//ALL the following is to support Shape having get/set methods with property shapes\n//and Shape itself having a nodeShape\n//if we dont need Shape to have get/set methods (like label and type) then this can be removed\n// Base Shape IRI follows the same scheme as every other core shape:\n// https://linked.cm/shape/core/Shape (corePackage above declared slug 'core').\nShape.shape = createNodeShapeData(\n getNodeShapeUri('@_linked/core', 'Shape'),\n);\naddNodeShapeToShapeClass(Shape.shape,Shape);\n\n//Here we can register the properties of the Shape class itself\n//We can't do that inside of Shape because it would cause circular dependencies\ncreatePropertyShape({\n path: rdfs.label,\n //TODO: multiple labels should be possible\n maxCount: 1,//currently get label is implemented to return a single value\n },\n 'label',\n shacl.Literal,\n Shape,\n);\ncreatePropertyShape(\n {\n path: rdf.type,\n shape: Shape,\n },\n 'type',\n shacl.IRI,\n Shape,\n);\n\ncreatePropertyShape(\n {\n path: shacl.property,\n shape: PropertyShape,\n contains: true, // a NodeShape owns its property shapes (cascade on delete)\n },\n 'properties',\n shacl.IRI,\n NodeShape,\n);\n\ncreatePropertyShape({\n path: rdfs.comment,\n maxCount: 1,\n },'description',shacl.Literal, NodeShape);\n\ncreatePropertyShape({\n path: rdf.type,\n maxCount: 1,\n shape: Shape,\n},'type',shacl.IRI, NodeShape);\n\ncreatePropertyShape(\n {\n path: shacl.targetClass,\n shape: Shape, //should be rdfs Class, but that's currently not available in LINCD. So queries currently cannot continue after accessing targetClass\n maxCount: 1,\n },\n 'targetClass',\n shacl.IRI,\n NodeShape,\n);\n\ncreatePropertyShape({\n path: shacl.targetNode,\n shape: Shape,//actually returns a NamedNode... is this correct then? Should we define or use a rdfs Class that matches the potential values?\n},'targetNode',shacl.IRI, NodeShape);\n\ncreatePropertyShape({\n path: coreOntology.isExtending,\n shape: NodeShape,\n},'extends',shacl.IRI, NodeShape);\n\n//currently path accepts multiple values, so its a multi-value property\n//these values will be consequent properties that follow each other. Other property paths are not supported yet.\ncreatePropertyShape(\n {\n // No fixed valueShape: sh:path is polymorphic (a predicate IRI, an rdf:List for a\n // sequence, or a PathNode for inverse/alt/cardinality). Omitting valueShape lets the\n // create pipeline use each value's own shape. Simple paths are passed as\n // {id} node references, complex paths as List/PathNode node-data.\n path: shacl.path,\n contains: true, // a property shape owns its complex path structure (List/PathNode)\n },\n 'path',\n shacl.IRI,\n PropertyShape,\n);\n\ncreatePropertyShape(\n {\n path: shacl.node,\n shape: NodeShape,\n maxCount: 1,\n },\n 'valueShape',\n shacl.IRI,\n PropertyShape,\n);\n\ncreatePropertyShape(\n {\n maxCount: 1,\n path: shacl.nodeKind,\n shape: Shape, //actually returns a NamedNode. Queries currently cannot continue after accessing nodeKind\n },\n 'nodeKind',\n shacl.IRI,\n PropertyShape,\n);\n\ncreatePropertyShape(\n {\n path: shacl.datatype,\n shape: Shape,\n maxCount: 1,\n },\n 'datatype',\n shacl.IRI,\n PropertyShape,\n);\n\n//PropertyShape.maxCount\ncreatePropertyShape(\n {\n path: shacl.maxCount,\n datatype: xsd.integer,\n maxCount: 1,\n },\n 'maxCount',\n shacl.Literal,\n PropertyShape,\n);\n\n//PropertyShape.minCount\ncreatePropertyShape(\n {\n path: shacl.minCount,\n datatype: xsd.integer,\n maxCount: 1,\n },\n 'minCount',\n shacl.Literal,\n PropertyShape,\n);\n\n//PropertyShape.name\ncreatePropertyShape(\n {\n path: shacl.name,\n maxCount: 1,\n },\n 'name',\n shacl.Literal,\n PropertyShape,\n);\n\n//PropertyShape.description\ncreatePropertyShape(\n {\n path: shacl.description,\n maxCount: 1,\n },\n 'description',\n shacl.Literal,\n PropertyShape,\n);\n\n// ---------------------------------------------------------------------------\n// Remaining SHACL meta-model accessors for shape serialization.\n// Labels match the PropertyShapeData / NodeShapeData fields so syncShapes() can\n// build the create-pipeline data directly. `sh:in` is owned (contains, valueShape List).\n// ---------------------------------------------------------------------------\n\n// PropertyShape.class\ncreatePropertyShape(\n {path: shacl.class, shape: Shape, maxCount: 1},\n 'class',\n shacl.IRI,\n PropertyShape,\n);\n\n// PropertyShape.in → an rdf:List (owned)\ncreatePropertyShape(\n {path: shacl.in, shape: ['@_linked/core', 'List'], maxCount: 1, contains: true},\n 'in',\n shacl.IRI,\n PropertyShape,\n);\n\n// PropertyShape pair constraints (values are property IRIs)\n// Labelled `equalsConstraint`, not `equals`: `equals` is a query-builder method, so a\n// property under that label is unreachable through the DSL (backlog 041). The name also\n// matches the `PropertyShapeData` field. The predicate stays sh:equals.\ncreatePropertyShape({path: shacl.equals, shape: Shape, maxCount: 1}, 'equalsConstraint', shacl.IRI, PropertyShape);\ncreatePropertyShape({path: shacl.disjoint, shape: Shape, maxCount: 1}, 'disjoint', shacl.IRI, PropertyShape);\ncreatePropertyShape({path: shacl.lessThan, shape: Shape, maxCount: 1}, 'lessThan', shacl.IRI, PropertyShape);\ncreatePropertyShape(\n {path: shacl.lessThanOrEquals, shape: Shape, maxCount: 1},\n 'lessThanOrEquals',\n shacl.IRI,\n PropertyShape,\n);\n\n// PropertyShape.hasValue (literal or IRI — generic)\ncreatePropertyShape({path: shacl.hasValue, maxCount: 1}, 'hasValue', null, PropertyShape);\n\n// PropertyShape.defaultValue (literal or IRI — generic, mirrors hasValue).\n// getResult() already emits `defaultValue`, but without this registration the\n// property is not queryable and a query referencing it throws before executing.\ncreatePropertyShape({path: shacl.defaultValue, maxCount: 1}, 'defaultValue', null, PropertyShape);\n\n// PropertyShape value-range / string-length / pattern constraints (report 021 §3, G5).\n// The range constraints carry no fixed datatype — the literal is typed from the JS value\n// (integer/double), mirroring the constrained property's own datatype. Length is an integer;\n// pattern is the regex source string.\ncreatePropertyShape({path: shacl.minInclusive, maxCount: 1}, 'minInclusive', shacl.Literal, PropertyShape);\ncreatePropertyShape({path: shacl.maxInclusive, maxCount: 1}, 'maxInclusive', shacl.Literal, PropertyShape);\ncreatePropertyShape({path: shacl.minExclusive, maxCount: 1}, 'minExclusive', shacl.Literal, PropertyShape);\ncreatePropertyShape({path: shacl.maxExclusive, maxCount: 1}, 'maxExclusive', shacl.Literal, PropertyShape);\ncreatePropertyShape(\n {path: shacl.minLength, datatype: xsd.integer, maxCount: 1},\n 'minLength',\n shacl.Literal,\n PropertyShape,\n);\ncreatePropertyShape(\n {path: shacl.maxLength, datatype: xsd.integer, maxCount: 1},\n 'maxLength',\n shacl.Literal,\n PropertyShape,\n);\ncreatePropertyShape(\n {path: shacl.pattern, datatype: xsd.string, maxCount: 1},\n 'pattern',\n shacl.Literal,\n PropertyShape,\n);\n\n// PropertyShape.order / group\ncreatePropertyShape(\n {path: shacl.order, datatype: xsd.integer, maxCount: 1},\n 'order',\n shacl.Literal,\n PropertyShape,\n);\ncreatePropertyShape({path: shacl.group, maxCount: 1}, 'group', shacl.Literal, PropertyShape);\n\n// PropertyShape.displayRank / displayHidden (linked_core: display vocabulary).\n// These materialize onto the pure sh:NodeShape and so travel with an ejected app.\ncreatePropertyShape(\n {path: coreOntology.displayRank, datatype: xsd.integer, maxCount: 1},\n 'displayRank',\n shacl.Literal,\n PropertyShape,\n);\ncreatePropertyShape(\n {path: coreOntology.displayHidden, datatype: xsd.boolean, maxCount: 1},\n 'displayHidden',\n shacl.Literal,\n PropertyShape,\n);\n\n// PropertyShape.contains (linked_core:contains — persists the composition flag)\ncreatePropertyShape(\n {path: coreOntology.contains, datatype: xsd.boolean, maxCount: 1},\n 'contains',\n shacl.Literal,\n PropertyShape,\n);\n\n// NodeShape.closed / ignoredProperties / dependent\ncreatePropertyShape(\n {path: shacl.closed, datatype: xsd.boolean, maxCount: 1},\n 'closed',\n shacl.Literal,\n NodeShape,\n);\ncreatePropertyShape(\n {path: shacl.ignoredProperties, shape: Shape},\n 'ignoredProperties',\n shacl.IRI,\n NodeShape,\n);\ncreatePropertyShape(\n {path: coreOntology.dependent, datatype: xsd.boolean, maxCount: 1},\n 'dependent',\n shacl.Literal,\n NodeShape,\n);\n"]}
1
+ {"version":3,"file":"Package.js","sourceRoot":"","sources":["../../../src/utils/Package.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,SAAS,EACT,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAC,mBAAmB,EAAqB,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAC,KAAK,EAAwB,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAC,IAAI,EAAC,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAC,GAAG,EAAC,MAAM,sBAAsB,CAAC;AACzC,OAAO,EA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C,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAC,EACxD,QAAQ,EACR,KAAK,CAAC,OAAO,EACb,SAAS,CACV,CAAC;AACF,mBAAmB,CACjB,EAAC,IAAI,EAAE,KAAK,CAAC,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAC,EAC7C,mBAAmB,EACnB,KAAK,CAAC,GAAG,EACT,SAAS,CACV,CAAC;AACF,mBAAmB,CACjB,EAAC,IAAI,EAAE,YAAY,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAC,EAClE,WAAW,EACX,KAAK,CAAC,OAAO,EACb,SAAS,CACV,CAAC","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport {\n createPropertyShape,\n getAndClearCallbacks,\n getNodeShapeUri,\n getPackageUri,\n setPackagePublishConfig,\n NodeShape,\n PropertyShape,\n} from '../shapes/SHACL.js';\nimport {createNodeShapeData, type NodeShapeData} from '../shapes/nodeShapeData.js';\nimport {Shape, type ShapeConstructor} from '../shapes/Shape.js';\nimport {List} from '../shapes/List.class.js';\nimport {Prefix} from './Prefix.js';\nimport {coreOntology} from '../ontologies/linked-core.js';\nimport {rdf} from '../ontologies/rdf.js';\nimport {addNodeShapeToShapeClass,getShapeClass} from './ShapeClass.js';\nimport {shacl} from '../ontologies/shacl.js';\nimport {rdfs} from '../ontologies/rdfs.js';\nimport {xsd} from '../ontologies/xsd.js';\nimport type {NodeReferenceValue} from './NodeReference.js';\n\n//global tree\ndeclare var _linked: any;\ndeclare var window;\ndeclare var global;\n\n\n// var packageParsePromises: Map<string,Promise<any>> = new Map();\n// var loadedPackages: Set<NamedNode> = new Set();\nlet ontologies: Set<any> = new Set();\nlet _autoLoadOntologyData = false;\n/**\n * a map of requested property shapes for specific nodes\n * The value is a promise if it's still loading, or true if it is fully loaded\n */\n// type ClassDecorator = <T extends {new (...args: any[]): {}}>(\n// constructor: T,\n// ) => T;\n\nexport type ShapeConfig = {\n /**\n * The name this shape is identified by, overriding the class name.\n *\n * A shape's IRI is `<baseUri>shape/<package>/<name>`, and `Server.call`\n * routes on it — so the name is persisted data, not a label. Taking it from\n * `constructor.name` couples that data to how the code was compiled: a\n * minifier renames the class, and so does a plain name collision, because a\n * shape and the ontology term it targets deliberately share a name. Either\n * one silently changes what the shape *is*.\n *\n * Optional, and defaults to `constructor.name`, so existing shapes are\n * unaffected. Set it where the identity has to outlive the build.\n */\n name?: string;\n /**\n * A short description of the shape, what it represents and what it is used for.\n * will be stored as rdfs:comment on the shape node\n */\n description?: string;\n /**\n * Marks this shape's instances as *dependent* (composition / no independent existence):\n * they may be cascade-deleted when reached through a `contains` property.\n */\n dependent?: boolean;\n /**\n * Close the shape (sh:closed): target nodes with properties outside this shape are invalid.\n */\n closed?: boolean;\n /**\n * Properties permitted in addition to the declared ones when the shape is closed\n * (sh:ignoredProperties).\n */\n ignoredProperties?: NodeReferenceValue[];\n};\n\nexport type PackageMetadata = {\n id: string;\n packageName: string;\n type: NodeReferenceValue;\n};\n\n/**\n * This object, returned by [linkedPackage()](/docs/lincd.js/modules/utils_Module#linkedPackage),\n * contains the decorators to link different parts of a LINCD module.\n */\nexport interface LinkedPackageObject\n{\n /**\n * Links a typescript class to a SHACL shape.\n * This decorator creates a SHACL shape and looks at the static property [targetClass](/docs/lincd.js/classes/shapes_Shape.Shape#targetclass)\n * The rest of the shape is typically 'shaped' by methods that use [property decorators](/docs/lincd.js/modules/utils_ShapeDecorators).\n *\n * @example\n * Example of a typescript class using the \\@linkedShape decorator:\n * ```tsx\n * @linkedShape\n * export class Person extends Shape { ... }\n * ```\n * Or with options:\n * ```tsx\n * @linkedShape({ description: \"...\" })\n * export class Person extends Shape { ... }\n * ```\n */\n linkedShape: {\n <T extends typeof Shape>(constructor: T): void;\n <T extends typeof Shape>(config?: ShapeConfig): (constructor: T) => void;\n };\n /**\n * Use this decorator to make any other classes or functions available on demand to other LINCD modules.\n * It does not change the object it is applied on.\n * This is specifically required for their use in an open-ended LINCD application.\n *\n * @example\n * An example helper utility using the \\@linkedUtil decorator:\n * ```tsx\n * @linkedUtil\n * export class Sort {\n * static byName(persons:Person[]) {\n * return persons.sort((p1,p2) => p1.name < p2.name ? -1 : 1)\n * }\n * ```\n */\n linkedUtil: (constructor: any) => any;\n /**\n * Used to notify LINCD.js of an ontology.\n * See also the [Ontology guides](/docs/guides/linked-code/ontologies).\n *\n * @param allFileExports - all the objects that are exported by the ontology file (use `import * as _this from \"./path-to-this-file\")`)\n * @param nameSpace - the result of [createNameSpace](/docs/lincd.js/modules/utils_NameSpace#createnamespace). This allows consumers to generate NamedNodes that may not be listed in this ontology if needed\n * @param prefixAndFileName - a suggested prefix chosen by you. Make sure the suggestedPrefix matches the file name and the name of the exported object that groups all entities together\n * @param loadDataFunction - a method that loads _and parses_ the raw ontology data. This means the ontology will be loaded into the local graph. The returned result is mostly a JSONLDParsePromise (from lincd-jsonld/JSONLD, not bundled in LINCD.js)\n * @param dataSource - the relative path to the raw data of the ontology\n * @example\n * Example of an Ontology File that used linkedOntology()\n * ```tsx\n * import {NamedNode} from 'lincd/models';\n * import {JSONLD} from 'lincd-jsonld/JSONLD';\n * import {createNameSpace} from 'lincd/utils/NameSpace';\n * import {linkedOntology} from '../package.js';\n * import * as _this from './my.js-ontology';\n *\n * let dataFile = '../data/my.js-ontology.json';\n * export var loadData = () => JSONLD.parsePromise(import(dataFile));\n *\n * export var ns = createNameSpace('http://www.my-ontology.com/');\n *\n * export var _self: NamedNode = ns('');\n *\n * // Classes\n * export var ExampleClass: NamedNode = ns('ExampleClass');\n *\n * // Properties\n * export var exampleProperty: NamedNode = ns('exampleProperty');\n *\n * export const myOntology = {\n * ExampleClass,\n * exampleProperty,\n * };\n *\n * linkedOntology(_this, ns, 'myOntology', loadData, dataFile);\n * ```\n */\n linkedOntology: (\n allFileExports,\n nameSpace: (term: string) => NodeReferenceValue,\n suggestedPrefixAndFileName: string,\n loadDataFunction?: () => Promise<any>,\n dataSource?: string | string[],\n ) => void;\n /**\n * Low level method used by other decorators to write to the modules' object in the LINCD tree.\n * You should typically not need this.\n * @param exportFileName - the file name that this exported object is available under. Needs to be unique across the module.\n * @param exportedObject - the exported object (the class, constant, function, etc)\n */\n registerPackageExport: (exportedObject: any) => void;\n\n /**\n * Get a Shape subclass registered in this package by name.\n * Returns undefined if the shape is not registered or bundled.\n *\n * Useful for avoiding circular dependencies between shapes.\n * E.g. `getOneAs(..., getPackageShape('ImageObject'))` in Thing.ts\n * avoids importing ImageObject (which extends Thing).\n */\n getPackageShape: (name: string) => ShapeConstructor | undefined;\n /**\n * A reference to the modules' object in the LINCD tree.\n * Contains all linked components of the module.\n */\n packageExports: any;\n packageName: string;\n packageMetadata: PackageMetadata;\n\n /**\n * Register a file (a javascript module) and all its exported objects.\n * Specifically helpful for registering multiple functional components if you declare them without a function name\n * @param _this\n * @param _module\n */\n registerPackageModule(_module): void;\n}\n\nexport var DEFAULT_LIMIT = 12;\n\nexport function setDefaultPageLimit(limit: number)\n{\n DEFAULT_LIMIT = limit;\n}\n\nexport function autoLoadOntologyData(value: boolean)\n{\n _autoLoadOntologyData = value;\n //this may be set to true after some ontologies have already indexed,\n if (_autoLoadOntologyData)\n {\n // so in that case we load all data of ontologies that are already indexed\n ontologies.forEach((ontologyExport) => {\n //see linkedOntology() where we store the data loading method under the _load key\n if (ontologyExport['_load'])\n {\n ontologyExport['_load']();\n }\n });\n }\n}\n\n\nexport function linkedPackage(\n packageName: string,\n options?: {baseUri?: string},\n): LinkedPackageObject\n{\n // Declare the package's publish root before any shape/metadata IRI is built.\n // The slug is derived from `packageName`; only `baseUri` is configurable — CN\n // injects a workspace-scoped root for private packages, first-party packages\n // default to linked.cm.\n setPackagePublishConfig(packageName, options);\n let packageMetadata = registerPackageMetadata(packageName);\n let packageTreeObject = registerPackageInTree(packageName);\n\n //#Create declarators for this module\n let registerPackageExport = function(object) {\n // Plan-011 §I2 interim — \"Key X was already defined\" warning silenced\n // until the duplicate-instance root cause is investigated. With Vite\n // SSR resolving workspace packages from src/, package.ts evaluates\n // twice and every export key trips this warning. The overwrite is\n // safe because the second registration is the same class.\n packageTreeObject[object.name] = object;\n };\n\n let registerInPackageTree = function(exportName,exportedObject) {\n packageTreeObject[exportName] = exportedObject;\n };\n\n function registerPackageModule(_module): void\n {\n for (var key in _module.exports)\n {\n //if the exported object itself is not named or its name is _wrappedComponent\n //then we give it the same name as it's export name.\n if (\n !_module.exports[key].name ||\n _module.exports[key].name === '_wrappedComponent'\n )\n {\n Object.defineProperty(_module.exports[key],'name',{value: key});\n //manual 'hack' to set the name of the original function\n if (\n _module.exports[key]['original'] &&\n !_module.exports[key]['original']['name']\n )\n {\n Object.defineProperty(_module.exports[key]['original'],'name',{\n value: key + '_implementation',\n });\n }\n }\n registerInPackageTree(key,_module.exports[key]);\n }\n }\n\n //create a declarator function which Components of this module can use register themselves and add themselves to the global tree\n let linkedUtil = function(constructor) {\n //add the component class of this module to the global tree\n registerPackageExport(constructor);\n\n //return the original class without modifications\n return constructor;\n };\n\n // helper that contains the previous body; applies the decorator work to a given constructor\n function applyLinkedShape<T extends typeof Shape>(\n constructor: T,\n options?: ShapeConfig,\n ): void\n {\n if(!constructor) {\n throw new Error('Constructor is undefined, skipping registration: '+constructor?.toString().substring(0,100)+' '+JSON.stringify(options));\n return;\n }\n // add the component class of this module to the global tree\n registerPackageExport(constructor);\n\n // register the component and its shape\n Shape.registerByType(constructor);\n\n // Track the un-sanitized package name on the constructor so consumers\n // (e.g. LincdServerProxy) can route backend calls using the real module\n // specifier (e.g. '@_linked/server'), not the lossy URI-sanitized form\n // ('-_linked-server' — non-recoverable via decodeURIComponent).\n if (!Object.getOwnPropertyNames(constructor).includes('packageName')) {\n (constructor as any).packageName = packageName;\n }\n\n // if no shape object has been attached to the constructor\n if (!Object.getOwnPropertyNames(constructor).includes('shape'))\n {\n // The shape's identity. An explicit name wins; otherwise the class name,\n // which is what every existing shape relies on.\n const shapeName = options?.name ?? constructor.name;\n\n // A class name ending in a digit, with no explicit name given, is almost\n // always a bundler disambiguating a collision — `BackendAPIStore2` when\n // the ontology term of the same name took the binding first. The shape\n // then registers under an IRI the rest of the system will never ask for,\n // and the only symptom is a 501 several layers away. Say so here, where\n // it is cheap and early.\n if (!options?.name && /\\d$/.test(constructor.name)) {\n console.warn(\n `[linked] Shape '${constructor.name}' in '${packageName}' has a name ending in a digit, ` +\n `which usually means a bundler renamed it to avoid a collision — often with the ` +\n `ontology term it targets. Its IRI will not match what consumers ask for. ` +\n `Pass an explicit name: @linkedShape({name: '...'}).`,\n );\n }\n\n // create a new node shape (plain metadata object) for this shapeClass\n const nodeShape: NodeShapeData = createNodeShapeData(\n getNodeShapeUri(packageName, shapeName),\n );\n // connect the typescript class to its NodeShape\n constructor.shape = nodeShape;\n // set the name\n nodeShape.label = shapeName;\n\n if (options)\n {\n if (options.description)\n {\n nodeShape.description = options.description;\n }\n if (options.dependent)\n {\n nodeShape.dependent = true;\n }\n if (options.closed !== undefined)\n {\n nodeShape.closed = options.closed;\n }\n if (options.ignoredProperties)\n {\n nodeShape.ignoredProperties = options.ignoredProperties;\n }\n }\n\n // also keep track of the reverse: nodeShape to typescript class\n addNodeShapeToShapeClass(nodeShape,constructor);\n\n //track what extends what (nodeShape level)\n const extendingShapeClass = Object.getPrototypeOf(\n constructor,\n ) as typeof Shape;\n const extendingShape = extendingShapeClass.shape;\n //if this shape class is extending something other then Shape\n if (extendingShape && !(extendingShapeClass === Shape)) {\n //store which nodeShape this nodeShape extends\n nodeShape.extends = {id: extendingShape.id};\n }\n \n\n // run deferred callbacks from property decorators\n if (constructor['shapeCallbacks'])\n {\n constructor['shapeCallbacks'].forEach((callback) => {\n callback(nodeShape);\n });\n const nodeCallbacks = getAndClearCallbacks(nodeShape.id);\n if(nodeCallbacks) {\n nodeCallbacks.forEach((callback) => {\n callback(nodeShape);\n });\n }\n delete constructor['shapeCallbacks'];\n }\n }\n else\n {\n console.warn('This ShapeClass already has a shape: ',constructor.shape);\n }\n\n if (constructor.targetClass)\n {\n (constructor.shape as NodeShapeData).targetClass = constructor.targetClass;\n }\n\n // return the original class without modifications\n // return constructor;\n }\n\n // Overloaded signatures to support both usages\n function linkedShape<T extends typeof Shape>(constructor: T): void;\n function linkedShape<T extends typeof Shape>(\n options?: ShapeConfig,\n ): (constructor: T) => void;\n function linkedShape(arg?: any): void | ((constructor: any) => void)\n {\n // usage as @linkedShape\n if (typeof arg === 'function')\n {\n applyLinkedShape(arg);\n return;\n }\n // usage as @linkedShape({...}) or @linkedShape()\n const options: ShapeConfig | undefined = arg;\n return function <T extends typeof Shape>(constructor: T): void {\n applyLinkedShape(constructor,options);\n };\n }\n\n /**\n *\n * @param exports all exports of the file, simply provide \"this\" as value!\n * @param dataSource the path leading to the ontology's data file\n * @param nameSpace the base URI of the ontology\n * @param prefixAndFileName the file name MUST match the prefix for this ontology\n */\n let linkedOntology = function(\n exports,\n nameSpace: (term: string) => NodeReferenceValue,\n prefixAndFileName: string,\n loadData?,\n dataSource?: string | string[],\n ) {\n let exportsCopy = {...exports};\n //store specifics in exports. And make sure we can detect this as an ontology later\n exportsCopy['_ns'] = nameSpace;\n exportsCopy['_prefix'] = prefixAndFileName;\n exportsCopy['_load'] = loadData;\n exportsCopy['_data'] = dataSource;\n\n //register the prefix here (so just calling linkedOntology with a prefix will automatically register that prefix)\n if (prefixAndFileName)\n {\n //run the namespace without any term name, this will give back a named node with just the namespace as URI, then get that URI to provide it as full URI\n Prefix.add(prefixAndFileName,nameSpace('').id);\n }\n\n ontologies.add(exportsCopy);\n //register all the exports under the prefix. NOTE: this means the file name HAS to match the prefix\n registerInPackageTree(prefixAndFileName,exportsCopy);\n // });\n\n if (_autoLoadOntologyData)\n {\n loadData().catch((err) => {\n console.warn(\n 'Could not load ontology data. Do you need to rebuild the module of the ' +\n prefixAndFileName +\n ' ontology?',\n err,\n );\n });\n }\n };\n\n /**\n * This method is used to get a shape class in this package by its name.\n * This can be used to avoid circular dependencies between shapes.\n * @param name\n */\n let getPackageShape = (name: string): ShapeConstructor | undefined => {\n //get the named node of the node shape first,\n //then get the shape class that defines this node shape\n return getShapeClass(\n getNodeShapeUri(packageName, name),\n );\n };\n\n //return the declarators so the module can use them\n return {\n linkedShape,\n linkedUtil,\n linkedOntology,\n registerPackageExport,\n registerPackageModule,\n getPackageShape,\n packageExports: packageTreeObject,\n packageName: packageName,\n packageMetadata,\n } as LinkedPackageObject;\n}\n\nfunction registerPackageInTree(packageName,packageExports?)\n{\n //if something with this name already registered in the global tree\n if (packageName in _linked._modules)\n {\n // Plan-011 §I2 interim — silenced until the duplicate-Linked-instance\n // root cause is investigated. Vite SSR resolving workspace packages\n // from src/ for HMR causes each package.ts to evaluate twice, so this\n // warning fired ~80x per boot. Same package, same exports — the\n // Object.assign below preserves the registry correctly.\n Object.assign(_linked._modules[packageName],packageExports);\n }\n else\n {\n //initiate an empty object for this module in the global tree\n _linked._modules[packageName] = packageExports || {};\n }\n return _linked._modules[packageName];\n}\n\nfunction registerPackageMetadata(packageName: string): PackageMetadata\n{\n if (!_linked._packages)\n {\n _linked._packages = {};\n }\n if (packageName in _linked._packages)\n {\n return _linked._packages[packageName];\n }\n const packageMetadata: PackageMetadata = {\n id: getPackageUri(packageName),\n packageName,\n type: coreOntology.Package,\n };\n _linked._packages[packageName] = packageMetadata;\n return packageMetadata;\n}\n\n\nexport function initTree()\n{\n let globalObject =\n typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : undefined;\n // Idempotent: if the global tree is already set up (by another copy of\n // this Package.ts in the same Node process — structural under Vite SSR,\n // which evaluates the file once for its own SSR transform AND once via\n // Node's resolver when a non-Vite import path reaches @_linked/core),\n // attach to it instead of throwing. Both instances write the same\n // _modules / _packages registry shape.\n //\n // Legacy `lincd` package's Package.ts (separate file) still throws on\n // dup — that throw signals a REAL problem (legacy `lincd` should never\n // load in a clean post-eradication state).\n if (!('_linked' in globalObject))\n {\n globalObject['_linked'] = {_modules: {}, _packages: {}};\n }\n}\n\n//when this file is used, make sure the tree is initialized\ninitTree();\n\n//now that this file is set up, we can link linked shapes in the core module itself\nexport const corePackage = linkedPackage('@_linked/core');\n// NodeShape, PropertyShape and List share their names with ontology terms (shacl.NodeShape,\n// shacl.PropertyShape, rdf.List), so a bundler may rename the classes. Explicit names keep\n// their IRIs independent of that.\ncorePackage.linkedShape({\n name: 'NodeShape',\n description:\n 'Represents a SHACL NodeShape; defines constraints for a class of RDF nodes. Links to multiple PropertyShapes. (schema, constraint, class validation)',\n})(NodeShape);\ncorePackage.linkedShape({\n name: 'PropertyShape',\n description:\n 'Represents a SHACL PropertyShape; specifies rules for one property of a NodeShape (path, datatype, cardinality). (validation rule, property constraint)',\n // A property shape has no independent existence — it is owned by its NodeShape via the\n // `contains` sh:property edge, so deleting the NodeShape cascade-deletes it.\n dependent: true,\n})(PropertyShape);\n// List is registered here, by value, because PropertyShape.in below uses it as its value\n// shape. Naming it by string instead would leave it unregistered for anyone who loads the\n// SHACL metamodel without importing shapes/List (backlog 045).\ncorePackage.linkedShape({\n name: 'List',\n dependent: true,\n})(List);\n// ValidationReport / ValidationResult removed in core metadata rewrite\n\n//ALL the following is to support Shape having get/set methods with property shapes\n//and Shape itself having a nodeShape\n//if we dont need Shape to have get/set methods (like label and type) then this can be removed\n// Base Shape IRI follows the same scheme as every other core shape:\n// https://linked.cm/shape/core/Shape (corePackage above declared slug 'core').\nShape.shape = createNodeShapeData(\n getNodeShapeUri('@_linked/core', 'Shape'),\n);\naddNodeShapeToShapeClass(Shape.shape,Shape);\n\n//Here we can register the properties of the Shape class itself\n//We can't do that inside of Shape because it would cause circular dependencies\ncreatePropertyShape({\n path: rdfs.label,\n //TODO: multiple labels should be possible\n maxCount: 1,//currently get label is implemented to return a single value\n },\n 'label',\n shacl.Literal,\n Shape,\n);\ncreatePropertyShape(\n {\n path: rdf.type,\n shape: Shape,\n },\n 'type',\n shacl.IRI,\n Shape,\n);\n\ncreatePropertyShape(\n {\n path: shacl.property,\n shape: PropertyShape,\n contains: true, // a NodeShape owns its property shapes (cascade on delete)\n },\n 'properties',\n shacl.IRI,\n NodeShape,\n);\n\ncreatePropertyShape({\n path: rdfs.comment,\n maxCount: 1,\n },'description',shacl.Literal, NodeShape);\n\ncreatePropertyShape({\n path: rdf.type,\n maxCount: 1,\n shape: Shape,\n},'type',shacl.IRI, NodeShape);\n\ncreatePropertyShape(\n {\n path: shacl.targetClass,\n shape: Shape, //should be rdfs Class, but that's currently not available in LINCD. So queries currently cannot continue after accessing targetClass\n maxCount: 1,\n },\n 'targetClass',\n shacl.IRI,\n NodeShape,\n);\n\ncreatePropertyShape({\n path: shacl.targetNode,\n shape: Shape,//actually returns a NamedNode... is this correct then? Should we define or use a rdfs Class that matches the potential values?\n},'targetNode',shacl.IRI, NodeShape);\n\ncreatePropertyShape({\n path: coreOntology.isExtending,\n shape: NodeShape,\n},'extends',shacl.IRI, NodeShape);\n\n//currently path accepts multiple values, so its a multi-value property\n//these values will be consequent properties that follow each other. Other property paths are not supported yet.\ncreatePropertyShape(\n {\n // No fixed valueShape: sh:path is polymorphic (a predicate IRI, an rdf:List for a\n // sequence, or a PathNode for inverse/alt/cardinality). Omitting valueShape lets the\n // create pipeline use each value's own shape. Simple paths are passed as\n // {id} node references, complex paths as List/PathNode node-data.\n path: shacl.path,\n contains: true, // a property shape owns its complex path structure (List/PathNode)\n },\n 'path',\n shacl.IRI,\n PropertyShape,\n);\n\ncreatePropertyShape(\n {\n path: shacl.node,\n shape: NodeShape,\n maxCount: 1,\n },\n 'valueShape',\n shacl.IRI,\n PropertyShape,\n);\n\ncreatePropertyShape(\n {\n maxCount: 1,\n path: shacl.nodeKind,\n shape: Shape, //actually returns a NamedNode. Queries currently cannot continue after accessing nodeKind\n },\n 'nodeKind',\n shacl.IRI,\n PropertyShape,\n);\n\ncreatePropertyShape(\n {\n path: shacl.datatype,\n shape: Shape,\n maxCount: 1,\n },\n 'datatype',\n shacl.IRI,\n PropertyShape,\n);\n\n//PropertyShape.maxCount\ncreatePropertyShape(\n {\n path: shacl.maxCount,\n datatype: xsd.integer,\n maxCount: 1,\n },\n 'maxCount',\n shacl.Literal,\n PropertyShape,\n);\n\n//PropertyShape.minCount\ncreatePropertyShape(\n {\n path: shacl.minCount,\n datatype: xsd.integer,\n maxCount: 1,\n },\n 'minCount',\n shacl.Literal,\n PropertyShape,\n);\n\n//PropertyShape.name\ncreatePropertyShape(\n {\n path: shacl.name,\n maxCount: 1,\n },\n 'name',\n shacl.Literal,\n PropertyShape,\n);\n\n//PropertyShape.description\ncreatePropertyShape(\n {\n path: shacl.description,\n maxCount: 1,\n },\n 'description',\n shacl.Literal,\n PropertyShape,\n);\n\n// ---------------------------------------------------------------------------\n// Remaining SHACL meta-model accessors for shape serialization.\n// Labels match the PropertyShapeData / NodeShapeData fields so syncShapes() can\n// build the create-pipeline data directly. `sh:in` is owned (contains, valueShape List).\n// ---------------------------------------------------------------------------\n\n// PropertyShape.class\ncreatePropertyShape(\n {path: shacl.class, shape: Shape, maxCount: 1},\n 'class',\n shacl.IRI,\n PropertyShape,\n);\n\n// PropertyShape.in → an rdf:List (owned)\ncreatePropertyShape(\n {path: shacl.in, shape: List, maxCount: 1, contains: true},\n 'in',\n shacl.IRI,\n PropertyShape,\n);\n\n// PropertyShape pair constraints (values are property IRIs)\n// Labelled `equalsConstraint`, not `equals`: `equals` is a query-builder method, so a\n// property under that label is unreachable through the DSL (backlog 041). The name also\n// matches the `PropertyShapeData` field. The predicate stays sh:equals.\ncreatePropertyShape({path: shacl.equals, shape: Shape, maxCount: 1}, 'equalsConstraint', shacl.IRI, PropertyShape);\ncreatePropertyShape({path: shacl.disjoint, shape: Shape, maxCount: 1}, 'disjoint', shacl.IRI, PropertyShape);\ncreatePropertyShape({path: shacl.lessThan, shape: Shape, maxCount: 1}, 'lessThan', shacl.IRI, PropertyShape);\ncreatePropertyShape(\n {path: shacl.lessThanOrEquals, shape: Shape, maxCount: 1},\n 'lessThanOrEquals',\n shacl.IRI,\n PropertyShape,\n);\n\n// PropertyShape.hasValue (literal or IRI — generic)\ncreatePropertyShape({path: shacl.hasValue, maxCount: 1}, 'hasValue', null, PropertyShape);\n\n// PropertyShape.defaultValue (literal or IRI — generic, mirrors hasValue).\n// getResult() already emits `defaultValue`, but without this registration the\n// property is not queryable and a query referencing it throws before executing.\ncreatePropertyShape({path: shacl.defaultValue, maxCount: 1}, 'defaultValue', null, PropertyShape);\n\n// PropertyShape value-range / string-length / pattern constraints (report 021 §3, G5).\n// The range constraints carry no fixed datatype — the literal is typed from the JS value\n// (integer/double), mirroring the constrained property's own datatype. Length is an integer;\n// pattern is the regex source string.\ncreatePropertyShape({path: shacl.minInclusive, maxCount: 1}, 'minInclusive', shacl.Literal, PropertyShape);\ncreatePropertyShape({path: shacl.maxInclusive, maxCount: 1}, 'maxInclusive', shacl.Literal, PropertyShape);\ncreatePropertyShape({path: shacl.minExclusive, maxCount: 1}, 'minExclusive', shacl.Literal, PropertyShape);\ncreatePropertyShape({path: shacl.maxExclusive, maxCount: 1}, 'maxExclusive', shacl.Literal, PropertyShape);\ncreatePropertyShape(\n {path: shacl.minLength, datatype: xsd.integer, maxCount: 1},\n 'minLength',\n shacl.Literal,\n PropertyShape,\n);\ncreatePropertyShape(\n {path: shacl.maxLength, datatype: xsd.integer, maxCount: 1},\n 'maxLength',\n shacl.Literal,\n PropertyShape,\n);\ncreatePropertyShape(\n {path: shacl.pattern, datatype: xsd.string, maxCount: 1},\n 'pattern',\n shacl.Literal,\n PropertyShape,\n);\n\n// PropertyShape.order / group\ncreatePropertyShape(\n {path: shacl.order, datatype: xsd.integer, maxCount: 1},\n 'order',\n shacl.Literal,\n PropertyShape,\n);\ncreatePropertyShape({path: shacl.group, maxCount: 1}, 'group', shacl.Literal, PropertyShape);\n\n// PropertyShape.displayRank / displayHidden (linked_core: display vocabulary).\n// These materialize onto the pure sh:NodeShape and so travel with an ejected app.\ncreatePropertyShape(\n {path: coreOntology.displayRank, datatype: xsd.integer, maxCount: 1},\n 'displayRank',\n shacl.Literal,\n PropertyShape,\n);\ncreatePropertyShape(\n {path: coreOntology.displayHidden, datatype: xsd.boolean, maxCount: 1},\n 'displayHidden',\n shacl.Literal,\n PropertyShape,\n);\n\n// PropertyShape.contains (linked_core:contains — persists the composition flag)\ncreatePropertyShape(\n {path: coreOntology.contains, datatype: xsd.boolean, maxCount: 1},\n 'contains',\n shacl.Literal,\n PropertyShape,\n);\n\n// NodeShape.closed / ignoredProperties / dependent\ncreatePropertyShape(\n {path: shacl.closed, datatype: xsd.boolean, maxCount: 1},\n 'closed',\n shacl.Literal,\n NodeShape,\n);\ncreatePropertyShape(\n {path: shacl.ignoredProperties, shape: Shape},\n 'ignoredProperties',\n shacl.IRI,\n NodeShape,\n);\ncreatePropertyShape(\n {path: coreOntology.dependent, datatype: xsd.boolean, maxCount: 1},\n 'dependent',\n shacl.Literal,\n NodeShape,\n);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_linked/core",
3
- "version": "2.22.9",
3
+ "version": "2.23.0",
4
4
  "packageManager": "npm@11.19.1",
5
5
  "license": "MIT",
6
6
  "linkedPackage": true,
@@ -16,7 +16,13 @@
16
16
  "**/ontologies/*.js",
17
17
  "**/ontologies/*.ts",
18
18
  "**/utils/Package.js",
19
- "**/utils/Package.ts"
19
+ "**/utils/Package.ts",
20
+ "**/lib/esm/index.js",
21
+ "**/src/index.ts",
22
+ "**/shapes/index.js",
23
+ "**/shapes/index.ts",
24
+ "**/shapes/*.js",
25
+ "**/shapes/*.ts"
20
26
  ],
21
27
  "exports": {
22
28
  ".": {