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 GRAPH needs graphname (as in w3c-test:trig-graph-bad-01) #2469

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions rdflib/plugins/parsers/trig.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,20 @@ def graph(self, argstr: str, i: int) -> int:
raise Exception if it looks like a graph, but isn't.
"""

need_graphid = False
# import pdb; pdb.set_trace()
j = self.sparqlTok("GRAPH", argstr, i) # optional GRAPH keyword
if j >= 0:
i = j
need_graphid = True

r: MutableSequence[Any] = []
j = self.labelOrSubject(argstr, i, r)
if j >= 0:
graph = r[0]
i = j
elif need_graphid:
return -1
aucampia marked this conversation as resolved.
Show resolved Hide resolved
else:
graph = self._store.graph.identifier # hack

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 @@ -173,9 +173,6 @@ def check_entry(entry: ManifestEntry) -> None:
f"{REMOTE_BASE_IRI}#trig-syntax-bad-list-04": pytest.mark.xfail(
reason="ignores badly formed quad"
),
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 @@ -923,7 +923,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-01> .

Expand Down
Loading