Re: function to find concise bounded graph for SPARQL Updates for dealing with blank nodes

On 01/24/2014 12:29 PM, Henry Story wrote:
> Hi all,
>
>    this is probably a known issue SPARQL land, and I wonder if anyone has
> yet written a function to try to update a graph with a blank node.
>
> I have written up the issue here
> https://github.com/stample/react-foaf/issues/7
>
> When a PATCH request using SPARQL Update
> <http://www.w3.org/Submission/SPARQL-Update/> contains a subject with a
> blank node, then INSERT DATA and DELETE DATA cannot work ( unless the
> relation is an owl:InverseFunctionalProperty ). In that case one must
> calculate the Concise Bounded Description
> <http://www.w3.org/Submission/CBD/> of the graph and put that in the
> WHERE clause. So one needs to calculate this CBD.
>
> ( not checked exactly if CBD is the right relation )
>
> for example in FOAF foaf:mbox <http://xmlns.com/foaf/0.1/mbox> is an
> owl:inverseFunctionalProperty. In that case
> the server could in fact delete all the correct blank nodes for the
> following request
>
> |   DELETE DATA { [] foaf:mbox <mailto:henry.story@bblfish.net> . }
> |
>
> But for an graph such as
>
> |<#me> contact:home [ a contact:ContactLocation;
>                                    contact:address [ contact:city "Fontainebleau";
>                                    contact:country "France";
>                                    contact:postalCode "77300";
>                                    contact:street "21 rue Saint Honore"
>                                  ];
>               ];
>              contact:work [ a contact:ContactLocation;
>                               contact:address [ contact:city "Fontainebleau";
>                                      contact:country "France";
>                                      contact:postalCode "77300";
>                                      contact:street "21 rue Saint Merry"
>                                ];
>             ];
>             contact:work [ a contact:ContactLocation;
>                       contact:address [ contact:city "Fontainebleau";
>                                    contact:country "France";
>                                    contact:postalCode "77300";
>                                    contact:street "23 rue Saint Merry"
>                        ];
>                ] .
> |
>
> The replacing the postalCode cannot be done like this
>
> |DELETE DATA { [] contact:postalCode "77300" }
> INSERT DATA { [] contact:postalCode "77305" }
> |
>
> because the server would not know
>
>   * which triple in the above graph to remove. ( the one for the home
>     address or the one for the work address ? )
>   * where to put the new triple ( does it even get attached to an address? )
>
> So really one needs a query such as the following:
>
> |DELETE { ?add contact:postalCode "77300" }
> INSERT { ?add contact:postalCode "77300" }
> WHERE {
>      ?add  contact:city "Fontainebleau";
>                 contact:country "France";
>                 contact:postalCode "77300";
>                 contact:street "21 rue Saint Merry"
> }
> |
>
> But this works only because we are here assuming that contact:city,
> contact:country, contact:postalCode and contact:street form an owl:key
> <http://www.w3.org/TR/2012/REC-owl2-primer-20121211/#Keys> .
>
> If these four relations did not form an owl:key then one would have to
> at leat try to add as many relations to the WHERE clause to make the
> update identify one object in that particular graph.
interesting! personally i find blank nodes giving me often hard time...

you example also reminds me 
https://web-payments.org/specs/source/web-identity/#a-typical-identity

i've suggested there adding at least fragment identifiers for 
shippingAddress and citizenship so one can update them more easily

http://lists.w3.org/Archives/Public/public-webpayments/2014Jan/0051.html

two articles i find also interesting here:
* http://manu.sporny.org/2013/rdf-identifiers/
* http://richard.cyganiak.de/blog/2011/03/blank-nodes-considered-harmful/

Received on Friday, 24 January 2014 11:46:10 UTC