Serialize subject and predicate literals correctly - #330
Conversation
I wonder if this has repercussions for #339; should we have a generic flag for "out of syntax features"? |
RubenVerborgh
left a comment
There was a problem hiding this comment.
Perhaps we should still keep _encodeSubject and _encodeObject around, just so we can error in those functions as needed.
...perhaps, though I worry about performance degradation doing it internally; we could just supply |
|
As an aside - are there any RDF syntaxes that don't support Line 207 in c7540c4 |
Turtle only allows it in the predicate position. |
3a8218a to
64a6ce0
Compare
Resolves conflicts with the RDF 1.2 triple-term syntax; keeps _encodeSubject/_encodeObject as thin wrappers around the shared literal-aware _encodeTerm encoding. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…mats Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Per @jeswr, I've pushed directly to this branch (thanks to "allow edits by maintainers") to bring it up to date — @joachimvh's diagnosis and fix are untouched and remain the core of this PR; his original commit is preserved as-is. What was added on top:
|
Closes #329
This does have as disadvantage that invalid turtle will be generated if quads get added to the writer that can not be represented in turtle. If that is a problem, an alternative solution would be to have variants of the writer, similarly to how n-quads get handled, where the turtle version throws an error if it encounters a literal in the subject/predicate position and the N3 version handles it correctly. Let me know what you prefer and I can update the PR.