File "rdf_store.py", line 17, in <module>
store = plugin.get('PostgreSQL', Store)('rdfstore')
TypeError: __init__() takes exactly 1 argument (2 given)
- Gunnar
On 14 February 2012 11:41, Dominique Guardiola Falco
> --
> You received this message because you are subscribed to the Google Groups
> "rdflib-dev" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rdflib-dev/-/-juRgQGLm3MJ.
>
> To post to this group, send email to rdfli...@googlegroups.com.
> To unsubscribe from this group, send email to
> rdflib-dev+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rdflib-dev?hl=en.
> I never used the psql store, but try removing the 'rdfstore' param here.
it passes without error, but then store.open() complains :
store.open(create=True)
TypeError: unbound method open() must be called with PostgreSQL instance as first argument (got nothing instead)
I don't get what can be a PosteGreSQL instance in this context
Trying to pass the previously created store instance won't work :
store.open(store,create=True)
TypeError: unbound method open() must be called with PostgreSQL instance as first argument (got type instance instead)
Can you help me please giving me an example of setting up a rdflib store with PostGreSQL ?
The differents docs explore many things, but lacks sortof basic examples for guys like me
The only example I found was at the very bottom of this page :
http://readthedocs.org/docs/rdfextras/en/latest/store/mysqlpg.html
I'm using rdflib 3.2.0 , rdfextras 0.2dev (cloned on the google code repository) and the rdflib_postgresql plugin on github (is it necessary as rdfextras also has PG store?)
with the example in the test files, I found my error, works better now :
from rdflib import plugin
from rdflib.graph import ConjunctiveGraph as Graph
from rdflib.store import Store
plugin.register(
'PostgreSQL', Store,
'rdflib_postgresql.PostgreSQL', 'PostgreSQL')
config = "host=localhost,user=dom,password=q4s5d6,db=rdflib"
default_graph_uri = "http://example.com/mygraph"
store = plugin.get('PostgreSQL', Store)
graph = Graph(store="PostgreSQL",
identifier = URIRef(default_graph_uri))
graph.open(config, create=True) # I was previously doing .open() on the store
it just outputs a strange error at the creation of the store:
"table kb_bec6803d52_asserted_statements Doesn't exist"
(but the table was created, along with the other tables)
and I can add triples so work can start now.
I want to use the PGSQL backend because of its full-text-search features (stemming among other filters), so this could be a lighter alternative to Lucene, only available with a few java-based stores. And mutualize the PG instance every django site already has.
Could you tell me, in your opinion, which backend has these features :
- lightweight (I'll need 100-200K triples in a store)
- fast query
- easy to install
- good support right now in rdflib
So I could switch if I really have problems with PG...
> --
> You received this message because you are subscribed to the Google Groups "rdflib-dev" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/rdflib-dev/-/AtQbyaSquyoJ.
4. The REGEXStore test is also broken until I can work out how to add the regexp function to PostgreSQL.