Orientdb 批处理解析问题

Orientdb 批处理解析问题,orientdb,pyorient,Orientdb,Pyorient,我目前正在尝试使用pyorient填充orientdb图形数据库。总的来说,一切都很顺利。然而,我在我的一个命令中偶然发现了一个解析问题。在Python中,如果我运行以下代码: >>> ab = 'UPDATE Patent SET primary_id = 676, original_abstract = set(original_abstract, "<p num=\\"0000\\">The present invention relates to comp

我目前正在尝试使用pyorient填充orientdb图形数据库。总的来说,一切都很顺利。然而,我在我的一个命令中偶然发现了一个解析问题。在Python中,如果我运行以下代码:

>>> ab = 'UPDATE Patent SET  primary_id = 676, original_abstract = set(original_abstract, "<p num=\\"0000\\">The present invention relates to compounds of the general formula (I) wherein\\n\\nR<sup>1</sup> is the group (A) or (B) or (C) or (D); R<sup>2</sup> is a non aromatic\\n\\nheterocycle, or is OR\' or N(R\\")<sub>2</sub>; R\' is lower alkyl,\\n\\nlower alkyl substituted by halogen or -(CH<sub>2</sub>)<sub>n</sub>-cycloalkyl;\\n\\nR\\" is lower alkyl; R<sup>3</sup> is NO<sub>2</sub>, CN or SO<sub>2</sub>R\';\\n\\nR<sup>4 </sup>is hydrogen, hydroxy, halogen, NO<sub>2</sub>, lower alkyl, lower\\n\\nalkyl, substituted by halogen, lower alkoxy, SO<sub>2</sub>R\' or C(O)OR\\";\\n\\nR<sup>5</sup>/R<sup>6</sup>/R<sup>7</sup> are hydrogen, halogen, lower alkyl\\n\\nor lower alkyl, substituted by halogen; X<sup>1</sup>/X<sup>1\\u00bf</sup>\\n\\nare CH or N, with the proviso that X<sup>1</sup>/X<sup>1\\u00bf</sup> are not simultaneously\\n\\nCH; X<sup>2</sup> is O, S, NH or N(lower alkyl); n is 0, l or 2; and to pharmaceutically\\n\\nactive acid addition salts and to their use in the treatment of neurological and\\n\\nneuropsychiatric disorders.</p>")  UPSERT WHERE primary_id = 676'
>>> client.batch(ab)
本发明涉及通式(I)的化合物,其中,\\n\\nR1为(A)或(B)或(C)或(D)组;R2为非芳香族\\n\\n杂环,或为“或”或“或”(R\\”)2、 R\'是低级烷基,\\n\\n被卤素或-(CH2)n-环烷基取代的低级烷基;\\n\\nR\'是低级烷基;R3是NO2、CN或SO2R\';\\n\\nR4是氢、羟基、卤素、NO2、低级烷基、低级\\n\\n-萘基,被卤素、低级烷氧基、SO2R\'或C(O)或\\';\\n\\nR5/R6/R7是氢、卤素、低级烷基或被卤素取代的低级烷基;X1/X1\\u00bf\\n\\n是CH或n,但条件是X1/X1\\u00bf不同时是\\n\\nCH;X2是O、S、NH或n(低级烷基);n为0、l或2;用于药物活性酸加成盐及其在神经和神经精神疾病治疗中的应用。

”)在原发性_id=676'时插入 >>>客户批处理(ab) 我得到以下错误:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/shaungupta/anaconda/lib/python2.7/site-packages/pyorient/orient.py", line 402, in batch
.prepare(( QUERY_SCRIPT, ) + args).send().fetch_response()
  File "/Users/shaungupta/anaconda/lib/python2.7/site-packages/pyorient/messages/commands.py", line 145, in fetch_response
    super( CommandMessage, self ).fetch_response()
  File "/Users/shaungupta/anaconda/lib/python2.7/site-packages/pyorient/messages/base.py", line 256, in fetch_response
self._decode_all()
  File "/Users/shaungupta/anaconda/lib/python2.7/site-packages/pyorient/messages/base.py", line 240, in _decode_all


 self._decode_header()
  File "/Users/shaungupta/anaconda/lib/python2.7/site-packages/pyorient/messages/base.py", line 192, in _decode_header
    [ exception_message.decode( 'utf8' ) ]
