本文整理汇总了Python中py2neo.Node.properties["id"]方法的典型用法代码示例。如果您正苦于以下问题:Python Node.properties["id"]方法的具体用法?Python Node.properties["id"]怎么用?Python Node.properties["id"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类py2neo.Node
的用法示例。
在下文中一共展示了Node.properties["id"]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Graph
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import properties["id"] [as 别名]
'''
Script to create some sample nodes and edges, purely for illustration purposes. Does not align with the
nodes, edges and properties in other scripts.
'''
from py2neo import Graph
graph = Graph()
from py2neo import Node, Relationship
magdalena = Node("Artist", name="Abakanowicz, Magdalena", id=10093, gender="Female", birthYear=1930)
polska=Node("Place", name="Polska")
magdalena_born_in_polska = Relationship(magdalena, "BORN_IN", polska)
graph.create(magdalena_born_in_polska)
polska.properties["id"]="Polska"
polska.push()
magdalena_born_in_polska.properties["date"]=1930
magdalena_born_in_polska.push()
t12979 = Node("Artwork", title="Abakan Red", date=1969, acno="T12979", id=102938)
magdalena_contributed_to_t12979 = Relationship(magdalena, "CONTRIBUTED_TO", t12979)
graph.create(magdalena_contributed_to_t12979)
metal = Node("Medium", name="metal")
sisal = Node("Medium", name="sisal")
abakan_made_of_metal = Relationship(t12979, "MADE_OF", metal)
abakan_made_of_sisal = Relationship(t12979, "MADE_OF", sisal)
graph.create(abakan_made_of_metal, abakan_made_of_sisal)
cities = Node("Place Types", name="cities, towns, villages (non-UK)")
countries = Node("Place Types", name="countries and continents")
abakan = Node("Place", name="Abakan")
abakan = Node("Place", name="Russia, Khakassia")
abakan = Node("Place", name="Abakan")