Have been playing with the 3store db format and have written an experimental rdfsql library in python. I did this because I'm not very hot with c and can knock things up much more quickly in python. I've implemented optional queries and a remove statement feature (doesnt handle inferred triples), which I needed for my veudas browser.