Skip to content

Instantly share code, notes, and snippets.

@asanchez75
Forked from rancas/RDFLib+python+Virtuoso
Created October 14, 2017 19:20
Show Gist options
  • Save asanchez75/9a85013c705e5e7e56992f49d839e821 to your computer and use it in GitHub Desktop.
Save asanchez75/9a85013c705e5e7e56992f49d839e821 to your computer and use it in GitHub Desktop.
A practical example to show how you can connect to a Virtuoso quad-store with python and rdflib.
from rdflib.graph import ConjunctiveGraph as Graph
from rdflib.store import Store
from rdflib.plugin import get as plugin
from rdflib.term import URIRef
Virtuoso = plugin("Virtuoso", Store)
store = Virtuoso("DSN=VOS;UID=dba;PWD=dba;WideAsUTF16=Y")
default_graph_uri = "http://www.w3.org/People/Berners-Lee/card"
graph = Graph(store,identifier = URIRef(default_graph_uri))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment