<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hmm, I will pass on this one, as I'm learning as I go and don't know
the answer to the question "Is there some way to use SPARQL to
delete statements that include a blank node?".<br>
<br>
Back to your original question about CONSTRUCT though, this does
work for me. Taking the graph:<br>
<blockquote><tt>@base <a class="moz-txt-link-rfc2396E" href="http://example.org/uris/"><http://example.org/uris/></a> .</tt><br>
<tt>@prefix rdf:
<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><http://www.w3.org/1999/02/22-rdf-syntax-ns#></a> .</tt><br>
<tt>@prefix ex: <a class="moz-txt-link-rfc2396E" href="http://example.org/terms#"><http://example.org/terms#></a> .</tt><br>
<br>
<tt><s1> <p1> [</tt><br>
<tt> a rdf:Seq ;</tt><br>
<tt> rdf:_1 <u1> ;</tt><br>
<tt> rdf:_2 [ ex:list <u2> ] ;</tt><br>
<tt> ] .</tt><br>
<br>
<tt><s2> <p1> [</tt><br>
<tt> a rdf:Seq ;</tt><br>
<tt> rdf:_1 <u1> ;</tt><br>
<tt> rdf:_2 [ ex:list <u2> ] ;</tt><br>
<tt> ] .</tt><br>
</blockquote>
then the SPARQL:<br>
<blockquote><tt>base <a class="moz-txt-link-rfc2396E" href="http://example.org/uris/"><http://example.org/uris/></a></tt><br>
<tt>prefix rdf:
<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><http://www.w3.org/1999/02/22-rdf-syntax-ns#></a></tt><br>
<tt>prefix ex: <a class="moz-txt-link-rfc2396E" href="http://example.org/terms#"><http://example.org/terms#></a></tt><br>
<br>
<tt>CONSTRUCT {</tt><br>
<tt> <s1> <p1> ?seq .</tt><br>
<tt> ?seq ?seq_index ?uri .</tt><br>
<tt> ?uri ex:list ?uri2 </tt><br>
<tt> } </tt><br>
<tt>WHERE</tt><br>
<tt> { <s1> <p1> ?seq .</tt><br>
<tt> ?seq ?seq_index ?uri</tt><br>
<tt> OPTIONAL { ?uri ex:list ?uri2 }</tt><br>
<tt> }</tt><br>
</blockquote>
will (using roqet) return the sub-graph:<br>
<blockquote><tt><s1> <p1> [</tt><br>
<tt> a rdf:Seq ;</tt><br>
<tt> rdf:_1 <u1> ;</tt><br>
<tt> rdf:_2 [ ex:list <u2> ] ;</tt><br>
<tt> ] .</tt><br>
</blockquote>
<br>
Best regards,<br>
Dave<br>
<br>
On 23/02/12 6:24 AM, Maxence Guesdon wrote:
<blockquote cite="mid:20120222182453.4585e1b8@alcazar" type="cite">
<pre wrap="">On Wed, 22 Feb 2012 10:28:52 +1300
David Brooks <a class="moz-txt-link-rfc2396E" href="mailto:d.brooks@auckland.ac.nz"><d.brooks@auckland.ac.nz></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I would use "DELETE WHERE { ... }" -- see
<a class="moz-txt-link-freetext" href="http://www.w3.org/TR/sparql11-update/#deleteInsert">http://www.w3.org/TR/sparql11-update/#deleteInsert</a>.
</pre>
</blockquote>
<pre wrap="">
Hello,
I just tried to to that, with no success.
If I try:
DELETE { <a class="moz-txt-link-rfc2396E" href="http://subject"><http://subject></a> <a class="moz-txt-link-rfc2396E" href="http://pred"><http://pred></a> ?seq .
?seq ?seq_index ?uri .
?uri <a class="moz-txt-link-rfc2396E" href="http://listOf"><http://listOf></a> ?uri2
}
WHERE
<a class="moz-txt-link-rfc2396E" href="http://subject"><http://subject></a> <a class="moz-txt-link-rfc2396E" href="http://pred"><http://pred></a> ?seq .
?seq ?seq_index ?uri
OPTIONAL { ?uri <listOf> ?uri2 }
With the same model as in my previous message, ?seq, ?seq_index and
sometimes ?uri match blank nodes. I thought these variables would refer to
the original blank nodes, so that they would be removed. But it does not
seem to be the case.
<a class="moz-txt-link-freetext" href="http://www.w3.org/TR/sparql11-update/#deleteInsert">http://www.w3.org/TR/sparql11-update/#deleteInsert</a> states that
"Blank nodes are prohibited in a DELETE template, since using a new blank
node in a DELETE template would lead to nothing being deleted, as a new
blank node cannot match anything in the Graph Store."
So it seems like it behaves like with the construct template.
So, is it impossible to delete blank nodes with such delete queries ?
Regards,
Maxence
</pre>
<blockquote type="cite">
<pre wrap="">
Regards,
Dave
On 22/02/12 12:29 AM, Maxence Guesdon wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On Tue, 21 Feb 2012 21:52:48 +1300
David Brooks<a class="moz-txt-link-rfc2396E" href="mailto:d.brooks@auckland.ac.nz"><d.brooks@auckland.ac.nz></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi Maxence,
</pre>
</blockquote>
<pre wrap="">Hello,
</pre>
<blockquote type="cite">
<pre wrap="">Blank nodes are anonymous -- the nodes without labels in a visual graph
of your model.
In an RDF store these nodes are given identifiers in order to include
the nodes in statements. The actual value of a blank node's identifier
though is local to the graph it is part of. Generating another graph via
a query is very likely to assign different values, and even two
identical queries against the same graph are likely to return different
blank node identifiers.
</pre>
</blockquote>
<pre wrap="">Thanks for your answer. So that's a feature.
The reason why I encountered this problem is that I wanted to remove a part
of my model. So this query was supposed to return the statements to remove
from my model.
I have to do it another way. For information, since I have no experience
yet of performing such an operation, what is your favorite way of removing
part of your model when it contains blank nodes ? I mean, the less painful
one, of cource :-)
Regards,
Maxence
</pre>
</blockquote>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
</body>
</html>