We had the same discussion here with Javed Khan [1] - this might be
somebody you already know as you're doing both almost the same
project...do you know each other?

Anyways, I'll cite myself:

> SPARQL 1.1 Update is straightforward ...
>
> General structure for making update queries aka. delete + insert:
>
>
> DELETE {
>
> }
>
> INSERT {
>
> }
>
> WHERE {
>
> }


[1]
https://mail-archives.apache.org/mod_mbox/jena-users/201707.mbox/%3CCAJhui%2BtTHYsz4qtYjpsVBmZp0p%3DpjOjvtR5_DcF4O7MQWC5RyQ%40mail.gmail.com%3E


On 15.08.2017 00:08, Sidra shah wrote:
> Hi Dave,
>
> "Your example just shows deducing an extra type, there's nothing to
> replace."
>
>  I think there is a need to replace existing data. For instance, if a
> player score is less than 10, he is from the Player class. When the score
> becomes greater than 10, he becomes the instance of StarPlayer while the
> old value also exists i-e remains the instance of Player class.
>
> I am not sure if same problem will arise also when we use INSERT query
> rather than jena rules.
>
> Regards
>
>
>
> On Mon, Aug 14, 2017 at 11:39 PM, Dave Reynolds <[email protected]>
> wrote:
>
>> On 14/08/17 21:31, Sidra shah wrote:
>>
>>> Hi Dave, I know its not the complete syntax of jena rule but I just
>>> included it for understanding.
>>>
>>> Would you mind if you could just briefly explain how update query can be
>>> used here in the situation above. Frankly speaking, I dont like jena rules
>>> (as it does not replace existing data with new one)
>>>
>> Well you can write rules which drop existing values but it's true that
>> rules are normally used to add new values (new entailments). Your example
>> just shows deducing an extra type, there's nothing to replace.
>>
>> and want if it could be
>>> replaced with SPARQL queries.
>>>
>> I've already said you can. Lookup the syntax for the Sparql update
>> INSERT...WHERE command and use that. If you need to also delete triples
>> then use the general DELETE...INSERT...WHERE form.
>>
>> Dave
>>
>>
>> On Mon, Aug 14, 2017 at 11:20 PM, Dave Reynolds <[email protected]
>>> wrote:
>>>
>>> On 14/08/17 19:05, Sidra shah wrote:
>>>> Can we perform jena rules duties from SPARQL?
>>>>> (?x rdf:type :Player) (?x :Score ?score) greaterthan (?score "10") -?
>>>>> (?x
>>>>> rdf:type :StarPlayer)
>>>>>
>>>>> Construct {?x rdf:type :StarPlayer}
>>>>>
>>>>> Where { ?x rdf:type :Player. ?x :Score ?score. > ?score 10)
>>>>>
>>>>>
>>>> That's not the exact syntax for either Jena rules or sparql but yes, for
>>>> a
>>>> single rule you can implement the same thing as a Sparql update.
>>>>
>>>> For an entire rule set you many need to iteratively apply the updates
>>>> until nothing more changes.
>>>>
>>>> Dave
>>>>
>>>>
>>>>

Reply via email to