|
The W3C DAWG just published the latest drafts of the SPARQL 1.1 specifications. The part of real interest to me is the Query specification, in the latest draft they've introduced a couple of nice things:
SAMPLE Aggregate
The new SAMPLE aggregate which solves the issue where you want to get a value out of a Group but you can't because you're not grouping on that variable. For example consider the following query:
SELECT ?s SAMPLE(?o) AS ?Object
WHERE
{
?s ?p ?o
} GROUP BY ?s
Previously if you grouped by a variable there was no way to project variables or apply functions over variables that you weren't grouping by. With the addition of the SAMPLE aggregate this is now incredibly easy and helpful - kudos to the working group for this one. It's already in the latest internal builds of dotNetRDF.
GROUP_CONCAT Aggregate
The new GROUP_CONCAT aggregate is actually equivalent to the fn:string-join() function from the XPath function library which I'd already added support for though GROUP_CONCAT has an implicit separator of the space character. There appears to still not be a consensus on what the separator should be so this may change or I wouldn't be surprised if they decide to permit a two argument version of the aggregate where the second argument is the separator by the time it reaches the next draft/candidate recommendation. Again GROUP_CONCAT is supported in the latest internal builds of dotNetRDF.
Property Paths
Property Paths are a major enhancement to SPARQL that allows previously complex/impossible Triple Patterns to be expressed succinctly using a Path syntax. This will be a very powerful feature if it makes it into the 1.1 specification though as an implementer I'm not looking forward to implementing paths though I suspect as with most things in SPARQL it'll be easier than it looks!
Realistically these are never going to make it into the next release of dotNetRDF (0.2.0) as they are too complex to quickly implement like the above aggregates. Hopefully though I'll get these into a later 0.2.x build in the coming months as they'd be a great feature to have. 29/01/2010 11:07:15 by Rob Vesse in English
9501 Views
Tags: Aggregates, DAWG, Property Paths, Query, SPARQL, Specification, Syntax, W3C
|