update regex pattern
@@ -73,13 +73,13 @@ class TripleGenerator:
self.yyyy_mm_dd_pattern = re.compile(
"[12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])")
self.yyyy_pattern = re.compile("[12]\d{3}")
+ # self.quantity_pattern = re.compile("([\+|\-]?[0-9]+\.?[0-9]*)(?:\[([\+|\-]?[0-9]+\.?[0-9]*),([\+|\-]?[0-9]+\.?[0-9]*)\])?([U|Q](?:[0-9]+))?")
self.quantity_pattern = re.compile(
- "([\+|\-]?[0-9]+\.?[0-9]*)(?:\[([\+|\-]?[0-9]+\.?[0-9]*),([\+|\-]?[0-9]+\.?[0-9]*)\])?([U|Q](?:[0-9]+))?")
+ "([\+|\-]?[0-9]+\.?[0-9]*[e|E]?[\-]?[0-9]*)(?:\[([\+|\-]?[0-9]+\.?[0-9]*),([\+|\-]?[0-9]+\.?[0-9]*)\])?([U|Q](?:[0-9]+))?")
# order map, know the column index of ["node1","property","node2",id]
self.order_map = {}
self.use_id = use_id
-
def _node_2_entity(self, node: str):
'''
A node can be Qxxx or Pxxx, return the proper entity.
@@ -276,6 +276,7 @@ class TripleGenerator:
elif edge_type == QuantityValue:
# +70[+60,+80]Q743895
+
res = self.quantity_pattern.match(node2).groups()
amount, lower_bound, upper_bound, unit = res
