Re: Minor Syntax issues

On Mon, Feb 14, 2005 at 01:48:46PM +0000, Seaborne, Andy wrote:
> Eric Prud'hommeaux wrote: ">"
> Steve Harris wrote: ">>"
> Andy Seaborne wrote: ">>>"
> 
> >>>6/ Clause order
> >>>
> >>>The current order is:
> >>>
> >>>BASE
> >>>PREFIX
> >>>SELECT
> >>>WITH
> >>>FROM
> >>>WHERE
> >>>LIMIT
> >>>
> >>>which is a mixed style.  It would make sense to have WITH and FROM 
> >>>before SELECT (declarations first) and have LIMIT before WHERE (modifier 
> >>>to SELECT).  It has confused some RDQL users that FROM comes after 
> >>>SELECT.
> >>
> >>>From before SELECT seems fine, its the other way round in SQL, but the 
> >>>SQL
> >>FROM is very different. OTOH I prefer LIMIT at the end, as its parallel
> >>with SQL is direct.
> >>
> >>Incidentally, I dont think of LIMIT as modifying SELECT, I think of it as
> >>modyfying the result set.
> >
> >
> >I think the same is true in SQL. LIMIT and GROUPing aren't in
> >relational calculus. I bet SQL defines a solution as the result of
> >LIMITing/GROUPing/COUNTing performed after the relational part is
> >done. Anyone know where I can get a copy of, say, the SQL 92 spec?
> 
> SPARQL is different :-) because of the various result forms.   SELECT 
> implies a result set but the others don't really.
> 
> Does LIMIT only apply to SELECT or to the others as well?  I'd thought it 
> only made sense when resutl form was SELECT (the streaming case).

In algae, I took LIMIT to control the number of solutions that were
returned, independent of the result format. It was pretty provable to
say that some subset of the RDF graph came from a solution.

eric@unagi:W3C/Rdf/bin$ ./algae @run.sh
+-------------------------+
|                        n|
|-------------------------|
|<http://example.org/n#A0>|
|<http://example.org/n#A2>|
|<http://example.org/n#A3>|
|<http://example.org/n#A1>|
+-------------------------+
eric@unagi:W3C/Rdf/bin$ ./algae --limit 2 @run.sh
+-------------------------+
|                        n|
|-------------------------|
|<http://example.org/n#A3>|
|<http://example.org/n#A2>|
+-------------------------+
eric@unagi:W3C/Rdf/bin$ ./algae --reportClass=n3 @run.sh
@prefix p: <http://example.org/n#>
p:A0 p:p1 p:B ;
     p:p2 p:C .
p:A1 p:p1 p:B ;
     p:p2 p:C .
p:A2 p:p1 p:B ;
     p:p2 p:C .
p:A3 p:p1 p:B ;
     p:p2 p:C .
eric@unagi:W3C/Rdf/bin$ ./algae --reportClass=n3 --limit 2 @run.sh
@prefix p: <http://example.org/n#>
p:A1 p:p1 p:B ;
     p:p2 p:C .
p:A2 p:p1 p:B ;
     p:p2 p:C .

This makes me wonder if it is easier to say that limits apply only to
certain result formats, or just specify the results in terms of
solutions. Even the input to DESCRIBE is either a constant or a set of
solutions. In the former case, it's easy to say "well, why'd you do
that anyways?" but for the latter, it's easy to inherit the usual
notion of limit.
-- 
-eric

office: +81.466.49.1170 W3C, Keio Research Institute at SFC,
                        Shonan Fujisawa Campus, Keio University,
                        5322 Endo, Fujisawa, Kanagawa 252-8520
                        JAPAN
        +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
cell:   +81.90.6533.3882

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

Received on Monday, 14 February 2005 15:48:39 UTC