本文整理汇总了Python中py2neo.Node.properties["namespace"]方法的典型用法代码示例。如果您正苦于以下问题:Python Node.properties["namespace"]方法的具体用法?Python Node.properties["namespace"]怎么用?Python Node.properties["namespace"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类py2neo.Node
的用法示例。
在下文中一共展示了Node.properties["namespace"]方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: construct_node
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import properties["namespace"] [as 别名]
def construct_node(self, push_namespace, relationship, label, name, properties):
namespace = self.get_namespace(name)
self.check_duplicates(label, name=namespace)
node = Node(label)
node.properties["namespace"] = namespace
node.properties["name"] = name
for i in properties.keys():
node.properties[i] = properties[i]
self.graph.create(node)
if len(self.parent_node) != 0:
relation_enity = Relationship(self.get_parent_node(), relationship, node)
self.graph.create(relation_enity)
if push_namespace == True:
self.namespace.append(name)
self.parent_node.append(node)
示例2: construct_merge_node
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import properties["namespace"] [as 别名]
def construct_merge_node(self, push_namespace, relationship, label, name, new_properties):
namespace = self.get_namespace(name)
node = self.graph.find_one(label, property_key="name", property_value=name)
if self.graph.find_one(label, property_key="name", property_value=name) != None:
for i in properties.keys():
node.properties[i] = properties[i]
node.push()
return node
else:
node = Node(label)
node.properties["namespace"] = namespace
node.properties["name"] = name
for i in properties.keys():
node.properties[i] = properties[i]
self.graph.create(node)
if len(self.namespace) != 0:
relation_enity = Relationship(self.get_namespace_node(), relationship, node)
self.graph.create(relation_enity)
if push_namespace == True:
self.namespace.append(name)
self.namespace.append(node)
return node