/usr/share/doc/python-rdflib-doc/examples/sparql_update_example.py is in python-rdflib-doc 4.1.2-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | """
SPARQL Update statements can be applied with :meth:`rdflib.graph.Graph.update`
"""
import rdflib
if __name__=='__main__':
g = rdflib.Graph()
g.load("foaf.rdf")
g.update('''
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dbpedia: <http://dbpedia.org/resource/>
INSERT
{ ?s a dbpedia:Human . }
WHERE
{ ?s a foaf:Person . }
''')
for x in g.subjects(
rdflib.RDF.type, rdflib.URIRef('http://dbpedia.org/resource/Human')):
print x
|