@shaclmate/compiler 4.0.64 → 4.0.66

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.
@@ -810,6 +810,7 @@ export var NodeShape;
810
810
  kind: "Identifier",
811
811
  type: { kind: "Identifier" },
812
812
  },
813
+ $type: { kind: "Discriminant", value: "NodeShape" },
813
814
  and: {
814
815
  kind: "Shacl",
815
816
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#and"),
@@ -1452,6 +1453,7 @@ export var Ontology;
1452
1453
  kind: "Identifier",
1453
1454
  type: { kind: "Identifier" },
1454
1455
  },
1456
+ $type: { kind: "Discriminant", value: "Ontology" },
1455
1457
  comment: {
1456
1458
  kind: "Shacl",
1457
1459
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
@@ -1548,6 +1550,7 @@ export var PropertyGroup;
1548
1550
  kind: "Identifier",
1549
1551
  type: { kind: "Identifier" },
1550
1552
  },
1553
+ $type: { kind: "Discriminant", value: "PropertyGroup" },
1551
1554
  comment: {
1552
1555
  kind: "Shacl",
1553
1556
  path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
@@ -2036,6 +2039,7 @@ export var PropertyShape;
2036
2039
  kind: "Identifier",
2037
2040
  type: { kind: "Identifier" },
2038
2041
  },
2042
+ $type: { kind: "Discriminant", value: "PropertyShape" },
2039
2043
  and: {
2040
2044
  kind: "Shacl",
2041
2045
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#and"),
@@ -2771,6 +2775,7 @@ export var ValidationReport;
2771
2775
  kind: "Identifier",
2772
2776
  type: { kind: "Identifier" },
2773
2777
  },
2778
+ $type: { kind: "Discriminant", value: "ValidationReport" },
2774
2779
  conforms: {
2775
2780
  kind: "Shacl",
2776
2781
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#conforms"),
@@ -2930,6 +2935,7 @@ export var ValidationResult;
2930
2935
  kind: "Identifier",
2931
2936
  type: { kind: "Identifier" },
2932
2937
  },
2938
+ $type: { kind: "Discriminant", value: "ValidationResult" },
2933
2939
  details: {
2934
2940
  kind: "Shacl",
2935
2941
  path: dataFactory.namedNode("http://www.w3.org/ns/shacl#detail"),
@@ -3400,179 +3406,44 @@ export var Shape;
3400
3406
  })(Shape || (Shape = {}));
3401
3407
  export var $Object;
