anuzzolese / pyrml

pyRML is a Python based engine for processing RML files. The RDF Mapping Language (RML) is a mapping language defined to express customized mapping rules from heterogeneous data structures and serializations to the RDF data model. RML is defined as a superset of the W3C-standardized mapping language R2RML, aiming to extend its applicability and broaden its scope, adding support for data in other structured formats.
Apache License 2.0
33 stars 12 forks source link

Error in Importing RMLConverter #6

Open shakeel26 opened 2 years ago

shakeel26 commented 2 years ago

There is error in import due to which its not possible to run anything.

Traceback (most recent call last):
  File "converter.py", line 2, in <module>
    from pyrml import RMLConverter
  File "/pyrml/pyrml/__init__.py", line 1, in <module>
    from pyrml.pyrml import *
  File "/pyrml/pyrml/pyrml.py", line 52
    def __init__(self, map_id: URIRef = None):
                             ^
SyntaxError: invalid syntax

Can you explain, how to fix ?

anuzzolese commented 2 years ago

Which version of Python you are using? pyRML requires Python 3.x. It seems you are using Python 2.x

shakeel26 commented 2 years ago

Thanks for reply, I am using 3.7 , 2.x is too old,

anuzzolese commented 2 years ago

How do you run the software? What are the steps you do?

shakeel26 commented 2 years ago

I have followed the readme instructions:

1 - Clone repo 2 - then installed pip install . within repo => it was success 3 - Tried example => python converter.py -o artists_places.ttl -f turtle examples/artists/artist-map.ttl

At the step 3 it was failed.

4 - Then I tried API method also had issue of Import RMLConverter .

5 - I have tried with my own RML but also same errors of course.

anuzzolese commented 2 years ago

If you type on terminal python -v what you have back?

shakeel26 commented 2 years ago

Python 3.8.0 Now I tried again the following command python converter.py -o artists_places.ttl -f turtle examples/artists/artist-map.ttl Now the error is different and you can see in attachment. Screenshot from 2022-10-14 18-57-16

anuzzolese commented 2 years ago

The latest issue you are reporting should be fixed by commit 978e224 I have just posted. Let me know if it works. Of course you need to sync your local repo in order to fetch the changes.