@traqula/rules-sparql-1-2 0.0.1-alpha.140 → 0.0.1-alpha.143

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.
Files changed (2) hide show
  1. package/lib/index.cjs +12 -16
  2. package/package.json +4 -4
package/lib/index.cjs CHANGED
@@ -9327,10 +9327,16 @@ function resolveIRI(iri3, base) {
9327
9327
  return base.replace(/(?:\?.*)?$/u, iri3);
9328
9328
  // Resolve root relative IRIs at the root of the base IRI
9329
9329
  case "/":
9330
- return base + iri3;
9330
+ const baseMatch = base.match(/^(?:[a-z]+:\/*)?[^\/]*/);
9331
+ if (!baseMatch) {
9332
+ throw new Error(`Could not determine relative IRI using base: ${base}`);
9333
+ }
9334
+ const baseRoot = baseMatch[0];
9335
+ return baseRoot + iri3;
9331
9336
  // Resolve all other IRIs at the base IRI's path
9332
9337
  default:
9333
- return base + iri3;
9338
+ const basePath = base.replace(/[^\/:]*$/, "");
9339
+ return basePath + iri3;
9334
9340
  }
9335
9341
  }
9336
9342
 
@@ -10535,12 +10541,6 @@ var blankNode = {
10535
10541
  {
10536
10542
  ALT: () => {
10537
10543
  const label = CONSUME(terminals_exports.blankNodeLabel).image;
10538
- ACTION(() => {
10539
- if (context.flushedBlankNodeLabels.has(label)) {
10540
- throw new Error("Detected reuse blank node across different request string.");
10541
- }
10542
- context.usedBlankNodeLabels.add(label);
10543
- });
10544
10544
  return ACTION(() => context.dataFactory.blankNode(label.replace("_:", "e_")));
10545
10545
  }
10546
10546
  },
@@ -10964,9 +10964,10 @@ var graphNodePath = graphNodeImpl("graphNodePath", true);
10964
10964
  // ../rules-sparql-1-1/lib/grammar/general.ts
10965
10965
  var prologue = {
10966
10966
  name: "prologue",
10967
- impl: ({ ACTION, SUBRULE, MANY, OR }) => () => {
10967
+ impl: ({ ACTION, SUBRULE, MANY, OR, context }) => () => {
10968
10968
  const result = {
10969
- prefixes: {}
10969
+ prefixes: {},
10970
+ ...context.baseIRI && { base: context.baseIRI }
10970
10971
  };
10971
10972
  MANY(() => {
10972
10973
  OR([
@@ -12768,6 +12769,7 @@ var updateUnit = {
12768
12769
  var update = {
12769
12770
  name: "update",
12770
12771
  impl: ({ ACTION, SUBRULE, CONSUME, OPTION1, OPTION2, context }) => () => {
12772
+ const blankLabelsUsedInInsertData = /* @__PURE__ */ new Set();
12771
12773
  const prologueValues = SUBRULE(prologue);
12772
12774
  const result = {
12773
12775
  type: "update",
@@ -12777,12 +12779,6 @@ var update = {
12777
12779
  };
12778
12780
  OPTION1(() => {
12779
12781
  const updateOperation = SUBRULE(update1);
12780
- ACTION(() => {
12781
- for (const label of context.usedBlankNodeLabels) {
12782
- context.flushedBlankNodeLabels.add(label);
12783
- }
12784
- context.usedBlankNodeLabels.clear();
12785
- });
12786
12782
  const recursiveRes = OPTION2(() => {
12787
12783
  CONSUME(symbols_exports.semi);
12788
12784
  return SUBRULE(update);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@traqula/rules-sparql-1-2",
3
- "version": "0.0.1-alpha.140+d75283c",
3
+ "version": "0.0.1-alpha.143+7e8a4c4",
4
4
  "description": "TRAQULA Lexer and Grammar Rules for sparql 1.2",
5
5
  "lsd:module": true,
6
6
  "license": "MIT",
@@ -38,11 +38,11 @@
38
38
  "build:transpile": " node \"../../node_modules/esbuild/bin/esbuild\" --format=cjs --bundle --log-level=error --outfile=lib/index.cjs lib/index.ts"
39
39
  },
40
40
  "dependencies": {
41
- "@traqula/core": "^0.0.1-alpha.140+d75283c",
42
- "@traqula/rules-sparql-1-1": "^0.0.1-alpha.140+d75283c"
41
+ "@traqula/core": "^0.0.1-alpha.143+7e8a4c4",
42
+ "@traqula/rules-sparql-1-1": "^0.0.1-alpha.143+7e8a4c4"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@rdfjs/types": "^2.0.0"
46
46
  },
47
- "gitHead": "d75283cbc0fd63d4fc4314c51db00e834b2ee7e0"
47
+ "gitHead": "7e8a4c4897f112e7291b733121a83726bacfdd0b"
48
48
  }