Skip to content

Commit 302c70e

Browse files
committed
lint
1 parent c24d38f commit 302c70e

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

examples/sparqlstore_example.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
"""
22
Simple examples showing how to use the SPARQLStore
33
"""
4-
from urllib.request import urlopen
4+
55
import sys
6+
from urllib.request import urlopen
67

78
from rdflib import Graph, Namespace, URIRef
8-
from rdflib.plugins.stores.sparqlstore import SPARQLUpdateStore, SPARQLStore
9-
from rdflib.term import Identifier, Literal
109
from rdflib.namespace import RDF, SKOS
10+
from rdflib.plugins.stores.sparqlstore import SPARQLStore, SPARQLUpdateStore
11+
from rdflib.term import Identifier, Literal
1112

1213
# Shows examples of the useage of SPARQLStore and SPARQLUpdateStore against local SPARQL1.1 endpoint if
1314
# available. This assumes SPARQL1.1 query/update endpoints running locally at
@@ -39,13 +40,15 @@
3940
graph.add((dbr.Brisbane, dbo.populationTotal, Literal(2)))
4041

4142
# EXAMPLE Update Store 2:
42-
update_store = SPARQLUpdateStore(query_endpoint="http://localhost:3030/db/sparql", update_endpoint="http://localhost:3030/db/update")
43+
update_store = SPARQLUpdateStore(
44+
query_endpoint="http://localhost:3030/db/sparql",
45+
update_endpoint="http://localhost:3030/db/update",
46+
)
4347
graph = Graph(store=update_store, identifier="http://dbpedia.org")
4448
graph.add((dbr["Category:Capitals_in_Europe"], RDF.type, SKOS.Concept))
4549
graph.add((dbr["Category:Holy_Grail"], RDF.type, SKOS.Concept))
4650
graph.add((dbr["Category:Hospital_ships_of_Japan"], RDF.type, SKOS.Concept))
4751

48-
4952
# EXAMPLE Store 1: using a Graph with the Store type string set to "SPARQLStore"
5053
graph = Graph("SPARQLStore", identifier="http://dbpedia.org")
5154
graph.open("http://localhost:3030/db/sparql")
@@ -85,7 +88,6 @@
8588
if count >= 3:
8689
break
8790

88-
8991
# EXAMPLE Query 4: doing RDFlib triple navigation using a Graph() with a SPARQLStore backend
9092
print("Triple navigation using a Graph() with a SPARQLStore backend:")
9193
st = SPARQLStore(query_endpoint="http://localhost:3030/db/sparql")

rdflib/plugins/stores/sparqlconnector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(
3333
self,
3434
query_endpoint: Optional[str] = None,
3535
update_endpoint: Optional[str] = None,
36-
returnFormat: Optional[str] = "xml", # noqa: N803
36+
returnFormat: Optional[str] = "xml", # noqa: N803
3737
method: te.Literal["GET", "POST", "POST_FORM"] = "GET",
3838
auth: Optional[Tuple[str, str]] = None,
3939
**kwargs,

test/test_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ def test_example(example_file: Path) -> None:
4040
try:
4141
result.check_returncode()
4242
except subprocess.CalledProcessError as process_error:
43-
if (process_error.returncode == 126):
43+
if process_error.returncode == 126:
4444
pytest.skip("This test returned 126 indikating to skip it.")
4545
raise

0 commit comments

Comments
 (0)