summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorNicholas Car <nicholas.car@surroundaustralia.com>2020-05-16 21:00:24 +1000
committerNicholas Car <nicholas.car@surroundaustralia.com>2020-05-16 21:00:24 +1000
commit0be6f6039479ce29cf71b11e76be54e186130036 (patch)
tree897d208525a7e8952fb496151db074d49dcdeb3a /examples
parent2a8d70824e1b4caf0c606074a44ac3a15fa72718 (diff)
downloadrdflib-0be6f6039479ce29cf71b11e76be54e186130036.tar.gz
blacked all python files
Diffstat (limited to 'examples')
-rw-r--r--examples/conjunctive_graphs.py2
-rw-r--r--examples/slice.py4
-rw-r--r--examples/sparqlstore_example.py19
-rw-r--r--examples/swap_primer.py2
4 files changed, 16 insertions, 11 deletions
diff --git a/examples/conjunctive_graphs.py b/examples/conjunctive_graphs.py
index 80282684..f714d9ff 100644
--- a/examples/conjunctive_graphs.py
+++ b/examples/conjunctive_graphs.py
@@ -53,7 +53,7 @@ if __name__ == "__main__":
# query the conjunction of all graphs
xx = None
- for x in g[mary: ns.loves / ns.hasCuteName]:
+ for x in g[mary : ns.loves / ns.hasCuteName]:
xx = x
print("Q: Who does Mary love?")
print("A: Mary loves {}".format(xx))
diff --git a/examples/slice.py b/examples/slice.py
index eaab1540..33aacf9b 100644
--- a/examples/slice.py
+++ b/examples/slice.py
@@ -18,9 +18,9 @@ if __name__ == "__main__":
graph.load("foaf.n3", format="n3")
- for person in graph[: RDF.type: FOAF.Person]:
+ for person in graph[: RDF.type : FOAF.Person]:
- friends = list(graph[person: FOAF.knows * "+" / FOAF.name])
+ friends = list(graph[person : FOAF.knows * "+" / FOAF.name])
if friends:
print("%s's circle of friends:" % graph.value(person, FOAF.name))
for name in friends:
diff --git a/examples/sparqlstore_example.py b/examples/sparqlstore_example.py
index 874d6183..936f6540 100644
--- a/examples/sparqlstore_example.py
+++ b/examples/sparqlstore_example.py
@@ -14,16 +14,21 @@ if __name__ == "__main__":
graph = Graph("SPARQLStore", identifier="http://dbpedia.org")
graph.open("http://dbpedia.org/sparql")
- pop = graph.value(
- URIRef("http://dbpedia.org/resource/Berlin"),
- dbo.populationTotal)
+ pop = graph.value(URIRef("http://dbpedia.org/resource/Berlin"), dbo.populationTotal)
- print("According to DBPedia, Berlin has a population of {0:,}".format(int(pop), ',d').replace(",", "."))
+ print(
+ "According to DBPedia, Berlin has a population of {0:,}".format(
+ int(pop), ",d"
+ ).replace(",", ".")
+ )
# using a SPARQLStore object directly
s = SPARQLStore(endpoint="http://dbpedia.org/sparql")
s.open(None)
pop = graph.value(
- URIRef("http://dbpedia.org/resource/Brisbane"),
- dbo.populationTotal)
- print("According to DBPedia, Brisbane has a population of " "{0:,}".format(int(pop), ',d'))
+ URIRef("http://dbpedia.org/resource/Brisbane"), dbo.populationTotal
+ )
+ print(
+ "According to DBPedia, Brisbane has a population of "
+ "{0:,}".format(int(pop), ",d")
+ )
diff --git a/examples/swap_primer.py b/examples/swap_primer.py
index e3adc298..35dc107c 100644
--- a/examples/swap_primer.py
+++ b/examples/swap_primer.py
@@ -58,7 +58,7 @@ if __name__ == "__main__":
# dataset from the example, and start
# with a fresh new graph.
- del(primer)
+ del primer
primer = ConjunctiveGraph()
# Lets start with a verbatim string straight from the primer text: