RDFLib / pyLODE

An OWL ontology documentation tool using Python and templating, based on LODE

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error from rdflib for declaration of VANN

rivettp opened this issue · comments

I'm using 3.0.1 of pylode and 4.0.6 of rdflib

Traceback (most recent call last):
File "/home/rivettp/.local/bin/pylode", line 5, in
from pylode.cli import main
File "/home/rivettp/.local/lib/python3.8/site-packages/pylode/init.py", line 1, in
from .utils import *
File "/home/rivettp/.local/lib/python3.8/site-packages/pylode/utils.py", line 32, in
from rdflib.namespace import (
ImportError: cannot import name 'VANN' from 'rdflib.namespace' (/home/rivettp/.local/lib/python3.8/site-packages/rdflib/namespace/init.py)

You'll need to upgrade to rdflib >= 5.0.0 but best would be 6.1.1. I'm not really able to maintain compatibility with such ancient RDFlib releases (4.0.6 must be from > 5 years ago!)

Apologies, I'm using rdflib 6.0.2, which is the latest that pip gives me for the version of python (3.8) included with my Ubuntu 20.0.4. And confirmed I'm getting the same error.

Ah, ok, I'll have to look into this then... blast!

Hmmm... this problem is tricky because I can't easily replicate it: the VANN namespace resolves just like all the others do in 6.0.2, see https://github.com/RDFLib/rdflib/tree/6.0.2/rdflib/namespace, so I don't yet know why you're seeing the error.

I'm going to have to try and run on Ubuntu and Python 3.8 exactly perhaps.

As an FYI to this issue, I had the same issue on MacOS with pylode installed in a pipx venv.

Traceback (most recent call last):
  File "/Users/cvardema/.local/bin/pylode", line 5, in <module>
    from pylode.cli import main
  File "/Users/cvardema/.local/pipx/venvs/pylode/lib/python3.10/site-packages/pylode/__init__.py", line 1, in <module>
    from .utils import *
  File "/Users/cvardema/.local/pipx/venvs/pylode/lib/python3.10/site-packages/pylode/utils.py", line 32, in <module>
    from rdflib.namespace import (
ImportError: cannot import name 'VANN' from 'rdflib.namespace' (/Users/cvardema/.local/pipx/venvs/pylode/lib/python3.10/site-packages/rdflib/namespace/__init__.py)
Python 3.10.2 (main, Feb  2 2022, 06:19:27) [Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import rdflib
RDFLib Version: 6.0.0

Uninstalling the pipx venv and reinstalling forced an upgrade of rdflib to 6.1.1 that seems to have solved the issue. Anyone running into this issue should probably first try to get to rdflib up to 6.1.1.