Return to Snippet

Revision: 40850
at February 8, 2011 23:14 by magicrebirth

Initial Code
[email protected]:~$ python
Python 2.6.4 (r264:75706, Dec  7 2009, 18:43:55) 
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rdflib
>>> graph = rdflib.Graph('Sleepycat')
>>>'my-store', create=True)
>>> graph.parse('')
>>> for object in graph.objects(predicate=rdflib.namespace.OWL.sameAs):
...   print object

Initial URL

Initial Description
Note that in the example the 'sleepycat' backend is used ( Oracle Berkeley DB, which requires the ''bsddb3'' python bindings). If you don't have that installed you can just remove that directive and the triples will be loaded in memory.....

Initial Title
RDFlib: access a triple store in 5 lines of code

Initial Tags

Initial Language