[jira] [Commented] (JENA-803) Custom aggregates in SPARQL.

2014-12-29 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14260214#comment-14260214
 ] 

ASF subversion and git services commented on JENA-803:
--

Commit 6537629d8a1c6f03810612321327e4dbc96f0dfa in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=6537629 ]

JENA-803 : Example custom aggregate

 Custom aggregates in SPARQL.
 

 Key: JENA-803
 URL: https://issues.apache.org/jira/browse/JENA-803
 Project: Apache Jena
  Issue Type: New Feature
  Components: ARQ
Affects Versions: Jena 2.12.1
Reporter: Andy Seaborne
Assignee: Andy Seaborne

 Support SPARQL custom aggregates.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-803) Custom aggregates in SPARQL.

2014-12-29 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14260227#comment-14260227
 ] 

Andy Seaborne commented on JENA-803:


Functionally complete.

Still to do: variable scope rules for SELECT (group and non-group variables).


 Custom aggregates in SPARQL.
 

 Key: JENA-803
 URL: https://issues.apache.org/jira/browse/JENA-803
 Project: Apache Jena
  Issue Type: New Feature
  Components: ARQ
Affects Versions: Jena 2.12.1
Reporter: Andy Seaborne
Assignee: Andy Seaborne

 Support SPARQL custom aggregates.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (JENA-803) Custom aggregates in SPARQL.

2014-12-29 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14260227#comment-14260227
 ] 

Andy Seaborne edited comment on JENA-803 at 12/29/14 5:09 PM:
--

Functionally complete.

Possible last step : variable scope rules for SELECT (group and non-group 
variables).



was (Author: andy.seaborne):
Functionally complete.

Still to do: variable scope rules for SELECT (group and non-group variables).


 Custom aggregates in SPARQL.
 

 Key: JENA-803
 URL: https://issues.apache.org/jira/browse/JENA-803
 Project: Apache Jena
  Issue Type: New Feature
  Components: ARQ
Affects Versions: Jena 2.12.1
Reporter: Andy Seaborne
Assignee: Andy Seaborne

 Support SPARQL custom aggregates.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: Custom aggregate functions

2014-12-29 Thread Andy Seaborne

Please try out the latest development build.

The JIRA is JENA-803

Example code:

https://github.com/apache/jena/blob/master/jena-arq/src-examples/arq/examples/aggregates/CustomAggregate.java

Andy

On 20/10/14 11:31, Rob Vesse wrote:

Well in Leviathan (dotNetRDF's engine) I use the pure SPARQL 1.1 syntax
approach and a central registry as I am proposing that we may want to add
to ARQ

The syntactic extension makes sense and might be a more future-proof
design because it allows for late binding of aggregates in the same way
that functions are currently late bound.  (Not that a central registry for
aggregates necessarily precludes late binding a la the existing Function
hierarchy)


Because whether a form is a custom function or an aggregate affects the 
generated query syntax tree (a choice, sort of) and the algebra 
generated (no choice), whether a form is a aggregate or a function call 
must be known.


In theory, it is possible to differentiate if GROUP is used but this 
example shows a case where it is simple not possible to tell from the 
query alone.


// May be a custom aggregate - group is the whole result set
// May be a custom function - no grouping.

SELECT (uri1(?s) AS ?xs) { ... }

So they must be predeclared, or using the extended syntax
AGG uri(...args...) at the moment.

If not declared, the query will have a function call in it.



I don't believe there is a JIRA specifically for this so I shall go ahead
and add one

Rob

On 20/10/2014 10:52, Andy Seaborne a...@apache.org wrote:


On 20/10/14 10:42, Rob Vesse wrote:

Andy

I recently put a comment on JENA-507 about this same issue

It would be nice to have some means to be able to inject custom
aggregates
without needing to modify the grammar with new tokens (because that
appears to be the only way to add custom aggregates right now).

It would be nice to have some sort of central registry of custom
aggregates which the parsers could then simply consult and either output
an aggregate if explicitly registered as such and otherwise use the
existing behaviour of assuming a custom function


In fact, custom aggregates in pure SPARQL 1.1 syntax absolutely need a
registry and it must be available during parsing because whether a URI
is an aggregate or a function affects parsing itself (not the best
feature of SPARQL).  It can't be left until execution time nor binding
to a dataset.

If a syntactic extension is acceptable, AGG(uri, args ..) would break
that dependency but both ways are quite doable.

Is there a JIRA?  (from memory there is but I can't remember which and
just at the moment, I'm working semi-offline and search JIRA is
impractical).

Andy



Rob

On 17/10/2014 15:44, Joshua TAYLOR joshuaaa...@gmail.com wrote:


On Thu, Oct 16, 2014 at 10:39 PM, Ian Emmons i...@emmons.mobi wrote:

the example he gave is an aggregate that would compute the maximum
score of a grouping of hotels based on multiple properties of the
hotels.



Things like that are already possible, though.  You can do, e.g.,

select ?hotel (max( (?price+?size)/?distance ) as ?ranking ) where {
   ?hotel :price ?price ; :size ?size ; :distance ?distance .
}
group by ?hotel

You can do a lot just with SPARQL 1.1., and if you add some custom
(non-aggregate) functions in there, you can do even more.  Without
specifics, it's hard to say, but I wouldn't be entirely surprised if
the actual use case is already possible.

//JT

--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
















[GitHub] jena pull request: Added yasqe as query editor

2014-12-29 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/jena/pull/11


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (JENA-823) Add YASQE as query editor in Fuseki2 UI

2014-12-29 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14260308#comment-14260308
 ] 

