File size: 1,298 Bytes
622387b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | diff --git a/rdflib/graph.py b/rdflib/graph.py
index 5d739a95..7b7256d0 100644
--- a/rdflib/graph.py
+++ b/rdflib/graph.py
@@ -2623,7 +2623,7 @@ class Dataset(ConjunctiveGraph):
file: Optional[Union[BinaryIO, TextIO]] = None,
data: Optional[Union[str, bytes]] = None,
**args: Any,
- ) -> Graph:
+ ) -> Dataset:
"""
Parse an RDF source adding the resulting triples to the Graph.
diff --git a/rdflib/plugins/sparql/update.py b/rdflib/plugins/sparql/update.py
index a6908393..c9d36564 100644
--- a/rdflib/plugins/sparql/update.py
+++ b/rdflib/plugins/sparql/update.py
@@ -182,7 +182,10 @@ def evalModify(ctx: QueryContext, u: CompValue) -> None:
ctx = ctx.pushGraph(g)
for c in list(res):
- dg = ctx.graph
+ # TODO: Make this more intentional and without the weird type checking logic
+ # once ConjunctiveGraph is removed and Dataset no longer inherits from
+ # Graph.
+ dg = ctx.graph if type(ctx.graph) is Graph else ctx.dataset.default_context
if u.delete:
# type error: Unsupported left operand type for - ("None")
# type error: Unsupported operand types for - ("Graph" and "Generator[Tuple[Identifier, Identifier, Identifier], None, None]")
|