You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Martynas Jusevičius <ma...@atomgraph.com> on 2016/05/26 13:09:23 UTC
SPARQL algebra operators ResultSets
Hey,
is there some code in Jena that implements SPARQL algebra operations
as functions on ResultSets? Something like:
ResultSet match(Graph graph, Node subject, Node property, Node object)
ResultSet join(ResultSetRewindable left, ResultSetRewindable right)
ResultSet leftJoin(ResultSetRewindable left, ResultSetRewindable right)
ResultSet union(ResultSetRewindable left, ResultSetRewindable right)
ResultSet filter(ResultSetRewindable left, Predicate<QuerySolution> filter)
I've done a very basic implementation, but I'd rather reuse code if it
exists already.
Martynas
atomgraph.com
Re: SPARQL algebra operators ResultSets
Posted by Andy Seaborne <an...@apache.org>.
There is the algebra evaluation and all the iterators in support of that.
A ResultSet is an Iterator of QuerySolution and QuerySolution has
nextBinding to become an Iterator<Binding> so you can get a QueryIterator.
But working in algebra (e,g. OpJoin, OpUnion, OpFilter) is easier --
just feed it to an OpExecutor
Andy
On 26/05/16 15:25, Rob Vesse wrote:
> Is there any particular reason you are trying to do this? As far as I know there is no such code
>
> It seems like you could do the same kind of thing by simply composing a query comprising of the two original queries as sub queries?
>
> Rob
>
> On 26/05/2016 14:09, "Martynas Jusevi\u010dius" <ma...@atomgraph.com> wrote:
>
>> Hey,
>>
>> is there some code in Jena that implements SPARQL algebra operations
>> as functions on ResultSets? Something like:
>>
>> ResultSet match(Graph graph, Node subject, Node property, Node object)
>> ResultSet join(ResultSetRewindable left, ResultSetRewindable right)
>> ResultSet leftJoin(ResultSetRewindable left, ResultSetRewindable right)
>> ResultSet union(ResultSetRewindable left, ResultSetRewindable right)
>> ResultSet filter(ResultSetRewindable left, Predicate<QuerySolution> filter)
>>
>> I've done a very basic implementation, but I'd rather reuse code if it
>> exists already.
>>
>>
>> Martynas
>> atomgraph.com
>
>
>
>
Re: SPARQL algebra operators ResultSets
Posted by Rob Vesse <rv...@dotnetrdf.org>.
Is there any particular reason you are trying to do this? As far as I know there is no such code
It seems like you could do the same kind of thing by simply composing a query comprising of the two original queries as sub queries?
Rob
On 26/05/2016 14:09, "Martynas Jusevičius" <ma...@atomgraph.com> wrote:
>Hey,
>
>is there some code in Jena that implements SPARQL algebra operations
>as functions on ResultSets? Something like:
>
>ResultSet match(Graph graph, Node subject, Node property, Node object)
>ResultSet join(ResultSetRewindable left, ResultSetRewindable right)
>ResultSet leftJoin(ResultSetRewindable left, ResultSetRewindable right)
>ResultSet union(ResultSetRewindable left, ResultSetRewindable right)
>ResultSet filter(ResultSetRewindable left, Predicate<QuerySolution> filter)
>
>I've done a very basic implementation, but I'd rather reuse code if it
>exists already.
>
>
>Martynas
>atomgraph.com