ASF subversion and git services commented on JENA-823:
--

Commit 9e523d226f66dc8c05732f5d4d109009b5378618 in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=9e523d2 ]

JENA-823 : Update for Fuseki2 interface : This closes #11


 Add YASQE as query editor in Fuseki2 UI
 ---

 Key: JENA-823
 URL: https://issues.apache.org/jira/browse/JENA-823
 Project: Apache Jena
  Issue Type: Improvement
  Components: Fuseki
Reporter: Andy Seaborne
Assignee: Andy Seaborne

 Pull request #11 : https://github.com/apache/jena/pull/11



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (JENA-823) Add YASQE as query editor in Fuseki2 UI

2014-12-29 Thread Andy Seaborne (JIRA)

 [ 
https://issues.apache.org/jira/browse/JENA-823?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andy Seaborne updated JENA-823:
---
Attachment: 11a.patch

For reference, here is the change as a patch.

This patch includes additional changes to the LICENSE and dist/LICNESE files.


 Add YASQE as query editor in Fuseki2 UI
 ---

 Key: JENA-823
 URL: https://issues.apache.org/jira/browse/JENA-823
 Project: Apache Jena
  Issue Type: Improvement
  Components: Fuseki
Reporter: Andy Seaborne
Assignee: Andy Seaborne
 Attachments: 11a.patch


 Pull request #11 : https://github.com/apache/jena/pull/11



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (JENA-823) Add YASQE as query editor in Fuseki2 UI

2014-12-29 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14260309#comment-14260309
 ] 

Andy Seaborne edited comment on JENA-823 at 12/29/14 6:47 PM:
--

For reference, here is the change as a patch.

This patch includes additional changes to the LICENSE and dist/LICENSE files.



was (Author: andy.seaborne):
For reference, here is the change as a patch.

This patch includes additional changes to the LICENSE and dist/LICNESE files.


 Add YASQE as query editor in Fuseki2 UI
 ---

 Key: JENA-823
 URL: https://issues.apache.org/jira/browse/JENA-823
 Project: Apache Jena
  Issue Type: Improvement
  Components: Fuseki
Reporter: Andy Seaborne
Assignee: Andy Seaborne
 Attachments: 11a.patch


 Pull request #11 : https://github.com/apache/jena/pull/11



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Issue Comment Deleted] (JENA-803) Custom aggregates in SPARQL.

2014-12-29 Thread Andy Seaborne (JIRA)

 [ 
https://issues.apache.org/jira/browse/JENA-803?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andy Seaborne updated JENA-803:
---
Comment: was deleted

(was: Functionally complete.

Possible last step : variable scope rules for SELECT (group and non-group 
variables).
)

 Custom aggregates in SPARQL.
 

 Key: JENA-803
 URL: https://issues.apache.org/jira/browse/JENA-803
 Project: Apache Jena
  Issue Type: New Feature
  Components: ARQ
Affects Versions: Jena 2.12.1
Reporter: Andy Seaborne
Assignee: Andy Seaborne
 Fix For: Jena 2.12.2


 Support SPARQL custom aggregates.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)