[redland-dev] Redland context in Virtuoso

Ben Morris ben at bendmorris.com
Tue Jan 29 17:05:47 EST 2013


I'm using the Redland Python bindings to add triples to Virtuoso
RDF.Storage(storage_name='virtuoso') and am trying to understand how
context is implemented. I am getting some surprising results.

If I add triples with:

    model.add_statements(context=something)

I can get them all back with:

    model.as_stream(context=something)

as expected. However, if I create a new model with the same storage
and try this:

    for stmt in model:
        print stmt

I get no result, as if the model is empty. Also, when I try the following:

    model.remove_statements_with_context(context=something)
    for stmt in model.as_stream(context=something):
        print stmt

I still get back all of the triples; they weren't removed as I
expected them to be.

Finally, when I try simple SPARQL queries that should match some of
the triples stored with context, I get no result.

Can anyone help me understand what's going on behind the scenes with
Redland contexts and Virtuoso?


-- 
Ben Morris
PhD student, Ecology/Evolutionary Biology
UNC Chapel Hill | National Evolutionary Synthesis Center
ben at bendmorris.com
www.bendmorris.com


More information about the redland-dev mailing list