pyorient.exceptions.PyOrientCommandException: com.orientechnologies.orient.core.sql.parser.TokenMgrError - Lexical error at line 1, column 311.  Encountered: <EOF> after : "\"<p num=\\\"0000\\\">The present invention relates to compounds of the general formula (I) wherein\\n\\nR<sup>1</sup> is the group (A) or (B) or (C) or (D); R<sup>2</sup> is a non aromatic\\n\\nheterocycle, or is OR\' or N(R\\\")<sub>2</sub>"
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/Users/shaungupta/anaconda/lib/python2.7/site packages/pyorient/orient.py”,第402行,分批
.prepare((查询脚本,)+args.send().fetch_response()
文件“/Users/shaungupta/anaconda/lib/python2.7/site packages/pyorient/messages/commands.py”,第145行,在fetch_响应中
super(CommandMessage,self).fetch_response()
文件“/Users/shaungupta/anaconda/lib/python2.7/site packages/pyorient/messages/base.py”,第256行,在fetch_响应中
self.\u解码\u all()
文件“/Users/shaungupta/anaconda/lib/python2.7/site packages/pyorient/messages/base.py”,第240行,全部解码
self.\u解码\u头()
文件“/Users/shaungupta/anaconda/lib/python2.7/site packages/pyorient/messages/base.py”,第192行,在解码头中
[异常消息.解码('utf8')]
PyoOrient.exceptions.PyoOrientCommandException:com.orientechnologies.orient.core.sql.parser.TokenMgrError-第1行第311列的词法错误。遇到:“\”

后本发明涉及通式(I)的化合物,其中\\n\\nR1为(A)或(B)或(C)或(D)组;R2为非芳香族\\n\\n杂环,或为“或”或“n(R\\”)2”

如果使用命令运行此命令,也会出现错误:

>>> client.command(ab)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/shaungupta/anaconda/lib/python2.7/site-packages/pyorient/orient.py", line 398, in command
    .prepare(( QUERY_CMD, ) + args).send().fetch_response()
  File "/Users/shaungupta/anaconda/lib/python2.7/site-packages/pyorient/messages/commands.py", line 145, in fetch_response
    super( CommandMessage, self ).fetch_response()
  File "/Users/shaungupta/anaconda/lib/python2.7/site-packages/pyorient/messages/base.py", line 256, in fetch_response
    self._decode_all()
  File "/Users/shaungupta/anaconda/lib/python2.7/site-packages/pyorient/messages/base.py", line 240, in _decode_all
    self._decode_header()
  File "/Users/shaungupta/anaconda/lib/python2.7/site-packages/pyorient/messages/base.py", line 192, in _decode_header
    [ exception_message.decode( 'utf8' ) ]
pyorient.exceptions.PyOrientCommandException: com.orientechnologies.orient.core.sql.OCommandSQLParsingExceptioncom.orientechnologies.orient.core.exception.OSerializationException - Error on parsing command at position #0: Error on reading parameters in: set(original_abstract, "<p num="0000">The present invention relates to compounds of the general formula (I) wherein

R<sup>1</sup> is the group (A) or (B) or (C) or (D); R<sup>2</sup> is a non aromatic

heterocycle, or is OR' or N(R")<sub>2</sub>; R' is lower alkyl,

lower alkyl substituted by halogen or -(CH<sub>2</sub>)<sub>n</sub>-cycloalkyl;

R" is lower alkyl; R<sup>3</sup> is NO<sub>2</sub>, CN or SO<sub>2</sub>R';

R<sup>4 </sup>is hydrogen, hydroxy, halogen, NO<sub>2</sub>, lower alkyl, lower

alkyl, substituted by halogen, lower alkoxy, SO<sub>2</sub>R' or C(O)OR";

R<sup>5</sup>/R<sup>6</sup>/R<sup>7</sup> are hydrogen, halogen, lower alkyl

or lower alkyl, substituted by halogen; X<sup>1</sup>/X<sup>1¿</sup>

are CH or N, with the proviso that X<sup>1</sup>/X<sup>1¿</sup> are not simultaneously

CH; X<sup>2</sup> is O, S, NH or N(lower alkyl); n is 0, l or 2; and to pharmaceutically

active acid addition salts and to their use in the treatment of neurological and

neuropsychiatric disordersFound invalid ) character at position 229 of text original_abstract, "<p num="0000">The present invention relates to compounds of the general formula (I) wherein

