This looks good for simple queries, In case of Queries with Unions and Subqueries etc, not sure what the construct graph would look like
> On 6 Feb 2015, at 9:58 pm, Andy Seaborne <[email protected]> wrote: > > On 06/02/15 09:54, Stian Soiland-Reyes wrote: >> Or use CONSTRUCT WHERE {} shorthand: >> >> http://www.w3.org/TR/sparql11-query/#constructWhere >> >> I must admit I didn't check if this works in Jena, but given that Andy >> cowrote the spec... :-) > > Yes, it works. > > It's syntactic sugar the parser sorts out. It's not even in the abstract > syntax tree. > > arq.qparse 'CONSTRUCT WHERE {?s ?p ?o}' > ==> > CONSTRUCT > { ?s ?p ?o .} > WHERE > { ?s ?p ?o} > > Andy > >> On 6 Feb 2015 09:39, "Andy Seaborne" <[email protected]> wrote: >> >>> On 06/02/15 02:32, Kamalraj Jairam wrote: >>> >>>> Hello All, >>>> >>>> How do i convert a sparql resultset to a model ? >>>> >>>> Is it possible without transforming the spraql select query to a >>>> construct query? >>>> >>>> Thanks >>>> Kamalraj >>>> >>> >>> What are you trying to do? >>> >>> You can convert a ResultSet to a model with ResultSetFormatter.toModel. >>> It's really left-over code from the days when SPARQL testing looked like it >>> would be model based. >>> >>> It is encoding the result set, and it's not related to the vocabulary of >>> the model queried. Try it out to see the vocabulary used. >>> >>> Andy >>> >>> >> >
