diff options
| author | Nicholas Car <nicholas.car@surroundaustralia.com> | 2021-06-18 19:40:42 +1000 |
|---|---|---|
| committer | Nicholas Car <nicholas.car@surroundaustralia.com> | 2021-06-18 19:40:42 +1000 |
| commit | 2bc50a48c1cb4f1d932ea3541dbd1aab6ee5b91b (patch) | |
| tree | e1e2fbc41b93e986088215e955465b33b95d06ef /docs | |
| parent | 88a353649c92da6903ea53b7396d9c1365c1b1ee (diff) | |
| parent | 8048f37e0ae7951c0dea07c8e0ac84b801a7044c (diff) | |
| download | rdflib-2bc50a48c1cb4f1d932ea3541dbd1aab6ee5b91b.tar.gz | |
Merge branch 'master' into docco_clean
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/intro_to_sparql.rst | 37 | ||||
| -rw-r--r-- | docs/sphinx-requirements.txt | 2 |
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 |
