You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using some special characters in properties of type string and uploading the data to the knowledge graph, the literals will not reflect those characters correctly. For example, a species with rdfs:label "Cu(NO3)2·2.5H2O" will be uploaded as Cu(NO3)2·2.5H2O (note the additional  character).
This seems to be an encoding issue as it is the case only for characters that are encoded differently between UTF-8 and Windows-1252, see https://www.w3schools.com/tags/ref_urlencode.ASP
I assume it happens when the rdflib.Graph is serialized to build an update query here:
As discussed, encoding-decoding special characters when interacting with blazegraph using twa (previously py4jps) is a known issue that requires investigation on how py4j handles encoding-decoding, see #667
Given the time constraint of various projects, a workaround could be used for the time being (assuming you queried literal from the blazegraph and saved it to python str object your_string):
your_string.encode('ISO-8859-1').decode('utf-8')
In this specific case, it will be "X·Yâ\x80\x99".encode('ISO-8859-1').decode('utf-8') that returns "X·Y’"
When using some special characters in properties of type string and uploading the data to the knowledge graph, the literals will not reflect those characters correctly. For example, a species with rdfs:label "Cu(NO3)2·2.5H2O" will be uploaded as Cu(NO3)2·2.5H2O (note the additional  character).
This seems to be an encoding issue as it is the case only for characters that are encoded differently between UTF-8 and Windows-1252, see https://www.w3schools.com/tags/ref_urlencode.ASP
I assume it happens when the rdflib.Graph is serialized to build an update query here:
TheWorldAvatar/JPS_BASE_LIB/python_wrapper/twa/kg_operations/sparql_client.py
Line 230 in 13f303c
The serialized string is then executed as query here:
TheWorldAvatar/JPS_BASE_LIB/python_wrapper/twa/kg_operations/sparql_client.py
Line 128 in 13f303c
Here is a minimal example to reproduce this issue:
The text was updated successfully, but these errors were encountered: