You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Amin beyranvand <am...@yahoo.com> on 2013/08/02 09:55:15 UTC

convert SPARQL query to a query tree


Hi

I want to write an engine for processing SPARQL queries. i want to use jena to parse SPARQL queries and convert them to a internal form for my application. i can parse queries and convert them to query algebra using this code:

Query q=QueryFactory.create("select ?s ?o where {?s ?p ?o }");
Op op = Algebra.compile(q) ;

but i don't know how to use op and what is the uses of op.visit(opVisitor) .

in more detail: i want to convert query to a left deep tree and then process query operators in a pipelined manner.

Re: convert SPARQL query to a query tree

Posted by Olivier Rossel <ol...@gmail.com>.
SPIN now has an Apache 2.0 licence ! ! ! !



On Fri, Aug 2, 2013 at 11:57 AM, Martynas Jusevičius
<ma...@graphity.org>wrote:

> Also consider SPIN from TopQuadrant. SPIN can represent SPARQL as RDF.
> There is a vocabulary and API:
> http://spinrdf.org/spin.html
> http://topbraid.org/spin/api/
>
> Martynas
> graphityhq.com
>
> On Fri, Aug 2, 2013 at 10:55 AM, Amin beyranvand <am...@yahoo.com>
> wrote:
> >
> >
> > Hi
> >
> > I want to write an engine for processing SPARQL queries. i want to use
> jena to parse SPARQL queries and convert them to a internal form for my
> application. i can parse queries and convert them to query algebra using
> this code:
> >
> > Query q=QueryFactory.create("select ?s ?o where {?s ?p ?o }");
> > Op op = Algebra.compile(q) ;
> >
> > but i don't know how to use op and what is the uses of
> op.visit(opVisitor) .
> >
> > in more detail: i want to convert query to a left deep tree and then
> process query operators in a pipelined manner.
>

Re: convert SPARQL query to a query tree

Posted by Martynas Jusevičius <ma...@graphity.org>.
Also consider SPIN from TopQuadrant. SPIN can represent SPARQL as RDF.
There is a vocabulary and API:
http://spinrdf.org/spin.html
http://topbraid.org/spin/api/

Martynas
graphityhq.com

On Fri, Aug 2, 2013 at 10:55 AM, Amin beyranvand <am...@yahoo.com> wrote:
>
>
> Hi
>
> I want to write an engine for processing SPARQL queries. i want to use jena to parse SPARQL queries and convert them to a internal form for my application. i can parse queries and convert them to query algebra using this code:
>
> Query q=QueryFactory.create("select ?s ?o where {?s ?p ?o }");
> Op op = Algebra.compile(q) ;
>
> but i don't know how to use op and what is the uses of op.visit(opVisitor) .
>
> in more detail: i want to convert query to a left deep tree and then process query operators in a pipelined manner.

Re: convert SPARQL query to a query tree

Posted by Andy Seaborne <an...@apache.org>.
On 02/08/13 08:55, Amin beyranvand wrote:
>
>
> Hi
>
> I want to write an engine for processing SPARQL queries. i want to use jena to parse SPARQL queries and convert them to a internal form for my application. i can parse queries and convert them to query algebra using this code:
>
> Query q=QueryFactory.create("select ?s ?o where {?s ?p ?o }");
> Op op = Algebra.compile(q) ;
>
> but i don't know how to use op and what is the uses of op.visit(opVisitor) .
>
> in more detail: i want to convert query to a left deep tree and then process query operators in a pipelined manner.
>

See
http://answers.semanticweb.com/questions/23925/parsing-a-sparql-query

You want to hook into the execution - that will pass to you each of the 
algebra operations, and you'll get e.g. OpBGP where you can get the 
triples easily.