owlim-discussion  

Re: [Owlim-discussion] Deleting contexts

Ivan Peikov
Tue, 15 Jun 2010 08:19:49 -0700

Hi Haibo,

You have stumbled upon a known issue. It is now fixed and will be released in 
the next version of SwiftOWLIM (soon to be announced).
In the meantime it is not safe to use RepositoryConnection.clear(<context>) 
method.
As a workaround please replace the clear() call with

  RepositoryConnection.remove(null, null, null, <context>)

This should remove all statements in the desired context resulting in 
equivalent effect.

Cheers,
Ivan

On Tuesday 15 June 2010 18:10:06 Haibo Liu wrote:
> Dear Ivan,
>
> I'm  experiencing a  strange situation with deleting context here. I'm
> using Sesame2.30 and SwiftOWLIM-3.0beta9.
> The code snip is here:
>
> if (catalog.owlse2.hasContext(uriConstruct, catalog.con)){ //make sure
> the context exist
>                    RepositoryConnection con2 =
> catalog.owlse2.getConnection();
>                     con2.clear((Resource) uriConstruct); //delete the
> context
>                     con2.close();
>                     catalog.log.info("Finished removing URL: " +
> uriConstruct);
>                 }
>
> The whole repository is wiped out  by above code.
> I know if the context does not exist the whole repository will be
> cleared. Here I test if the context exist before deleting. However, the
> repository still get wiped out with one context deleting. This
> particular repository has more then 100 contexts to delete.
>
> Any way to go around this issue?
>
> Thanks a lot,
>
> Haibo
>
> _______________________________________________
> OWLIM-discussion mailing list
> OWLIM-discussion@ontotext.com
> http://ontotext.com/mailman/listinfo/owlim-discussion


_______________________________________________
OWLIM-discussion mailing list
OWLIM-discussion@ontotext.com
http://ontotext.com/mailman/listinfo/owlim-discussion