Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Commit 548b609

Browse files
authored
Merge pull request #9 from DerwenAI/update
Update
2 parents 2932bda + 6017568 commit 548b609

File tree

5 files changed

+391
-44
lines changed

5 files changed

+391
-44
lines changed

dat/cyp/q2.tsv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
4 3 4 6 66 pattern path
66
5 4 5 6 37 node pattern
77
6 5 6 7 10 identifier tom
8-
7 5 6 10 17 label
8+
7 5 6 10 17 label :Person
99
8 5 6 18 36 map
1010
9 8 7 19 23 prop name name
1111
10 8 7 24 35 string 'Tom Hanks'
1212
11 4 5 37 53 rel pattern
1313
12 11 6 39 42 identifier rel
14-
13 11 6 42 51 rel type
14+
13 11 6 42 51 rel type :DIRECTED
1515
14 4 5 53 66 node pattern
1616
15 14 6 54 59 identifier movie
17-
16 14 6 59 65 label
17+
16 14 6 59 65 label :Movie
1818
17 1 2 67 173 RETURN
1919
18 17 3 74 90 projection
2020
19 18 4 74 83 property

goedwig/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"""
77

88
from .cypher import CypherItem
9-
from .query import Query
9+
from .query import QueryPlan
1010
from .version import __version__

goedwig/cypher.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CypherItem: # pylint: disable=R0902,R0903
1212
"""
1313
Represent data for one AST tree item in a parsed Cypher query.
1414
"""
15-
REPR_STR = "@{}[{}]\t{}..{}\t{:<4}{:<10}{:<16} |> {}"
15+
REPR_STR = "@{:<3}[{:3}] {:3}..{:<3}\t{:<4}{:<16}{:<16} |> {}"
1616

1717
def __init__ (
1818
self,
@@ -37,15 +37,17 @@ def __repr__ (
3737
self,
3838
) -> str:
3939
"""
40-
Printed representation for an AST item.
40+
Text representation.
4141
"""
42+
kiddos = ",".join(map(lambda x: str(x), self.children)) # pylint: disable=W0108
43+
4244
return self.REPR_STR.format(
4345
self.ordinal,
4446
self.parent,
4547
self.s0,
4648
self.s1,
4749
self.depth,
48-
str(self.children),
50+
kiddos,
4951
self.ast_typestr,
5052
self.literal,
5153
)

0 commit comments

Comments
 (0)