Conversation
…ts of sibling node objects
…m defined on demand
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
These tests fail on the head of #481 by design, so the CI of this PR is expected to be red until the findings of the review on #481 are fixed.
The context overflow check counts the distinct URLs of a cache that lives for the whole document, so remote contexts of sibling node objects add up. Test "remote contexts of sibling node objects do not add up to a context overflow" fails with
CHECK( context overflow == )andCHECK( 101 == 102 ). A self-including remote context (er02) overflows the stack on the PR head; it has no test here because doctest cannot catch that.A relative context URL is a view into the thread_local buffer of the IRIFactory, and it is used as the base of the nested parse. Test "relative urls in a remote context resolve against the url of that context" fails because
http://ex/ot/sub3.jsonldis requested instead ofhttp://ex/dir/sub3.jsonld, with "loading remote context failed not found" and no quad.With
"@propagate": falsein a remote context,previous_contextpoints to a dead object. Test "@propagate false in a remote context does not reach nested node objects" throwsstd::bad_allocin RelWithDebInfo, and ASan reportsstack-use-after-return ... Context::find_term_position JsonLdParserTypes.cpp:17.@basein a remote context is applied (spec 4.1 step 5.7 skips it). Test "@base in a remote context is ignored" fails with<http://other.example/s> <http://ex/p> "v" .instead of<http://doc.example/s> <http://ex/p> "v" ..A term that
iri_expansiondefines on demand stores an empty base URL for its scoped context. Test "a term defined on demand loads its remote scoped context" fails with "invalid scoped context (loading document failed)".A remote context document without
@contextreports a simdjson error. Test "a remote context document without @context is an invalid remote context" fails withCHECK( NO_SUCH_FIELD: The JSON field referenced does not exist in this object. == invalid remote context ).An imported
@contextthat is not a map reports a simdjson error. Test "an imported context that is not a map is an invalid remote context" fails withCHECK( INCORRECT_TYPE: The JSON element does not have the requested type. == invalid remote context ).Loading remote contexts leaves the base of the shared parsing state at a context URL. Test "loading remote contexts does not change the base of the parsing state" fails with
CHECK( http://ctx.example.com/c1.jsonld == http://example.com/doc ), and a later Turtle parse giveshttp://ctx.example.com/s.An exception thrown by
request_urlescapes the iterator. Test "an exception from request_url becomes a parsing error" fails withCHECK_NOTHROW( parse_all() ) THREW exception: "timeout".base_urlis part of the protected term check, and the on-demand path stores an empty one, so an identical redefinition fails. Test "a protected term that is defined on demand may be redefined with the same definition" fails with "protected term redefinition" (develop parses this input).parse_contextclears the pending scoped context checks of the terms thathandle_remotepasses to it. Test "an invalid scoped context before a remote context is reported" fails because a quad is returned and no error.Pass condition: for each test, a small local fix of the library (not part of this PR) was applied, the test passed (
test cases: 1 | 1 passed), and the fix was reverted. The @propagate test was also run under ASan with the fix. With the library of the PR head, the full tests_JSON_LD_Parser run shows exactly these 11 tests failing and all 24 old tests passing. The first commit adds a small helper that most of the later tests use.(prepared with claude)