-
Notifications
You must be signed in to change notification settings - Fork 5
GN-5607: correctly parse older-style literal nodes #1323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-node
attribute...)heading
node itself is not rdfa-aware, it does not have backlinks definedheading
node 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 plainheading
node inside.AFAIK, resource nodes may not have a
datatype
attribute, while literal nodes always have one.Checks PR readiness