flowquery 1.0.34 → 1.0.35

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 (66) hide show
  1. package/dist/flowquery.min.js +1 -1
  2. package/dist/graph/database.d.ts +1 -0
  3. package/dist/graph/database.d.ts.map +1 -1
  4. package/dist/graph/database.js +43 -6
  5. package/dist/graph/database.js.map +1 -1
  6. package/dist/graph/relationship.d.ts +3 -1
  7. package/dist/graph/relationship.d.ts.map +1 -1
  8. package/dist/graph/relationship.js +12 -4
  9. package/dist/graph/relationship.js.map +1 -1
  10. package/dist/graph/relationship_data.js +1 -1
  11. package/dist/graph/relationship_data.js.map +1 -1
  12. package/dist/graph/relationship_match_collector.d.ts.map +1 -1
  13. package/dist/graph/relationship_match_collector.js +6 -3
  14. package/dist/graph/relationship_match_collector.js.map +1 -1
  15. package/dist/graph/relationship_reference.js +1 -1
  16. package/dist/graph/relationship_reference.js.map +1 -1
  17. package/dist/parsing/functions/function_factory.d.ts +1 -0
  18. package/dist/parsing/functions/function_factory.d.ts.map +1 -1
  19. package/dist/parsing/functions/function_factory.js +1 -0
  20. package/dist/parsing/functions/function_factory.js.map +1 -1
  21. package/dist/parsing/functions/predicate_sum.d.ts.map +1 -1
  22. package/dist/parsing/functions/predicate_sum.js +13 -10
  23. package/dist/parsing/functions/predicate_sum.js.map +1 -1
  24. package/dist/parsing/functions/schema.d.ts +5 -2
  25. package/dist/parsing/functions/schema.d.ts.map +1 -1
  26. package/dist/parsing/functions/schema.js +7 -4
  27. package/dist/parsing/functions/schema.js.map +1 -1
  28. package/dist/parsing/functions/trim.d.ts +7 -0
  29. package/dist/parsing/functions/trim.d.ts.map +1 -0
  30. package/dist/parsing/functions/trim.js +37 -0
  31. package/dist/parsing/functions/trim.js.map +1 -0
  32. package/dist/parsing/operations/group_by.d.ts.map +1 -1
  33. package/dist/parsing/operations/group_by.js +4 -2
  34. package/dist/parsing/operations/group_by.js.map +1 -1
  35. package/dist/parsing/parser.d.ts.map +1 -1
  36. package/dist/parsing/parser.js +15 -2
  37. package/dist/parsing/parser.js.map +1 -1
  38. package/docs/flowquery.min.js +1 -1
  39. package/flowquery-py/pyproject.toml +1 -1
  40. package/flowquery-py/src/graph/database.py +44 -11
  41. package/flowquery-py/src/graph/relationship.py +11 -3
  42. package/flowquery-py/src/graph/relationship_data.py +2 -1
  43. package/flowquery-py/src/graph/relationship_match_collector.py +7 -1
  44. package/flowquery-py/src/graph/relationship_reference.py +2 -2
  45. package/flowquery-py/src/parsing/functions/__init__.py +2 -0
  46. package/flowquery-py/src/parsing/functions/predicate_sum.py +3 -6
  47. package/flowquery-py/src/parsing/functions/schema.py +9 -5
  48. package/flowquery-py/src/parsing/functions/trim.py +35 -0
  49. package/flowquery-py/src/parsing/operations/group_by.py +2 -0
  50. package/flowquery-py/src/parsing/parser.py +12 -2
  51. package/flowquery-py/tests/compute/test_runner.py +249 -4
  52. package/flowquery-vscode/flowQueryEngine/flowquery.min.js +1 -1
  53. package/package.json +1 -1
  54. package/src/graph/database.ts +42 -4
  55. package/src/graph/relationship.ts +12 -4
  56. package/src/graph/relationship_data.ts +1 -1
  57. package/src/graph/relationship_match_collector.ts +6 -2
  58. package/src/graph/relationship_reference.ts +1 -1
  59. package/src/parsing/functions/function_factory.ts +1 -0
  60. package/src/parsing/functions/predicate_sum.ts +17 -12
  61. package/src/parsing/functions/schema.ts +7 -4
  62. package/src/parsing/functions/trim.ts +25 -0
  63. package/src/parsing/operations/group_by.ts +4 -1
  64. package/src/parsing/parser.ts +15 -2
  65. package/tests/compute/runner.test.ts +279 -3
  66. package/tests/parsing/parser.test.ts +37 -0
@@ -750,6 +750,43 @@ test("Match with graph pattern including relationships", () => {
750
750
  expect(target.label).toBe("Person");
751
751
  });
752
752
 
753
+ test("Match with ORed relationship types", () => {
754
+ const parser = new Parser();
755
+ const ast = parser.parse("MATCH (a:Person)-[:KNOWS|FOLLOWS]->(b:Person) RETURN a, b");
756
+ const match = ast.firstChild() as Match;
757
+ expect(match.patterns[0].chain.length).toBe(3);
758
+ const relationship = match.patterns[0].chain[1] as Relationship;
759
+ expect(relationship.types).toEqual(["KNOWS", "FOLLOWS"]);
760
+ expect(relationship.type).toBe("KNOWS");
761
+ });
762
+
763
+ test("Match with ORed relationship types with optional colons", () => {
764
+ const parser = new Parser();
765
+ const ast = parser.parse("MATCH (a:Person)-[:KNOWS|:FOLLOWS|:LIKES]->(b:Person) RETURN a, b");
766
+ const match = ast.firstChild() as Match;
767
+ const relationship = match.patterns[0].chain[1] as Relationship;
768
+ expect(relationship.types).toEqual(["KNOWS", "FOLLOWS", "LIKES"]);
769
+ });
770
+
771
+ test("Match with ORed relationship types and variable", () => {
772
+ const parser = new Parser();
773
+ const ast = parser.parse("MATCH (a:Person)-[r:KNOWS|FOLLOWS]->(b:Person) RETURN a, r, b");
774
+ const match = ast.firstChild() as Match;
775
+ const relationship = match.patterns[0].chain[1] as Relationship;
776
+ expect(relationship.identifier).toBe("r");
777
+ expect(relationship.types).toEqual(["KNOWS", "FOLLOWS"]);
778
+ });
779
+
780
+ test("Match with ORed relationship types and hops", () => {
781
+ const parser = new Parser();
782
+ const ast = parser.parse("MATCH (a:Person)-[:KNOWS|FOLLOWS*1..3]->(b:Person) RETURN a, b");
783
+ const match = ast.firstChild() as Match;
784
+ const relationship = match.patterns[0].chain[1] as Relationship;
785
+ expect(relationship.types).toEqual(["KNOWS", "FOLLOWS"]);
786
+ expect(relationship.hops!.min).toBe(1);
787
+ expect(relationship.hops!.max).toBe(3);
788
+ });
789
+
753
790
  test("Test not equal operator", () => {
754
791
  const parser = new Parser();
755
792
  const ast = parser.parse("RETURN 1 <> 2");