@@ -98,30 +98,17 @@ def parse_statistics(self, raw_statistics):
9898
9999 def parse_metadata (self , raw_metadata ):
100100 # Decode metadata:
101- # [
102- # ["version", VERSION],
103- # ["labels", [[VALUE_STRING, "label_1"] ... ]],
104- # ["relationship types ", [[VALUE_STRING, "reltype_1"] ... ]],
105- # ["property keys", [[VALUE_STRING, "prop_1"] ... ]]
106- # ]
107- version = raw_metadata [0 ][1 ]
108- raw_labels = raw_metadata [1 ][1 ]
109- raw_reltypes = raw_metadata [2 ][1 ]
110- raw_props = raw_metadata [3 ][1 ]
111-
112- # Arrays to be passed into the internal graph structure.
113- labels = [None ] * len (raw_labels )
114- reltypes = [None ] * len (raw_reltypes )
115- properties = [None ] * len (raw_props )
116-
117- for idx , label in enumerate (raw_labels ):
118- labels [idx ] = self .parse_scalar (label )
119-
120- for idx , reltype in enumerate (raw_reltypes ):
121- reltypes [idx ] = self .parse_scalar (reltype )
122-
123- for idx , prop in enumerate (raw_props ):
124- properties [idx ] = self .parse_scalar (prop )
101+ # {
102+ # "version", VERSION,
103+ # "labels", [[VALUE_STRING, "label_1"] ... ],
104+ # "relationship types ", [[VALUE_STRING, "reltype_1"] ... ],
105+ # "property keys", [[VALUE_STRING, "prop_1"] ... ]
106+ # }
107+ metadata = self .parse_map (raw_metadata )
108+ version = metadata ["version" ]
109+ labels = metadata ["labels" ]
110+ reltypes = metadata ["relationship types" ]
111+ properties = metadata ["property keys" ]
125112
126113 # Update the graph's internal metadata.
127114 self .graph .refresh_metadata (version , labels , reltypes , properties )
0 commit comments