Closed anatoly-scherbakov closed 2 years ago
UPD. I had to update the code, description, and title of the issue because I could reproduce it in an easier way.
Problem. Code and output: https://gist.github.com/anatoly-scherbakov/e7baee765ca9f22f419a2eb5a89689e8
The t in graph code will fail if the object of the triple t is a Literal with language tag defined. For example, in the code snippet provided above,
t in graph
object
t
Literal
( URIRef('https://foo'), RDFS.comment, Literal('', lang='en'), ) in graph
throws an AttributeError: objLanguage on an empty graph.
AttributeError: objLanguage
I could try helping fix this but I need a better understanding of reasons of the error. I am not clear enough about how the table structure works.
Thanks, @anatoly-scherbakov . The problem was that the code for deciding which tables to query (sloppily) checked for not obj rather than obj is None, but not Literal('', lang='en') == True.
not obj
obj is None
not Literal('', lang='en') == True
UPD. I had to update the code, description, and title of the issue because I could reproduce it in an easier way.
Problem. Code and output: https://gist.github.com/anatoly-scherbakov/e7baee765ca9f22f419a2eb5a89689e8
The
t in graph
code will fail if theobject
of the triplet
is aLiteral
with language tag defined. For example, in the code snippet provided above,throws an
AttributeError: objLanguage
on an empty graph.I could try helping fix this but I need a better understanding of reasons of the error. I am not clear enough about how the table structure works.