summaryrefslogtreecommitdiff
path: root/examples/sparql_query_example.py
diff options
context:
space:
mode:
authorGunnar Aastrand Grimnes <gromgull@gmail.com>2013-05-03 21:12:44 +0200
committerGunnar Aastrand Grimnes <gromgull@gmail.com>2013-05-03 21:12:44 +0200
commit937edd34747dec528ec818e7893a1f2e3c0a84b3 (patch)
tree8b872efe1bec7ea9600617800a905ab9e4c01368 /examples/sparql_query_example.py
parent723137895125209c071ea0aac927b0153892d557 (diff)
downloadrdflib-937edd34747dec528ec818e7893a1f2e3c0a84b3.tar.gz
cleanup - move stuff from rdfextras to sensible packages - entry_points for console scripts
Diffstat (limited to 'examples/sparql_query_example.py')
-rw-r--r--examples/sparql_query_example.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/sparql_query_example.py b/examples/sparql_query_example.py
index 285eabf1..293c4354 100644
--- a/examples/sparql_query_example.py
+++ b/examples/sparql_query_example.py
@@ -19,9 +19,14 @@ import rdflib
g = rdflib.Graph()
g.load("foaf.rdf")
+# the QueryProcessor knows the FOAF prefix from the graph
+# which in turn knows it from reading the RDF/XML file
for row in g.query(
- 'select ?s where { [] <http://xmlns.com/foaf/0.1/knows> ?s .}'):
+ 'select ?s where { [] foaf:knows ?s .}'):
print row.s
# or row["s"]
# or row[rdflib.Variable("s")]
+
+
+