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

Sparql connector default graph #2761

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
3 changes: 2 additions & 1 deletion rdflib/plugins/stores/sparqlconnector.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def query(
raise SPARQLConnectorException("Query endpoint not set!")

params = {}
default_graph = default_graph or self.kwargs.get("default_graph")
# this test ensures we don't have a useless (BNode) default graph URI, which calls to Graph().query() will add
if default_graph is not None and type(default_graph) is not BNode:
params["default-graph-uri"] = default_graph
Expand Down Expand Up @@ -162,7 +163,7 @@ def update(
raise SPARQLConnectorException("Query endpoint not set!")

params = {}

default_graph = default_graph or self.kwargs.get("default_graph")
if default_graph is not None:
params["using-graph-uri"] = default_graph

Expand Down
Loading