diff --git a/rdflib/plugins/parsers/trig.py b/rdflib/plugins/parsers/trig.py index d28198bce..71593b5ce 100644 --- a/rdflib/plugins/parsers/trig.py +++ b/rdflib/plugins/parsers/trig.py @@ -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 diff --git a/test/test_w3c_spec/test_trig_w3c.py b/test/test_w3c_spec/test_trig_w3c.py index ea2b02edd..d7c843340 100644 --- a/test/test_w3c_spec/test_trig_w3c.py +++ b/test/test_w3c_spec/test_trig_w3c.py @@ -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" - ), } diff --git a/test_reports/rdflib_w3c_trig-HEAD.ttl b/test_reports/rdflib_w3c_trig-HEAD.ttl index 7c22104d2..78a28d61c 100644 --- a/test_reports/rdflib_w3c_trig-HEAD.ttl +++ b/test_reports/rdflib_w3c_trig-HEAD.ttl @@ -971,7 +971,7 @@ earl:assertedBy ; earl:mode earl:automatic ; earl:result [ a earl:TestResult ; - earl:outcome earl:failed ] ; + earl:outcome earl:passed ] ; earl:subject ; earl:test .