Re: Removing triples from a store?

On Jun 4, 2010, at 14:10 , Mark Birbeck wrote:

> Hi Ivan,
> 
> 'Triple adding' will also be important for programmers.
> 
> A typical use-case is to parse a page for details of a Twitter
> account, and then use those details to retrieve the latest tweets by a
> person. You /could/ simply retrieve the tweets and display them --
> essentially an 'old-fashioned' JavaScripty technique. But a better
> approach would be to retrieve the tweets and then just drop them
> straight into the store. Once in the store they can be queried for,
> and manipulated in whatever way we want, including being displayed.
> 

Which is line with what I said about parsing. Ie, that adding a triple is important for parsers. I am not sure whether it is important to have the possibility to programmatically create a triple and then add that triple to a store.

But I think this is a bit a side issue, because the fact of being used for a parser means that it is necessary to have an 'add' method, and that is fine. We do not have an issue there.


> Separating the retrieval of additional data from actions performed on
> that data makes for a very powerful programming model.
> 
> Which brings us back to your point about /removing/ triples...
> 
> My instinct tells me that there must be a scenario for deleting
> triples that is comparable to the one I've just described for adding
> them -- but I can't think of one at the moment. :)
> 

That is exactly my feeling:-)


> The use-case itself would probably relate to removing data from the
> store that is difficult to ignore when writing a query. However,
> although I think we probably should support this feature, I have to
> say that in all the applications I've developed using my RDFa library,
> it's much more common to want to delete entire graphs.
> 

Which we have, there as a possibility to clean an entire store.

> For example, in the Twitter scenario I gave earlier, I actually insert
> the tweets into separate named graphs within a store. This means that
> if I then go back to retrieve tweets for the same person again I can
> simply delete their 'tweet graph' (one per person), rather than having
> to find the individual tweets that are now buried in one monolithic
> graph. Once the graph has been deleted it's a simple case of creating
> it again and then adding in the latest tweets.
> 
> Obviously we haven't added graph support to the API yet, but my guess
> is that any scenarios we think of for deleting triples will more than
> likely be better served by providing named graph support so that we
> can delete an entire collection in one go.
> 

I am not sure what you mean by graph support to the API. In my mind, a store is a graph, the only reason we have not called it a graph is because we do not want to scare people away with unknown concepts. The application can have as many stores^H^H^H^H^H^Hgraphs as he/she wants, so I do not think we need anything more...

Ivan

> (None of which is to say that we don't support simple triple deletion, too.)
> 
> Regards,
> 
> Mark
> 
> 
> On Fri, Jun 4, 2010 at 12:40 PM, Ivan Herman <ivan@w3.org> wrote:
>> 
>> On Jun 4, 2010, at 13:30 , Toby Inkster wrote:
>> 
>>> On Fri, 2010-06-04 at 10:36 +0200, Ivan Herman wrote:
>>>> There is currently no method to remove a triple from a store. I wonder
>>>> whether there are reasons to add this facility...
>>> 
>>> Right now, I suppose the workaround would be to create a new store,
>>> iterate through the old store, adding each triple to the new one except
>>> for those you wanted to remove, and then replace any references to the
>>> old store with references to the new store. That's not an especially
>>> nice solution though.
>> 
>> That is a typical British understatement:-)
>> 
>> To be fair, I still have to have a clear use case when one wants that. At least for browser-style Web applications even the triple adding is really really important for parsers, I guess...
>> 
>> Ivan
>> 
>>> 
>>> --
>>> Toby A Inkster
>>> <mailto:mail@tobyinkster.co.uk>
>>> <http://tobyinkster.co.uk>
>>> 
>> 
>> 
>> ----
>> Ivan Herman, W3C Semantic Web Activity Lead
>> Home: http://www.w3.org/People/Ivan/
>> mobile: +31-641044153
>> PGP Key: http://www.ivan-herman.net/pgpkey.html
>> FOAF: http://www.ivan-herman.net/foaf.rdf
>> 
>> 
>> 
>> 
>> 
>> 


----
Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
PGP Key: http://www.ivan-herman.net/pgpkey.html
FOAF: http://www.ivan-herman.net/foaf.rdf

Received on Friday, 4 June 2010 13:55:45 UTC