def create_edge(self, from_v: Vertex, to_v: Vertex, edge_label: str, related_as: str,
updated_by_uuid: str = INebulaGraph.uuid_system) -> Edge:
uuid = DateAndUuidUtils.uuid_generate()
now = DateAndUuidUtils.datetime_of_now()
updated_on = DateAndUuidUtils.java_epoch_of(now)
updated_on_str = DateAndUuidUtils.datetime_to_iso(now)
created_edge: Edge = self.g.add_e(edge_label). \
from_(from_v).to(to_v). \
property("name", ""). \
property("updatedOn", updatedOn). \
property("updatedOnStr", updated_on_str). \
property("relatedAs", related_as). \
property("updatedBy", updated_by_uuid). \
property("uuid", uuid). \
next()
return created_edge
DateAndUuidUtils.datetime_of_now() returns a python (int) of the Java Epoch value via datatime(). When above code is executed it exceptions by the underlying code saying that the value is too big and use gremlin bigint.statics.long() has fixed this issue. from gremlin_python.statics import longproperty("updatedOn", updatedOn) to property("updatedOn", long(updatedOn))if obj < -9223372036854775808 or obj > 9223372036854775807: obj is much smaller in my case than the range it compares.Join the Discord to ask follow-up questions and connect with the community
Apache TinkerPop is an open source graph computing framework and the home of the Gremlin graph query language.
1,383 Members
Join