Discussion:
SPARQL 1.1 Update
Sorin Gheorghiu
2016-07-07 14:13:21 UTC
Permalink
Hi,

while attempting to remove some triples, I noticed that VALUES is not
supported, here an example:

DELETE WHERE {
VALUES (?value) { ( '10' ) ( '20' ) ( '30' ) }
?s ?p ?o .
?s _:prop ?value .
}

although SELECT works with multiple values:

SELECT * WHERE {
VALUES (?value) { ( '10' ) ( '20' ) ( '30' ) }
?s ?p ?o .
?s _:prop ?value .
}

I would assume VALUES is not supported by SPARQL 1.1, but at least
DELETE using the |IN| function in a |FILTER| clause should be supported
according to example 6 from
https://www.w3.org/TR/2013/REC-sparql11-update-20130321/

DELETE WHERE {
?s ?p ?o .
?s _:prop ?value .
FILTER(?value IN("10","20","30"))
}

Regards,
Sorin
Andy Seaborne
2016-07-07 18:55:21 UTC
Permalink
Post by Sorin Gheorghiu
Hi,
while attempting to remove some triples, I noticed that VALUES is not
DELETE WHERE {
VALUES (?value) { ( '10' ) ( '20' ) ( '30' ) }
?s ?p ?o .
?s _:prop ?value .
}
DELETE WHERE is a shorthand for the full form of DELETE:

DELETE { X } WHERE { X }

which places restrictions on X to be a template for the first { X }.
Templates (c.f. CONSTRUCT) does not allow VALUES.


DELETE {
VALUES (?value) { ( '10' ) ( '20' ) ( '30' ) }
?s ?p ?o .
?s _:prop ?value .
}
WHERE {
?s ?p ?o .
?s _:prop ?value .
}

DELETE WHERE {
?s ?p ?o .
?s _:prop '10' , '20' , '30 .
}

because it is a single variable VALUES.
Post by Sorin Gheorghiu
SELECT * WHERE {
VALUES (?value) { ( '10' ) ( '20' ) ( '30' ) }
?s ?p ?o .
?s _:prop ?value .
}
I would assume VALUES is not supported by SPARQL 1.1, but at least
DELETE using the |IN| function in a |FILTER| clause should be supported
according to example 6 from
https://www.w3.org/TR/2013/REC-sparql11-update-20130321/
?? I don't see this example in the spec.
Post by Sorin Gheorghiu
DELETE WHERE {
?s ?p ?o .
?s _:prop ?value .
FILTER(?value IN("10","20","30"))
}
Example 6 is:

DELETE
{ ?book ?p ?v }
WHERE
{ ?book dc:date ?date .
FILTER ( ?date > "1970-01-01T00:00:00-02:00"^^xsd:dateTime )
?book ?p ?v
}

which is the full form.

Andy

Oh - and _:prop (a blank node as property) is not legal either. It gets
weird otherwise ...
Post by Sorin Gheorghiu
Regards,
Sorin
Sorin Gheorghiu
2016-07-08 19:20:37 UTC
Permalink
Hi Andy,

Following your answer, I succeeded to delete the whole tuples using:

