GN-5607: correctly parse older-style literal nodes#1323
Conversation
f7611f8 to
6d10919
Compare
|
It seems some issues popped-up with this change in the external-triple tests, will investigate this further... |
91db7b4 to
8b9aad3
Compare
I've added a quick/hacky solution for the external triples. If this PR looks good to you, I'll refactor it in a more robust solution. |
piemonkey
left a comment
There was a problem hiding this comment.
Looks good to me (after removing the duplicate title in the given example). I'm not sure of the best way to tell what is a resource, but I'm confident that they shouldn't have datatypes.
|
Hmm I don't think literal nodes always have a datatype I'm curious about the "alternative" solution of wrapping it in a literal node, cause that's I think the ideal result. I'm assuming it's more of an additional thing right, since we'd still need the parser changes in this pr to make that possible? |
I indeed think not all literal nodes have a datatype, but all nodes with a datatype should be literal nodes right (with the exception of external triples). On the wrapping solution: I agree that this would be a nice solution, but I think that this parser change is indeed still necessary. The wrapping is something we'd do on the prosemirror level. I can look into it in a seperate PR maybe? |
57063f5 to
a803ce2
Compare
03dd619 to
4a02d11
Compare
|
@abeforgit I have included an example of the wrapping-strategy in #1329 |
a803ce2 to
329a9d1
Compare
a086289 to
ab31283
Compare
Overview
This PR ensures that older-style literal nodes (which are not per se rdfa-aware) are more or less correctly parsed.
The example used to test this PR are older decision templates with non rdfa-aware titles.
connected issues and PRs:
GN-5607
How to test/reproduce
data-literal-nodeattribute...)headingnode itself is not rdfa-aware, it does not have backlinks definedheadingnode works and results in the correct changes in the RDF outputChallenges/uncertainties
This is not a perfect solution, as heading nodes are (no longer) rdfa-aware.
An alternative solution would be to convert these type of headings to a div node (
block_rdfa) with a plainheadingnode inside.AFAIK, resource nodes may not have a
datatypeattribute, while literal nodes always have one.Checks PR readiness