3402
3408
  (function ($Object) {
3403
- $Object.$toString = (value) => {
3404
- if (NodeShape.isNodeShape(value)) {
3405
- return NodeShape.$toString(value);
3406
- }
3407
- if (Ontology.isOntology(value)) {
3408
- return Ontology.$toString(value);
3409
- }
3410
- if (PropertyGroup.isPropertyGroup(value)) {
3411
- return PropertyGroup.$toString(value);
3412
- }
3413
- if (PropertyShape.isPropertyShape(value)) {
3414
- return PropertyShape.$toString(value);
3415
- }
3416
- if (ValidationReport.isValidationReport(value)) {
3417
- return ValidationReport.$toString(value);
3418
- }
3419
- if (ValidationResult.isValidationResult(value)) {
3420
- return ValidationResult.$toString(value);
3421
- }
3422
- throw new Error("unable to serialize to string");
3423
- };
3424
- $Object.fromRdfResource = (resource, options) => NodeShape.fromRdfResource(resource, {
3425
- ...options,
3426
- ignoreRdfType: false,
3427
- })
3428
- .altLazy(() => Ontology.fromRdfResource(resource, {
3429
- ...options,
3430
- ignoreRdfType: false,
3431
- }))
3432
- .altLazy(() => PropertyGroup.fromRdfResource(resource, {
3433
- ...options,
3434
- ignoreRdfType: false,
3435
- }))
3436
- .altLazy(() => PropertyShape.fromRdfResource(resource, {
3437
- ...options,
3438
- ignoreRdfType: false,
3439
- }))
3440
- .altLazy(() => ValidationReport.fromRdfResource(resource, {
3441
- ...options,
3442
- ignoreRdfType: false,
3443
- }))
3444
- .altLazy(() => ValidationResult.fromRdfResource(resource, {
3445
- ...options,
3446
- ignoreRdfType: false,
3447
- }));
3448
- $Object.fromRdfResourceValues = ((values, options) => values.chainMap((value) => {
3449
- const valueAsValues = value.toValues();
3450
- return NodeShape.fromRdfResourceValues(valueAsValues, {
3451
- ...options,
3452
- schema: options.schema.members["NodeShape"].type,
3453
- })
3454
- .altLazy(() => Ontology.fromRdfResourceValues(valueAsValues, {
3455
- ...options,
3456
- schema: options.schema.members["Ontology"].type,
3457
- }))
3458
- .altLazy(() => PropertyGroup.fromRdfResourceValues(valueAsValues, {
3459
- ...options,
3460
- schema: options.schema.members["PropertyGroup"].type,
3461
- }))
3462
- .altLazy(() => PropertyShape.fromRdfResourceValues(valueAsValues, {
3463
- ...options,
3464
- schema: options.schema.members["PropertyShape"].type,
3465
- }))
3466
- .altLazy(() => ValidationReport.fromRdfResourceValues(valueAsValues, {
3467
- ...options,
3468
- schema: options.schema.members["ValidationReport"].type,
3469
- }))
3470
- .altLazy(() => ValidationResult.fromRdfResourceValues(valueAsValues, {
3471
- ...options,
3472
- schema: options.schema.members["ValidationResult"].type,
3473
- }))
3474
- .chain((values) => values.head());
3475
- }));
3476
- let Identifier;
3477
- (function (Identifier) {
3478
- Identifier.parse = $parseIdentifier;
3479
- Identifier.stringify = NTriplesTerm.stringify;
3480
- })(Identifier = $Object.Identifier || ($Object.Identifier = {}));
3481
- $Object.schema = {
3482
- kind: "ObjectDiscriminatedUnion",
3483
- members: {
3484
- NodeShape: { discriminantValues: ["NodeShape"], type: NodeShape.schema },
3485
- Ontology: { discriminantValues: ["Ontology"], type: Ontology.schema },
3486
- PropertyGroup: {
3487
- discriminantValues: ["PropertyGroup"],
3488
- type: PropertyGroup.schema,
3489
- },
3490
- PropertyShape: {
3491
- discriminantValues: ["PropertyShape"],
3492
- type: PropertyShape.schema,
3493
- },
3494
- ValidationReport: {
3495
- discriminantValues: ["ValidationReport"],
3496
- type: ValidationReport.schema,
3497
- },
3498
- ValidationResult: {
3499
- discriminantValues: ["ValidationResult"],
3500
- type: ValidationResult.schema,
3501
- },
3502
- },
3503
- properties: {},
3504
- };
3505
3409
  $Object.toRdfResource = (object, options) => {
3506
- if (NodeShape.isNodeShape(object)) {
3507
- return NodeShape.toRdfResource(object, options);
3508
- }
3509
- if (Ontology.isOntology(object)) {
3510
- return Ontology.toRdfResource(object, options);
3511
- }
3512
- if (PropertyGroup.isPropertyGroup(object)) {
3513
- return PropertyGroup.toRdfResource(object, options);
3514
- }
3515
- if (PropertyShape.isPropertyShape(object)) {
3516
- return PropertyShape.toRdfResource(object, options);
3517
- }
3518
- if (ValidationReport.isValidationReport(object)) {
3519
- return ValidationReport.toRdfResource(object, options);
3520
- }
3521
- if (ValidationResult.isValidationResult(object)) {
3522
- return ValidationResult.toRdfResource(object, options);
3410
+ switch (object.$type) {
3411
+ case "NodeShape":
3412
+ return NodeShape.toRdfResource(object, options);
3413
+ case "Ontology":
3414
+ return Ontology.toRdfResource(object, options);
3415
+ case "PropertyGroup":
3416
+ return PropertyGroup.toRdfResource(object, options);
3417
+ case "PropertyShape":
3418
+ return PropertyShape.toRdfResource(object, options);
3419
+ case "ValidationReport":
3420
+ return ValidationReport.toRdfResource(object, options);
3421
+ case "ValidationResult":
3422
+ return ValidationResult.toRdfResource(object, options);
3423
+ default:
3424
+ object;
3425
+ throw new Error("should never reach this point");
3523
3426
  }
3524
- throw new Error("unrecognized type");
3525
3427
  };
3526
- $Object.toRdfResourceValues = ((value, _options) => {
3527
- if (NodeShape.isNodeShape(value)) {
3528
- return [
3529
- NodeShape.toRdfResource(value, {
3530
- graph: _options.graph,
3531
- resourceSet: _options.resourceSet,
3532
- }).identifier,
3533
- ];
3534
- }
3535
- if (Ontology.isOntology(value)) {
3536
- return [
3537
- Ontology.toRdfResource(value, {
3538
- graph: _options.graph,
3539
- resourceSet: _options.resourceSet,
3540
- }).identifier,
3541
- ];
3428
+ function $toString(object) {
3429
+ switch (object.$type) {
3430
+ case "NodeShape":
3431
+ return NodeShape.$toString(object);
3432
+ case "Ontology":
3433
+ return Ontology.$toString(object);
3434
+ case "PropertyGroup":
3435
+ return PropertyGroup.$toString(object);
3436
+ case "PropertyShape":
3437
+ return PropertyShape.$toString(object);
3438
+ case "ValidationReport":
3439
+ return ValidationReport.$toString(object);
3440
+ case "ValidationResult":
3441
+ return ValidationResult.$toString(object);
3442
+ default:
3443
+ object;
3444
+ throw new Error("should never reach this point");
3542
3445
  }
3543
- if (PropertyGroup.isPropertyGroup(value)) {
3544
- return [
3545
- PropertyGroup.toRdfResource(value, {
3546
- graph: _options.graph,
3547
- resourceSet: _options.resourceSet,
3548
- }).identifier,
3549
- ];
3550
- }
3551
- if (PropertyShape.isPropertyShape(value)) {
3552
- return [
3553
- PropertyShape.toRdfResource(value, {
3554
- graph: _options.graph,
3555
- resourceSet: _options.resourceSet,
3556
- }).identifier,
3557
- ];
3558
- }
3559
- if (ValidationReport.isValidationReport(value)) {
3560
- return [
3561
- ValidationReport.toRdfResource(value, {
3562
- graph: _options.graph,
3563
- resourceSet: _options.resourceSet,
3564
- }).identifier,
3565
- ];
3566
- }
3567
- if (ValidationResult.isValidationResult(value)) {
3568
- return [
3569
- ValidationResult.toRdfResource(value, {
3570
- graph: _options.graph,
3571
- resourceSet: _options.resourceSet,
3572
- }).identifier,
3573
- ];
3574
- }
3575
- throw new Error("unable to serialize to RDF");
3576
- });
3446
+ }
3447
+ $Object.$toString = $toString;
3577
3448
  })($Object || ($Object = {}));
3578
3449
  //# sourceMappingURL=input.shaclmate.js.map
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "dependencies": {
3
- "@shaclmate/shacl-ast": "4.0.64",
3
+ "@shaclmate/shacl-ast": "4.0.66",
4
4
  "@rdfjs/dataset": "~2.0.2",
5
5
  "@rdfjs/prefix-map": "~0.1.2",
6
6
  "@rdfjs/term-map": "~2.0.2",
7
7
  "@rdfjs/term-set": "~2.0.3",
8
8
  "@rdfjs/types": "~2.0.1",
9
- "@rdfx/data-factory": "0.0.30",
10
- "@rdfx/literal": "0.0.30",
11
- "@rdfx/resource": "0.0.30",
12
- "@rdfx/string": "0.0.30",
9
+ "@rdfx/data-factory": "0.0.32",
10
+ "@rdfx/literal": "0.0.32",
11
+ "@rdfx/resource": "0.0.32",
12
+ "@rdfx/string": "0.0.32",
13
13
  "@sindresorhus/base62": "~0.1.0",
14
14
  "@tpluscode/rdf-ns-builders": "~4.3.0",
15
15
  "@types/rdfjs__dataset": "~2.0.7",
@@ -27,8 +27,8 @@
27
27
  "typescript-memoize": "~1.1.1"
28
28
  },
29
29
  "devDependencies": {
30
- "@rdfx/fs": "0.0.30",
31
- "@rdfx/serializers": "0.0.30"
30
+ "@rdfx/fs": "0.0.32",
31
+ "@rdfx/serializers": "0.0.32"
32
32
  },
33
33
  "files": [
34
34
  "dist/Compiler.d.ts",
@@ -721,5 +721,5 @@
721
721
  },
722
722
  "type": "module",
723
723
  "types": "./dist/index.d.ts",
724
- "version": "4.0.64"
724
+ "version": "4.0.66"
725
725
  }