[redland-dev] triples with context

Alex Gilman agilman at lbl.gov
Fri Oct 14 19:41:23 BST 2005


This seems to be a problem with the Ruby bindings.  I had the same 
problem two weeks ago and got a reply which was not echoed to the list:

> Jorge Santos wrote:
>> I've had the same kind of problems, I think the Ruby bindings are
>> buggy and intend to look into that.  For now, I've been calling
>> Redland::librdf_model_sync(@model.model) after insertions to make sure
>> they get stored in the database.
>> 
>> Bye,
>> jorge

That librdf_model_sync call worked for me also.

Eyal Oren wrote:
> Hi, my problem with hash storage is not specifically with contexts, but 
> that my model is not stored (therefore i'm using serialisation, which is 
> not possible with contexts).  See following code:
> 
>     #!/bin/ruby
>     require 'rdf/redland'
> 
>     def make_uri uri
>         Redland::Node.new(Redland::Uri.new(uri))
>     end
> 
>     store = Redland::HashStore.new('bdb', 'test', '.', false)
>     model = Redland::Model.new(store)
> 
>     model.add make_uri('now'), make_uri('time'), make_uri(Time.now.to_s)
>     model.dump_model
> 
> This code adds the triple to the model every time, but after running it, 
> the 'test' store is empty, which can be verified with rdfproc, or by 
> running it the same scirpt again (it will only show the new triple).
> 
> Adding triples to a hash_store with rdfproc works fine, I can then read 
> them in with this little script for example.
> 
> Am I missing some code to 'close' the hash storage, and make the data 
> persistent? I can't find such a thing in the API.
> Eyal


More information about the redland-dev mailing list