Example #1
0
 def create(cls, guide_id, file_name, **kwargs):
     print(guide_id)
     node = Node(cls.__name__,
                 id=UUID(),
                 guide_id=guide_id,
                 file_name=file_name,
                 **kwargs)
     graph_.create(node)
     return node["id"]
Example #2
0
 def create(cls, policy_id, file_name, **kwargs):
     # kwargs["id"]=
     node = Node("Policy",
                 id=UUID(),
                 policy_id=policy_id,
                 file_name=file_name,
                 **kwargs)
     graph_.create(node)
     return node["id"]
Example #3
0
 def create(cls, type_, name, field=None, **kwargs):
     """
     往数据库中添加一个字段信息,现在允许重复
     :param type_: Field 或者 Alia
     :param field: 字段名
     :param name: 字段中文
     :param kwargs:
     :return:
     """
     if type_ == "Field":
         node = Node(cls.__name__,
                     type_,
                     id=UUID(),
                     name=name,
                     field=field,
                     **kwargs)
     else:  # Alia
         node = Node(cls.__name__, type_, id=UUID(), name=name, **kwargs)
     graph_.create(node)
     return node["id"], node
Example #4
0
 def create(cls, **kwargs):
     node = Node(cls.__name__, id=UUID(), **kwargs)
     graph_.create(node)
     return node["id"]
Example #5
0
 def create(cls, **kwargs):
     # if kwargs.get("value", None) not in PredicateValue:
     #     raise Exception(f"predicate value must in {PredicateValue}")
     node = Node(cls.__name__, id=UUID(), **kwargs)
     graph_.create(node)
     return node["id"]
Example #6
0
 def create(cls, object_type, **kwargs):
     if object_type not in ObjectType:
         raise Exception(f"object_type must in {ObjectType}")
     node = Node(cls.__name__, object_type, id=UUID(), **kwargs)
     graph_.create(node)
     return node["id"]