You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Zen 98052 <z9...@outlook.com> on 2015/09/29 17:06:26 UTC

delete all triples

Is it possible to delete all triples? I tried this command below, and got error saying variables are not permitted.


DELETE DATA

{
 ?s ?p ?o
}


Thanks,
Z


Re: delete all triples

Posted by Andy Seaborne <an...@apache.org>.
On 29/09/15 18:09, Zen 98052 wrote:
> Thanks Andy! I change the command to this and it works:
>
> DELETE WHERE
> {
>   ?s ?p ?o
> }

> Follow up question, right now I subclass Jena's DatasetGraphBase class, and override the delete method, i.e.:
>
>      @Override
>      public void delete(Quad quad) {
>          // call our lib to delete that specific quad from back-end store
>      }
>
> Follow up question below...
> I see this can become performance issue when there are many rows
involved like in this case
> I see I can override deleteAny method, and create iterator and
> handle
the batch myself, like the template code in DatasetGraphBase.java
> But it looks like deleteAny method is only called from CLEAR
> command. Is it possible to implement batch deletion for DELETE WHERE
> command? Or is there a better way doing this from Jena?

There isn't a batching system builtin - it's the responsibility of the 
implementation.  Your system can do that batching - for example, catch 
all (or upto some limit) deletes and flush if a non-delete is called. An 
optional framework would be good (contributions welcome).

The right way to batch together is often dependent on the system and 
different systems want different batching, hence framework not built-in. 
  That may be simply the size of batch (the size is a feature of the 
underlying system as are the resources) but also whether the batch is 
driven from the incoming update stream or driven by the underling 
storage or other operations in progress.

	Andy


Re: delete all triples

Posted by Zen 98052 <z9...@outlook.com>.
Thanks Andy! I change the command to this and it works:

DELETE WHERE
{
 ?s ?p ?o
}

Follow up question, right now I subclass Jena's DatasetGraphBase class, and override the delete method, i.e.:

    @Override
    public void delete(Quad quad) {
        // call our lib to delete that specific quad from back-end store
    }

Follow up question below...
I see this can become performance issue when there are many rows involved like in this case
I see I can override deleteAny method, and create iterator and handle the batch myself, like the template code in DatasetGraphBase.java
But it looks like deleteAny method is only called from CLEAR command.
Is it possible to implement batch deletion for DELETE WHERE command? Or is there a better way doing this from Jena?


Thanks,
Z

________________________________________
From: Andy Seaborne <an...@apache.org>
Sent: Tuesday, September 29, 2015 11:40 AM
To: users@jena.apache.org
Subject: Re: delete all triples

On 29/09/15 16:06, Zen 98052 wrote:
> Is it possible to delete all triples? I tried this command below, and got error saying variables are not permitted.
>
>
> DELETE DATA
>
> {
>   ?s ?p ?o
> }
>
>
> Thanks,
> Z
>
>

Hi - the relevant specs are:

http://www.w3.org/TR/sparql11-update/

http://www.w3.org/TR/sparql11-http-rdf-update/

        Andy

Re: delete all triples

Posted by Andy Seaborne <an...@apache.org>.
On 29/09/15 16:06, Zen 98052 wrote:
> Is it possible to delete all triples? I tried this command below, and got error saying variables are not permitted.
>
>
> DELETE DATA
>
> {
>   ?s ?p ?o
> }
>
>
> Thanks,
> Z
>
>

Hi - the relevant specs are:

http://www.w3.org/TR/sparql11-update/

http://www.w3.org/TR/sparql11-http-rdf-update/

	Andy