本文整理汇总了Python中py2neo.Node.hydrate方法的典型用法代码示例。如果您正苦于以下问题:Python Node.hydrate方法的具体用法?Python Node.hydrate怎么用?Python Node.hydrate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类py2neo.Node
的用法示例。
在下文中一共展示了Node.hydrate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_full_node_hydrate
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import hydrate [as 别名]
def test_full_node_hydrate():
dehydrated = {
"extensions": {
},
"paged_traverse": "http://localhost:7474/db/data/node/0/paged/traverse/{returnType}{?pageSize,leaseTime}",
"labels": "http://localhost:7474/db/data/node/0/labels",
"outgoing_relationships": "http://localhost:7474/db/data/node/0/relationships/out",
"traverse": "http://localhost:7474/db/data/node/0/traverse/{returnType}",
"all_typed_relationships": "http://localhost:7474/db/data/node/0/relationships/all/{-list|&|types}",
"property": "http://localhost:7474/db/data/node/0/properties/{key}",
"all_relationships": "http://localhost:7474/db/data/node/0/relationships/all",
"self": "http://localhost:7474/db/data/node/0",
"outgoing_typed_relationships": "http://localhost:7474/db/data/node/0/relationships/out/{-list|&|types}",
"properties": "http://localhost:7474/db/data/node/0/properties",
"incoming_relationships": "http://localhost:7474/db/data/node/0/relationships/in",
"incoming_typed_relationships": "http://localhost:7474/db/data/node/0/relationships/in/{-list|&|types}",
"create_relationship": "http://localhost:7474/db/data/node/0/relationships",
"data": {
"name": "Alice",
"age": 33,
},
}
hydrated = Node.hydrate(dehydrated)
assert isinstance(hydrated, Node)
assert hydrated.properties == dehydrated["data"]
assert hydrated.bound
assert hydrated.resource.uri == dehydrated["self"]
示例2: test_minimal_node_hydrate
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import hydrate [as 别名]
def test_minimal_node_hydrate():
dehydrated = {
"self": "http://localhost:7474/db/data/node/0",
}
hydrated = Node.hydrate(dehydrated)
assert isinstance(hydrated, Node)
assert hydrated.bound
assert hydrated.resource.uri == dehydrated["self"]
示例3: test_node_hydrate_with_properties
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import hydrate [as 别名]
def test_node_hydrate_with_properties():
dehydrated = {
"self": "http://localhost:7474/db/data/node/0",
"data": {
"name": "Alice",
"age": 33,
},
}
hydrated = Node.hydrate(dehydrated)
assert isinstance(hydrated, Node)
assert hydrated.properties == dehydrated["data"]
assert hydrated.bound
assert hydrated.resource.uri == dehydrated["self"]