4

I would like to access Virtuoso RDF store from Python much like I do Postgres using psycopg. After some googling, I came to the this page but I couldn't get either SQLAlchemy

sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:virtuoso

or RDFLib

rdflib.plugin.PluginException: No plugin registered for (Virtuoso, <class 'rdflib.store.Store'>)

to work. Any idea how to get either one to work so I can query and update RDF data from Python?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
amphibient
  • 29,770
  • 54
  • 146
  • 240
  • 1
    i am facing the same problem!!! exactly the same, and after some reaserch i believe that Virtuosois somehow is unknowing to RDFLib. If you figure it out plz post an answer , i will do the same. – raeX Nov 23 '16 at 23:38
  • 1
    After some reaserch, I found this [Virtuoso wrapper library for python](https://github.com/juanique/python-virtuoso). I have to try it out first but I believe this will do the work! – raeX Nov 24 '16 at 15:55
  • 1
    Have you seen these [RDFLib and SQLAlchemy bindings for Virtuoso](https://github.com/maparent/virtuoso-python), last updated in September 2016? – TallTed Nov 28 '16 at 15:16
  • I am having problems installing python-virtuoso that are encapsulated by [this post](http://stackoverflow.com/questions/40850108/python-module-from-github-installed-using-setup-py-cant-see-own-submodules/40850171#40850171), in case you are able to chime in. – amphibient Nov 28 '16 at 18:38
  • @TallTed, i got exceptions when running `python setup.py install` – amphibient Nov 28 '16 at 19:13
  • No-one can help resolve exceptions, unless you include the text of same… Maybe in a new question, maybe in an issue on the project, maybe in a message to a project mailing list… Totally guessing, you may need to adjust some PATH or similar settings in your environment. – TallTed Nov 28 '16 at 19:57
  • i think the problem is that those libraries were written with an older version of Python and I am using 3.5 and they are not forward compatible – amphibient Nov 28 '16 at 20:10
  • for example, they use `print` without parenths etc – amphibient Nov 28 '16 at 20:14

1 Answers1

3

There is the following Python module for Virtuoso:

http://pythonhosted.org/virtuoso/

and also:

http://kidehen.typepad.com/kingsley_idehens_typepad/2011/01/sparql-guide-for-python-developer.html

HughWilliams
  • 126
  • 1