R<sup>1</sup> is the group (A) or (B) or (C) or (D); R<sup>2</sup> is a non aromatic

heterocycle, or is OR' or N(R")<sub>2</sub>. Ensure it is opened and closed correctly.
>客户端命令(ab)
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
命令行398中的文件“/Users/shaungupta/anaconda/lib/python2.7/site packages/pyorient/orient.py”
.prepare((QUERY_CMD,)+args.send().fetch_response()
文件“/Users/shaungupta/anaconda/lib/python2.7/site packages/pyorient/messages/commands.py”,第145行,在fetch_响应中
super(CommandMessage,self).fetch_response()
文件“/Users/shaungupta/anaconda/lib/python2.7/site packages/pyorient/messages/base.py”,第256行,在fetch_响应中
self.\u解码\u all()
文件“/Users/shaungupta/anaconda/lib/python2.7/site packages/pyorient/messages/base.py”,第240行,全部解码
self.\u解码\u头()
文件“/Users/shaungupta/anaconda/lib/python2.7/site packages/pyorient/messages/base.py”,第192行,在解码头中
[异常消息.解码('utf8')]
pyorient.exceptions.PyOrientCommandException:com.orientechnologies.orient.core.sql.OCommandSQLParsingExceptioncom.orientechnologies.orient.core.exception.OSerializationException-在位置0处解析命令时出错:读取参数时出错:set(原始摘要,

本发明涉及通式(I)化合物,其中 R1为基团(A)或(B)或(C)或(D);R2为非芳香族 杂环,或是“或”或N(R“)2;R”是低级烷基, 被卤素或-(CH2)n-环烷基取代的低级烷基; R“为低级烷基;R3为NO2、CN或SO2R’; R4是氢、羟基、卤素、NO2、低级烷基、低级烷基 烷基,被卤素、低烷氧基、SO2R'或C(O)或“; R5/R6/R7是氢、卤素、低级烷基 或被卤素取代的低级烷基;X1/X1 是CH还是N,条件是X1/X1不是同时存在的 CH;X2为O、S、NH或N(低级烷基);N为0、l或2;以及医药上 活性酸加成盐及其在神经和神经系统疾病治疗中的应用 本发明涉及通式(I)化合物,其中: R1为(A)或(B)或(C)或(D)组;R2是非芳香族化合物 杂环,或是“或”或N(R“)2.确保其正确打开和关闭。

但是,我发现,如果我不将原始_abstract下的信息作为一个集合添加,则在使用以下命令时它会起作用:

>>> aba = 'UPDATE Patent SET  primary_id = 676, original_abstract = "<p num=\\"0000\\">The present invention relates to compounds of the general formula (I) wherein\\n\\nR<sup>1</sup> is the group (A) or (B) or (C) or (D); R<sup>2</sup> is a non aromatic\\n\\nheterocycle, or is OR\' or N(R\\")<sub>2</sub>; R\' is lower alkyl,\\n\\nlower alkyl substituted by halogen or -(CH<sub>2</sub>)<sub>n</sub>-cycloalkyl;\\n\\nR\\" is lower alkyl; R<sup>3</sup> is NO<sub>2</sub>, CN or SO<sub>2</sub>R\';\\n\\nR<sup>4 </sup>is hydrogen, hydroxy, halogen, NO<sub>2</sub>, lower alkyl, lower\\n\\nalkyl, substituted by halogen, lower alkoxy, SO<sub>2</sub>R\' or C(O)OR\\";\\n\\nR<sup>5</sup>/R<sup>6</sup>/R<sup>7</sup> are hydrogen, halogen, lower alkyl\\n\\nor lower alkyl, substituted by halogen; X<sup>1</sup>/X<sup>1\\u00bf</sup>\\n\\nare CH or N, with the proviso that X<sup>1</sup>/X<sup>1\\u00bf</sup> are not simultaneously\\n\\nCH; X<sup>2</sup> is O, S, NH or N(lower alkyl); n is 0, l or 2; and to pharmaceutically\\n\\nactive acid addition salts and to their use in the treatment of neurological and\\n\\nneuropsychiatric disorders.</p>"  UPSERT WHERE primary_id = 676'
>>> client.command(aba)
['1']
>>aba='UPDATE Patent SET primary\u id=676,original\u abstract=“

本发明涉及通式(I)化合物,其中\\n\\nR1为(A)或(B)或(C)或(D)组;R2为非芳香族\\n\\n杂环,或为或\'或n(R \')2;R \'为低级烷基,\\n\\n被卤素或-(CH2)n-环烷基取代的低级烷基;\\n\\nR \'为低级烷基;R3为NO2、CN或SO2R\'\\n\\nR4是氢、羟基、卤素、NO2、低烷基、低烷氧基、SO2R\'或C(O)或\\“;\\n\\nR5/R6/R7是氢、卤素、低烷基、低烷基、低烷基、低烷基,被卤素取代;X1/X1\\u00bf\\n\\n是CH或n,但前提是X1/X1\\u00bf不同时是\\n\\nCH;X2是O、S、NH或n(低烷基);n为0、l或2;以及用于医药活性酸加成盐及其在神经和神经精神疾病治疗中的用途。

“在原发性id=676的情况下插入” >>>客户端命令(aba) ['1']
但是,client.batch仍然不能
>>> client.batch(aba)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/shaungupta/anaconda/lib/python2.7/site-packages/pyorient/orient.py", line 402, in batch
    .prepare(( QUERY_SCRIPT, ) + args).send().fetch_response()
  File "/Users/shaungupta/anaconda/lib/python2.7/site-packages/pyorient/messages/commands.py", line 145, in fetch_response
    super( CommandMessage, self ).fetch_response()
  File "/Users/shaungupta/anaconda/lib/python2.7/site-packages/pyorient/messages/base.py", line 256, in fetch_response
    self._decode_all()
  File "/Users/shaungupta/anaconda/lib/python2.7/site-packages/pyorient/messages/base.py", line 240, in _decode_all
    self._decode_header()
  File "/Users/shaungupta/anaconda/lib/python2.7/site-packages/pyorient/messages/base.py", line 192, in _decode_header
    [ exception_message.decode( 'utf8' ) ]
pyorient.exceptions.PyOrientCommandException: com.orientechnologies.orient.core.exception.OSerializationException - Found invalid ) character at position 274 of text UPDATE Patent SET  primary_id = 676, original_abstract = "<p num=\"0000\">The present invention relates to compounds of the general formula (I) wherein\n\nR<sup>1</sup> is the group (A) or (B) or (C) or (D); R<sup>2</sup> is a non aromatic\n\nheterocycle, or is OR' or N(R\")<sub>2</sub>; R' is lower alkyl,\n\nlower alkyl substituted by halogen or -(CH<sub>2</sub>)<sub>n</sub>-cycloalkyl;\n\nR\" is lower alkyl; R<sup>3</sup> is NO<sub>2</sub>, CN or SO<sub>2</sub>R';\n\nR<sup>4 </sup>is hydrogen, hydroxy, halogen, NO<sub>2</sub>, lower alkyl, lower\n\nalkyl, substituted by halogen, lower alkoxy, SO<sub>2</sub>R' or C(O)OR\";\n\nR<sup>5</sup>/R<sup>6</sup>/R<sup>7</sup> are hydrogen, halogen, lower alkyl\n\nor lower alkyl, substituted by halogen; X<sup>1</sup>/X<sup>1\u00bf</sup>\n\nare CH or N, with the proviso that X<sup>1</sup>/X<sup>1\u00bf</sup> are not simultaneously\n\nCH; X<sup>2</sup> is O, S, NH or N(lower alkyl); n is 0, l or 2; and to pharmaceutically\n\nactive acid addition salts and to their use in the treatment of neurological and\n\nneuropsychiatric disorders.</p>"  UPSERT WHERE primary_id = 676. Ensure it is opened and closed correctly.