DELETE {?s ?p ?o] WHERE
?s ?p ?o .
?s rdf:id ?value .
FILTER (?value IN ( { ( '10' ) ( '20' ) ( '30' ) }
}

The initial question wasn't related to blank nodes, I used a wrong dummy
_:prop

Thank you,
Sorin
Post by Andy Seaborne
Post by Sorin Gheorghiu
Hi,
while attempting to remove some triples, I noticed that VALUES is not
DELETE WHERE {
VALUES (?value) { ( '10' ) ( '20' ) ( '30' ) }
?s ?p ?o .
?s _:prop ?value .
}
DELETE { X } WHERE { X }
which places restrictions on X to be a template for the first { X }.
Templates (c.f. CONSTRUCT) does not allow VALUES.
DELETE {
VALUES (?value) { ( '10' ) ( '20' ) ( '30' ) }
?s ?p ?o .
?s _:prop ?value .
}
WHERE {
?s ?p ?o .
?s _:prop ?value .
}
DELETE WHERE {
?s ?p ?o .
?s _:prop '10' , '20' , '30 .
}
because it is a single variable VALUES.
Post by Sorin Gheorghiu
SELECT * WHERE {
VALUES (?value) { ( '10' ) ( '20' ) ( '30' ) }
?s ?p ?o .
?s _:prop ?value .
}
I would assume VALUES is not supported by SPARQL 1.1, but at least
DELETE using the |IN| function in a |FILTER| clause should be supported
according to example 6 from
https://www.w3.org/TR/2013/REC-sparql11-update-20130321/
?? I don't see this example in the spec.
Post by Sorin Gheorghiu
DELETE WHERE {
?s ?p ?o .
?s _:prop ?value .
FILTER(?value IN("10","20","30"))
}
DELETE
{ ?book ?p ?v }
WHERE
{ ?book dc:date ?date .
FILTER ( ?date > "1970-01-01T00:00:00-02:00"^^xsd:dateTime )
?book ?p ?v
}
which is the full form.
Andy
Oh - and _:prop (a blank node as property) is not legal either. It
gets weird otherwise ...
Post by Sorin Gheorghiu
Regards,
Sorin
--
Sorin Gheorghiu Tel: +49 7531 88-3198
UniversitÀt Konstanz Raum: B703
78464 Konstanz ***@uni-konstanz.de

- KIM: Abteilung Contentdienste -
Martynas Jusevičius
2016-07-08 19:26:36 UTC
Permalink
I don't think there is an rdf:id property? You haven't provided the
namespace for it, but you shouldn't be introducing your own terms in
the RDF namespace.

On Fri, Jul 8, 2016 at 9:20 PM, Sorin Gheorghiu
Post by Sorin Gheorghiu
Hi Andy,
DELETE {?s ?p ?o] WHERE
?s ?p ?o .
?s rdf:id ?value .
FILTER (?value IN ( { ( '10' ) ( '20' ) ( '30' ) }
}
The initial question wasn't related to blank nodes, I used a wrong dummy
_:prop
Thank you,
Sorin
Post by Andy Seaborne
Post by Sorin Gheorghiu
Hi,
while attempting to remove some triples, I noticed that VALUES is not
DELETE WHERE {
VALUES (?value) { ( '10' ) ( '20' ) ( '30' ) }
?s ?p ?o .
?s _:prop ?value .
}
DELETE { X } WHERE { X }
which places restrictions on X to be a template for the first { X }.
Templates (c.f. CONSTRUCT) does not allow VALUES.
DELETE {
VALUES (?value) { ( '10' ) ( '20' ) ( '30' ) }
?s ?p ?o .
?s _:prop ?value .
}
WHERE {
?s ?p ?o .
?s _:prop ?value .
}
DELETE WHERE {
?s ?p ?o .
?s _:prop '10' , '20' , '30 .
}
because it is a single variable VALUES.
Post by Sorin Gheorghiu
SELECT * WHERE {
VALUES (?value) { ( '10' ) ( '20' ) ( '30' ) }
?s ?p ?o .
?s _:prop ?value .
}
I would assume VALUES is not supported by SPARQL 1.1, but at least
DELETE using the |IN| function in a |FILTER| clause should be supported
according to example 6 from
https://www.w3.org/TR/2013/REC-sparql11-update-20130321/
?? I don't see this example in the spec.
Post by Sorin Gheorghiu
DELETE WHERE {
?s ?p ?o .
?s _:prop ?value .
FILTER(?value IN("10","20","30"))
}
DELETE
{ ?book ?p ?v }
WHERE
{ ?book dc:date ?date .
FILTER ( ?date > "1970-01-01T00:00:00-02:00"^^xsd:dateTime )
?book ?p ?v
}
which is the full form.
Andy
Oh - and _:prop (a blank node as property) is not legal either. It gets
weird otherwise ...
Post by Sorin Gheorghiu
Regards,
Sorin
--
Sorin Gheorghiu Tel: +49 7531 88-3198
Universität Konstanz Raum: B703
- KIM: Abteilung Contentdienste -
Loading...