- From: Seaborne, Andy <andy.seaborne@hp.com>
- Date: Sat, 05 Mar 2005 15:31:14 +0000
- To: Steve Harris <S.W.Harris@ecs.soton.ac.uk>
- Cc: public-rdf-dawg@w3.org
Steve Harris wrote: > On Fri, Mar 04, 2005 at 02:52:17 +0000, Dave Beckett wrote: > >>On Thu, 2005-03-03 at 16:51 -0500, Eric Prud'hommeaux wrote: >> >> >>>as promised, AND is now FILTER: >>>SELECT ?who >>> WHERE { ?who :age ?n. FILTER ?n + 1 < 5 } >> >>This I like, as it was pretty much how I thought about constraints - get >>a bunch of triples then filter them with a big expression. > > > Its cleaner than AND, but I think we should avoid > > FILTER ?x + 1 < 4 FILER ?y + 2 < 4 Allowing FILTER to be close to a triple that binds the variable it tests is natural: { <v> :p ?x . FILTER ?x < 4 . <v> :q ?y . REGEXP(?y, "foo", "i") . } Nothing to do with which syntax here. So I think that would need at least one dot to separate adjacent FILTERs without making special cases to drop the separator for FILTER and/or to keep them apart. { <v> :p ?x ; :q ?y . FILTER ?x + 1 < 4 . REGEXP(?y, "foo", "i") . } seems OK. A corner case is: FILTER ?x + 1 < 4 <http://> :p ?v . i.e. a triple pattern after a FILTER - not a problem technically unless (*) literals-as-subject appear and we have unary +/- FILTER ?x + 1 < 4 -2 :p ?v . which is icky (enough lookahead (3?) resolves but the error messages are likely to be quite confusing). Andy (*) rq23 does allow them in the definitions and references the note in RDF core. The data wil not have any lierals-as-subjects if legal RDF so no matches. We can control the syntax in SPARQL. > > even though it makes sense if it has the same semantics as AND, it reads a > bit oddly > > I have a mild preference for a closer relationship to SQL: > > SELECT ?var FROM { :a :b ?var } WHERE ?var < 3 > > But I can see why that might be confusing. > > - Steve >
Received on Saturday, 5 March 2005 15:36:59 UTC