- From: Michael Kifer <kifer@cs.sunysb.edu>
- Date: Tue, 13 Dec 2005 15:38:41 -0500
- To: Jeremy Carroll <jjc@hpl.hp.com>
- Cc: "Evan K. Wallace" <ewallace@cme.nist.gov>, public-rif-wg@w3.org
>>>>> "JC" == Message from Jeremy Carroll <<jjc@hpl.hp.com> > writes: JC> Michael Kifer wrote: >>> Attached is a slightly modified version of the SW compatibility breakout notes >>> in PDF form. I added a key for the labels I used for the speakers. >>> >>> -Evan >> >> I have a Q regarding one of the remarks that Bijan made (according to the >> notes). Posting here because there might be wider interest in this. >> >> There was a discussion of whether the query language (SPARQL) has negation >> and Bijan said that the existentials get us there. >> This is something that I don't understand. *Universal quantification* in a >> query language introduces negation. But existential conjunctive queries >> without explicit negation are Horn clauses and are within Datalog. >> For those queries the classical equivalence of logical implication, least >> fixpoint, and the unique min model holds. JC> I am not sure if this bit of SPARQL is relevant. JC> If not please ignore. JC> From JC> http://www.w3.org/TR/2005/WD-rdf-sparql-query-20051123/ JC> [[ JC> One may test that a graph pattern is not expressed by specifying an JC> optional graph pattern that introduces a variable and testing to see JC> that the variable is not bound. This is called Negation as Failure in JC> logic programming. JC> This query matches the people with a name but no expressed date: JC> PREFIX foaf: <http://xmlns.com/foaf/0.1/> JC> PREFIX dc: <http://purl.org/dc/elements/1.1/> JC> SELECT ?name JC> WHERE { ?x foaf:givenName ?name . JC> OPTIONAL { ?x dc:date ?date } . JC> FILTER (!bound(?date)) } JC> Query result: JC> name JC> "Alice" JC> ]] This is indeed a NAF and a very bad syntax at that. Why not use something more decent and conventional? Seems that the process of butchering SPARQL has already began even before the language has been born officially. Anyway, I thought that Bijan said that SPARQL doesn't have explicit negation, but if things like ! and binding tests are allowed then it appears that it has negation in a roundabout way. One more stab at it: binding tests are appropriate for programming languages (like Prolog), but not for a query language that is pitched as a declarative language. My $0.02. --michael
Received on Tuesday, 13 December 2005 20:44:49 UTC