@shaclmate/compiler 4.0.65 → 4.0.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generators/ts/DiscriminatedUnionType.d.ts +1 -2
- package/dist/generators/ts/DiscriminatedUnionType.js +1 -3
- package/dist/generators/ts/TsGenerator.d.ts +0 -4
- package/dist/generators/ts/TsGenerator.js +8 -93
- package/dist/generators/ts/UberObjectDiscriminatedUnionType.d.ts +29 -0
- package/dist/generators/ts/UberObjectDiscriminatedUnionType.js +144 -0
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_graphqlTypeVariableStatement.js +0 -3
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_typeGuardFunctionDeclaration.js +0 -3
- package/dist/generators/ts/_snippets/snippets_RdfVocabularies.js +1 -0
- package/dist/input/input.shaclmate.d.ts +37 -1315
- package/dist/input/input.shaclmate.js +41 -170
- package/package.json +10 -8
|
@@ -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
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
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
|
-
$
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
NodeShape
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
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
|
-
|
|
3544
|
-
|
|
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.
|
|
3
|
+
"@shaclmate/shacl-ast": "4.0.67",
|
|
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.
|
|
10
|
-
"@rdfx/literal": "0.0.
|
|
11
|
-
"@rdfx/resource": "0.0.
|
|
12
|
-
"@rdfx/string": "0.0.
|
|
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.
|
|
31
|
-
"@rdfx/serializers": "0.0.
|
|
30
|
+
"@rdfx/fs": "0.0.32",
|
|
31
|
+
"@rdfx/serializers": "0.0.32"
|
|
32
32
|
},
|
|
33
33
|
"files": [
|
|
34
34
|
"dist/Compiler.d.ts",
|
|
@@ -227,6 +227,8 @@
|
|
|
227
227
|
"dist/generators/ts/TypeFactory.js",
|
|
228
228
|
"dist/generators/ts/Typeof.d.ts",
|
|
229
229
|
"dist/generators/ts/Typeof.js",
|
|
230
|
+
"dist/generators/ts/UberObjectDiscriminatedUnionType.d.ts",
|
|
231
|
+
"dist/generators/ts/UberObjectDiscriminatedUnionType.js",
|
|
230
232
|
"dist/generators/ts/ZodGenerator.d.ts",
|
|
231
233
|
"dist/generators/ts/ZodGenerator.js",
|
|
232
234
|
"dist/generators/ts/_AbstractType/AbstractType_ConversionFunction.d.ts",
|
|
@@ -721,5 +723,5 @@
|
|
|
721
723
|
},
|
|
722
724
|
"type": "module",
|
|
723
725
|
"types": "./dist/index.d.ts",
|
|
724
|
-
"version": "4.0.
|
|
726
|
+
"version": "4.0.67"
|
|
725
727
|
}
|