typhon-project / typhonql

Typhon Query Language
Eclipse Public License 2.0
4 stars 1 forks source link

[BUG] Can't add reference (when NLP is involved) #117

Closed MarieSaphira closed 3 years ago

MarieSaphira commented 3 years ago

Describe the bug Adding a reference throws errors

Query

update RawTextWarnings r 
where r.@id == #e9ba9f2d-2415-4aec-84c7-dd37f6e52472 
set { pw: #0008ee2d-3344-40c8-8a3d-17cf5f148d27 }

Model VW's

entity RawTextWarnings {
    ew : freetext[NamedEntityRecognition[atb_weather_ner]] 
    pw -> ProcessedWarnings[1]
}

RawTextWarnins is in a MongoDB, ProcessedWarnings in a MariaDB. RawTextWarnings.pw was empty before trying the update

Expected behavior Add the ProcessedWarnings to the RawTextWarnins

REST API

Jan 18, 2021 @ 15:19:23.000typhonql-server
java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: (conn=11592) Table 'RelationalDB.ProcessedWarnings.pw^-RawTextWarnings.pw' doesn't exist
 Jan 18, 2021 @ 15:19:23.000typhonql-server
(internal error)
 Jan 18, 2021 @ 15:19:23.000typhonql-server
    at $typhonql$(|main://$typhonql$|)
 Jan 18, 2021 @ 15:19:23.000typhonql-server
 Jan 18, 2021 @ 15:19:23.000typhonql-server
java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: (conn=11592) Table 'RelationalDB.ProcessedWarnings.pw^-RawTextWarnings.pw' doesn't exist
 Jan 18, 2021 @ 15:19:23.000typhonql-server
    at nl.cwi.swat.typhonql.backend.mariadb.MariaDBEngine$2.performUpdate(MariaDBEngine.java:179)
 Jan 18, 2021 @ 15:19:23.000typhonql-server
    at nl.cwi.swat.typhonql.backend.UpdateExecutor.executeUpdateOperation(UpdateExecutor.java:77)
tvdstorm commented 3 years ago

Thanks for the report, can you try to put an inverse/opposite on ProcessedWarnings, like so:

rtw -> RawTextWarnings."RawTextWarnings.pw"[0..1]
tvdstorm commented 3 years ago

If this works, I know where to look for a fix.

tvdstorm commented 3 years ago

Fixed in 4e7a4298e8160086d5be8bb5a73ac43212112240