@traqula/rules-sparql-1-1-adjust 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
@@ -9550,10 +9550,16 @@ function resolveIRI(iri3, base) {
9550
9550
  return base.replace(/(?:\?.*)?$/u, iri3);
9551
9551
  // Resolve root relative IRIs at the root of the base IRI
9552
9552
  case "/":
9553
- return base + iri3;
9553
+ const baseMatch = base.match(/^(?:[a-z]+:\/*)?[^\/]*/);
9554
+ if (!baseMatch) {
9555
+ throw new Error(`Could not determine relative IRI using base: ${base}`);
9556
+ }
9557
+ const baseRoot = baseMatch[0];
9558
+ return baseRoot + iri3;
9554
9559
  // Resolve all other IRIs at the base IRI's path
9555
9560
  default:
9556
- return base + iri3;
9561
+ const basePath = base.replace(/[^\/:]*$/, "");
9562
+ return basePath + iri3;
9557
9563
  }
9558
9564
  }
9559
9565
 
@@ -10418,12 +10424,6 @@ var blankNode = {
10418
10424
  {
10419
10425
  ALT: () => {
10420
10426
  const label = CONSUME(terminals_exports.blankNodeLabel).image;
10421
- ACTION(() => {
10422
- if (context.flushedBlankNodeLabels.has(label)) {
10423
- throw new Error("Detected reuse blank node across different request string.");
10424
- }
10425
- context.usedBlankNodeLabels.add(label);
10426
- });
10427
10427
  return ACTION(() => context.dataFactory.blankNode(label.replace("_:", "e_")));
10428
10428
  }
10429
10429
  },
@@ -10847,9 +10847,10 @@ var graphNodePath = graphNodeImpl("graphNodePath", true);
10847
10847
  // ../rules-sparql-1-1/lib/grammar/general.ts
10848
10848
  var prologue = {
10849
10849
  name: "prologue",
10850
- impl: ({ ACTION, SUBRULE, MANY, OR }) => () => {
10850
+ impl: ({ ACTION, SUBRULE, MANY, OR, context }) => () => {
10851
10851
  const result = {
10852
- prefixes: {}
10852
+ prefixes: {},
10853
+ ...context.baseIRI && { base: context.baseIRI }
10853
10854
  };
10854
10855
  MANY(() => {
10855
10856
  OR([
@@ -12651,6 +12652,7 @@ var updateUnit = {
12651
12652
  var update = {
12652
12653
  name: "update",
12653
12654
  impl: ({ ACTION, SUBRULE, CONSUME, OPTION1, OPTION2, context }) => () => {
12655
+ const blankLabelsUsedInInsertData = /* @__PURE__ */ new Set();
12654
12656
  const prologueValues = SUBRULE(prologue);
12655
12657
  const result = {
12656
12658
  type: "update",
@@ -12660,12 +12662,6 @@ var update = {
12660
12662
  };
12661
12663
  OPTION1(() => {
12662
12664
  const updateOperation = SUBRULE(update1);
12663
- ACTION(() => {
12664
- for (const label of context.usedBlankNodeLabels) {
12665
- context.flushedBlankNodeLabels.add(label);
12666
- }
12667
- context.usedBlankNodeLabels.clear();
12668
- });
12669
12665
  const recursiveRes = OPTION2(() => {
12670
12666
  CONSUME(symbols_exports.semi);
12671
12667
  return SUBRULE(update);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@traqula/rules-sparql-1-1-adjust",
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.1-ADJUST",
5
5
  "lsd:module": true,
6
6
  "license": "MIT",
@@ -38,8 +38,8 @@
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
- "gitHead": "d75283cbc0fd63d4fc4314c51db00e834b2ee7e0"
44
+ "gitHead": "7e8a4c4897f112e7291b733121a83726bacfdd0b"
45
45
  }