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

trig Parser now raises SyntaxError, when finding nested graphs #2468

Merged
merged 3 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions rdflib/plugins/parsers/trig.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def graph(self, argstr: str, i: int) -> int:

j = i + 1

if self._context is not None:
self.BadSyntax(argstr, i, "Nested graphs are not allowed")

oldParentContext = self._parentContext
self._parentContext = self._context
reason2 = self._reason2
Expand Down
3 changes: 0 additions & 3 deletions test/test_w3c_spec/test_trig_w3c.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@ def check_entry(entry: ManifestEntry) -> None:
f"{REMOTE_BASE_IRI}#trig-graph-bad-01": pytest.mark.xfail(
reason="accepts GRAPH with no name"
),
f"{REMOTE_BASE_IRI}#trig-graph-bad-07": pytest.mark.xfail(
reason="accepts nested GRAPH"
),
}


Expand Down
2 changes: 1 addition & 1 deletion test_reports/rdflib_w3c_trig-HEAD.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@
earl:assertedBy <https://github.com/RDFLib/rdflib> ;
earl:mode earl:automatic ;
earl:result [ a earl:TestResult ;
earl:outcome earl:failed ] ;
earl:outcome earl:passed ] ;
earl:subject <https://github.com/RDFLib/rdflib> ;
earl:test <http://www.w3.org/2013/TriGTests/#trig-graph-bad-07> .

Expand Down