@traqula/rules-sparql-1-2 0.0.20 → 0.0.21

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/lib/grammar.d.ts CHANGED
@@ -57,12 +57,12 @@ export declare const triplesSameSubjectPath: SparqlGrammarRule<"triplesSameSubje
57
57
  * OVERRIDING RULE: {@link S11.object}.
58
58
  * [[86]](https://www.w3.org/TR/sparql12-query/#rObject) Used by ObjectList
59
59
  */
60
- export declare const object: SparqlGrammarRule<"object", TripleNesting, [GraphNode, T11.TermIriFull | T11.TermIriPrefixed | T11.TermVariable | T11.PropertyPathChain | T11.PathModified | T11.PathNegated]>;
60
+ export declare const object: SparqlGrammarRule<"object", TripleNesting, [GraphNode, T11.TermIriFull | T11.TermIriPrefixed | T11.TermVariable | T11.PathNegated | T11.PathModified | T11.PropertyPathChain]>;
61
61
  /**
62
62
  * OVERRIDING RULE: {@link S11.objectPath}.
63
63
  * [[87]](https://www.w3.org/TR/sparql12-query/#rTriplesSameSubjectPath) Used by ObjectListPath
64
64
  */
65
- export declare const objectPath: SparqlGrammarRule<"objectPath", TripleNesting, [GraphNode, T11.TermIriFull | T11.TermIriPrefixed | T11.TermVariable | T11.PropertyPathChain | T11.PathModified | T11.PathNegated]>;
65
+ export declare const objectPath: SparqlGrammarRule<"objectPath", TripleNesting, [GraphNode, T11.TermIriFull | T11.TermIriPrefixed | T11.TermVariable | T11.PathNegated | T11.PathModified | T11.PropertyPathChain]>;
66
66
  /**
67
67
  * [[109]](https://www.w3.org/TR/sparql12-query/#rAnnotationPath)
68
68
  */
package/lib/index.cjs CHANGED
@@ -9526,7 +9526,7 @@ var LexerBuilder = class _LexerBuilder {
9526
9526
  };
9527
9527
 
9528
9528
  // ../core/lib/TransformerObject.js
9529
- var TransformerObject = class {
9529
+ var TransformerObject = class _TransformerObject {
9530
9530
  defaultContext;
9531
9531
  maxStackSize = 1e6;
9532
9532
  /**
@@ -9536,12 +9536,15 @@ var TransformerObject = class {
9536
9536
  constructor(defaultContext = {}) {
9537
9537
  this.defaultContext = defaultContext;
9538
9538
  }
9539
+ clone(newDefaultContext = {}) {
9540
+ return new _TransformerObject({ ...this.defaultContext, ...newDefaultContext });
9541
+ }
9539
9542
  /**
9540
9543
  * Function to shallow clone any type.
9541
9544
  * @param obj
9542
9545
  * @protected
9543
9546
  */
9544
- clone(obj) {
9547
+ cloneObj(obj) {
9545
9548
  if (obj === null || typeof obj !== "object") {
9546
9549
  return obj;
9547
9550
  }
@@ -9616,7 +9619,7 @@ var TransformerObject = class {
9616
9619
  const ignoreKeys = context.ignoreKeys ?? defaultIgnoreKeys;
9617
9620
  const shallowKeys = context.shallowKeys ?? defaultShallowKeys;
9618
9621
  didShortCut = context.shortcut ?? defaultDidShortCut;
9619
- const copy3 = copyFlag ? this.clone(curObject) : curObject;
9622
+ const copy3 = copyFlag ? this.cloneObj(curObject) : curObject;
9620
9623
  handleMapperOnLen.push(stack.length);
9621
9624
  mapperCopyStack.push(copy3);
9622
9625
  mapperOrigStack.push(curObject);
@@ -9630,7 +9633,7 @@ var TransformerObject = class {
9630
9633
  const val = copy3[key];
9631
9634
  const onlyShallow = shallowKeys && shallowKeys?.has(key);
9632
9635
  if (onlyShallow) {
9633
- copy3[key] = this.clone(val);
9636
+ copy3[key] = this.cloneObj(val);
9634
9637
  }
9635
9638
  if (ignoreKeys && ignoreKeys.has(key)) {
9636
9639
  continue;
@@ -9711,12 +9714,15 @@ var TransformerObject = class {
9711
9714
  };
9712
9715
 
9713
9716
  // ../core/lib/TransformerTyped.js
9714
- var TransformerTyped = class extends TransformerObject {
9717
+ var TransformerTyped = class _TransformerTyped extends TransformerObject {
9715
9718
  defaultNodePreVisitor;
9716
9719
  constructor(defaultContext = {}, defaultNodePreVisitor = {}) {
9717
9720
  super(defaultContext);
9718
9721
  this.defaultNodePreVisitor = defaultNodePreVisitor;
9719
9722
  }
9723
+ clone(newDefaultContext = {}, newDefaultNodePreVisitor = {}) {
9724
+ return new _TransformerTyped({ ...this.defaultContext, ...newDefaultContext }, { ...this.defaultNodePreVisitor, ...newDefaultNodePreVisitor });
9725
+ }
9720
9726
  /**
9721
9727
  * Transform a single node.
9722
9728
  * The transformation calls the preVisitor from starting from the startObject.
@@ -9805,10 +9811,13 @@ var TransformerTyped = class extends TransformerObject {
9805
9811
  };
9806
9812
 
9807
9813
  // ../core/lib/TransformerSubTyped.js
9808
- var TransformerSubTyped = class extends TransformerTyped {
9814
+ var TransformerSubTyped = class _TransformerSubTyped extends TransformerTyped {
9809
9815
  constructor(defaultContext = {}, defaultNodePreVisitor = {}) {
9810
9816
  super(defaultContext, defaultNodePreVisitor);
9811
9817
  }
9818
+ clone(newDefaultContext = {}, newDefaultNodePreVisitor = {}) {
9819
+ return new _TransformerSubTyped({ ...this.defaultContext, ...newDefaultContext }, { ...this.defaultNodePreVisitor, ...newDefaultNodePreVisitor });
9820
+ }
9812
9821
  /**
9813
9822
  * Shares the functionality and first two arguments with {@link this.transformNode}.
9814
9823
  * The third argument allows you to also transform based on the subType of objects.
@@ -11559,8 +11568,7 @@ function findPatternBoundedVars(iter, boundedVars) {
11559
11568
  optional: (op) => ({ next: op.patterns }),
11560
11569
  service: (op) => ({ next: [op.name, ...op.patterns] }),
11561
11570
  bind: (op) => ({ next: [op.variable] }),
11562
- graph: (op) => ({ next: [op.name, ...op.patterns] }),
11563
- minus: (op) => ({ next: op.patterns.slice(0, 1) })
11571
+ graph: (op) => ({ next: [op.name, ...op.patterns] })
11564
11572
  },
11565
11573
  term: {
11566
11574
  variable: (op) => {
package/lib/lexer.d.ts CHANGED
@@ -17,4 +17,4 @@ export declare const buildInSUBJECT: import("@traqula/core").NamedToken<"BuiltIn
17
17
  export declare const buildInPREDICATE: import("@traqula/core").NamedToken<"BuiltInPredicate">;
18
18
  export declare const buildInOBJECT: import("@traqula/core").NamedToken<"BuiltInObject">;
19
19
  export declare const LANG_DIR: import("@traqula/core").NamedToken<"LANG_DIR">;
20
- export declare const sparql12LexerBuilder: LexerBuilder<"BuiltInStr" | "BuiltInLang" | "BuiltInLangmatches" | "BuiltInDatatype" | "BuiltInBound" | "BuiltInIri" | "BuiltInUri" | "BuiltInBnode" | "BuiltInRand" | "BuiltInAbs" | "BuiltInCeil" | "BuiltInFloor" | "BuiltInRound" | "BuiltInConcat" | "BuiltInStrlen" | "BuiltInUcase" | "BuiltInLcase" | "BuiltInEncode_for_uri" | "BuiltInContains" | "BuiltInStrstarts" | "BuiltInStrends" | "BuiltInStrbefore" | "BuiltInStrafter" | "BuiltInYear" | "BuiltInMonth" | "BuiltInDay" | "BuiltInHours" | "BuiltInMinutes" | "BuiltInSeconds" | "BuiltInTimezone" | "BuiltInTz" | "BuiltInNow" | "BuiltInUuid" | "BuiltInStruuid" | "BuiltInMd5" | "BuiltInSha1" | "BuiltInSha256" | "BuiltInSha384" | "BuiltInSha512" | "BuiltInCoalesce" | "BuiltInIf" | "BuiltInStrlang" | "BuiltInStrdt" | "BuiltInSameterm" | "BuiltInIsiri" | "BuiltInIsuri" | "BuiltInIsblank" | "BuiltInIsliteral" | "BuiltInIsnumeric" | "BuiltInRegex" | "BuiltInSubstr" | "BuiltInReplace" | "BuiltInExists" | "BuiltInNotexists" | "BuiltInCount" | "BuiltInSum" | "BuiltInMin" | "BuiltInMax" | "BuiltInAvg" | "BuiltInSample" | "BuiltInGroup_concat" | "NamedGraph" | "DefaultGraph" | "Graph" | "GraphAll" | "BaseDecl" | "PrefixDecl" | "Select" | "Distinct" | "Reduced" | "As" | "Construct" | "Describe" | "Ask" | "From" | "Where" | "GroupByGroup" | "By" | "Having" | "Order" | "OrderAsc" | "OrderDesc" | "Limit" | "Offset" | "Values" | "Load" | "Silent" | "LoadInto" | "Clear" | "Drop" | "Create" | "Add" | "To" | "Move" | "Copy" | "ModifyWith" | "DeleteDataClause" | "DeleteWhereClause" | "DeleteClause" | "InsertDataClause" | "InsertClause" | "UsingClause" | "Optional" | "Service" | "Bind" | "Undef" | "Minus" | "Union" | "Filter" | "a" | "True" | "False" | "In" | "NotIn" | "Separator" | "LCurly" | "RCurly" | "Dot" | "Comma" | "Semi" | "LParen" | "RParen" | "LSquare" | "RSquare" | "Pipe" | "Slash" | "Hat" | "Question" | "Star" | "OpPlus" | "OpMinus" | "Exclamation" | "LogicAnd" | "LogicOr" | "Equal" | "NotEqual" | "LessThan" | "GreaterThan" | "LessThanEqual" | "GreaterThanEqual" | "Hathat" | "IriRef" | "PNameLn" | "PNameNs" | "BlankNodeLabel" | "Var1" | "Var2" | "Integer" | "Decimal" | "Double" | "InterferePositive" | "DecimalPositive" | "DoublePositive" | "IntegerNegative" | "DecimalNegative" | "DoubleNegative" | "StringLiteral1" | "StringLiteral2" | "StringLiteralLong1" | "StringLiteralLong2" | "Ws" | "Comment" | "Nil" | "Anon" | "Version" | "Tilde" | "AnnotationOpen" | "AnnotationClose" | "ReificationOpen" | "ReificationClose" | "TripleTermOpen" | "TripleTermClose" | "BuiltInLangdir" | "BuiltInStrLangdir" | "BuiltInHasLang" | "BuiltInHasLangdir" | "BuiltInIsTriple" | "BuiltInTriple" | "BuiltInSubject" | "BuiltInPredicate" | "BuiltInObject" | "LANG_DIR">;
20
+ export declare const sparql12LexerBuilder: LexerBuilder<"StringLiteral1" | "StringLiteral2" | "BuiltInLangdir" | "BuiltInStrLangdir" | "BuiltInHasLang" | "BuiltInHasLangdir" | "BuiltInIsTriple" | "BuiltInTriple" | "BuiltInSubject" | "BuiltInPredicate" | "BuiltInObject" | "OpPlus" | "OpMinus" | "Version" | "Tilde" | "AnnotationOpen" | "AnnotationClose" | "Nil" | "ReificationOpen" | "ReificationClose" | "TripleTermOpen" | "TripleTermClose" | "a" | "LANG_DIR" | "Hathat" | "Exclamation" | "IriRef" | "PNameNs" | "PNameLn" | "BlankNodeLabel" | "Var1" | "Var2" | "Double" | "Decimal" | "Integer" | "InterferePositive" | "DecimalPositive" | "DoublePositive" | "IntegerNegative" | "DecimalNegative" | "DoubleNegative" | "StringLiteralLong1" | "StringLiteralLong2" | "Ws" | "Comment" | "Anon" | "BaseDecl" | "PrefixDecl" | "Select" | "Distinct" | "Reduced" | "Construct" | "Describe" | "Ask" | "From" | "Where" | "Having" | "GroupByGroup" | "By" | "Order" | "OrderAsc" | "OrderDesc" | "Limit" | "Offset" | "Values" | "Load" | "Silent" | "LoadInto" | "Clear" | "Drop" | "Create" | "Add" | "To" | "Move" | "Copy" | "ModifyWith" | "DeleteWhereClause" | "DeleteDataClause" | "DeleteClause" | "InsertDataClause" | "InsertClause" | "UsingClause" | "Optional" | "Service" | "Bind" | "Undef" | "Minus" | "Union" | "Filter" | "As" | "True" | "False" | "In" | "NotIn" | "Separator" | "BuiltInLangmatches" | "BuiltInDatatype" | "BuiltInLang" | "BuiltInBound" | "BuiltInIri" | "BuiltInUri" | "BuiltInBnode" | "BuiltInRand" | "BuiltInAbs" | "BuiltInCeil" | "BuiltInFloor" | "BuiltInRound" | "BuiltInConcat" | "BuiltInStrlen" | "BuiltInUcase" | "BuiltInLcase" | "BuiltInEncode_for_uri" | "BuiltInContains" | "BuiltInStrstarts" | "BuiltInStrends" | "BuiltInStrbefore" | "BuiltInStrafter" | "BuiltInYear" | "BuiltInMonth" | "BuiltInDay" | "BuiltInHours" | "BuiltInMinutes" | "BuiltInSeconds" | "BuiltInTimezone" | "BuiltInTz" | "BuiltInNow" | "BuiltInUuid" | "BuiltInStruuid" | "BuiltInMd5" | "BuiltInSha1" | "BuiltInSha256" | "BuiltInSha384" | "BuiltInSha512" | "BuiltInCoalesce" | "BuiltInIf" | "BuiltInStrlang" | "BuiltInStrdt" | "BuiltInSameterm" | "BuiltInIsiri" | "BuiltInIsuri" | "BuiltInIsblank" | "BuiltInIsliteral" | "BuiltInIsnumeric" | "BuiltInRegex" | "BuiltInSubstr" | "BuiltInReplace" | "BuiltInExists" | "BuiltInNotexists" | "BuiltInCount" | "BuiltInSum" | "BuiltInMin" | "BuiltInMax" | "BuiltInAvg" | "BuiltInSample" | "BuiltInGroup_concat" | "BuiltInStr" | "NamedGraph" | "DefaultGraph" | "Graph" | "GraphAll" | "LogicAnd" | "LogicOr" | "NotEqual" | "LessThanEqual" | "GreaterThanEqual" | "LCurly" | "RCurly" | "Dot" | "Comma" | "Semi" | "LParen" | "RParen" | "LSquare" | "RSquare" | "Pipe" | "Slash" | "Hat" | "Question" | "Star" | "Equal" | "LessThan" | "GreaterThan">;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@traqula/rules-sparql-1-2",
3
3
  "type": "module",
4
- "version": "0.0.20",
4
+ "version": "0.0.21",
5
5
  "description": "Traqula Lexer and Grammar Rules for sparql 1.2",
6
6
  "lsd:module": true,
7
7
  "license": "MIT",
@@ -42,8 +42,8 @@
42
42
  "build:transpile": " node \"../../node_modules/esbuild/bin/esbuild\" --format=cjs --bundle --log-level=error --outfile=lib/index.cjs lib/index.ts"
43
43
  },
44
44
  "dependencies": {
45
- "@traqula/core": "^0.0.20",
46
- "@traqula/rules-sparql-1-1": "^0.0.20"
45
+ "@traqula/core": "^0.0.21",
46
+ "@traqula/rules-sparql-1-1": "^0.0.21"
47
47
  },
48
- "gitHead": "caf35c28d4ddbfec5947566b697d34f38c1e6e31"
48
+ "gitHead": "6e27b4bab942e473c11576196320bd52894ea5a4"
49
49
  }