enricobacis / wos

📚 Web of Science python client
https://wos.readthedocs.io/
MIT License
210 stars 45 forks source link

Parenthesized expression should be quoted here #12

Closed nemobis closed 7 years ago

nemobis commented 7 years ago

Every query for a DOI with a parenthesis, such as wos --sid ... query "DO=10.1016/S0140-6736(88)92668-2", gives:

ERROR: (QEE0001) The SOAP request message is invalid. Reason: The userQuery element is invalid. Cause: Translation Exception : Parenthesized expression should be quoted here. . Remedy: Correct your request and submit it again.

This looks like something more easily fixed in the utility than in the user input. What do you think?

Example DOIs I got this error with:

10.1002/(SICI)1097-0223(199909)19:9<808::AID-PD637>3.0.CO;2-B
10.1002/(SICI)1098-2264(199803)21:3<217::AID-GCC5>3.0.CO;2-2
10.1002/(SICI)1098-2361(1996)15:2<135::AID-ZOO4>3.0.CO;2-C
10.1002/1097-0142(20010801)92:3<460::AID-CNCR1344>3.0.CO;2-D
10.1002/1520-6696(197501)11:1<49::AID-JHBS2300110112>3.0.CO;2-6
10.1016/0002-8703(83)90022-4
10.1016/0002-9610(68)90462-5
10.1016/0002-9610(91)91111-U
10.1016/0003-4916(61)90067-7
10.1016/0005-2736(67)90094-6
10.1016/0005-2736(75)90347-8
10.1016/0006-291X(71)90749-2
10.1016/0006-291X(75)90681-6
10.1016/0006-291X(89)91665-3
10.1016/0006-2952(93)90408-O
10.1016/0006-3002(54)90069-4
10.1016/0006-3002(55)90224-9
10.1016/0006-3002(59)90492-5
10.1016/0006-8993(90)91761-5
10.1016/0006-8993(92)91583-Z
10.1016/0010-440X(90)90018-N
10.1016/0010-440x(89)90052-7
10.1016/0011-2240(84)90079-8
10.1016/0012-821X(75)90088-6
10.1016/0012-821X(95)00205-Q
10.1016/0014-5793(87)80207-7
10.1016/0014-5793(92)80266-J
10.1016/0014-5793(94)01052-8
10.1016/0014-5793(96)00631-X
10.1016/0016-5085(95)90565-0
10.1016/0019-1035(66)90036-4
10.1016/0019-1035(74)90050-5
10.1016/0019-1035(77)90173-7
10.1016/0019-1035(78)90076-3
10.1016/0019-1035(79)90119-2
10.1016/0019-1035(88)90054-1
10.1016/0019-1035(89)90180-2
10.1016/0019-1035(90)90094-P
10.1016/0019-1035(92)90156-2
10.1016/0020-7322(78)90006-5
10.1016/0021-9517(67)90174-1
10.1016/0022-1902(70)80355-4
10.1016/0022-2836(70)90057-4
10.1016/0022-2836(80)90196-5
10.1016/0022-3093(80)90040-X
10.1016/0022-4731(86)90442-5
10.1016/0024-4937(90)90040-8
10.1016/0025-5408(76)90179-3
10.1016/0038-1098(80)90515-3
10.1016/0038-1101(63)90081-9
10.1016/0039-128X(91)90028-T
10.1016/0039-6028(95)01263-X
10.1016/0040-1951(91)90041-P
10.1016/0041-008X(91)90221-Y
10.1016/0047-2670(76)85005-8
10.1016/0091-3057(87)90159-6
10.1016/0091-6749(85)90061-2
10.1016/0092-1157(73)90048-6
10.1016/0161-5890(94)90061-2
10.1016/0166-4328(81)90053-X
10.1016/0167-2789(91)90234-Z
10.1016/0168-9274(91)90102-6
10.1016/0190-9622(93)70284-Z
10.1016/0190-9622(95)91846-9
10.1016/0196-9781(81)90003-6
10.1016/0272-0590(90)90219-A
10.1016/0278-4343(87)90073-2
10.1016/0304-3940(91)90276-Y
10.1016/0304-4173(79)90006-5
10.1016/0304-419X(76)90003-2
10.1016/0370-1573(85)90023-7
10.1016/0370-1573(92)90093-F
10.1016/0378-1119(93)90110-O
10.1016/0378-1119(94)90027-2
10.1016/0378-1119(94)90802-8
10.1016/0378-8741(88)90122-5
10.1016/0379-6779(93)91166-Y
10.1016/0736-4679(87)90218-6
10.1016/0893-133X(94)00064-7
10.1016/0921-8181(90)90018-8
10.1016/0925-8388(95)01672-4
10.1016/0955-0674(95)80111-1
10.1016/0960-0760(94)90151-1
10.1016/0960-0760(95)00134-L
10.1016/1056-8727(94)00058-1
10.1016/S0002-9378(99)70120-1
10.1016/S0003-3472(80)80088-1
10.1016/S0005-7894(97)80048-2
10.1016/S0006-291X(02)02670-0
10.1016/S0006-2952(03)00143-6
10.1016/S0006-3207(96)00112-7
10.1016/S0008-6215(00)82748-2
10.1016/S0014-2999(00)00837-2
10.1016/S0014-2999(97)01412-X
10.1016/S0014-2999(98)00068-5
10.1016/S0014-4827(03)00261-1
10.1016/S0014-5793(00)01107-8
10.1016/S0015-0282(00)00487-8
10.1016/S0015-0282(02)04694-0
10.1016/S0016-5085(98)70429-9
10.1016/S0016-5107(04)02200-X
10.1016/S0016-6995(69)80005-7
10.1016/S0016-7878(08)80129-0
10.1016/S0019-1035(03)00134-9
10.1016/S0019-1035(03)00146-5
10.1016/S0021-9673(02)01387-0
10.1016/S0022-2836(75)80083-0
10.1016/S0022-328X(00)98709-6
10.1016/S0022-3476(03)00186-0
10.1016/S0022-3476(95)70263-6
10.1016/S0022-3476(97)70249-X
10.1016/S0022-3913(08)00110-8
10.1016/S0027-5107(97)00173-5
10.1016/S0029-7844(01)01759-8
10.1016/S0031-0182(02)00718-6
10.1016/S0031-0182(03)00539-X
10.1016/S0032-0633(00)00105-7
10.1016/S0033-5894(03)00057-7
10.1016/S0039-6257(96)90001-6
10.1016/S0040-4020(01)92417-2
10.1016/S0040-4020(99)00748-6
10.1016/S0040-4039(01)87348-2
10.1016/S0041-1345(02)02600-3
10.1016/S0048-9697(98)00272-1
10.1016/S0065-3055(08)60647-4
10.1016/S0065-3233(01)59005-1
10.1016/S0079-6123(06)62006-2
10.1016/S0091-3057(96)00456-X
10.1016/S0091-6749(98)70171-X
10.1016/S0094-5765(99)00022-3
10.1016/S0140-6736(00)02250-9
10.1016/S0140-6736(00)04006-X
10.1016/S0140-6736(01)00020-4
10.1016/S0140-6736(01)05410-1
10.1016/S0140-6736(01)06449-2
10.1016/S0140-6736(02)07740-1
10.1016/S0140-6736(03)12948-0
10.1016/S0140-6736(03)15024-6
10.1016/S0140-6736(04)16980-8
10.1016/S0140-6736(05)67216-9
10.1016/S0140-6736(07)60198-6
10.1016/S0140-6736(08)60207-X
10.1016/S0140-6736(08)60419-5
10.1016/S0140-6736(08)60602-9
10.1016/S0140-6736(08)61626-8
10.1016/S0140-6736(09)60551-1
10.1016/S0140-6736(09)60627-9
10.1016/S0140-6736(09)60902-8
10.1016/S0140-6736(10)60837-9
10.1016/S0140-6736(10)61389-X
10.1016/S0140-6736(12)60521-2
10.1016/S0140-6736(12)61381-6
10.1016/S0140-6736(13)60982-4
10.1016/S0140-6736(13)60996-4
10.1016/S0140-6736(14)60082-9
10.1016/S0140-6736(54)91257-X
10.1016/S0140-6736(62)92422-4
10.1016/S0140-6736(65)92415-3
10.1016/S0140-6736(72)92704-3
10.1016/S0140-6736(78)92912-4
10.1016/S0140-6736(84)91531-9
10.1016/S0140-6736(86)92677-2
10.1016/S0140-6736(88)92668-2
10.1016/S0149-2918(00)80021-1
10.1016/S0149-7634(88)80004-6
10.1016/S0160-9327(99)01209-0
10.1016/S0165-022X(03)00154-4
10.1016/S0165-0270(01)00457-5
10.1016/S0165-7836(01)00259-4
10.1016/S0167-8809(00)00275-9
10.1016/S0168-8227(01)00223-6
10.1016/S0168-8278(00)80273-1
10.1016/S0168-8278(01)00026-5
10.1016/S0176-1617(11)82015-8
10.1016/S0190-9622(94)70143-1
10.1016/S0191-8869(02)00002-8
10.1016/S0196-6774(03)00048-8
10.1016/S0210-5691(11)70015-8
10.1016/S0265-931X(96)00074-4
10.1016/S0272-6386(96)90568-5
10.1016/S0275-5408(97)00070-7
10.1016/S0278-4343(00)00016-9
10.1016/S0278-6915(02)00105-9
10.1016/S0300-595X(82)80003-0
10.1016/S0301-0511(98)00049-0
10.1016/S0301-9268(01)00219-4
10.1016/S0304-3959(99)00104-9
10.1016/S0304-4157(00)00016-2
10.1016/S0306-4565(98)00032-1
10.1016/S0309-1740(03)00151-7
10.1016/S0378-1119(97)00616-1
10.1016/S0378-8741(98)00168-8
10.1016/S0733-8635(03)00031-7
10.1016/S0747-5632(99)00056-4
10.1016/S0889-1575(03)00045-0
10.1016/S0895-7061(97)00491-3
10.1016/S0899-9007(97)00230-X
10.1016/S0920-5446(06)80012-9
10.1016/S0920-5861(97)00003-5
10.1016/S0925-8388(00)01201-9
10.1016/S0925-8388(96)02709-0
10.1016/S0927-6505(99)00103-6
10.1016/S0955-0674(97)80014-2
10.1016/S0959-4388(00)00191-4
10.1016/S0959-440X(00)00124-X
10.1016/S0960-894X(99)00572-7
10.1016/S0965-2299(03)00004-9
10.1016/S0966-9795(01)00064-4
10.1016/S0968-0896(02)00469-8
10.1016/S1004-9541(08)60012-9
10.1016/S1040-6182(01)00093-3
10.1016/S1040-6182(02)00089-7
10.1016/S1055-7903(03)00225-2
10.1016/S1072-7515(01)01016-X
10.1016/S1081-1206(10)62905-5
10.1016/S1092-9134(03)00075-3
10.1016/S1367-5931(02)00376-9
10.1016/S1470-2045(12)70473-4
10.1016/S1473-3099(04)01248-4
10.1016/S1473-3099(10)70143-2
10.1016/S1473-3099(16)00095-5
10.1016/S1474-4422(08)70088-7
10.1016/S1474-4422(13)70150-9
10.1016/S1522-8401(03)00061-2
10.1016/S1575-0922(09)70555-8
10.1016/s0040-4039(00)71006-9
10.1016/s0140-6736(13)60222-6
10.1016/s0140-6736(98)02146-1
10.1016/s0304-3959(03)00065-4
10.1016/s0378-1135(02)00041-x
10.1016/s0753-3969(99)80009-3
10.1016/s1742-6847(09)70019-9
10.1175/1520-0477(2002)083<0249:NEFI>2.3.CO;2
10.1175/1520-0493(1997)125<1465:TIOMOO>2.0.CO;2
10.1656/1528-7092(2002)001[0189:FROTGS]2.0.CO;2
10.1666/0022-3360(2006)080[0400:NIRTHO]2.0.CO;2
10.1666/0094-8373(2005)031[0291:teafot]2.0.co;2
10.1890/0012-9658(2001)082[3531:TEBOLH]2.0.CO;2
10.3417/0026-6493(2007)94[407:doaait]2.0.co;2
enricobacis commented 7 years ago

Hi, in principle it's seems like a neat idea, but how do you discriminates fields that should be quoted?

For example the user query from the documentation:

AU=(Poole M* OR Wise J*) AND AD=Univ* Illinois

should not be quoted. So we should integrate a parser, which may seem overkill. Do you have any simpler idea to avoid a parser?

nemobis commented 7 years ago

You're right. My problem is that I don't even know how to correct my input, if it's wrong. Quoting the string or escaping the parentheses doesn't seem to work. I now see that replacing the parentheses with spaces does (at least with the current search system they have)!

DO=10.1656/1528-7092 2002 001[0189:FROTGS]2.0.CO;2

So you could consider it an error in user input and close this issue.

Does the same apply to other fields?

enricobacis commented 7 years ago

Ok, if anything comes to your mind about how to fix it directly in the tool in an elegant and error-proof way, reopen this issue or send a PR.