You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Wojciech Ciesielski <wo...@kierzbun.pl> on 2015/06/02 19:16:37 UTC
Fuseki2 Delete blank node
Hi again :)
DELETE DATA
{
GRAPH <http://przyklad.pl/>
{
_:asdfasd
<http://przyklad.pl/TypObiektu#jest>
<http://przyklad.pl/TypObiektu#test>
}
}
fuseki give me that error:
Error 400: Line 5, column 6: Blank nodes not allowed in DELETE templates: _:asdfasd
Fuseki - version 2.0.0 (Build date: 2015-03-08T09:49:20+0000)
It is any way too delete blank node from fuseki using SPARQL?
Or using usnig java ?
I know i can delete it from fuseki manualy.
Thanks
--
Pozdrawiam
Wojciech Ciesielski
Re: Fuseki2 Delete blank node
Posted by Martynas Jusevičius <ma...@graphity.org>.
I think in such case it would be better to use Parameterized SPARQL
String instead of string concatenation:
https://jena.apache.org/documentation/query/parameterized-sparql-strings.html
On Thu, Jun 4, 2015 at 2:06 AM, Wojciech Ciesielski <wo...@kierzbun.pl> wrote:
> ok thx
> problem solved :)
> i read name/temat/predykat/object from TextField, validate it and when
> temat/obiekt be blank node i replace it for ?a/?c and it works :)
> code below
> query= " WITH " + name+
> " DELETE " +
> " { "+
> temat + " " + predykat + " " +obiekt+ " " +
> " } " +
> " WHERE " +
> " { "+
> temat + " " + predykat + " " +obiekt+ " " +
> " } ";
>
> --
> Pozdrawiam
> Wojciech Ciesielski
>
Re: Fuseki2 Delete blank node
Posted by Wojciech Ciesielski <wo...@kierzbun.pl>.
ok thx
problem solved :)
i read name/temat/predykat/object from TextField, validate it and when
temat/obiekt be blank node i replace it for ?a/?c and it works :)
code below
query= " WITH " + name+
" DELETE " +
" { "+
temat + " " + predykat + " " +obiekt+ " " +
" } " +
" WHERE " +
" { "+
temat + " " + predykat + " " +obiekt+ " " +
" } ";
--
Pozdrawiam
Wojciech Ciesielski
Re: Fuseki2 Delete blank node
Posted by Andy Seaborne <an...@apache.org>.
On 02/06/15 19:06, Wojciech Ciesielski wrote:
> W dniu 2015-06-02 o 19:33, Martynas Jusevičius pisze:
>> Can't you use a variable instead?
>> On Jun 2, 2015 7:17 PM, "Wojciech Ciesielski" <wo...@kierzbun.pl> wrote:
>>
>>> Hi again :)
>>>
>>> DELETE DATA
>>>
>>> {
>>> GRAPH <http://przyklad.pl/>
>>> {
>>> _:asdfasd
>>> <http://przyklad.pl/TypObiektu#jest>
>>> <http://przyklad.pl/TypObiektu#test>
>>> }
>>> }
>>>
>>> fuseki give me that error:
>>> Error 400: Line 5, column 6: Blank nodes not allowed in DELETE
>>> templates:
>>> _:asdfasd
>>> Fuseki - version 2.0.0 (Build date: 2015-03-08T09:49:20+0000)
>>>
>>> It is any way too delete blank node from fuseki using SPARQL?
>>> Or using usnig java ?
>>> I know i can delete it from fuseki manualy.
>>>
>>> Thanks
>
> how ? that dont work also :(
>
> DELETE DATA
> {
> GRAPH <http://przyklad.pl/>
> {
> ?a
> <http://przyklad.pl/TypObiektu#jest>
> <http://przyklad.pl/TypObiektu#test>
> }
> }
>
> Error 400: Variables not permitted in data quad
(INSERT|DELETE) DATA takes, well, data. Variables aren't data (things
would all get a bit meta otherwise).
I think Martynas is suggesting the delete-template operation where you
you find the blank node in some way.
e.g. If it has a unique key:
DELETE { ?b <http://przyklad.pl/TypObiektu#jest>
<http://przyklad.pl/TypObiektu#test> }
WHERE {
?b :inverseFunctionalProperty "key"
}
or some other way to find the ?b by a query pattern.
There is also the possibiluty of using an earlier query in ARQ/Fuseki
because because IRI(?bnode) generates a <_:label> URI for the blank node
that can be used again later.
Andy
> Fuseki - version 2.0.0 (Build date: 2015-03-08T09:49:20+0000)
>
> http://www.w3.org/TR/2013/REC-sparql11-update-20130321/#deleteData
> "
> |/QuadData/| denotes triples to be removed and is as described in
> |INSERT DATA
> <http://www.w3.org/TR/2013/REC-sparql11-update-20130321/#insertData>|,
> with the difference that in a |DELETE DATA| operation neither variables
> nor blank nodes are allowed (see Notes 8+9 in the grammar
> <http://www.w3.org/TR/sparql11-query/#sparqlGrammar>).
>
> 8. The |QuadData <http://www.w3.org/TR/sparql11-query/#rQuadData>| and
> |QuadPattern <http://www.w3.org/TR/sparql11-query/#rQuadPattern>|
> rules both use rule |Quads
> <http://www.w3.org/TR/sparql11-query/#rQuads>|. The rule |QuadData
> <http://www.w3.org/TR/sparql11-query/#rQuadData>|, used in |INSERT
> DATA| <http://www.w3.org/TR/sparql11-query/#rInsertData> and |DELETE
> DATA| <http://www.w3.org/TR/sparql11-query/#rDeleteData>, must not
> allow variables in the quad patterns.
> 9. Blank node syntax is not allowed in |DELETE WHERE
> <http://www.w3.org/TR/sparql11-query/#rDeleteWhere>|, the
> |DeleteClause <http://www.w3.org/TR/sparql11-query/#rDeleteClause>|
> for |DELETE|, nor in |DELETE DATA|
> <http://www.w3.org/TR/sparql11-query/#rDeleteData>.
>
> "
>
> :?
>
Re: Fuseki2 Delete blank node
Posted by Wojciech Ciesielski <wo...@kierzbun.pl>.
W dniu 2015-06-02 o 19:33, Martynas Jusevičius pisze:
> Can't you use a variable instead?
> On Jun 2, 2015 7:17 PM, "Wojciech Ciesielski" <wo...@kierzbun.pl> wrote:
>
>> Hi again :)
>>
>> DELETE DATA
>>
>> {
>> GRAPH <http://przyklad.pl/>
>> {
>> _:asdfasd
>> <http://przyklad.pl/TypObiektu#jest>
>> <http://przyklad.pl/TypObiektu#test>
>> }
>> }
>>
>> fuseki give me that error:
>> Error 400: Line 5, column 6: Blank nodes not allowed in DELETE templates:
>> _:asdfasd
>> Fuseki - version 2.0.0 (Build date: 2015-03-08T09:49:20+0000)
>>
>> It is any way too delete blank node from fuseki using SPARQL?
>> Or using usnig java ?
>> I know i can delete it from fuseki manualy.
>>
>> Thanks
how ? that dont work also :(
DELETE DATA
{
GRAPH <http://przyklad.pl/>
{
?a
<http://przyklad.pl/TypObiektu#jest>
<http://przyklad.pl/TypObiektu#test>
}
}
Error 400: Variables not permitted in data quad
Fuseki - version 2.0.0 (Build date: 2015-03-08T09:49:20+0000)
http://www.w3.org/TR/2013/REC-sparql11-update-20130321/#deleteData
"
|/QuadData/| denotes triples to be removed and is as described in
|INSERT DATA
<http://www.w3.org/TR/2013/REC-sparql11-update-20130321/#insertData>|,
with the difference that in a |DELETE DATA| operation neither variables
nor blank nodes are allowed (see Notes 8+9 in the grammar
<http://www.w3.org/TR/sparql11-query/#sparqlGrammar>).
8. The |QuadData <http://www.w3.org/TR/sparql11-query/#rQuadData>| and
|QuadPattern <http://www.w3.org/TR/sparql11-query/#rQuadPattern>|
rules both use rule |Quads
<http://www.w3.org/TR/sparql11-query/#rQuads>|. The rule |QuadData
<http://www.w3.org/TR/sparql11-query/#rQuadData>|, used in |INSERT
DATA| <http://www.w3.org/TR/sparql11-query/#rInsertData> and |DELETE
DATA| <http://www.w3.org/TR/sparql11-query/#rDeleteData>, must not
allow variables in the quad patterns.
9. Blank node syntax is not allowed in |DELETE WHERE
<http://www.w3.org/TR/sparql11-query/#rDeleteWhere>|, the
|DeleteClause <http://www.w3.org/TR/sparql11-query/#rDeleteClause>|
for |DELETE|, nor in |DELETE DATA|
<http://www.w3.org/TR/sparql11-query/#rDeleteData>.
"
:?
--
Pozdrawiam
Wojciech Ciesielski
Re: Fuseki2 Delete blank node
Posted by Martynas Jusevičius <ma...@graphity.org>.
Can't you use a variable instead?
On Jun 2, 2015 7:17 PM, "Wojciech Ciesielski" <wo...@kierzbun.pl> wrote:
> Hi again :)
>
> DELETE DATA
>
> {
> GRAPH <http://przyklad.pl/>
> {
> _:asdfasd
> <http://przyklad.pl/TypObiektu#jest>
> <http://przyklad.pl/TypObiektu#test>
> }
> }
>
> fuseki give me that error:
> Error 400: Line 5, column 6: Blank nodes not allowed in DELETE templates:
> _:asdfasd
> Fuseki - version 2.0.0 (Build date: 2015-03-08T09:49:20+0000)
>
> It is any way too delete blank node from fuseki using SPARQL?
> Or using usnig java ?
> I know i can delete it from fuseki manualy.
>
> Thanks
>
> --
> Pozdrawiam
> Wojciech Ciesielski
>
>