In ingen.py, line 224 when iterating over the attributes of class NS, dunder attributes (__dict__ and __weakref__) must be skipped, otherwise rdflib logs this warning.
<attribute '__dict__' of 'NS' objects> does not look like a valid URI, trying to serialize this will break.
<attribute '__weakref__' of 'NS' objects> does not look like a valid URI, trying to serialize this will break.
Adding these attributes as URIRefs, also leads to an error when calling ingen.Remote.get():
error: at line 13 of <>:
Bad syntax (expected '.' or '}' or ']' at end of statement) at ^ in:
"...b" .\n@prefix __dict__: <<attribute '__dict__' of 'NS' objects>"^b"> .\n@prefix __weakref__: <<attribute '__weakref__' of 'NS' o"..."
In ingenish the return value of ingen.Remote.get() (type bytes) must be decoded before printing, to keep the corerct formatting in the output. There may be other places where decoding bytes instances is necessary.
Here's a patch I apply to the ingen-git AUR package, which, I believe, fixes these issues:
ingen.py
, line 224 when iterating over the attributes of classNS
, dunder attributes (__dict__
and__weakref__
) must be skipped, otherwiserdflib
logs this warning.Adding these attributes as
URIRef
s, also leads to an error when callingingen.Remote.get()
:ingenish
the return value ofingen.Remote.get()
(typebytes
) must be decoded before printing, to keep the corerct formatting in the output. There may be other places where decodingbytes
instances is necessary.Here's a patch I apply to the
ingen-git
AUR package, which, I believe, fixes these issues:https://aur.archlinux.org/cgit/aur.git/tree/ingen-ingenish-python3.diff?h=ingen-git