Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add processor state, term constructor, and triple constructors. Change reifiedTriple to reifingTriple. #62
Add processor state, term constructor, and triple constructors. Change reifiedTriple to reifingTriple. #62
Changes from 6 commits
aea3484
102b6f7
506d7e4
1873565
d99af73
4d7e208
c1e90dd
07960c1
c14ab8d
06cf7ff
79eb5f6
778d4c0
9d6ada0
41b6da1
ca01a5f
91a72b2
6300061
2d4b70a
8e718f9
5d909e4
3ad14fb
15297c9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Small errata to RDF 1.1:
curSubject
andcurPredicate
are stacks, or alternative the parser state is a stack.curSubject
is bound to the subject production." True but it is more than justsubject
even in RDF 1.1 (subject position,blankNodePropertyList
, property lists in the object position and collections). RDF 1.2 adds thetripleTerm
,reifiedTriple
,annotation
andannotationBlock
cases.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.
Neither
curSubject
norcurPredicate
(nor the parser state in general) is a stack, they are global state. Triple constructors save and restore their values, so the "stack" is implemented via the activation records of these constructors, such as the Triple Term constructor.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.
It is not set until the end of the production so it is that previous sate at this point.
The production will set
curReifier
- there 's no "if". Do this now and not at the end, then yield the reifies triple usingcurReifier
.There is no need to have a stack for
curReifier
. Even in annotations, only the last value is needed.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.
The text is intended to capture the events generated by
:s :p :o ~:r1 ~:r2
. When seeing~:r1
there is no previously establishedcurReifier
so nothing is emitted, thencurReifier
is set from thereifier
term constructor. The next time when it sees~:r2
,curReifier
would be:r1
so:ri rdf:reifies <<(...)>>
is emitted and thencurReifier
is set to:r2
.There is no stack for
curReifier
, there is just if it was previously set or not (Note that there is no text that says to save the value ofcurReifier
anywhere). It is cleared when entering Annotations, set in either
Reifieror
Annotation Block, and consumed in
Reifier,
Annotation Blockor
Annotations`.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.
I'm beginning to see what you want to do here but then some text does seem right.
needs a condition that curReifier is set. In
:s :p :o ~:r {| :x :y |}
it is not (it's been used). That's where I see identical triples being emitted once for the annotationBlock and one at the and of annotations.There needs to be more recording and restoring:
which I think is:
note
:r1 :x2 :y2
.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.
That's what my parser produces.
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.
Delete this text. Moved to earlier.
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.
The reason it is written the way it is is that
Reifier
can set the value that might be used inAnnotation Block
, but we'll only know that if there is an Annotation Block after the Reifier. If it was set, but not used, and we see another Reifier, it can then be emitted for the savedcurReifier
.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.
In the parser state section, maybe explain "record" means a stack.
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.
It may not be the
subject
production. It can bereifiedTriple
. They both setcurSubject
but that is used used later as the reifier carried over.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.
curSubject
may have been modified by the subject/reifiedTriple in the subject position inside<< >>
.It might be batter use
curReifier
and make it a stack (for annotation and asserted triples it does not need to be a stack as in comment above.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.
The rdf:reifies triple is generated in
AnnotationBlock
.The "annotation" production is
annotation ::= (reifier | annotationBlock)*
so I don't think there is much to do here especially if therdf:refies
triple is generated at the start of anannotationBlock
and allreifier
needs to do is setcurReifier
which gets carried to the next block only (or thereifiedTriple
case).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.
As mentioned above, this is needed to emit the reifying triple if |curReifier| was not consumed in an Annotation Block. For example
:s :p :o ~ :r
.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.
OK - I will reread but I thought a reifing triple was created in both parts for
~:r {| :q :z |}
. Maybe Annotation Block only handled the "no explicit reifier case".And
:s :p :o :~r1 ~:r2
.