@shaclmate/compiler 4.0.4 → 4.0.5

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.
@@ -201,10 +201,10 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
201
201
  return code `typeof ${this.schema}`;
202
202
  }
203
203
  get sparqlConstructTriplesFunction() {
204
- return code `(({ ignoreRdfType, schema, ...otherParameters }: ${snippets.SparqlConstructTriplesFunctionParameters}<${this.filterType}, ${this.schemaType}>) => ${this.staticModuleName}.${syntheticNamePrefix}sparqlConstructTriples({ ignoreRdfType: ignoreRdfType ?? true, ...otherParameters }))`;
204
+ return code `(({ filter, ignoreRdfType, valueVariable, variablePrefix }: ${snippets.SparqlConstructTriplesFunctionParameters}<${this.filterType}, ${this.schemaType}>) => ${this.staticModuleName}.${syntheticNamePrefix}sparqlConstructTriples({ filter, focusIdentifier: valueVariable, ignoreRdfType: ignoreRdfType ?? true, variablePrefix }))`;
205
205
  }
206
206
  get sparqlWherePatternsFunction() {
207
- return code `(({ ignoreRdfType, propertyPatterns, schema, valueVariable, ...otherParameters }: ${snippets.SparqlWherePatternsFunctionParameters}<${this.filterType}, ${this.schemaType}>) => (propertyPatterns as readonly ${snippets.SparqlPattern}[]).concat(${this.staticModuleName}.${syntheticNamePrefix}sparqlWherePatterns({ focusIdentifier: valueVariable, ignoreRdfType: ignoreRdfType ?? true, ...otherParameters })))`;
207
+ return code `(({ filter, ignoreRdfType, propertyPatterns, valueVariable, variablePrefix }: ${snippets.SparqlWherePatternsFunctionParameters}<${this.filterType}, ${this.schemaType}>) => (propertyPatterns as readonly ${snippets.SparqlPattern}[]).concat(${this.staticModuleName}.${syntheticNamePrefix}sparqlWherePatterns({ filter, focusIdentifier: valueVariable, ignoreRdfType: ignoreRdfType ?? true, variablePrefix })))`;
208
208
  }
209
209
  get toRdfjsResourceType() {
210
210
  if (this.parentObjectTypes.length > 0) {
@@ -294,7 +294,7 @@ ${memberType.discriminantValues.map((discriminantValue) => `case "${discriminant
294
294
  let triples: ${imports.sparqljs}.Triple[] = [];
295
295
 
296
296
  ${joinCode(this.memberTypes.map((memberType) => code `\
297
- triples = triples.concat(${memberType.sparqlConstructTriplesFunction}({ filter: filter?.on?.["${memberType.discriminantValues[0]}"], ignoreRdfType: false, schema: schema.members["${memberType.discriminantValues[0]}"].type, ...otherParameters }));`))}
297
+ triples = triples.concat(${memberType.sparqlConstructTriplesFunction}({ ...otherParameters, filter: filter?.on?.["${memberType.discriminantValues[0]}"], ignoreRdfType: false, schema: schema.members["${memberType.discriminantValues[0]}"].type }));`))}
298
298
 
299
299
  return triples;
300
300
  })`;
@@ -305,7 +305,7 @@ triples = triples.concat(${memberType.sparqlConstructTriplesFunction}({ filter:
305
305
  const unionPatterns: ${imports.sparqljs}.GroupPattern[] = [];
306
306
 
307
307
  ${joinCode(this.memberTypes.map((memberType) => code `\
308
- unionPatterns.push({ patterns: ${memberType.sparqlWherePatternsFunction}({ filter: filter?.on?.["${memberType.discriminantValues[0]}"], ignoreRdfType: false, schema: schema.members["${memberType.discriminantValues[0]}"].type, ...otherParameters }).concat(), type: "group" });`))}
308
+ unionPatterns.push({ patterns: ${memberType.sparqlWherePatternsFunction}({ ...otherParameters, filter: filter?.on?.["${memberType.discriminantValues[0]}"], ignoreRdfType: false, schema: schema.members["${memberType.discriminantValues[0]}"].type }).concat(), type: "group" });`))}
309
309
 
310
310
  return [{ patterns: unionPatterns, type: "union" }];
311
311
  })`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
- "@shaclmate/shacl-ast": "4.0.4",
3
+ "@shaclmate/shacl-ast": "4.0.5",
4
4
  "@rdfjs/data-model": "~2.1.1",
5
5
  "@rdfjs/dataset": "~2.0.2",
6
6
  "@rdfjs/prefix-map": "~0.1.2",
@@ -80,5 +80,5 @@
80
80
  },
81
81
  "type": "module",
82
82
  "types": "./dist/index.d.ts",
83
- "version": "4.0.4"
83
+ "version": "4.0.5"
84
84
  }