Skip to content

Commit

Permalink
Improve README example.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pibmy committed Feb 18, 2020
1 parent c81e80b commit 380d711
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,25 @@ Examples
.. code-block:: python
from fuseki_manager import FusekiSPARQLClient
# Creation du client
db = FusekiSPARQLClient('dataset_name')
# SELECT request
query = "SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 25"
db.query(query)
result = db.query(query)
// result = JSON parsed response's results' bindings
# Other kind of requests with results
ns = {'foaf': 'http://xmlns.com/foaf/0.1/'}
query = 'ASK { ?x foaf:name "Alice" }'
db.raw_query(query, namespaces=ns)
result = db.raw_query(query, namespaces=ns)
// result = Raw JSON parsed response
# INSERT requets
ns = {'dc': 'http://purl.org/dc/elements/1.1/'}
query = 'INSERT DATA { <http://example/book1> dc:title "A new book" }'
db.update_query(query, namespaces=ns)
result = db.update_query(query, namespaces=ns)
// result = Raw HTTP response
Installation
Expand Down

0 comments on commit 380d711

Please sign in to comment.