On 07/07/16 15:13, Sorin Gheorghiu wrote:
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 .
}

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.


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/

?? I don't see this example in the spec.


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 ...


Regards,
Sorin




Reply via email to