Hello,
I am also trying to construct a SPARQL update string from a parsed query 
structure. 

E.g. I want to parse a query, validate and possibly alter some elements, 
and then submit the modified query to a graph. 

Is Mark's approach the only one available to do that, i.e. do I have to use 
separate code? 

I would expect that some methods must be somewehere in RDFLib that 
transform e.g. a Python set operation on a Graph class into a SPARQL query, 
and I wonder if I can use those methods directly for my custom operations. 

Thanks.

On Thursday, December 28, 2017 at 9:24:37 AM UTC-6, [email protected] wrote:
>
> Hello
>
> I don't know how relevant this is for you, but I am working on the SERVICE 
> implementation for federated queries within rdflib
>
> https://github.com/RDFLib/rdflib/issues/769#issuecomment-344939011
>
> I am currently on a personal branch, investigating options; obtaining the 
> query string from a parsed result is a piece of useful functionality
>
> I have been looking into the evaluate processes, if, in 
>
> https://github.com/marqh/rdflib/commit/aef5726ef02347714be5e7f1e0c4342357c9d90f#diff-7839f066926df815492a71be68544a7dR214
> class Comp(TokenConverter)
> the 'expr' is kept, then this can be used later, e.g. for the service 
> clause
>
> https://github.com/marqh/rdflib/commit/aef5726ef02347714be5e7f1e0c4342357c9d90f#diff-7839f066926df815492a71be68544a7dR225
>
> making use of pyparsing's
> originalTextFor and searchString methods
> (https://pythonhosted.org/pyparsing/pyparsing-module.html#originalTextFor)
>
> perhaps there is a useful pattern here for you
>
> all the best
> mark
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rdflib-dev/8322a244-e621-4d02-8692-5642d208f0e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to