summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorNicholas Car <nicholas.car@surroundaustralia.com>2021-06-18 19:40:42 +1000
committerNicholas Car <nicholas.car@surroundaustralia.com>2021-06-18 19:40:42 +1000
commit2bc50a48c1cb4f1d932ea3541dbd1aab6ee5b91b (patch)
treee1e2fbc41b93e986088215e955465b33b95d06ef /docs
parent88a353649c92da6903ea53b7396d9c1365c1b1ee (diff)
parent8048f37e0ae7951c0dea07c8e0ac84b801a7044c (diff)
downloadrdflib-2bc50a48c1cb4f1d932ea3541dbd1aab6ee5b91b.tar.gz
Merge branch 'master' into docco_clean
Diffstat (limited to 'docs')
-rw-r--r--docs/intro_to_sparql.rst37
-rw-r--r--docs/sphinx-requirements.txt2
2 files changed, 18 insertions, 21 deletions
diff --git a/docs/intro_to_sparql.rst b/docs/intro_to_sparql.rst
index 3ad00c2c..e80cae58 100644
--- a/docs/intro_to_sparql.rst
+++ b/docs/intro_to_sparql.rst
@@ -29,19 +29,16 @@ For example...
.. code-block:: python
import rdflib
-
g = rdflib.Graph()
+ g.parse("http://danbri.org/foaf.rdf#")
- # ... add some triples to g somehow ...
- g.parse("some_foaf_file.rdf")
-
- qres = g.query(
- """SELECT DISTINCT ?aname ?bname
- WHERE {
- ?a foaf:knows ?b .
- ?a foaf:name ?aname .
- ?b foaf:name ?bname .
- }""")
+ knows_query = """
+ SELECT DISTINCT ?aname ?bname
+ WHERE {
+ ?a foaf:knows ?b .
+ ?a foaf:name ?aname .
+ ?b foaf:name ?bname .
+ }"""
for row in qres:
print(f"{row.aname} knows {row.bname}")
@@ -175,18 +172,18 @@ initial bindings:
.. code-block:: python
- q = prepareQuery(
- "SELECT ?s WHERE { ?person foaf:knows ?s .}",
- initNs = { "foaf": FOAF }
- )
+ q = prepareQuery(
+ "SELECT ?s WHERE { ?person foaf:knows ?s .}",
+ initNs = { "foaf": FOAF }
+ )
- g = rdflib.Graph()
- g.load("foaf.rdf")
+ g = rdflib.Graph()
+ g.load("foaf.rdf")
- tim = rdflib.URIRef("http://www.w3.org/People/Berners-Lee/card#i")
+ tim = rdflib.URIRef("http://www.w3.org/People/Berners-Lee/card#i")
- for row in g.query(q, initBindings={'person': tim}):
- print(row)
+ for row in g.query(q, initBindings={'person': tim}):
+ print(row)
Custom Evaluation Functions
diff --git a/docs/sphinx-requirements.txt b/docs/sphinx-requirements.txt
index 48ba7549..b4f0ddd9 100644
--- a/docs/sphinx-requirements.txt
+++ b/docs/sphinx-requirements.txt
@@ -1,3 +1,3 @@
-sphinx==4.0.1
+sphinx==4.0.2
sphinxcontrib-apidoc
git+https://github.com/gniezen/n3pygments.git