CLARIAH / COW

Integrated CSV to RDF converter, using CSVW and nanopublications
MIT License
46 stars 9 forks source link

Could not find source or metadata file in path; make sure you called with a .csv file #152

Closed esorolla closed 1 year ago

esorolla commented 1 year ago

Hi,

I'm trying to convert a csv file into RDF format unsuccessfully. I tried to run the command proposed on the pypi.org site of the cow-csvw library:

cow_tool convert myfile.csv

The whole error message is

Converting addresses.csv to RDF
Initializing converter for addresses.csv
Something went wrong, skipping addresses.csv.
Traceback (most recent call last):
  File "C:\Users\dende\AppData\Local\Programs\Python\Python39\lib\site-packages\cow_csvw\csvw_tool.py", line 55, in __init__
    c = CSVWConverter(source_file, delimiter=delimiter,
  File "C:\Users\dende\AppData\Local\Programs\Python\Python39\lib\site-packages\cow_csvw\converter\csvw.py", line 203, in __init__
    raise Exception(
Exception: Could not find source or metadata file in path; make sure you called with a .csv file

I tried also using the absolute file path without success. After checking the "csvw_tool.py" script I couldn't find the problem. The Exception is raised from an if block where the target file is not found. I included the csvw_tool folder path in the PATH environmental variable but obviously the file is not encountered by the script.

Any hint?

esorolla commented 1 year ago

Ok, I had to apply the build command to generate the metadata prior to apply the convert command. Now it works!