SDM-TIB / SDM-RDFizer

An Efficient RML-Compliant Engine for Knowledge Graph Construction
https://doi.org/10.5281/zenodo.3872103
Apache License 2.0
107 stars 25 forks source link

Expected string or bytes-like object #38

Closed arenas-guerrero-julian closed 3 years ago

arenas-guerrero-julian commented 3 years ago

Hi There!

Describe the bug I am getting the following error when using RDFizer with MySQL and GTFS-Madrid-bench:

Traceback (most recent call last):
  File "/home/julian/PycharmProjects/SDM-RDFizer/rdfizer/run_rdfizer.py", line 3, in <module>
    semantify(str(sys.argv[1]))
  File "/home/julian/PycharmProjects/SDM-RDFizer/rdfizer/rdfizer/semantify.py", line 3982, in semantify
    number_triple += executor.submit(semantify_mysql, row, row_headers, triples_map, triples_map_list, output_file_descriptor, wr, config[dataset_i]["name"], config[dataset_i]["host"], int(config[dataset_i]["port"]), config[dataset_i]["user"], config[dataset_i]["password"],config[dataset_i]["db"]).result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
    raise self._exception
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/julian/PycharmProjects/SDM-RDFizer/rdfizer/rdfizer/semantify.py", line 2768, in semantify_mysql
    object = string_substitution_array(predicate_object_map.object_map.value, ".+", row, row_headers, "object")
  File "/home/julian/PycharmProjects/SDM-RDFizer/rdfizer/rdfizer/functions.py", line 351, in string_substitution_array
    if re.search("^[\s|\t]*$", value) is None:
  File "/usr/lib/python3.8/re.py", line 201, in search
    return _compile(pattern, flags).search(string)
TypeError: expected string or bytes-like object

Process finished with exit code 1

Environment Running RDFizer Ubuntu 20.04 LTS using python 3.8 mysql:5.7 docker image

Additionally The following warning is being printed by python 3.8 (default in Ubunto 20.04 LTS) in case you want to take a look at it or derives in problems:

/home/julian/PycharmProjects/SDM-RDFizer/rdfizer/rdfizer/semantify.py:3658: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if p is not "None":
/home/julian/PycharmProjects/SDM-RDFizer/rdfizer/rdfizer/semantify.py:3734: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if p is not "None":
eiglesias34 commented 3 years ago

Hello,

I have updated the SDM-RDFizer. Please confirm if the error has been corrected, so we can close this issue.

arenas-guerrero-julian commented 3 years ago

You are missing another str(value), in line 352 of functions.py

Julián

eiglesias34 commented 3 years ago

I added it there as well. Thank you.

arenas-guerrero-julian commented 3 years ago

Working (tested).

Julián