Python py2neo中未处理的异常:类型错误
我正在编写一个应用程序,其目的是从日志数据集创建一个图形。数据集是一个xml文件,它被解析以提取叶数据。使用这个列表,我编写了一个py2neo脚本来创建图形。该文件已附加到此邮件。 在处理脚本时引发了一个异常: 已调试的程序引发了未经处理的异常TypeError 1676{提图洛:重新检查是否存在类似的问题} 文件:/usr/lib/python2.7/site-packages/py2neo-1.5.1-py2.7.egg/py2neo/neo4j.py,行:472 我不知道怎么处理这件事。我认为代码在语法上是正确的…但是 我不知道是否应该在这里发布整个代码,因此代码位于: 代码如下: +++++++++++++++++++++++++++++++++++ ' !/usr/bin/env python ` 引发异常的py2neo片段Python py2neo中未处理的异常:类型错误,python,py2neo,Python,Py2neo,我正在编写一个应用程序,其目的是从日志数据集创建一个图形。数据集是一个xml文件,它被解析以提取叶数据。使用这个列表,我编写了一个py2neo脚本来创建图形。该文件已附加到此邮件。 在处理脚本时引发了一个异常: 已调试的程序引发了未经处理的异常TypeError 1676{提图洛:重新检查是否存在类似的问题} 文件:/usr/lib/python2.7/site-packages/py2neo-1.5.1-py2.7.egg/py2neo/neo4j.py,行:472 我不知道怎么处理这件事。我
def get_or_create_relationships(self, *abstracts):
""" Fetch or create relationships with the specified criteria depending
on whether or not such relationships exist. Each relationship
descriptor should be a tuple of (start, type, end) or (start, type,
end, data) where start and end are either existing :py:class:`Node`
instances or :py:const:`None` (both nodes cannot be :py:const:`None`).
Uses Cypher `CREATE UNIQUE` clause, raising
:py:class:`NotImplementedError` if server support not available.
.. deprecated:: 1.5
use either :py:func:`WriteBatch.get_or_create_relationship` or
:py:func:`Path.get_or_create` instead.
"""
batch = WriteBatch(self)
for abstract in abstracts:
if 3 <= len(abstract) <= 4:
batch.get_or_create_relationship(*abstract)
else:
raise TypeError(abstract) # this is the 472 line.
try:
return batch.submit()
except cypher.CypherError:
raise NotImplementedError(
"The Neo4j server at <{0}> does not support " \
"Cypher CREATE UNIQUE clauses or the query contains " \
"an unsupported property type".format(self.__uri__)
)
======
有什么帮助吗?多亏了奈杰尔·斯莫尔,我已经修好了。我在写关于建立关系的文章时犯了一个错误。我键入: publicacao=graph\u db.get\u或\u create\u relationshipstitulo\u节点[i]、publicado\u em、dataPub\u节点[i] 它必须是: publicacao=graph\u db.get\u或\u create\u relationshipstitulo\u节点[i]、publicado\u em、dataPub\u节点[i] 顺便说一下,还有另一个编码错误: 关键字\u节点.appendkeyword\u索引.get\u或\u createkeyword,pedacos[i][3][k] 必须是
keyword_nodes.appendkeyword_index.get_或_createkeyword,pedacos[i][3][k],{keyword:pedacos[i][3][k]}如果无法发布整个代码,请在第472行周围发布几行。顺便说一下,错误不在该文件中。它在neo4j模块中。
def get_or_create_relationships(self, *abstracts):
""" Fetch or create relationships with the specified criteria depending
on whether or not such relationships exist. Each relationship
descriptor should be a tuple of (start, type, end) or (start, type,
end, data) where start and end are either existing :py:class:`Node`
instances or :py:const:`None` (both nodes cannot be :py:const:`None`).
Uses Cypher `CREATE UNIQUE` clause, raising
:py:class:`NotImplementedError` if server support not available.
.. deprecated:: 1.5
use either :py:func:`WriteBatch.get_or_create_relationship` or
:py:func:`Path.get_or_create` instead.
"""
batch = WriteBatch(self)
for abstract in abstracts:
if 3 <= len(abstract) <= 4:
batch.get_or_create_relationship(*abstract)
else:
raise TypeError(abstract) # this is the 472 line.
try:
return batch.submit()
except cypher.CypherError:
raise NotImplementedError(
"The Neo4j server at <{0}> does not support " \
"Cypher CREATE UNIQUE clauses or the query contains " \
"an unsupported property type".format(self.__uri__)
)