fix: TriG parser error handling for nested graphs (#2468) · RDFLib/rdflib@afea615 (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Commit afea615

fix: TriG parser error handling for nested graphs (#2468)

Raise an error when nested graphs occur in TriG. With this change, the <http://www.w3.org/2013/TriGTests/#trig-graph-bad-07> test passes. --------- Co-authored-by: WhiteGobo richardfechner@posteo.net Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Iwan Aucamp aucampia@gmail.com

File tree

3 files changed

lines changed

3 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -98,6 +98,9 @@ def graph(self, argstr: str, i: int) -> int:
98 98
99 99 j = i + 1
100 100
101 +if self._context is not None:
102 +self.BadSyntax(argstr, i, "Nested graphs are not allowed")
103 +
101 104 oldParentContext = self._parentContext
102 105 self._parentContext = self._context
103 106 reason2 = self._reason2
Original file line number Diff line number Diff line change
@@ -176,9 +176,6 @@ def check_entry(entry: ManifestEntry) -> None:
176 176 f"{REMOTE_BASE_IRI}#trig-graph-bad-01": pytest.mark.xfail(
177 177 reason="accepts GRAPH with no name"
178 178 ),
179 -f"{REMOTE_BASE_IRI}#trig-graph-bad-07": pytest.mark.xfail(
180 -reason="accepts nested GRAPH"
181 - ),
182 179 }
183 180
184 181
Original file line number Diff line number Diff line change
@@ -971,7 +971,7 @@
971 971 earl:assertedBy https://github.com/RDFLib/rdflib ;
972 972 earl:mode earl:automatic ;
973 973 earl:result [ a earl:TestResult ;
974 - earl:outcome earl:failed ] ;
974 + earl:outcome earl:passed ] ;
975 975 earl:subject https://github.com/RDFLib/rdflib ;
976 976 earl:test http://www.w3.org/2013/TriGTests/#trig-graph-bad-07 .
977 977