Convert parsed SPARQL query back to string?

33 views
Skip to first unread message

onto...@gmail.com

unread,
May 30, 2017, 5:24:30 PM5/30/17
to rdflib-dev
I'd like to take a SPARQL query, do some transformations on it, then turn it back to a string and submit it to a remote SPARQL endpoint.

I looked over the rdflib.plugins.sparql code and haven't found any built-in methods to do this. Is there something there that I missed?

Gunnar Aastrand Grimnes

unread,
May 31, 2017, 2:26:08 AM5/31/17
to rdfli...@googlegroups.com
nope - that isn't currently possible. It shouldn't be impossible to implement.

If you just want to generate sparql queries, i have some code like
this: https://gist.github.com/gromgull/70e2d0500fbcb820dd99

but that one is old, I've added lots to it since then, if you're
interested, I'll dig it out.

No way to get from an existing textual query to that though.



- Gunnar

On 30 May 2017 at 23:24, <onto...@gmail.com> wrote:
> I'd like to take a SPARQL query, do some transformations on it, then turn it back to a string and submit it to a remote SPARQL endpoint.
>
> I looked over the rdflib.plugins.sparql code and haven't found any built-in methods to do this. Is there something there that I missed?
>
> --
> http://github.com/RDFLib
> ---
> You received this message because you are subscribed to the Google Groups "rdflib-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rdflib-dev+...@googlegroups.com.
> To post to this group, send email to rdfli...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rdflib-dev/ed6dd457-b0c2-4136-b7e7-a0ddbfd85d5a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
http://gromgull.net

Sergio Fernández

unread,
Jun 1, 2017, 11:43:36 AM6/1/17
to rdfli...@googlegroups.com
Internally SPARQLWarooer stores the original query as string, so it
should be possible to retrieve it via the Store class.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rdflib-dev/CAGm1ODmyAtW4Bvx7NGW60%3DvwNFQrWNx770WegSx-jBNz%2BBg0zg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--
Sergio Fernández
http://www.wikier.org
Reply all
Reply to author
Forward
0 new messages