Turtle parser accepts literal subjects, which is invalid RDF #1614
-
While running a script including this kind of loop,
..an accidentally added literal as a subject is surprisingly allowed (originally from the loaded turtle formatted file). None as a subject can read types (in this case literals) outside the standard. An assumption is that it is the parser that allows non-standard subject types. Python: 3.6.9 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
To clarify: The problem is with the Turtle parser, not the .triples method (where it surfaced). The parser seems to happily accept a literal in the subject position, even though this is not allowed in RDF. Contents of test.ttl:
Code:
The N-Triples parser fails on the same file. |
Beta Was this translation helpful? Give feedback.
-
Related to #895 - it appears that rdflib is not very strict about RDF and in some cases (but not always) supports generalized RDF datasets where literals can be in the subject position. |
Beta Was this translation helpful? Give feedback.
Related to #895 - it appears that rdflib is not very strict about RDF and in some cases (but not always) supports generalized RDF datasets where literals can be in the subject position.