本文整理汇总了Python中py2neo.Node.properties["key"]方法的典型用法代码示例。如果您正苦于以下问题:Python Node.properties["key"]方法的具体用法?Python Node.properties["key"]怎么用?Python Node.properties["key"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类py2neo.Node
的用法示例。
在下文中一共展示了Node.properties["key"]方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: save
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import properties["key"] [as 别名]
def save(self):
""" Tallennus kantaan. Edellytetään, että henkilölle on asetettu:
- oid
- name = Name(etu, suku)
Lisäksi tallennetaan valinnaiset tiedot:
- events[] = (Event(), )
- occupation
- place
"""
# TODO: pitäsi huolehtia, että käytetään entistä tapahtumaa, jos on
global graph
# Henkilö-noodi
persoona = Node(self.label, oid=self.oid, \
firstname=self.name.first, lastname=self.name.last)
if self.occupation:
persoona.properties["occu"] = self.occupation
if self.place:
persoona.properties["place"] = self.place
persoona.properties["key"] = self.key()
if len(self.events) > 0:
# Luodaan (Person)-->(Event) solmuparit
for event in self.events:
# Tapahtuma-noodi
tapahtuma = Node(Event.label, oid=event.oid, kind=event.kind, \
name=event.name, date=event.date)
tapahtuma.properties["key"] = event.key()
if event.name_orig:
tapahtuma.properties["name_orig"] = event.name_orig
osallistui = Relationship(persoona, "OSALLISTUI", tapahtuma)
try:
graph.create(osallistui)
except Exception as e:
flash('Lisääminen ei onnistunut: {}. henkilö {}, tapahtuma {}'.\
format(e, persoona, tapahtuma), 'error')
logging.warning('Lisääminen ei onnistunut: {}'.format(e))
else:
# Henkilö ilman tapahtumaa (näitä ei taida aineistossamme olla)
graph.create(persoona)
示例2: Node
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import properties["key"] [as 别名]
note = elements[17]
crossref = elements[18]
isbn = elements[19]
series = elements[20]
school = elements[21]
chapter = elements[22]
cite = elements[23]
oldPaper = graph.find_one("Paper", "mdate", mdate)
paper = Node("Paper", title=title)
print "paper created", counter
counter = counter + 1
paper.properties["mdate"] = mdate
paper.properties["key"] = key
paper.properties["editor"] = editor
paper.properties["pages"] = pages
paper.properties["year"] = int(year)
paper.properties["volume"] = volume
paper.properties["journal"] = journal
paper.properties["number"] = number
paper.properties["url"] = url
paper.properties["ee"] = ee
paper.properties["address"] = address
paper.properties["booktitle"] = booktitle
paper.properties["month"] = month
paper.properties["cdrom"] = cdrom
paper.properties["publisher"] = publisher
paper.properties["note"] = note