@shaclmate/compiler 4.0.6 → 4.0.8
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/ObjectType.js +17 -4
- package/dist/generators/ts/ObjectUnionType.js +21 -9
- package/dist/generators/ts/ZodGenerator.d.ts +7 -0
- package/dist/generators/ts/ZodGenerator.js +37 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclarations.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_jsonFunctionDeclarations.js → ObjectType_fromJsonFunctionDeclarations.js} +8 -64
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfFunctionDeclaration.js +27 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js +14 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js +18 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonZodSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonZodSchemaFunctionDeclaration.js +30 -0
- package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromRdfFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_rdfFunctionDeclarations.js → ObjectType_propertiesFromRdfFunctionDeclaration.js} +5 -37
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts +4 -1
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +6 -2
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts +4 -1
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +6 -2
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructTriplesFunctionDeclaration.js +57 -0
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlWherePatternsFunctionDeclarations.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlWherePatternsFunctionDeclarations.js +106 -0
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromJsonFunctionDeclaration.js +19 -0
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromRdfFunctionDeclarations.d.ts +5 -0
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromRdfFunctionDeclarations.js +20 -0
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.js +14 -0
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.js +15 -0
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlWherePatternsFunctionDeclaration.js +35 -0
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toJsonFunctionDeclaration.js +26 -0
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toRdfFunctionDeclarations.d.ts +5 -0
- package/dist/generators/ts/_ObjectUnionType/{ObjectUnionType_rdfFunctionDeclarations.js → ObjectUnionType_toRdfFunctionDeclarations.js} +6 -23
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/input/NodeShape.d.ts +5 -5
- package/dist/input/NodeShape.js +20 -20
- package/dist/input/Ontology.d.ts +4 -4
- package/dist/input/Ontology.js +10 -10
- package/dist/input/PropertyShape.d.ts +4 -4
- package/dist/input/PropertyShape.js +10 -10
- package/dist/input/ShapesGraph.js +5 -5
- package/dist/input/generated.d.ts +708 -2008
- package/dist/input/generated.js +2504 -2156
- package/package.json +2 -2
- package/dist/generators/ts/_ObjectType/ObjectType_jsonFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_rdfFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlFunctionDeclarations.js +0 -140
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonFunctionDeclarations.js +0 -50
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_rdfFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlFunctionDeclarations.js +0 -44
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { rdf, rdfs } from "@tpluscode/rdf-ns-builders";
|
|
2
|
+
import { Maybe } from "purify-ts";
|
|
3
|
+
import { imports } from "../imports.js";
|
|
4
|
+
import { rdfjsTermExpression } from "../rdfjsTermExpression.js";
|
|
5
|
+
import { snippets } from "../snippets.js";
|
|
6
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
7
|
+
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
8
|
+
const variables = {
|
|
9
|
+
filter: code `parameters.filter`,
|
|
10
|
+
preferredLanguages: code `parameters.preferredLanguages`,
|
|
11
|
+
focusIdentifier: code `parameters.focusIdentifier`,
|
|
12
|
+
variablePrefix: code `parameters.variablePrefix`,
|
|
13
|
+
};
|
|
14
|
+
export function ObjectType_sparqlWherePatternsFunctionDeclaration() {
|
|
15
|
+
if (!this.features.has("sparql")) {
|
|
16
|
+
return Maybe.empty();
|
|
17
|
+
}
|
|
18
|
+
const rdfClassVariable = code `${imports.dataFactory}.variable!(\`\${${variables.variablePrefix}}RdfClass\`)`;
|
|
19
|
+
const rdfTypeVariable = code `${imports.dataFactory}.variable!(\`\${${variables.variablePrefix}}RdfType\`)`;
|
|
20
|
+
let patternsVariableDeclarationKeyword = "const";
|
|
21
|
+
const statements = [];
|
|
22
|
+
for (const parentObjectType of this.parentObjectTypes) {
|
|
23
|
+
statements.push(code `\
|
|
24
|
+
patterns = patterns.concat(${parentObjectType.staticModuleName}.${syntheticNamePrefix}sparqlWherePatterns(${{ filter: variables.filter, focusIdentifier: variables.focusIdentifier, ignoreRdfType: true, preferredLanguages: variables.preferredLanguages, variablePrefix: variables.variablePrefix }}));`);
|
|
25
|
+
patternsVariableDeclarationKeyword = "let";
|
|
26
|
+
}
|
|
27
|
+
if (this.fromRdfType.isJust()) {
|
|
28
|
+
const fromRdfTypeVariables = this.fromRdfTypeVariable
|
|
29
|
+
.toList()
|
|
30
|
+
.concat(this.descendantFromRdfTypeVariables);
|
|
31
|
+
statements.push(code `const rdfTypeVariable = ${rdfTypeVariable};`, code `\
|
|
32
|
+
if (!parameters?.ignoreRdfType) {
|
|
33
|
+
patterns.push(
|
|
34
|
+
${fromRdfTypeVariables.length > 1
|
|
35
|
+
? code `\
|
|
36
|
+
{
|
|
37
|
+
type: "values" as const,
|
|
38
|
+
values: [${joinCode(fromRdfTypeVariables, { on: "," })}].map((identifier) => {
|
|
39
|
+
const valuePatternRow: ${imports.sparqljs}.ValuePatternRow = {};
|
|
40
|
+
valuePatternRow[\`?\${${variables.variablePrefix}}FromRdfType\`] = identifier as ${imports.NamedNode};
|
|
41
|
+
return valuePatternRow;
|
|
42
|
+
}),
|
|
43
|
+
},
|
|
44
|
+
${snippets.sparqlInstancesOfPattern}({ rdfType: ${imports.dataFactory}.variable!(\`\${${variables.variablePrefix}}FromRdfType\`), subject: ${variables.focusIdentifier} }),`
|
|
45
|
+
: code `${snippets.sparqlInstancesOfPattern}({ rdfType: ${fromRdfTypeVariables[0]}, subject: ${variables.focusIdentifier} }),`}
|
|
46
|
+
{
|
|
47
|
+
triples: [
|
|
48
|
+
{
|
|
49
|
+
subject: ${variables.focusIdentifier},
|
|
50
|
+
predicate: ${rdfjsTermExpression(rdf.type)},
|
|
51
|
+
object: rdfTypeVariable
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
type: "bgp" as const
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
patterns: [
|
|
58
|
+
{
|
|
59
|
+
triples: [
|
|
60
|
+
{
|
|
61
|
+
subject: rdfTypeVariable,
|
|
62
|
+
predicate: {
|
|
63
|
+
items: [${rdfjsTermExpression(rdfs.subClassOf)}],
|
|
64
|
+
pathType: "+" as const,
|
|
65
|
+
type: "path" as const
|
|
66
|
+
},
|
|
67
|
+
object: ${rdfClassVariable}
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
type: "bgp" as const
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
type: "optional" as const
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}`);
|
|
77
|
+
}
|
|
78
|
+
for (const property of this.ownProperties) {
|
|
79
|
+
if (property.recursive) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
property
|
|
83
|
+
.sparqlWherePatternsExpression({ variables })
|
|
84
|
+
.ifJust(({ condition, patterns }) => {
|
|
85
|
+
const concatStatement = code `patterns = patterns.concat(${patterns});`;
|
|
86
|
+
if (condition) {
|
|
87
|
+
statements.push(code `if (${condition}) { ${concatStatement} }`);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
statements.push(concatStatement);
|
|
91
|
+
}
|
|
92
|
+
patternsVariableDeclarationKeyword = "let";
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return Maybe.of(code `\
|
|
96
|
+
export function ${syntheticNamePrefix}sparqlWherePatterns(${statements.length === 0 ? "_" : ""}parameters: { filter: ${this.filterType} | undefined; focusIdentifier: ${imports.NamedNode} | ${imports.Variable}; ignoreRdfType: boolean; preferredLanguages: readonly string[] | undefined; variablePrefix: string }): readonly ${snippets.SparqlPattern}[] {
|
|
97
|
+
${statements.length > 0
|
|
98
|
+
? joinCode([
|
|
99
|
+
code `${patternsVariableDeclarationKeyword} patterns: ${snippets.SparqlPattern}[] = [];`,
|
|
100
|
+
...statements,
|
|
101
|
+
code `return patterns;`,
|
|
102
|
+
])
|
|
103
|
+
: "return [];"}
|
|
104
|
+
}`);
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=ObjectType_sparqlWherePatternsFunctionDeclarations.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import { type Code } from "ts-poet";
|
|
3
|
+
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
4
|
+
export declare function ObjectUnionType_fromJsonFunctionDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=ObjectUnionType_fromJsonFunctionDeclaration.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import { code } from "ts-poet";
|
|
3
|
+
import { imports } from "../imports.js";
|
|
4
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
5
|
+
export function ObjectUnionType_fromJsonFunctionDeclaration() {
|
|
6
|
+
if (!this.features.has("json")) {
|
|
7
|
+
return Maybe.empty();
|
|
8
|
+
}
|
|
9
|
+
return Maybe.of(code `\
|
|
10
|
+
export function ${syntheticNamePrefix}fromJson(json: unknown): ${imports.Either}<${imports.z}.ZodError, ${this.name}> {
|
|
11
|
+
return ${this.concreteMemberTypes.reduce((expression, memberType) => {
|
|
12
|
+
const memberTypeExpression = code `(${memberType.staticModuleName}.${syntheticNamePrefix}fromJson(json) as ${imports.Either}<${imports.z}.ZodError, ${this.name}>)`;
|
|
13
|
+
return expression !== null
|
|
14
|
+
? code `${expression}.altLazy(() => ${memberTypeExpression})`
|
|
15
|
+
: memberTypeExpression;
|
|
16
|
+
}, null)};
|
|
17
|
+
}`);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=ObjectUnionType_fromJsonFunctionDeclaration.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function ObjectUnionType_fromRdfFunctionDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=ObjectUnionType_fromRdfFunctionDeclarations.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import { imports } from "../imports.js";
|
|
3
|
+
import { snippets } from "../snippets.js";
|
|
4
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
5
|
+
import { code } from "../ts-poet-wrapper.js";
|
|
6
|
+
export function ObjectUnionType_fromRdfFunctionDeclaration() {
|
|
7
|
+
if (!this.features.has("rdf")) {
|
|
8
|
+
return Maybe.empty();
|
|
9
|
+
}
|
|
10
|
+
return Maybe.of(code `\
|
|
11
|
+
export function ${syntheticNamePrefix}fromRdf(resource: ${imports.Resource}, options?: ${snippets.FromRdfOptions}): ${imports.Either}<Error, ${this.name}> {
|
|
12
|
+
return ${this.concreteMemberTypes.reduce((expression, memberType) => {
|
|
13
|
+
const memberTypeExpression = code `(${memberType.staticModuleName}.${syntheticNamePrefix}fromRdf(resource, { ...options, ignoreRdfType: false }) as ${imports.Either}<Error, ${this.name}>)`;
|
|
14
|
+
return expression !== null
|
|
15
|
+
? code `${expression}.altLazy(() => ${memberTypeExpression})`
|
|
16
|
+
: memberTypeExpression;
|
|
17
|
+
}, null)};
|
|
18
|
+
}`);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=ObjectUnionType_fromRdfFunctionDeclarations.js.map
|
package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import { type Code } from "ts-poet";
|
|
3
|
+
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
4
|
+
export declare function ObjectUnionType_jsonZodSchemaFunctionDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=ObjectUnionType_jsonZodSchemaFunctionDeclaration.d.ts.map
|
package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import { code, joinCode } from "ts-poet";
|
|
3
|
+
import { imports } from "../imports.js";
|
|
4
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
5
|
+
export function ObjectUnionType_jsonZodSchemaFunctionDeclaration() {
|
|
6
|
+
if (!this.features.has("json")) {
|
|
7
|
+
return Maybe.empty();
|
|
8
|
+
}
|
|
9
|
+
return Maybe.of(code `\
|
|
10
|
+
export function ${syntheticNamePrefix}jsonZodSchema() {
|
|
11
|
+
return ${imports.z}.discriminatedUnion("${this._discriminantProperty.name}", [${joinCode(this.concreteMemberTypes.map((memberType) => memberType.jsonZodSchema({ context: "type" })), { on: ", " })}]);
|
|
12
|
+
}`);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ObjectUnionType_jsonZodSchemaFunctionDeclaration.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function ObjectUnionType_sparqlConstructTriplesFunctionDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { pascalCase } from "change-case";
|
|
2
|
+
import { Maybe } from "purify-ts";
|
|
3
|
+
import { imports } from "../imports.js";
|
|
4
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
5
|
+
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
6
|
+
export function ObjectUnionType_sparqlConstructTriplesFunctionDeclaration() {
|
|
7
|
+
if (!this.features.has("sparql")) {
|
|
8
|
+
return Maybe.empty();
|
|
9
|
+
}
|
|
10
|
+
return Maybe.of(code `\
|
|
11
|
+
export function ${syntheticNamePrefix}sparqlConstructTriples({ filter, focusIdentifier, variablePrefix }: { filter: ${this.filterType} | undefined; focusIdentifier: ${imports.NamedNode} | ${imports.Variable}; ignoreRdfType: boolean; variablePrefix: string }): readonly ${imports.sparqljs}.Triple[] {
|
|
12
|
+
return [${joinCode(this.concreteMemberTypes.map((memberType) => code `...${memberType.staticModuleName}.${syntheticNamePrefix}sparqlConstructTriples({ filter: filter?.on?.${memberType.name}, focusIdentifier, ignoreRdfType: false, variablePrefix: \`\${variablePrefix}${pascalCase(memberType.name)}\` }).concat()`), { on: ", " })}];
|
|
13
|
+
}`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function ObjectUnionType_sparqlWherePatternsFunctionDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=ObjectUnionType_sparqlWherePatternsFunctionDeclaration.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { pascalCase } from "change-case";
|
|
2
|
+
import { Maybe } from "purify-ts";
|
|
3
|
+
import { imports } from "../imports.js";
|
|
4
|
+
import { snippets } from "../snippets.js";
|
|
5
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
6
|
+
import { code, joinCode, literalOf } from "../ts-poet-wrapper.js";
|
|
7
|
+
export function ObjectUnionType_sparqlWherePatternsFunctionDeclaration() {
|
|
8
|
+
if (!this.features.has("sparql")) {
|
|
9
|
+
return Maybe.empty();
|
|
10
|
+
}
|
|
11
|
+
return Maybe.of(code `\
|
|
12
|
+
export function ${syntheticNamePrefix}sparqlWherePatterns({ filter, focusIdentifier, preferredLanguages, variablePrefix }: { filter: ${this.filterType} | undefined; focusIdentifier: ${imports.NamedNode} | ${imports.Variable}; ignoreRdfType: boolean; preferredLanguages: readonly string[] | undefined; variablePrefix: string }): readonly ${snippets.SparqlPattern}[] {
|
|
13
|
+
${joinCode([
|
|
14
|
+
code `let patterns: ${snippets.SparqlPattern}[] = [];`,
|
|
15
|
+
code `\
|
|
16
|
+
if (focusIdentifier.termType === "Variable") {
|
|
17
|
+
patterns = patterns.concat(${this.identifierType.sparqlWherePatternsFunction}({
|
|
18
|
+
filter: filter?.${syntheticNamePrefix}identifier,
|
|
19
|
+
ignoreRdfType: false,
|
|
20
|
+
preferredLanguages,
|
|
21
|
+
propertyPatterns: [],
|
|
22
|
+
schema: ${this.identifierType.schema},
|
|
23
|
+
valueVariable: focusIdentifier,
|
|
24
|
+
variablePrefix,
|
|
25
|
+
}));
|
|
26
|
+
}`,
|
|
27
|
+
code `patterns.push({ patterns: [${joinCode(this.concreteMemberTypes.map((memberType) => code `${{
|
|
28
|
+
patterns: code `${memberType.staticModuleName}.${syntheticNamePrefix}sparqlWherePatterns({ filter: filter?.on?.${memberType.name}, focusIdentifier, ignoreRdfType: false, preferredLanguages, variablePrefix: \`\${variablePrefix}${pascalCase(memberType.name)}\` }).concat()`,
|
|
29
|
+
type: literalOf("group"),
|
|
30
|
+
}}`), { on: ", " })}], type: "union" });`,
|
|
31
|
+
code `return patterns;`,
|
|
32
|
+
])}
|
|
33
|
+
}`);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=ObjectUnionType_sparqlWherePatternsFunctionDeclaration.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import { type Code } from "ts-poet";
|
|
3
|
+
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
4
|
+
export declare function ObjectUnionType_toJsonFunctionDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=ObjectUnionType_toJsonFunctionDeclaration.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import { code, joinCode } from "ts-poet";
|
|
3
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
4
|
+
export function ObjectUnionType_toJsonFunctionDeclaration() {
|
|
5
|
+
if (!this.features.has("json")) {
|
|
6
|
+
return Maybe.empty();
|
|
7
|
+
}
|
|
8
|
+
return Maybe.of(code `\
|
|
9
|
+
export function ${syntheticNamePrefix}toJson(${this.thisVariable}: ${this.name}): ${this.jsonType().name} {
|
|
10
|
+
${joinCode(this.concreteMemberTypes
|
|
11
|
+
.map((memberType) => {
|
|
12
|
+
let returnExpression;
|
|
13
|
+
switch (memberType.declarationType) {
|
|
14
|
+
case "class":
|
|
15
|
+
returnExpression = code `${this.thisVariable}.${syntheticNamePrefix}toJson()`;
|
|
16
|
+
break;
|
|
17
|
+
case "interface":
|
|
18
|
+
returnExpression = code `${memberType.staticModuleName}.${syntheticNamePrefix}toJson(${this.thisVariable})`;
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
return code `if (${memberType.staticModuleName}.is${memberType.name}(${this.thisVariable})) { return ${returnExpression}; }`;
|
|
22
|
+
})
|
|
23
|
+
.concat(code `throw new Error("unrecognized type");`))}
|
|
24
|
+
}`);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=ObjectUnionType_toJsonFunctionDeclaration.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function ObjectUnionType_toRdfFunctionDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=ObjectUnionType_toRdfFunctionDeclarations.d.ts.map
|
|
@@ -1,29 +1,12 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
1
2
|
import { codeEquals } from "../codeEquals.js";
|
|
2
3
|
import { imports } from "../imports.js";
|
|
3
|
-
import { snippets } from "../snippets.js";
|
|
4
4
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
5
5
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
6
|
-
function
|
|
7
|
-
return code `\
|
|
8
|
-
export function ${syntheticNamePrefix}fromRdf(resource: ${imports.Resource}, options?: ${snippets.FromRdfOptions}): ${imports.Either}<Error, ${this.name}> {
|
|
9
|
-
return ${this.concreteMemberTypes.reduce((expression, memberType) => {
|
|
10
|
-
const memberTypeExpression = code `(${memberType.staticModuleName}.${syntheticNamePrefix}fromRdf(resource, { ...options, ignoreRdfType: false }) as ${imports.Either}<Error, ${this.name}>)`;
|
|
11
|
-
return expression !== null
|
|
12
|
-
? code `${expression}.altLazy(() => ${memberTypeExpression})`
|
|
13
|
-
: memberTypeExpression;
|
|
14
|
-
}, null)};
|
|
15
|
-
}`;
|
|
16
|
-
}
|
|
17
|
-
export function rdfFunctionDeclarations() {
|
|
6
|
+
export function ObjectUnionType_toRdfFunctionDeclaration() {
|
|
18
7
|
if (!this.features.has("rdf")) {
|
|
19
|
-
return
|
|
8
|
+
return Maybe.empty();
|
|
20
9
|
}
|
|
21
|
-
return [
|
|
22
|
-
ObjectUnionType_fromRdfFunctionDeclaration.bind(this)(),
|
|
23
|
-
ObjectUnionType_toRdfFunctionDeclaration.bind(this)(),
|
|
24
|
-
];
|
|
25
|
-
}
|
|
26
|
-
function ObjectUnionType_toRdfFunctionDeclaration() {
|
|
27
10
|
const parametersVariable = "_parameters";
|
|
28
11
|
const returnType = () => {
|
|
29
12
|
let returnType;
|
|
@@ -39,7 +22,7 @@ function ObjectUnionType_toRdfFunctionDeclaration() {
|
|
|
39
22
|
// The types agree
|
|
40
23
|
return returnType;
|
|
41
24
|
};
|
|
42
|
-
return code `\
|
|
25
|
+
return Maybe.of(code `\
|
|
43
26
|
export function ${syntheticNamePrefix}toRdf(${this.thisVariable}: ${this.name}, ${parametersVariable}?: { graph?: Exclude<${imports.Quad_Graph}, ${imports.Variable}>, resourceSet?: ${imports.ResourceSet} }): ${returnType()} {
|
|
44
27
|
${joinCode(this.concreteMemberTypes
|
|
45
28
|
.map((memberType) => {
|
|
@@ -55,6 +38,6 @@ ${joinCode(this.concreteMemberTypes
|
|
|
55
38
|
return code `if (${memberType.staticModuleName}.is${memberType.name}(${this.thisVariable})) { return ${returnExpression}; }`;
|
|
56
39
|
})
|
|
57
40
|
.concat(code `throw new Error("unrecognized type");`))}
|
|
58
|
-
}
|
|
41
|
+
}`);
|
|
59
42
|
}
|
|
60
|
-
//# sourceMappingURL=
|
|
43
|
+
//# sourceMappingURL=ObjectUnionType_toRdfFunctionDeclarations.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./Compiler.js";
|
|
|
3
3
|
export type { Generator } from "./generators/Generator.js";
|
|
4
4
|
export { AstJsonGenerator } from "./generators/json/AstJsonGenerator.js";
|
|
5
5
|
export { TsGenerator } from "./generators/ts/TsGenerator.js";
|
|
6
|
+
export { ZodGenerator } from "./generators/ts/ZodGenerator.js";
|
|
6
7
|
export * from "./input/ShapesGraph.js";
|
|
7
8
|
export * from "./ShapesGraphToAstTransformer.js";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * as ast from "./ast/index.js";
|
|
|
2
2
|
export * from "./Compiler.js";
|
|
3
3
|
export { AstJsonGenerator } from "./generators/json/AstJsonGenerator.js";
|
|
4
4
|
export { TsGenerator } from "./generators/ts/TsGenerator.js";
|
|
5
|
+
export { ZodGenerator } from "./generators/ts/ZodGenerator.js";
|
|
5
6
|
export * from "./input/ShapesGraph.js";
|
|
6
7
|
export * from "./ShapesGraphToAstTransformer.js";
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import type { NamedNode } from "@rdfjs/types";
|
|
2
|
-
import { NodeShape as
|
|
2
|
+
import { NodeShape as ShaclAstNodeShape } from "@shaclmate/shacl-ast";
|
|
3
3
|
import { Either, type Maybe } from "purify-ts";
|
|
4
4
|
import type { IdentifierMintingStrategy } from "../enums/IdentifierMintingStrategy.js";
|
|
5
5
|
import type { TsObjectDeclarationType } from "../enums/TsObjectDeclarationType.js";
|
|
6
6
|
import type * as generated from "./generated.js";
|
|
7
7
|
import type { Ontology, PropertyGroup, PropertyShape, ShapesGraph } from "./index.js";
|
|
8
8
|
import type { Shape } from "./Shape.js";
|
|
9
|
-
export declare class NodeShape extends
|
|
9
|
+
export declare class NodeShape extends ShaclAstNodeShape<any, Ontology, PropertyGroup, PropertyShape, Shape> {
|
|
10
10
|
private readonly ancestorClassIris;
|
|
11
11
|
private readonly childClassIris;
|
|
12
12
|
private readonly descendantClassIris;
|
|
13
|
-
private readonly
|
|
13
|
+
private readonly generatedNodeShape;
|
|
14
14
|
private readonly parentClassIris;
|
|
15
15
|
readonly isClass: boolean;
|
|
16
16
|
readonly isList: boolean;
|
|
17
17
|
readonly kind = "NodeShape";
|
|
18
|
-
constructor({ ancestorClassIris, childClassIris, descendantClassIris,
|
|
18
|
+
constructor({ ancestorClassIris, childClassIris, descendantClassIris, generatedNodeShape, isClass, isList, parentClassIris, shapesGraph, }: {
|
|
19
19
|
ancestorClassIris: readonly NamedNode[];
|
|
20
|
-
|
|
20
|
+
generatedNodeShape: generated.NodeShape;
|
|
21
21
|
childClassIris: readonly NamedNode[];
|
|
22
22
|
descendantClassIris: readonly NamedNode[];
|
|
23
23
|
isClass: boolean;
|
package/dist/input/NodeShape.js
CHANGED
|
@@ -4,22 +4,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { NodeShape as
|
|
7
|
+
import { NodeShape as ShaclAstNodeShape } from "@shaclmate/shacl-ast";
|
|
8
8
|
import { rdf } from "@tpluscode/rdf-ns-builders";
|
|
9
9
|
import { Either, List } from "purify-ts";
|
|
10
10
|
import { invariant } from "ts-invariant";
|
|
11
11
|
import { Memoize } from "typescript-memoize";
|
|
12
|
-
export class NodeShape extends
|
|
12
|
+
export class NodeShape extends ShaclAstNodeShape {
|
|
13
13
|
ancestorClassIris;
|
|
14
14
|
childClassIris;
|
|
15
15
|
descendantClassIris;
|
|
16
|
-
|
|
16
|
+
generatedNodeShape;
|
|
17
17
|
parentClassIris;
|
|
18
18
|
isClass;
|
|
19
19
|
isList;
|
|
20
20
|
kind = "NodeShape";
|
|
21
|
-
constructor({ ancestorClassIris, childClassIris, descendantClassIris,
|
|
22
|
-
super(
|
|
21
|
+
constructor({ ancestorClassIris, childClassIris, descendantClassIris, generatedNodeShape, isClass, isList, parentClassIris, shapesGraph, }) {
|
|
22
|
+
super(generatedNodeShape, shapesGraph);
|
|
23
23
|
if (ancestorClassIris.length > 0 ||
|
|
24
24
|
childClassIris.length > 0 ||
|
|
25
25
|
descendantClassIris.length > 0 ||
|
|
@@ -30,13 +30,13 @@ export class NodeShape extends ShaclCoreNodeShape {
|
|
|
30
30
|
this.ancestorClassIris = ancestorClassIris;
|
|
31
31
|
this.childClassIris = childClassIris;
|
|
32
32
|
this.descendantClassIris = descendantClassIris;
|
|
33
|
-
this.
|
|
33
|
+
this.generatedNodeShape = generatedNodeShape;
|
|
34
34
|
this.isClass = isClass;
|
|
35
35
|
this.isList = isList;
|
|
36
36
|
this.parentClassIris = parentClassIris;
|
|
37
37
|
}
|
|
38
38
|
get abstract() {
|
|
39
|
-
return this.
|
|
39
|
+
return this.generatedNodeShape.abstract;
|
|
40
40
|
}
|
|
41
41
|
get ancestorNodeShapes() {
|
|
42
42
|
return Either.sequence(this.ancestorClassIris
|
|
@@ -53,22 +53,22 @@ export class NodeShape extends ShaclCoreNodeShape {
|
|
|
53
53
|
return Either.sequence(this.descendantClassIris.flatMap((classIri) => this.shapesGraph.nodeShapeByIdentifier(classIri)));
|
|
54
54
|
}
|
|
55
55
|
get discriminantValue() {
|
|
56
|
-
return this.
|
|
56
|
+
return this.generatedNodeShape.discriminantValue;
|
|
57
57
|
}
|
|
58
58
|
get export() {
|
|
59
|
-
return this.
|
|
59
|
+
return this.generatedNodeShape.export_;
|
|
60
60
|
}
|
|
61
61
|
get extern() {
|
|
62
|
-
return this.
|
|
62
|
+
return this.generatedNodeShape.extern;
|
|
63
63
|
}
|
|
64
64
|
get fromRdfType() {
|
|
65
|
-
return this.
|
|
65
|
+
return this.generatedNodeShape.fromRdfType;
|
|
66
66
|
}
|
|
67
67
|
get identifierIn() {
|
|
68
68
|
return this.constraints.in_.filter((value) => value.termType === "NamedNode");
|
|
69
69
|
}
|
|
70
70
|
get identifierMintingStrategy() {
|
|
71
|
-
return this.
|
|
71
|
+
return this.generatedNodeShape.identifierMintingStrategy.map((iri) => {
|
|
72
72
|
switch (iri.value) {
|
|
73
73
|
case "http://purl.org/shaclmate/ontology#_IdentifierMintingStrategy_BlankNode":
|
|
74
74
|
return "blankNode";
|
|
@@ -86,7 +86,7 @@ export class NodeShape extends ShaclCoreNodeShape {
|
|
|
86
86
|
return List.head(this.labels);
|
|
87
87
|
}
|
|
88
88
|
get mutable() {
|
|
89
|
-
return this.
|
|
89
|
+
return this.generatedNodeShape.mutable;
|
|
90
90
|
}
|
|
91
91
|
get parentNodeShapes() {
|
|
92
92
|
return Either.sequence(this.parentClassIris
|
|
@@ -94,25 +94,25 @@ export class NodeShape extends ShaclCoreNodeShape {
|
|
|
94
94
|
.map((classIri) => this.shapesGraph.nodeShapeByIdentifier(classIri)));
|
|
95
95
|
}
|
|
96
96
|
get rdfType() {
|
|
97
|
-
return this.
|
|
97
|
+
return this.generatedNodeShape.rdfType;
|
|
98
98
|
}
|
|
99
99
|
get shaclmateName() {
|
|
100
|
-
return this.
|
|
100
|
+
return this.generatedNodeShape.name;
|
|
101
101
|
}
|
|
102
102
|
get toRdfTypes() {
|
|
103
|
-
return this.
|
|
103
|
+
return this.generatedNodeShape.toRdfTypes;
|
|
104
104
|
}
|
|
105
105
|
get tsFeatureExcludes() {
|
|
106
|
-
return this.
|
|
106
|
+
return this.generatedNodeShape.tsFeatureExcludes;
|
|
107
107
|
}
|
|
108
108
|
get tsFeatureIncludes() {
|
|
109
|
-
return this.
|
|
109
|
+
return this.generatedNodeShape.tsFeatureIncludes;
|
|
110
110
|
}
|
|
111
111
|
get tsImports() {
|
|
112
|
-
return this.
|
|
112
|
+
return this.generatedNodeShape.tsImports;
|
|
113
113
|
}
|
|
114
114
|
get tsObjectDeclarationType() {
|
|
115
|
-
return this.
|
|
115
|
+
return this.generatedNodeShape.tsObjectDeclarationType.map((iri) => {
|
|
116
116
|
switch (iri.value) {
|
|
117
117
|
case "http://purl.org/shaclmate/ontology#_TsObjectDeclarationType_Class":
|
|
118
118
|
return "class";
|
package/dist/input/Ontology.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Ontology as
|
|
1
|
+
import { Ontology as ShaclAstOntology } from "@shaclmate/shacl-ast";
|
|
2
2
|
import type { Maybe } from "purify-ts";
|
|
3
3
|
import type { TsObjectDeclarationType } from "../enums/TsObjectDeclarationType.js";
|
|
4
4
|
import type * as generated from "./generated.js";
|
|
5
|
-
export declare class Ontology extends
|
|
6
|
-
private readonly
|
|
7
|
-
constructor(
|
|
5
|
+
export declare class Ontology extends ShaclAstOntology {
|
|
6
|
+
private readonly _generatedOntology;
|
|
7
|
+
constructor(_generatedOntology: generated.Ontology);
|
|
8
8
|
get tsFeatureExcludes(): readonly import("@rdfjs/types").NamedNode<"http://purl.org/shaclmate/ontology#_TsFeatures_All" | "http://purl.org/shaclmate/ontology#_TsFeature_Create" | "http://purl.org/shaclmate/ontology#_TsFeatures_Default" | "http://purl.org/shaclmate/ontology#_TsFeature_Equals" | "http://purl.org/shaclmate/ontology#_TsFeature_Graphql" | "http://purl.org/shaclmate/ontology#_TsFeature_Hash" | "http://purl.org/shaclmate/ontology#_TsFeature_Json" | "http://purl.org/shaclmate/ontology#_TsFeatures_None" | "http://purl.org/shaclmate/ontology#_TsFeature_Rdf" | "http://purl.org/shaclmate/ontology#_TsFeature_Sparql">[];
|
|
9
9
|
get tsFeatureIncludes(): readonly import("@rdfjs/types").NamedNode<"http://purl.org/shaclmate/ontology#_TsFeatures_All" | "http://purl.org/shaclmate/ontology#_TsFeature_Create" | "http://purl.org/shaclmate/ontology#_TsFeatures_Default" | "http://purl.org/shaclmate/ontology#_TsFeature_Equals" | "http://purl.org/shaclmate/ontology#_TsFeature_Graphql" | "http://purl.org/shaclmate/ontology#_TsFeature_Hash" | "http://purl.org/shaclmate/ontology#_TsFeature_Json" | "http://purl.org/shaclmate/ontology#_TsFeatures_None" | "http://purl.org/shaclmate/ontology#_TsFeature_Rdf" | "http://purl.org/shaclmate/ontology#_TsFeature_Sparql">[];
|
|
10
10
|
get tsImports(): readonly string[];
|
package/dist/input/Ontology.js
CHANGED
|
@@ -4,25 +4,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { Ontology as
|
|
7
|
+
import { Ontology as ShaclAstOntology } from "@shaclmate/shacl-ast";
|
|
8
8
|
import { Memoize } from "typescript-memoize";
|
|
9
|
-
export class Ontology extends
|
|
10
|
-
|
|
11
|
-
constructor(
|
|
12
|
-
super(
|
|
13
|
-
this.
|
|
9
|
+
export class Ontology extends ShaclAstOntology {
|
|
10
|
+
_generatedOntology;
|
|
11
|
+
constructor(_generatedOntology) {
|
|
12
|
+
super(_generatedOntology);
|
|
13
|
+
this._generatedOntology = _generatedOntology;
|
|
14
14
|
}
|
|
15
15
|
get tsFeatureExcludes() {
|
|
16
|
-
return this.
|
|
16
|
+
return this._generatedOntology.tsFeatureExcludes;
|
|
17
17
|
}
|
|
18
18
|
get tsFeatureIncludes() {
|
|
19
|
-
return this.
|
|
19
|
+
return this._generatedOntology.tsFeatureIncludes;
|
|
20
20
|
}
|
|
21
21
|
get tsImports() {
|
|
22
|
-
return this.
|
|
22
|
+
return this._generatedOntology.tsImports;
|
|
23
23
|
}
|
|
24
24
|
get tsObjectDeclarationType() {
|
|
25
|
-
return this.
|
|
25
|
+
return this._generatedOntology.tsObjectDeclarationType.map((iri) => {
|
|
26
26
|
switch (iri.value) {
|
|
27
27
|
case "http://purl.org/shaclmate/ontology#_TsObjectDeclarationType_Class":
|
|
28
28
|
return "class";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { PropertyShape as
|
|
1
|
+
import { PropertyShape as ShaclAstPropertyShape } from "@shaclmate/shacl-ast";
|
|
2
2
|
import { Either, Maybe } from "purify-ts";
|
|
3
3
|
import type { PropertyVisibility } from "../enums/PropertyVisibility.js";
|
|
4
4
|
import type * as generated from "./generated.js";
|
|
5
5
|
import type { NodeShape, Ontology, PropertyGroup, ShapesGraph } from "./index.js";
|
|
6
6
|
import type { Shape } from "./Shape.js";
|
|
7
|
-
export declare class PropertyShape extends
|
|
8
|
-
private readonly
|
|
7
|
+
export declare class PropertyShape extends ShaclAstPropertyShape<NodeShape, Ontology, PropertyGroup, any, Shape> {
|
|
8
|
+
private readonly _generatedPropertyShape;
|
|
9
9
|
readonly kind = "PropertyShape";
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(_generatedPropertyShape: generated.PropertyShape, shapesGraph: ShapesGraph);
|
|
11
11
|
get comment(): Maybe<string>;
|
|
12
12
|
get description(): Maybe<string>;
|
|
13
13
|
get label(): Maybe<string>;
|
|
@@ -4,15 +4,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { PropertyShape as
|
|
7
|
+
import { PropertyShape as ShaclAstPropertyShape } from "@shaclmate/shacl-ast";
|
|
8
8
|
import { Either, List, Maybe } from "purify-ts";
|
|
9
9
|
import { Memoize } from "typescript-memoize";
|
|
10
|
-
export class PropertyShape extends
|
|
11
|
-
|
|
10
|
+
export class PropertyShape extends ShaclAstPropertyShape {
|
|
11
|
+
_generatedPropertyShape;
|
|
12
12
|
kind = "PropertyShape";
|
|
13
|
-
constructor(
|
|
14
|
-
super({ ...
|
|
15
|
-
this.
|
|
13
|
+
constructor(_generatedPropertyShape, shapesGraph) {
|
|
14
|
+
super({ ..._generatedPropertyShape, uniqueLang: Maybe.empty() }, shapesGraph);
|
|
15
|
+
this._generatedPropertyShape = _generatedPropertyShape;
|
|
16
16
|
}
|
|
17
17
|
get comment() {
|
|
18
18
|
return List.head(this.comments);
|
|
@@ -24,13 +24,13 @@ export class PropertyShape extends ShaclCorePropertyShape {
|
|
|
24
24
|
return List.head(this.labels);
|
|
25
25
|
}
|
|
26
26
|
get mutable() {
|
|
27
|
-
return this.
|
|
27
|
+
return this._generatedPropertyShape.mutable;
|
|
28
28
|
}
|
|
29
29
|
get name() {
|
|
30
30
|
return List.head(this.names);
|
|
31
31
|
}
|
|
32
32
|
get resolve() {
|
|
33
|
-
const identifier = this.
|
|
33
|
+
const identifier = this._generatedPropertyShape.resolve.extract();
|
|
34
34
|
return identifier
|
|
35
35
|
? this.shapesGraph
|
|
36
36
|
.nodeShapeByIdentifier(identifier)
|
|
@@ -38,10 +38,10 @@ export class PropertyShape extends ShaclCorePropertyShape {
|
|
|
38
38
|
: Either.of(Maybe.empty());
|
|
39
39
|
}
|
|
40
40
|
get shaclmateName() {
|
|
41
|
-
return this.
|
|
41
|
+
return this._generatedPropertyShape.name;
|
|
42
42
|
}
|
|
43
43
|
get visibility() {
|
|
44
|
-
return this.
|
|
44
|
+
return this._generatedPropertyShape.visibility
|
|
45
45
|
.map((iri) => {
|
|
46
46
|
switch (iri.value) {
|
|
47
47
|
case "http://purl.org/shaclmate/ontology#_Visibility_Private":
|