-
Notifications
You must be signed in to change notification settings - Fork 1
Developer Docs
Nolan Nichols edited this page Aug 17, 2014
·
7 revisions
Virtuoso is currently able to be deployed as a docker container
docker pull nicholsn/virtuoso
To access Virtuoso via ODBC, thus enabling access using rdflib or sqlalchemy, a few non-standard packages are needed. Virtuoso can also be accessed via the Web application and directly queried, but do to limitations with file upload sizes, ODBC is preferred.
To configure native python access to Virtuoso install the following:
pip install https://github.com/core/uricore/archive/master.zip
pip install https://github.com/zzzeek/sqlalchemy/archive/master.zip
pip install https://github.com/RDFLib/rdflib/archive/master.zip
pip install https://github.com/maparent/pyodbc/archive/v3-virtuoso.zip
pip install https://github.com/maparent/virtuoso-python/archive/master.zip
Then create an odbc located at /etc/odbc.ini and inclued the following:
[VOS]
Description = Virtuoso
Driver = /usr/local/lib/virtodbc.so
Servername = localhost
Port = 1111
UserName = dba
If all is configured correctly, you should be able to connect with the following:
import rdflib
from sqlalchemy.engine import create_engine
from virtuoso.vstore import Virtuoso
# first check the sqlalchemy connection
# pyodbc string'DRIVER=/usr/local/lib/virtodbcu_r.so;HOST=192.168.59.103:1111;UID=dba;PWD=dba'
engine = create_engine("virtuoso://dba:dba@VOS")
engine.table_names()
# then check that rdflib can connect
rdflib_connection = "DSN=VOS;UID=dba;PWD=dba;WideAsUTF16=Y"
store = Virtuoso(rdflib_connection)
g = rdflib.ConjunctiveGraph(store)
g.subjects().next()
- serializers
- error mapping
errors = { "NotFoundError":
{ 'message': 'Not Found',
'status' 404,
}
- With Panamax or otherwise, there are two backed in prefixed used to attach NIQuery to a given server
- MQ: Be sure that a NIQ Docker Container is linked to the message queue by exposing the MQ prefix
- VIRT: Be sure that a NIQ Docker Container is linked to Virtuoso by exposing the VIRT prefix
# RabbitMQ
docker run -it -p 5000:5000 --link rabbitmq_docker_container:MQ nicholsn/niquery /bin/bash
# Virtuoso
docker run -it -p 5000:5000 --link virtuoso_docker_container:VIRT nicholsn/niquery /bin/bash