Skip to content
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

Need to save curTripleTerm on entry/exit to reifiedTriple and annotationBlock #67

Closed
gkellogg opened this issue Sep 2, 2024 · 0 comments · Fixed by #68
Closed

Need to save curTripleTerm on entry/exit to reifiedTriple and annotationBlock #67

gkellogg opened this issue Sep 2, 2024 · 0 comments · Fixed by #68
Labels
spec:bug Bug in the specification

Comments

@gkellogg
Copy link
Member

gkellogg commented Sep 2, 2024

Consider the following:

:s :p :o ~:r1 {| :p1 << :s2 :p2 :o2 >> |} ~:r2

This is intended to be the same as the following N-Triples:

:s :p :o .
:r1 rdf:reifies <<(:s :p :o)>> .
:r1 :p1 _:r0 .
_:r0 rdf:reifies <<(:s2 :p2 :o2)>> .
:r2 rdf:reifies <<(:s :p :o)>> .

However, because curTripleTerm is reset to <<(:s2 :p2 :o2)>> when parsing the inner reified triple, it forgets the original <<(:s :p :o)>> when it gets to ~:r2. The same thing can happen with annotations. this would result in the following incorrect output:

:s :p :o .
:r1 rdf:reifies <<(:s :p :o)>> .
:r1 :p1 _:r0 .
_:r0 rdf:reifies <<(:s2 :p2 :o2)>> .
:r2 rdf:reifies <<(:s2 :p2 :o2)>> .

Instead, productions need to save and restore the value of curTripleTerm on entry and exit to reifiedTriple and annotationBlock productions.

@gkellogg gkellogg added the spec:bug Bug in the specification label Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec:bug Bug in the specification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant