RE: [jena-dev] COUNT syntax

 

 

 

Hi

 

Now aggregates and grouping are certainly important.

I would say that if select (count (*)) does  not wwork in Virtuoso, it might as well.  So in the spirit of supporting expressions in the select list we just have to rectify this.  This does not merit having an extra  switch in Jena.

We will have a new cut of Virtuoso Open Source Edition out in a few days most likely so the parenthesis fix can go there.

 

But since we are on the subject, I’d like to bring up the topic of derived tables, subqueries and quantification, since these continue to separate  SPARQL from SQL even if aggregation  and grouping were addressed.

 

It is reasonable to ask questions like what is the market share of the lowest cost retailer  of gizmos in November  as compared to total gizmo sales in November.

  This would be a division of a sum aggregate subquery for the lowest price gizmos, i.e. where price = min (price) from November sales divided by total Nov sales of gizmos.  And in order to give names to these values, should they be used in more than  one expression, one would use a derived table or inline view,, as also they are called, i.e. a select inside another select’s from clause in SQL.

 

In a data integration situation, asking such a question in terms of SPARQL instead of SQL would even make sense, supposing multiple order processing or sales data repositories were mapped into a common ontology.  Semantic is after all meant to allow using language more abstract than column names of independently designed relational schemas when talking about common things such as extended unit price.  Further, while such things can be done case by 

case by views and federated database or extract-transform-load and data warehousing, there  is extra gain from mapping to a common CRM ontology in either case.

 

One might of course move the issue away from SPARQL by referring to an external inference engine that would present  results of otherwise expressed calculations as triples, a bit like a SQL view presents complex queries like a table.  But the problem there is that while SQL views are SQL, such rules are not SPARQL.

 

 

Existence is sort of present in SPARQL through optional and the bound check.  The all quantifier does not seem  very common in SQL practice.  Anyway, all x reverts to  not exists not x.  But this cannot be said very easily in SPARQL

 

 

 

 

 

 

 

 

 

 

  _____  

From: public-rdf-dawg-request@w3.org [mailto:public-rdf-dawg-request@w3.org] On Behalf Of Adrian Walker
Sent: Monday, December 03, 2007 8:42 PM
To: jena-dev@yahoogroups.com
Cc: public-rdf-dawg@w3.org
Subject: Re: [jena-dev] COUNT syntax

 

Andy --

[apologies for cross posting -- this seems, well, important]

You wrote...

The working group is just finishing up so "official" [syntax and semantics for SPARQL aggregation] will have to wait for rechartering.

SQL made the mistake of not standardizing the semantics of aggregation, and it seems a shame that SPARQL is going down the same road.  In particular, it makes it difficult to automatically generate SQL or SPARQL queries from higher level stuff.

Is there anyone in W3C who can be persuaded  that this is a higher priority item?

                                    Cheers,  -- Adrian

Internet Business Logic
A Wiki and SOA Endpoint for Executable Open Vocabulary English
Online at www.reengineeringllc.com    Shared use is free

Adrian Walker
Reengineering



On 12/3/07, Andreas Langegger <al@jku.at> wrote:

Hello,

it has already been noted that there are different syntax styles 
around for aggregate functions like COUNT which are out of scope of 
the SPARQL Rec:
https://www.blogger.com/comment.g?blogID=18002060 <https://www.blogger.com/comment.g?blogID=18002060&postID=4691605369637965896> &postID=4691605369637965896 

In my case it's also an issue. The problem is, even if I just use a 
"SELECT COUNT(*)" without additional parentheses - which should work 
for both ARQ and Virtuoso (DBpedia e.g.) - ARQ will add the ARQ-style 
parentheses when serializing the Query back into a String: "SELECT 
(COUNT(*))" e.g. when executing remote queries...

I'd like to here some comments and appraisal from the community. Is 
there a chance that aggregate functions become part of official 
SPARQL? When? ;-)

A possible solution for ARQ would be to add a Syntax.syntaxVirtuoso, 
however this is not really a solution for this issue.

Thanks,
Andy

PS@ Andy Seaborne:
Concerning my remote-bug - it was my fault. However I was already 
confused enough cause I had another strange behavior with D2R 
resulting in empty variable mappings when joining. Switched off the 
optimizer sinze I'm using some custom Transforms... now it's working. 
Thanks a lot and sorry for the false alarm!

----------------------------------------------------------
Dipl.-Ing.(FH) Andreas Langegger
Institute for Applied Knowledge Processing
Johannes Kepler University Linz
A-4040 Linz, Altenberger Strafle 69
http://www.faw.at
http://www.langegger.at

__._,_.___ 

Messages in this topic  <http://groups.yahoo.com/group/jena-dev/message/31867;_ylc=X3oDMTM2Zmx0OWFrBF9TAzk3MzU5NzE0BGdycElkAzM5OTc1NTMEZ3Jwc3BJZAMxNzA1MDA3MTgxBG1zZ0lkAzMxODY3BHNlYwNmdHIEc2xrA3Z0cGMEc3RpbWUDMTE5NjY5NDI4MwR0cGNJZAMzMTg2Nw--> (1) Reply (via web post)  <http://groups.yahoo.com/group/jena-dev/post;_ylc=X3oDMTJxb2dhY3ZrBF9TAzk3MzU5NzE0BGdycElkAzM5OTc1NTMEZ3Jwc3BJZAMxNzA1MDA3MTgxBG1zZ0lkAzMxODY3BHNlYwNmdHIEc2xrA3JwbHkEc3RpbWUDMTE5NjY5NDI4Mw--?act=reply&messageNum=31867> | Start a new topic  <http://groups.yahoo.com/group/jena-dev/post;_ylc=X3oDMTJlNDZqZGgwBF9TAzk3MzU5NzE0BGdycElkAzM5OTc1NTMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwNmdHIEc2xrA250cGMEc3RpbWUDMTE5NjY5NDI4Mw--> 

Messages <http://groups.yahoo.com/group/jena-dev/messages;_ylc=X3oDMTJldmxxYjdnBF9TAzk3MzU5NzE0BGdycElkAzM5OTc1NTMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwNmdHIEc2xrA21zZ3MEc3RpbWUDMTE5NjY5NDI4Mw-->  | Members <http://groups.yahoo.com/group/jena-dev/members;_ylc=X3oDMTJlNzBybmM1BF9TAzk3MzU5NzE0BGdycElkAzM5OTc1NTMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwNmdHIEc2xrA21icnMEc3RpbWUDMTE5NjY5NDI4Mw-->  | Calendar <http://groups.yahoo.com/group/jena-dev/calendar;_ylc=X3oDMTJkdDQxbnZzBF9TAzk3MzU5NzE0BGdycElkAzM5OTc1NTMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwNmdHIEc2xrA2NhbARzdGltZQMxMTk2Njk0Mjgz>  

 <http://groups.yahoo.com/;_ylc=X3oDMTJkZXNpdHQ3BF9TAzk3MzU5NzE0BGdycElkAzM5OTc1NTMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwNmdHIEc2xrA2dmcARzdGltZQMxMTk2Njk0Mjgz> Yahoo! Groups
Change settings via the Web <http://groups.yahoo.com/group/jena-dev/join;_ylc=X3oDMTJmZ2V1amw0BF9TAzk3MzU5NzE0BGdycElkAzM5OTc1NTMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwNmdHIEc2xrA3N0bmdzBHN0aW1lAzExOTY2OTQyODM->  (Yahoo! ID required) 
Change settings via email: Switch delivery to Daily Digest <mailto:jena-dev-digest@yahoogroups.com?subject=Email+Delivery:+Digest>  | Switch format to Traditional <mailto:jena-dev-traditional@yahoogroups.com?subject=Change+Delivery+Format:+Traditional>  
Visit Your Group  <http://groups.yahoo.com/group/jena-dev;_ylc=X3oDMTJkOThra2w0BF9TAzk3MzU5NzE0BGdycElkAzM5OTc1NTMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwNmdHIEc2xrA2hwZgRzdGltZQMxMTk2Njk0Mjgz> | Yahoo! Groups Terms of <http://docs.yahoo.com/info/terms/>  Use | Unsubscribe  <mailto:jena-dev-unsubscribe@yahoogroups.com?subject=> 

Recent Activity

*                           15

New Members <http://groups.yahoo.com/group/jena-dev/members;_ylc=X3oDMTJmNjFuZzZ2BF9TAzk3MzU5NzE0BGdycElkAzM5OTc1NTMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwN2dGwEc2xrA3ZtYnJzBHN0aW1lAzExOTY2OTQyODM-> 

Visit Your Group  <http://groups.yahoo.com/group/jena-dev;_ylc=X3oDMTJlaGtzZHByBF9TAzk3MzU5NzE0BGdycElkAzM5OTc1NTMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwN2dGwEc2xrA3ZnaHAEc3RpbWUDMTE5NjY5NDI4Mw--> 

Y! Messenger

Instant hello <http://us.ard.yahoo.com/SIG=12j4hsc0i/M=493064.10729668.11333359.8674578/D=groups/S=1705007181:NC/Y=YAHOO/EXP=1196701483/A=3848582/R=0/SIG=11umg3fun/*http:/us.rd.yahoo.com/evt=42403/*http:/messenger.yahoo.com> 

Chat over IM with

group members.

Yahoo! Groups HD

The official Samsung <http://us.ard.yahoo.com/SIG=12jrf9flv/M=493064.10972170.11554072.8674578/D=groups/S=1705007181:NC/Y=YAHOO/EXP=1196701483/A=4706130/R=0/SIG=11f8fj6tf/*http:/tech.groups.yahoo.com/group/samsunghd/> 

Y! Group for HDTVs

and devices.

Yahoo! Groups

Real Food Group <http://us.ard.yahoo.com/SIG=12jdkva85/M=493064.11036139.11614791.8674578/D=groups/S=1705007181:NC/Y=YAHOO/EXP=1196701483/A=4725796/R=0/SIG=1192rfjiu/*http:/groups.yahoo.com/group/realfood/> 

Share recipes

and favorite meals.

.


__,_._,___ 

 

Received on Monday, 3 December 2007 22:07:46 UTC