oeg-upm / mapeathor

Translator of spreadsheet mappings into R2RML, RML or YARRRML
https://morph.oeg.fi.upm.es/tool/mapeathor
Apache License 2.0
30 stars 10 forks source link

An unused Function lead to error #39

Closed mnieuwland closed 2 years ago

mnieuwland commented 2 years ago

As soon as a Function is defined, but not used in the Predicate_Object sheet, I get the following error:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/mapeathor/__main__.py", line 3, in <module>
    mapeathor.main()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/mapeathor/__init__.py", line 43, in main
    outputFile = mapping_generator.generateMapping(inputFile, args.output_file)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/mapeathor/mapping_generator.py", line 273, in generateMapping
    json = organizeJson(json)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/mapeathor/mapping_generator.py", line 55, in organizeJson
    json['Function'] = reFormatFunction(data['Function'], json)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/mapeathor/mapping_generator.py", line 138, in reFormatFunction
    result[fun]['Source']['FunctionID'] = fun
TypeError: 'NoneType' object does not support item assignment

Why would I define a function that I'm not using?

Well I do use the function. The result of the function is used as the input for another function. That works fine, but only after I also use the first function as a 'dummy' Object in the Predicate_Object sheet, the error is gone. However, this leaves me with a dummy triple I don't really want....

anaigmo commented 2 years ago

Solved in v1.5.4